X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/7243c8da5a23936555f2a7adc1abf6f297a4e746..7ca15b5853146dd809f2ad3f5b2e1d9dab4f8dd4:/WEB-INF/lib/ttRegistrator.class.php diff --git a/WEB-INF/lib/ttRegistrator.class.php b/WEB-INF/lib/ttRegistrator.class.php index 3ac6166d..71f49e69 100644 --- a/WEB-INF/lib/ttRegistrator.class.php +++ b/WEB-INF/lib/ttRegistrator.class.php @@ -81,7 +81,7 @@ class ttRegistrator { // The register function registers a user in Time Tracker. function register() { - if ($this->err->yes()) return; // There are errors, do not proceed. + if ($this->err->yes()) return false; // There are errors, do not proceed. global $i18n; @@ -89,30 +89,33 @@ class ttRegistrator { if (ttUserHelper::getUserByLogin($this->login)) { // User login already exists. $this->err->add($i18n->getKey('error.user_exists')); - return; + return false; } // Create a new group. $this->group_id = $this->createGroup(); if (!$this->group_id) { $this->err->add($i18n->getKey('error.db')); - return; + return false; } import('ttRoleHelper'); if (!ttRoleHelper::createPredefinedRoles($this->group_id, $this->lang)) { $err->add($i18n->getKey('error.db')); - return; + return false; } $this->role_id = ttRoleHelper::getTopManagerRoleID(); $this->user_id = $this->createUser(); if (!$this->user_id) { $err->add($i18n->getKey('error.db')); - return; + return false; } - $this->setCreatedBy($this->user_id); + if (!$this->setCreatedBy($this->user_id)) + return false; + + return true; } // The createGroup function creates a group in Time Tracker as part