| 32 |
if ($remember === null) $remember = mosGetParam($_POST, 'remember', ''); |
if ($remember === null) $remember = mosGetParam($_POST, 'remember', ''); |
| 33 |
|
|
| 34 |
if (!$username || !$passwd) { |
if (!$username || !$passwd) { |
| 35 |
echo "<script> alert(\""._LOGIN_INCOMPLETE."\"); window.history.go(-1); </script>\n"; |
echo "<script> alert(\"".T_('Please complete the username and password fields.')."\"); window.history.go(-1); </script>\n"; |
| 36 |
exit(); |
exit(); |
| 37 |
} else { |
} else { |
| 38 |
$loginfo =& new mosLoginDetails($username, $passwd, $remember); |
$loginfo =& new mosLoginDetails($username, $passwd, $remember); |
| 39 |
$checkuser = true; |
$checkuser = true; |
| 40 |
$logresults = $mambothandler->trigger('requiredLogin',array($loginfo)); |
$logresults = $mambothandler->trigger('requiredLogin',array($loginfo)); |
| 41 |
if (count($logresults) == 0) $logresults[] = _LOGIN_NOAUTHENTICS; |
if (count($logresults) == 0) $logresults[] = T_('Logins are not permitted. There is no authentication check active.'); |
| 42 |
foreach ($logresults as $message) { |
foreach ($logresults as $message) { |
| 43 |
if ($message) $checkuser = false; |
if ($message) $checkuser = false; |
| 44 |
break; |
break; |
| 69 |
); |
); |
| 70 |
if ($database->loadObject($row)) { |
if ($database->loadObject($row)) { |
| 71 |
if ($row->block) { |
if ($row->block) { |
| 72 |
$message = _LOGIN_BLOCKED; |
$message = T_('Your login has been blocked. Please contact the administrator.'); |
| 73 |
return false; |
return false; |
| 74 |
} |
} |
| 75 |
// fudge the group stuff |
// fudge the group stuff |
| 100 |
//mosCache::cleanCache('com_content'); |
//mosCache::cleanCache('com_content'); |
| 101 |
mosCache::cleanCache(); |
mosCache::cleanCache(); |
| 102 |
} else { |
} else { |
| 103 |
$message =_LOGIN_INCORRECT; |
$message = T_('Incorrect username or password. Please try again.'); |
| 104 |
$this->clearSession($session); |
$this->clearSession($session); |
| 105 |
return false; |
return false; |
| 106 |
} |
} |
| 144 |
$pass = $database->getEscaped(mosGetParam($_POST, 'pass', '')); |
$pass = $database->getEscaped(mosGetParam($_POST, 'pass', '')); |
| 145 |
|
|
| 146 |
$my = null; |
$my = null; |
| 147 |
if (!$pass) echo "<script>alert('Please enter a password'); document.location.href='index.php';</script>\n"; |
if (!$pass) echo "<script>alert('".T_('Please enter a password')."'); document.location.href='index.php';</script>\n"; |
| 148 |
else $pass = md5( $pass ); |
else $pass = md5( $pass ); |
| 149 |
|
|
| 150 |
$admintypes = array ('administrator', 'superadministrator', 'super administrator'); |
$admintypes = array ('administrator', 'superadministrator', 'super administrator'); |
| 163 |
if ($oneuser->username == $usrname) $my =& $users[$key]; |
if ($oneuser->username == $usrname) $my =& $users[$key]; |
| 164 |
} |
} |
| 165 |
} |
} |
| 166 |
if ($admins == 0) echo "<script>alert(\""._LOGIN_NOADMINS."\"); window.history.go(-1); </script>\n"; |
if ($admins == 0) echo "<script>alert(\"".T_('You cannot login. There are no administrators set up.')."\"); window.history.go(-1); </script>\n"; |
| 167 |
/** find the user group (or groups in the future) */ |
/** find the user group (or groups in the future) */ |
| 168 |
elseif (isset($my)) { |
elseif (isset($my)) { |
| 169 |
// $authoriser = new mosAuthoriser($database); |
// $authoriser = new mosAuthoriser($database); |