Cannot register registered username
This commit is contained in:
parent
c43b4744db
commit
b78a84585f
@ -71,6 +71,15 @@ class Home
|
|||||||
$args['full_name'] = htmlspecialchars($args['full_name']);
|
$args['full_name'] = htmlspecialchars($args['full_name']);
|
||||||
$args['username'] = htmlspecialchars($args['username']);
|
$args['username'] = htmlspecialchars($args['username']);
|
||||||
|
|
||||||
|
$data = $this->access->showAll();
|
||||||
|
foreach ($data as $users) {
|
||||||
|
if ($args['username'] == $users['username']) {
|
||||||
|
Session::flash('info', 'Username already exists');
|
||||||
|
Redirect::to('./register');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->access->entry($table, $args);
|
$this->access->entry($table, $args);
|
||||||
|
|
||||||
Redirect::to('/');
|
Redirect::to('/');
|
||||||
|
@ -30,7 +30,7 @@ class Access extends \Core\Model
|
|||||||
|
|
||||||
if ($stmt = $db->query($sql)) {
|
if ($stmt = $db->query($sql)) {
|
||||||
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
return true;
|
return $result;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user