password handling refactoring and added conversion of passwords to unicode

This commit is contained in:
skodak
2006-03-11 11:26:36 +00:00
parent c5b71097bc
commit df1931578a
12 changed files with 91 additions and 57 deletions
-20
View File
@@ -1280,26 +1280,6 @@ function update_record($table, $dataobject) {
/// USER DATABASE ////////////////////////////////////////////////
/**
* Does this username and password specify a valid admin user?
*
* @uses $CFG
* @param string $username The name of the user to be tested for admin rights
* @param string $md5password The password supplied by the user in md5 encrypted format.
* @return bool
*/
function adminlogin($username, $md5password) {
global $CFG;
return record_exists_sql("SELECT u.id
FROM {$CFG->prefix}user u,
{$CFG->prefix}user_admins a
WHERE u.id = a.userid
AND u.username = '$username'
AND u.password = '$md5password'");
}
/**
* Get the guest user information from the database
*