Merge branch 'master' into noglob
This commit is contained in:
commit
7d35a8f3f0
27 changed files with 430 additions and 288 deletions
|
|
@ -74,11 +74,26 @@ class User implements UserInterface
|
|||
$time = time();
|
||||
if ($time - $lasttime > self::LIFE_TIME) return null; // Вышло время сессии
|
||||
$id = $this->id;
|
||||
$this->db->executeQuery("UPDATE users SET lasttime = $time WHERE id_user = $id"); // Время последнего обращения входа
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
function setSID() {
|
||||
function setSID($random, $result) {
|
||||
return $this->db->executeQuery("UPDATE users SET sid = '$random', trie_count = 0 WHERE id_user = " . $result->getInt('id_user'));
|
||||
}
|
||||
|
||||
function resetTries($login) {
|
||||
$this->db->executeQuery(
|
||||
"UPDATE users SET trie_count = :count WHERE login = :login",
|
||||
['count' => 0, 'login' => $login]
|
||||
);
|
||||
}
|
||||
|
||||
function updateTries($login) {
|
||||
$user = $this->db->fetchOneArray("SELECT id_user, trie_count FROM users WHERE login = :login", ['login' => $login]);
|
||||
$this->db->executeQuery(
|
||||
"UPDATE users SET trie_time = :cur_time, trie_count = :count WHERE id_user = :id_user",
|
||||
['cur_time' => time(), 'count' => $user['trie_count']+1, 'id_user' => $user['id_user']]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue