Fix copy/paste err: the validateAccount function was defined 2 times
This commit is contained in:
parent
cb94764071
commit
37a9f13e4a
|
@ -42,51 +42,7 @@ class admin_auth {
|
|||
}
|
||||
|
||||
function validateAccount($id) {
|
||||
/* can only do this after upgrade, which means
|
||||
* that the first login will always fail
|
||||
$query
|
||||
= ' select id, disabled,password,privileges'
|
||||
. ' from %s'
|
||||
. ' where id = ?';
|
||||
*/
|
||||
|
||||
$query
|
||||
= ' select id, disabled,password'
|
||||
. ' from %s'
|
||||
. ' where id = ?';
|
||||
|
||||
$query = sprintf($query, $GLOBALS['tables']['admin']);
|
||||
$req = Sql_Query_Params($query, array($id));
|
||||
$data = Sql_Fetch_Row($req);
|
||||
if (!$data[0]) {
|
||||
return array(0,s("No such account"));
|
||||
} elseif ($data[1]) {
|
||||
return array(0,s("your account has been disabled"));
|
||||
}
|
||||
|
||||
## do this seperately from above, to avoid lock out when the DB hasn't been upgraded.
|
||||
## so, ignore the error
|
||||
$query
|
||||
= ' select privileges'
|
||||
. ' from %s'
|
||||
. ' where id = ?';
|
||||
|
||||
$query = sprintf($query, $GLOBALS['tables']['admin']);
|
||||
$req = Sql_Query_Params($query, array($id),1);
|
||||
if ($req) {
|
||||
$data = Sql_Fetch_Row($req);
|
||||
} else {
|
||||
$data = array();
|
||||
}
|
||||
|
||||
if (!empty($data[0])) {
|
||||
$_SESSION['privileges'] = unserialize($data[0]);
|
||||
}
|
||||
return array(1,"OK");
|
||||
}
|
||||
|
||||
function validateAccount($id) {
|
||||
/* can only do this after upgrade, which means
|
||||
/* can only do this after upgrade, which means
|
||||
* that the first login will always fail
|
||||
$query
|
||||
= ' select id, disabled,password,privileges'
|
||||
|
|
Loading…
Reference in New Issue