[UPDATE] Coding style

This commit is contained in:
Sebastian Grewe 2014-01-02 11:05:07 +01:00
parent 4c3421cc8a
commit 67a6d9aff4
2 changed files with 59 additions and 61 deletions

View File

@ -172,7 +172,7 @@ public function generatePin($userID, $current) {
$username = $this->getUserName($userID); $username = $this->getUserName($userID);
$email = $this->getUserEmail($username); $email = $this->getUserEmail($username);
$current = $this->getHash($current); $current = $this->getHash($current);
$newpin = intval( "0" . rand(1,9) . rand(0,9) . rand(0,9) . rand(0,9) ); $newpin = intval( '0' . rand(1,9) . rand(0,9) . rand(0,9) . rand(0,9) );
$aData['username'] = $username; $aData['username'] = $username;
$aData['email'] = $email; $aData['email'] = $email;
$aData['pin'] = $newpin; $aData['pin'] = $newpin;
@ -180,8 +180,7 @@ public function generatePin($userID, $current) {
$aData['subject'] = 'PIN Reset Request'; $aData['subject'] = 'PIN Reset Request';
$stmt = $this->mysqli->prepare("UPDATE $this->table SET pin = ? WHERE ( id = ? AND pass = ? )"); $stmt = $this->mysqli->prepare("UPDATE $this->table SET pin = ? WHERE ( id = ? AND pass = ? )");
if ($this->checkStmt($stmt) && $stmt->bind_param('sis', $newpin, $userID, $current) && $stmt->execute()) if ($this->checkStmt($stmt) && $stmt->bind_param('sis', $newpin, $userID, $current) && $stmt->execute()) {
{
if ($stmt->errno == 0 && $stmt->affected_rows === 1) { if ($stmt->errno == 0 && $stmt->affected_rows === 1) {
if ($this->mail->sendMail('pin/reset', $aData)) { if ($this->mail->sendMail('pin/reset', $aData)) {
return true; return true;
@ -190,7 +189,6 @@ public function generatePin($userID, $current) {
return false; return false;
} }
} }
$stmt->close();
} }
$this->setErrorMessage( 'Unable to generate PIN, current password incorrect?' ); $this->setErrorMessage( 'Unable to generate PIN, current password incorrect?' );
return false; return false;