diff options
author | Malf Furious <m@lfurio.us> | 2016-02-06 18:18:11 -0500 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2016-02-06 18:18:11 -0500 |
commit | b3a31ffef3a6203ec61e745821945b371fff7c22 (patch) | |
tree | 53dc200a17925c4236a9324a34f583e66bb6dc39 /app/model | |
parent | 39394819d45ebcf68cab96c13a6affb994f734f3 (diff) | |
download | scrott-b3a31ffef3a6203ec61e745821945b371fff7c22.tar.gz scrott-b3a31ffef3a6203ec61e745821945b371fff7c22.zip |
Update Auth model to reflect changes in previous commit
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); |