1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

prevent login attempt on class initiation with CLI.

This commit is contained in:
CaMer0n
2008-01-22 01:41:36 +00:00
parent e908832d8b
commit ad3b2bac36

View File

@@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/login.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/login.php,v $
| $Revision: 1.16 $ | $Revision: 1.17 $
| $Date: 2008-01-22 00:39:08 $ | $Date: 2008-01-22 01:41:36 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -39,6 +39,12 @@ class userlogin
$username = trim($username); $username = trim($username);
$userpass = trim($userpass); $userpass = trim($userpass);
if($_E107['cli'] && ($username == ""))
{
return;
}
if($username == "" || $userpass == "") if($username == "" || $userpass == "")
{ // Required fields blank { // Required fields blank
define("LOGINMESSAGE", LAN_LOGIN_20."<br /><br />"); define("LOGINMESSAGE", LAN_LOGIN_20."<br /><br />");
@@ -188,7 +194,10 @@ class userlogin
$e_event->trigger("login", $edata_li); $e_event->trigger("login", $edata_li);
$redir = (e_QUERY ? e_SELF."?".e_QUERY : e_SELF); $redir = (e_QUERY ? e_SELF."?".e_QUERY : e_SELF);
if($_E107['cli'])
{
return $cookieval;
}
if (isset($pref['frontpage_force']) && is_array($pref['frontpage_force'])) if (isset($pref['frontpage_force']) && is_array($pref['frontpage_force']))
{ // See if we're to force a page immediately following login - assumes $pref['frontpage_force'] is an ordered list of rules { // See if we're to force a page immediately following login - assumes $pref['frontpage_force'] is an ordered list of rules
@@ -209,10 +218,7 @@ class userlogin
} }
} }
if($_E107['cli'])
{
return $cookieval;
}
if (strstr($_SERVER['SERVER_SOFTWARE'], "Apache")) { if (strstr($_SERVER['SERVER_SOFTWARE'], "Apache")) {
header("Location: ".$redir); header("Location: ".$redir);