r411 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r410‎ | r411 | r412 >
Date:22:16, 21 May 2002
Author:vibber
Status:old
Tags:
Comment:
Fix the cookie path to work for /wiki.phtml and /wiki/ both
Modified paths:
  • /trunk/phpwiki/fpw/special_userlogin.php (modified) (history)
  • /trunk/phpwiki/fpw/special_userlogout.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/fpw/special_userlogin.php
@@ -26,10 +26,10 @@
2727 if ( $nu->isLoggedIn ) {
2828 $user = new WikiUser ;
2929 $user = $nu ;
30 - setcookie ( "WikiUserID" , $user->id , $expiration ) ;
31 - setcookie ( "WikiLoggedIn" , "yes" , $expiration ) ;
 30+ setcookie ( "WikiUserID" , $user->id , $expiration , "/" ) ;
 31+ setcookie ( "WikiLoggedIn" , "yes" , $expiration , "/" ) ;
3232 $WikiLoggedIn = "yes" ;
33 - if ( $user->options["rememberPassword"] == "on" ) setcookie ( "WikiUserPassword" , $user->password , $expiration ) ;
 33+ if ( $user->options["rememberPassword"] == "on" ) setcookie ( "WikiUserPassword" , $user->password , $expiration , "/" ) ;
3434 $user->options["rememberPassword"] = $REMEMBERPASSWORD ;
3535 $user->saveSettings() ;
3636 loadSkin () ;
@@ -40,9 +40,9 @@
4141 $user = $nu ;
4242 global $wikiWelcomeCreation ;
4343 $s = str_replace ( "$1" , $user->name , $wikiWelcomeCreation ) ;
44 - setcookie ( "WikiLoggedIn" , "yes" , $expiration ) ;
45 - setcookie ( "WikiUserID" , $user->id , $expiration ) ;
46 - if ( $user->options["rememberPassword"] == "on" ) setcookie ( "WikiUserPassword" , $user->password , $expiration ) ;
 44+ setcookie ( "WikiLoggedIn" , "yes" , $expiration , "/" ) ;
 45+ setcookie ( "WikiUserID" , $user->id , $expiration , "/" ) ;
 46+ if ( $user->options["rememberPassword"] == "on" ) setcookie ( "WikiUserPassword" , $user->password , $expiration , "/" ) ;
4747 $user->options["rememberPassword"] = $REMEMBERPASSWORD ;
4848 # FIXME: user_email always comes up null in the database. Don't know why.
4949 if ( isset ( $EMAILADDR ) ) $user->email = $EMAILADDR ;
Index: trunk/phpwiki/fpw/special_userlogout.php
@@ -3,7 +3,7 @@
44 global $user , $vpage , $WikiLoggedIn , $wikiGoodbye ;
55 $vpage->title = "User logout" ;
66 setcookie ( "WikiLoggedIn" , "" , time()-3600 ) ;
7 - if ( $user->options["rememberPassword"] != "on" ) setcookie ( "WikiUserPassword" , "" , time()-3600 ) ;
 7+ if ( $user->options["rememberPassword"] != "on" ) setcookie ( "WikiUserPassword" , "" , time()-3600 , "/") ;
88 $user->isLoggedIn = false ;
99 $WikiLoggedIn = false ;
1010 return str_replace ( "$1" , $user->name , $wikiGoodbye ) ;

Status & tagging log