diff options
Diffstat (limited to 'app/model')
-rw-r--r-- | app/model/auth.mod.php | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/app/model/auth.mod.php b/app/model/auth.mod.php index 2b61b91..23b8288 100644 --- a/app/model/auth.mod.php +++ b/app/model/auth.mod.php @@ -3,6 +3,7 @@ require_once "model/common.mod.php"; require_once "class/user.class.php"; require_once "class/form.class.php"; +require_once "class/setting.class.php"; class AuthModel extends CommonModel { @@ -11,33 +12,35 @@ class AuthModel extends CommonModel */ function deflt() { - /* Make sure user accounts exist since this is preping the page to login. If there are no accounts in the DB, - * return false to signal controller to display the admin account creation */ - $userTbl = new User(); if (count($userTbl->getAllUsers_orderByName()) == 0) - return false; + { + $this->noaccounts = true; + $this->activeTab['signup'] = "in active"; + $this->tabSwap = false; + } - return true; + else + { + $this->activeTab['login'] = "in active"; + $this->tabSwap = Setting::allowPublicSignup(); + } } /* - * Signup action + * Attempt to register a new account */ - function signup() + function signup($input) { $userTbl = new User(); - if (count($userTbl->getAllUsers_orderByName()) == 0) - $this->noaccounts = true; - } + if (!Setting::allowPublicSignup() && count($userTbl->getAllUsers_orderByName()) > 0) + { + $this->logError("You may not signup at this time"); + return; + } - /* - * Attempt to register a new account - */ - function signupSubmit($input) - { $form = new Form(); $form->field_text("username"); $form->field_text("password", null, false); |