From: Nik Okuntseff Date: Mon, 24 Dec 2018 15:24:05 +0000 (+0000) Subject: Fixed ttRegistrator class. X-Git-Tag: timetracker_1.19-1~378 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a468ccc781de1988967194b2bf89e6b7a404e716;p=timetracker.git Fixed ttRegistrator class. --- diff --git a/WEB-INF/lib/ttRegistrator.class.php b/WEB-INF/lib/ttRegistrator.class.php index 77ffb6b5..1664461b 100644 --- a/WEB-INF/lib/ttRegistrator.class.php +++ b/WEB-INF/lib/ttRegistrator.class.php @@ -26,6 +26,9 @@ // | https://www.anuko.com/time_tracker/credits.htm // +----------------------------------------------------------------------+ +import('ttUserHelper'); +import('ttRoleHelper'); + // ttRegistrator class is used to register a user in Time Tracker. class ttRegistrator { var $user_name = null; // User name. @@ -83,6 +86,8 @@ class ttRegistrator { $this->err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password')); if (!ttValidEmail($this->email, true)) $this->err->add($i18n->get('error.field'), $i18n->get('label.email')); + if (!ttUserHelper::canAdd()) + $this->err->add($i18n->get('error.user_count')); } // The register function registers a user in Time Tracker. @@ -115,7 +120,6 @@ class ttRegistrator { return false; } - import('ttRoleHelper'); if (!ttRoleHelper::createPredefinedRoles($this->group_id, $this->lang)) { $err->add($i18n->get('error.db')); return false; @@ -124,7 +128,7 @@ class ttRegistrator { $this->user_id = $this->createUser(); if (!$this->user_id) { - $err->add($i18n->get('error.db')); + $this->err->add($i18n->get('error.db')); return false; } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index d163b71d..6cac932b 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.36.4687 | Copyright © Anuko | +  Anuko Time Tracker 1.18.36.4688 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve}