svn: /web/php-bugs/trunk/ include/functions.php www/logout.php

From: Date: Wed, 23 Mar 2011 13:34:25 +0000
Subject: svn: /web/php-bugs/trunk/ include/functions.php www/logout.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-10718@lists.php.net to get a copy of this message
bjori Wed, 23 Mar 2011 13:34:25 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=309600 Log: Store the credentials in the local session so we don't have to "login" on every change Changed paths: U web/php-bugs/trunk/include/functions.php U web/php-bugs/trunk/www/logout.php Modified: web/php-bugs/trunk/include/functions.php =================================================================== --- web/php-bugs/trunk/include/functions.php 2011-03-23 13:14:34 UTC (rev 309599) +++ web/php-bugs/trunk/include/functions.php 2011-03-23 13:34:25 UTC (rev 309600) @@ -93,6 +93,8 @@ return false; } + $_SESSION["credentials"] = array($user, $pass); + return true; } @@ -153,6 +155,8 @@ } elseif (isset($auth_user) && is_object($auth_user) && $auth_user->handle) { $user = $auth_user->handle; $pw = $auth_user->password; + } elseif (isset($_SESSION["credentials"]) && count($_SESSION["credentials"]) == 2) { + list($user, $pw) = $_SESSION["credentials"]; // FIXME: Killed magic cookie login.. } elseif (false && isset($_COOKIE['MAGIC_COOKIE'])) { @list($user, $pw) = explode(':', base64_decode($_COOKIE['MAGIC_COOKIE']), 2); @@ -1633,7 +1637,6 @@ <a href="search.php" class="menuWhite">advanced search</a>&nbsp;|&nbsp; <a href="search-howto.php" class="menuWhite">search howto</a>&nbsp;|&nbsp; <a href="stats.php" class="menuWhite">statistics</a>&nbsp;|&nbsp; - <a href="http://master.php.net/login.php" class="menuWhite">login</a> </td> </tr> Modified: web/php-bugs/trunk/www/logout.php =================================================================== --- web/php-bugs/trunk/www/logout.php 2011-03-23 13:14:34 UTC (rev 309599) +++ web/php-bugs/trunk/www/logout.php 2011-03-23 13:34:25 UTC (rev 309600) @@ -4,6 +4,8 @@ setcookie("MAGIC_COOKIE","",time()-3600,'/','.php.net'); setcookie("MAGIC_COOKIE","",time()-3600,'/'); +$_SESSION["credentials"] = array(); +session_destroy(); response_header('Logout');

« previous php.webmaster (#10718) next »