X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=WEB-INF%2Flib%2FAuth.class.php;h=d57a0c4a3ed634de3bd995c14d5e94135e963aea;hb=cb611bf2abbb4072459632155b11301ae6fe840b;hp=e8a4ec07bf8cd15ca7bd10c41ca82c3fc2a429ed;hpb=993450e17195b87dc406c3135ee22dafe9b825fb;p=timetracker.git
diff --git a/WEB-INF/lib/Auth.class.php b/WEB-INF/lib/Auth.class.php
index e8a4ec07..d57a0c4a 100644
--- a/WEB-INF/lib/Auth.class.php
+++ b/WEB-INF/lib/Auth.class.php
@@ -36,7 +36,8 @@ class Auth {
// die ("Your browser's cookie functionality is turned off. Please turn it on.");
// }
- $GLOBALS['SMARTY']->assign('authenticated', true); // Used in header.tpl for menu display.
+ global $smarty;
+ $smarty->assign('authenticated', true); // Used in header.tpl for menu display.
return true;
}
session_write_close();
@@ -52,18 +53,18 @@ class Auth {
{
return false;
}
-
+
// isPasswordExternal - returns true if actual password is not stored in the internal DB.
function isPasswordExternal()
{
return false;
}
-
+
// doLogin - perfoms a login procedure.
function doLogin($login, $password) {
$auth = $this->authenticate($login, $password);
-
- if (defined('AUTH_DEBUG') && isTrue(AUTH_DEBUG)) {
+
+ if (isTrue(AUTH_DEBUG)) {
echo '
'; var_dump($auth); echo '
';
}
@@ -76,17 +77,17 @@ class Auth {
$sql = "SELECT id FROM tt_users WHERE login = ".$mdb2->quote($login)." AND status = 1";
$res = $mdb2->query($sql);
if (is_a($res, 'PEAR_Error')) {
- if (defined('AUTH_DEBUG') && isTrue(AUTH_DEBUG))
+ if (isTrue(AUTH_DEBUG))
echo 'db error!
';
return false;
}
$val = $res->fetchRow();
if (!$val['id']) {
- if (defined('AUTH_DEBUG') && isTrue(AUTH_DEBUG))
+ if (isTrue(AUTH_DEBUG))
echo 'login "'.$login.'" does not exist in Time Tracker database.
';
return false;
}
-
+
$this->setAuth($val['id'], $login);
return true;
}
@@ -111,7 +112,7 @@ class Auth {
function getUserLogin() {
return $_SESSION['login'];
}
-
+
// getUserId - retrieves user ID from session.
function getUserId() {
if (isset($_SESSION['authenticated_user_id']))