Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.3.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=42)
-   -   Mys v1.3.4 Seamless Login/Logout Redirect to Index (http://www.mysidiaadoptables.com/forum/showthread.php?t=4761)

Kyttias 01-15-2015 02:17 PM

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: /" ); 

http://fc03.deviantart.net/fs71/f/20...as-d8e0rq1.gif
(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);    
    }
}
?>


rickasawr 01-15-2015 04:06 PM

Very interesting! Might make a use of this in my script!

Also, what do you use to make your gif's when you display your webpages? Ive seen some things like this on tumblr and was very interested in finding out!

Kyttias 01-15-2015 07:26 PM

Quote:

Originally Posted by rickasawr (Post 31889)
Also, what do you use to make your gif's when you display your webpages? Ive seen some things like this on tumblr and was very interested in finding out!

It's a nifty little program called LICEcap. ^^

rickasawr 01-15-2015 07:38 PM

Thanks! I bookmarked the site for when i need to use it!

MikiHeart 01-15-2015 11:46 PM

I love you <3 I wanted to do this <3

CallumCharlton 03-09-2015 03:17 PM

Thanks very much! Modding my script is becoming enticing :o :happyc:

AndromedaKerova 04-19-2015 07:11 PM

It doesn't seem to work for me. The logout button seems to still take me to a "/login/logout" page

Kyttias 04-19-2015 08:44 PM

In the original post I left a spoiler tag. Open it up and paste the entire contents to replace the entire file? It appears I forgot to mention one also needs to place a header redirect inside the logout function a few lines down, as well. No one else mentioned this because they probably just replaced their entire file, I guess. :veeee:

AndromedaKerova 04-19-2015 11:16 PM

I think I might just be an idiot. Or tired.
All fixed and working now. :D
Doesn't even take me to that pointless /index page either.

Cirris 09-17-2015 11:19 AM

Does anyone know what the proper way to write the location when your site is installed into a subfolder?

header( "Location: /" ); will redirect me to the root of my site. (Which is not where my install of mysidia is located.)

I tried header( "Location: subfolder/" ); but it only half works. When I login, it takes me to the correct page, but the url duplicates the subfolder. www.mysite.com/subfolder/subfolder When I logout, it duplicates the subfolder in the url so many times it breaks everything.


All times are GMT -5. The time now is 05:57 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.