Compare commits

..

No commits in common. "38cc436f4d7353c74ce5494d57e5f6315ab1d6b1" and "f205df36ffd5509be761aee67eae20ce945325bb" have entirely different histories.

3 changed files with 2 additions and 16 deletions

View File

@ -44,6 +44,7 @@ class UserManager
public static function login ($username, $password, $rememberMe) {
try {
if ($user = Db::loadOne ('SELECT * FROM users WHERE (LOWER(username)=LOWER(?) OR LOWER(email)=LOWER(?))', array ($username, $username))) {
var_dump($user);
if ($user['password'] == UserManager::getHashPassword($password)) {
if (isset($rememberMe) && $rememberMe == 'true') {
setcookie ("rememberMe", self::setEncryptedCookie($user['username']), time () + (30 * 24 * 60 * 60 * 1000), BASEDIR, $_SERVER['HTTP_HOST'], 1);
@ -58,9 +59,7 @@ class UserManager
throw new PDOException("Uživatel s tím to jménem neexistuje!");
}
} catch(PDOException $error) {
$_SESSION['msg'] = $error->getMessage();
unset($_POST);
header('Location: ' . BASEURL . 'login');
echo $error->getMessage();
die();
}
}

View File

@ -14,10 +14,6 @@
<div class="label">Remember me:</div>
<input class="" type="checkbox" name="remember" value="true"/>
</div>
<?php if (!empty ($_SESSION['msg'])): ?>
<label class="message"><?php echo $_SESSION['msg']; ?></label><br/><br/>
<?php unset ($_SESSION['msg']); ?>
<?php endif; ?>
<input type="submit" class="button" name="login" value="Login"/>
</form>
</div>

View File

@ -475,15 +475,6 @@ html {
color: #a32929;
}
.message {
border: 2px solid #a32929;
background-color: #f6cbcb;
color: #a32929;
padding: .75rem 1rem;
margin-bottom: .8em;
width: 100%;
}
.content {
width: fit-content;
margin: 5px;