Use FORK_GROUP_UNVERIFIED

This commit is contained in:
Visman 2021-11-29 22:03:26 +07:00
parent a76d1c1788
commit 5d0ffc6633
3 changed files with 9 additions and 6 deletions

View file

@ -150,7 +150,7 @@ class Register extends Page
protected function regEnd(Validator $v): Page
{
if ('1' == $this->c->config->o_regs_verify) {
$groupId = 0;
$groupId = FORK_GROUP_UNVERIFIED;
$key = $this->c->Secury->randomPass(31);
} else {
$groupId = $this->c->config->i_default_user_group;

View file

@ -41,7 +41,7 @@ class Model extends DataModel
*/
protected function getisUnverified(): bool
{
return 0 === $this->group_id;
return $this->group_id === FORK_GROUP_UNVERIFIED;
}
/**

View file

@ -19,19 +19,22 @@ class Stats extends Action
*/
public function stats(): array
{
$vars = [
':gid' => FORK_GROUP_UNVERIFIED,
];
$query = 'SELECT COUNT(u.id)-1
FROM ::users AS u
WHERE u.group_id!=0';
WHERE u.group_id!=?i:gid';
$total = $this->c->DB->query($query)->fetchColumn();
$total = $this->c->DB->query($query, $vars)->fetchColumn();
$query = 'SELECT u.id, u.username
FROM ::users AS u
WHERE u.group_id!=0
WHERE u.group_id!=?i:gid
ORDER BY u.registered DESC
LIMIT 1';
$last = $this->c->DB->query($query)->fetch();
$last = $this->c->DB->query($query, $vars)->fetch();
return [
'total' => $total,