diff --git a/src/bb-library/Model/Admin.php b/src/bb-library/Model/Admin.php index dc6b00ec0..1212d8f61 100644 --- a/src/bb-library/Model/Admin.php +++ b/src/bb-library/Model/Admin.php @@ -24,4 +24,16 @@ class Model_Admin extends \RedBean_SimpleModel { return $this->name; } + + public function getStatus($status = '') + { + $statusArray = array( + self::STATUS_ACTIVE, + self::STATUS_INACTIVE + ); + if (in_array($status, $statusArray)){ + return strtolower($status); + } + return self::STATUS_INACTIVE; + } } \ No newline at end of file diff --git a/src/bb-modules/Staff/Service.php b/src/bb-modules/Staff/Service.php index a282ffd5e..108e83752 100644 --- a/src/bb-modules/Staff/Service.php +++ b/src/bb-modules/Staff/Service.php @@ -470,7 +470,7 @@ class Service implements InjectionAwareInterface $model->email = $data['email']; $model->pass = $this->di['password']->hashIt($data['password']); $model->name = $data['name']; - $model->status = \Model_Admin::STATUS_ACTIVE; + $model->status = $model->getStatus($data['status']); $model->signature = $signature; $model->created_at = date('c'); $model->updated_at = date('c');