-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from alpha1125/master
Auth class previously using a non-default function parameter following a set of params with default values set
- Loading branch information
Showing
1 changed file
with
5 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,17 +99,17 @@ static function SetSession($name, $value = "") | |
} | ||
} | ||
|
||
/** | ||
/** | ||
* The main authentication mechanism, checks username and password against the database and logs the user in on a successful authenitcation request. | ||
* @author Bobby Allen ([email protected]) | ||
* @global db_driver $zdbh The ZPX database handle. | ||
* @param string $username The username to use to authenticate with. | ||
* @param string $password The password to use to authenticate with. | ||
* @param bool $rememberme Remember the password for 30 days? (true/false) | ||
* @param bool $rememberMe Remember the password for 30 days? (true/false) | ||
* @param bool $checkingcookie The authentication request has come from a set cookie. | ||
* @return mixed Returns 'false' if the authentication fails otherwise will return the user ID. | ||
*/ | ||
static function Authenticate($username, $password, $rememberme = false, $iscookie = false, $sessionSecuirty) | ||
static function Authenticate($username, $password, $rememberMe = false, $isCookie = false, $sessionSecurity = false) | ||
{ | ||
global $zdbh; | ||
$sqlString = "SELECT * FROM | ||
|
@@ -130,10 +130,10 @@ static function Authenticate($username, $password, $rememberme = false, $iscooki | |
//Disabled till zpanel 10.0.3 | ||
//runtime_sessionsecurity::sessionRegen(); | ||
|
||
ctrl_auth::SetUserSession($row['ac_id_pk'], $sessionSecuirty); | ||
ctrl_auth::SetUserSession($row['ac_id_pk'], $sessionSecurity); | ||
$log_logon = $zdbh->prepare("UPDATE x_accounts SET ac_lastlogon_ts=" . time() . " WHERE ac_id_pk=" . $row['ac_id_pk'] . ""); | ||
$log_logon->execute(); | ||
if ($rememberme) { | ||
if ($rememberMe) { | ||
setcookie("zUser", $username, time() + 60 * 60 * 24 * 30, "/"); | ||
setcookie("zPass", $password, time() + 60 * 60 * 24 * 30, "/"); | ||
//setcookie("zSec", $sessionSecuirty, time() + 60 * 60 * 24 * 30, "/"); | ||
|
@@ -191,5 +191,3 @@ static function CurrentUserID() | |
} | ||
|
||
} | ||
|
||
?> |