View Single Post
  #1  
Old 01-15-2015, 02:17 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 89,080
Kyttias is on a distinguished road
Arrow Seamless Login/Logout Redirect to Index

login/logout redirect
I can't believe I didn't figure this one out sooner! Inside view/loginview.php, inside each of the functions, add in this line before the $mysidia variable is set:
PHP Code:
header"Location: /" ); 

(The online users count won't update until you visit another page, btw?)

  Spoiler: loginview.php 
In case anyone needs my final version of the file (you shouldn't), here it is, for reference:
PHP Code:
<?php

class LoginView extends View{
    
    public function 
index(){
        
header"Location: /" );
        
$mysidia Registry::get("mysidia");
        
$document $this->document;

        if(
$mysidia->input->post("submit")){
            
$document->setTitle($this->lang->success_title);
            
$document->addLangvar("Welcome back {$mysidia->input->post("username")}{$this->lang->success}");
            return;
        }
        
        
$document->setTitle($this->lang->title);
        
$document->addLangvar($this->lang->login);

        
# $loginForm = $mysidia->frame->getSidebar()->getLoginBar();
        # $document->add($loginForm);    
    
}
    
    public function 
logout(){
        
header"Location: /" );
        
$mysidia Registry::get("mysidia");
        
$document $this->document;        
        
$document->setTitle($this->lang->logout_title);
        
$document->addLangvar($this->lang->logout);    
    }
}
?>
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote