Skip to content

Commit

Permalink
Merge pull request #80 from alpha1125/master
Browse files Browse the repository at this point in the history
Auth class previously using a non-default function parameter following a set of params with default values set
  • Loading branch information
allebb committed Oct 27, 2014
2 parents 87d6f73 + 9446b5b commit b322671
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions dryden/ctrl/auth.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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, "/");
Expand Down Expand Up @@ -191,5 +191,3 @@ static function CurrentUserID()
}

}

?>

0 comments on commit b322671

Please sign in to comment.