ensure the new username is not the same if (!empty($old_usr) && (isset($PHP_AUTH_USER) && $old_usr == $PHP_AUTH_USER)) { $PHP_AUTH_USER = ''; } // Returns whether we get authentication settings or not if (empty($PHP_AUTH_USER)) { return FALSE; } else { if (get_magic_quotes_gpc()) { $PHP_AUTH_USER = stripslashes($PHP_AUTH_USER); $PHP_AUTH_PW = stripslashes($PHP_AUTH_PW); } return TRUE; } } // end of the 'PMA_auth_check()' function /** * Set the user and password after last checkings if required * * @global array the valid servers settings * @global integer the id of the current server * @global array the current server settings * @global string the current username * @global string the current password * * @return boolean always true * * @access public */ function PMA_auth_set_user() { global $cfgServers, $server, $cfgServer; global $PHP_AUTH_USER, $PHP_AUTH_PW; // Ensures the valid 'only_db' setting is used if ($cfgServer['user'] != $PHP_AUTH_USER) { $servers_cnt = count($cfgServers); for ($i = 1; $i <= $servers_cnt; $i++) { if (isset($cfgServers[$i]) && ($cfgServers[$i]['host'] == $cfgServer['host'] && $cfgServers[$i]['user'] == $PHP_AUTH_USER)) { $server = $i; $cfgServer = $cfgServers[$i]; break; } } // end for } // end if $cfgServer['user'] = $PHP_AUTH_USER; $cfgServer['password'] = $PHP_AUTH_PW; return TRUE; } // end of the 'PMA_auth_set_user()' function /** * User is not allowed to login to MySQL -> authentication failed * * @return boolean always true (no return indeed) * * @access public */ function PMA_auth_fails() { PMA_auth(); return TRUE; } // end of the 'PMA_auth()' function } // $__PMA_HTTP_AUTH_LIB__ ?>