- Email verification (regular, business owner), CLI administration

This commit is contained in:
Ty Clifford
2026-06-18 14:50:48 -04:00
parent 66f93757b6
commit cfd1fba5ab
9 changed files with 778 additions and 28 deletions
+10 -4
View File
@@ -7,11 +7,17 @@ $err = '';
if (isPost()) {
csrfCheck();
$un = ps('username'); $pw = ps('password');
$u = qone("SELECT * FROM users WHERE (username=? OR email=?) AND is_active=1", [$un, $un]);
$u = qone("SELECT * FROM users WHERE (username=? OR email=?)", [$un, $un]);
if ($u && password_verify($pw, $u['password'])) {
loginUser($u);
flash('Welcome back, '.e($u['username']).'!', 'success');
go($next);
if (empty($u['email_verified_at'])) {
$err = 'Please verify your email address before signing in.';
} elseif ((int)$u['is_active'] !== 1) {
$err = 'Your account is not active. Please contact the site administrator.';
} else {
loginUser($u);
flash('Welcome back, '.e($u['username']).'!', 'success');
go($next);
}
} else {
$err = 'Invalid username or password.';
}