Fixed ttRegistrator class.
authorNik Okuntseff <support@anuko.com>
Mon, 24 Dec 2018 15:24:05 +0000 (15:24 +0000)
committerNik Okuntseff <support@anuko.com>
Mon, 24 Dec 2018 15:24:05 +0000 (15:24 +0000)
WEB-INF/lib/ttRegistrator.class.php
WEB-INF/templates/footer.tpl

index 77ffb6b..1664461 100644 (file)
@@ -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;
     }
 
index d163b71..6cac932 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.18.36.4687 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.18.36.4688 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>