Cannot register registered username

This commit is contained in:
2017-09-06 15:04:41 +07:00
parent c43b4744db
commit b78a84585f
2 changed files with 10 additions and 1 deletions

View File

@@ -71,6 +71,15 @@ class Home
$args['full_name'] = htmlspecialchars($args['full_name']);
$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);
Redirect::to('/');