*/
function authenticate($login, $password)
{
- $mdb2 = getConnection();
-
- // Try md5 password match first.
- $sql = "SELECT id FROM tt_users
+ $mdb2 = getConnection();
+
+ // Try md5 password match first.
+ $sql = "SELECT id FROM tt_users
WHERE login = ".$mdb2->quote($login)." AND password = md5(".$mdb2->quote($password).") AND status = 1";
$res = $mdb2->query($sql);
if ($val['id'] > 0) {
return array('login'=>$login,'id'=>$val['id']);
}
- return false;
}
+
+ // Special handling for admin@localhost - search for an account with admin role with a matching password.
+ if ($login == 'admin@localhost') {
+ $sql = "SELECT id, login FROM tt_users
+ WHERE role = 1024 AND password = md5(".$mdb2->quote($password).") AND 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;
}
function isPasswordExternal() {
*/
function authenticate($login, $password)
{
+ // Special handling for admin@localhost - authenticate against db, not ldap.
+ // It is a fallback mechanism when admin account in LDAP directory does not exist or is misconfigured.
+ if ($login == 'admin@localhost') {
+ import('auth.Auth_db');
+ return Auth_db::authenticate($login, $password);
+ }
+
if (!function_exists('ldap_bind')) {
die ('php_ldap extension not loaded!');
}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.9.19.3442 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.9.20.3443 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>