From 04a696522d9c389e8f21d593c8ddd396114c8263 Mon Sep 17 00:00:00 2001 From: NikhitaPaturu Date: Thu, 26 Apr 2018 12:21:47 +0100 Subject: [PATCH] made changes to user while creating hosts --- app/controller/usercontroller.ctrl.php | 7 +++++-- app/view/host/index.php | 2 +- app/view/user/create.php | 9 ++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/controller/usercontroller.ctrl.php b/app/controller/usercontroller.ctrl.php index 0773dcae..0d7d03c4 100644 --- a/app/controller/usercontroller.ctrl.php +++ b/app/controller/usercontroller.ctrl.php @@ -377,9 +377,12 @@ public function create() { $error['role'] = 'Please select a role for the User.'; } - if(empty($group)){ - $group = NULL; + if((empty($groups)) && ($role == '3')) + { + $groups = NULL; + $error['group'] = 'Please select a group for the User.'; } + if(!$this->User->checkEmail($email)){ $error['email'] = 'This email is already in use in our database. Please use another one.'; } diff --git a/app/view/host/index.php b/app/view/host/index.php index e92819af..83e4d877 100644 --- a/app/view/host/index.php +++ b/app/view/host/index.php @@ -32,7 +32,7 @@
  • path)) { ?> - <?php echo $g->name; ?> Image + <?php echo $g->name; ?> Image <?php echo $group->name; ?> Image diff --git a/app/view/user/create.php b/app/view/user/create.php index e281d4bb..3d31bcaa 100644 --- a/app/view/user/create.php +++ b/app/view/user/create.php @@ -43,7 +43,7 @@
    - "> @@ -56,18 +56,17 @@
    */ ?> -
    "> + ' . $error['group'] . ''; } ?>
    +
    - - - ' . $error['group'] . ''; } ?> +