+
+ // Special handling for admin@localhost - search for an account with admin role with a matching password.
+ if ($login == 'admin@localhost') {
+ $sql = "SELECT u.id, u.login FROM tt_users u".
+ " LEFT JOIN tt_roles r on (u.role_id = r.id)".
+ " WHERE r.rank = 1024 AND password = md5(".$mdb2->quote($password).") AND u.status = 1";
+ $res = $mdb2->query($sql);
+ if (is_a($res, 'PEAR_Error')) {
+ die($res->getMessage());
+ }
+ $val = $res->fetchRow();
+ if ($val['id'] > 0) {
+ return array('login'=>$val['login'],'id'=>$val['id']);
+ }
+ }
+
+ return false;