Index: trunk/phase3/includes/User.php |
— | — | @@ -800,31 +800,25 @@ |
801 | 801 | return $result; |
802 | 802 | } |
803 | 803 | |
804 | | - if ( isset( $_SESSION['wsUserID'] ) ) { |
805 | | - if ( 0 != $_SESSION['wsUserID'] ) { |
| 804 | + if ( isset( $_COOKIE["{$wgCookiePrefix}UserID"] ) ) { |
| 805 | + $sId = intval( $_COOKIE["{$wgCookiePrefix}UserID"] ); |
| 806 | + if( isset( $_SESSION['wsUserID'] ) && $sId != $_SESSION['wsUserID'] ) { |
| 807 | + $this->loadDefaults(); // Possible collision! |
| 808 | + return false; |
| 809 | + } |
| 810 | + $_SESSION['wsUserID'] = $sId; |
| 811 | + } else if ( isset( $_SESSION['wsUserID'] ) ) { |
| 812 | + if ( $_SESSION['wsUserID'] != 0 ) { |
806 | 813 | $sId = $_SESSION['wsUserID']; |
807 | 814 | } else { |
808 | 815 | $this->loadDefaults(); |
809 | 816 | return false; |
810 | 817 | } |
811 | | - } else if ( isset( $_COOKIE["{$wgCookiePrefix}UserID"] ) ) { |
812 | | - $sId = intval( $_COOKIE["{$wgCookiePrefix}UserID"] ); |
813 | | - $_SESSION['wsUserID'] = $sId; |
814 | 818 | } else { |
815 | 819 | $this->loadDefaults(); |
816 | 820 | return false; |
817 | 821 | } |
818 | | - /* |
819 | | - if ( isset( $_SESSION['wsUserName'] ) && isset( $_COOKIE["{$wgCookiePrefix}UserName"] ) ) { |
820 | | - // Cookie and session username should match |
821 | | - if( $_SESSION['wsUserName'] == $_COOKIE["{$wgCookiePrefix}UserName"] ) { |
822 | | - $sName = $_SESSION['wsUserName']; |
823 | | - } else { |
824 | | - $this->loadDefaults(); |
825 | | - return false; |
826 | | - } |
827 | | - } |
828 | | - */ |
| 822 | + |
829 | 823 | if ( isset( $_SESSION['wsUserName'] ) ) { |
830 | 824 | $sName = $_SESSION['wsUserName']; |
831 | 825 | } else if ( isset( $_COOKIE["{$wgCookiePrefix}UserName"] ) ) { |