X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/367baa10353d5f679e6e3c795ae9d35a275a24d9..87dff6fdf1e60ff60fb429290488cb1c9bf778d9:/WEB-INF/lib/ttUserHelper.class.php diff --git a/WEB-INF/lib/ttUserHelper.class.php b/WEB-INF/lib/ttUserHelper.class.php index b3a5e360..538a2fc4 100644 --- a/WEB-INF/lib/ttUserHelper.class.php +++ b/WEB-INF/lib/ttUserHelper.class.php @@ -388,7 +388,7 @@ class ttUserHelper { } // canAdd determines if we can add a user in case there is a limit. - static function canAdd() { + static function canAdd($num_users = 1) { $mdb2 = getConnection(); $sql = "select param_value from tt_site_config where param_name = 'max_users'"; $res = $mdb2->query($sql); @@ -399,7 +399,7 @@ class ttUserHelper { $sql = "select count(*) as user_count from tt_users where status is not null"; $res = $mdb2->query($sql); $val = $res->fetchRow(); - if ($val['user_count'] < $max_count) + if ($val['user_count'] < $max_count - $num_users) // TODO: test this. return true; // Limit not reached. return false;