diff options
author | Malf Furious <m@lfurio.us> | 2016-01-26 21:55:43 -0500 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2016-01-26 21:55:43 -0500 |
commit | 9ce26b55017a24f3cae5c20958f2d612273c2f60 (patch) | |
tree | bb21fb624c76c64b07f11da5d69f22cc4739b7fa /app/model | |
parent | 50cd689b49148c47df60d92ce33340b9a4c516b7 (diff) | |
download | scrott-9ce26b55017a24f3cae5c20958f2d612273c2f60.tar.gz scrott-9ce26b55017a24f3cae5c20958f2d612273c2f60.zip |
+ Added function to User class to fetch all users from DB
* Altered Auth MVC deflt action to return false if no users are found. This way, the Auth controller can automatically present user a page to create an admin account
Diffstat (limited to 'app/model')
-rw-r--r-- | app/model/auth.mod.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/model/auth.mod.php b/app/model/auth.mod.php index 9c356e2..9cd6b7c 100644 --- a/app/model/auth.mod.php +++ b/app/model/auth.mod.php @@ -1,6 +1,7 @@ <?php require_once "model/common.mod.php"; +require_once "class/user.class.php"; class AuthModel extends CommonModel { @@ -9,6 +10,15 @@ 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; + + return true; } } |