diff --git a/cohort/lib.php b/cohort/lib.php index e33f77a..61c542b 100755 --- a/cohort/lib.php +++ b/cohort/lib.php @@ -268,7 +268,7 @@ class cohort_candidate_selector extends user_selector_base { if (!$this->is_validating()) { $potentialmemberscount = $DB->count_records_sql($countfields . $sql, $params); - if ($potentialmemberscount > 100) { + if ($potentialmemberscount > user_selector_base::MAX_USERS_PER_PAGE) { return $this->too_many_results($search, $potentialmemberscount); } } @@ -330,7 +330,7 @@ class cohort_existing_selector extends user_selector_base { if (!$this->is_validating()) { $potentialmemberscount = $DB->count_records_sql($countfields . $sql, $params); - if ($potentialmemberscount > 100) { + if ($potentialmemberscount > user_selector_base::MAX_USERS_PER_PAGE) { return $this->too_many_results($search, $potentialmemberscount); } } diff --git a/enrol/manual/locallib.php b/enrol/manual/locallib.php index 2a25af7..b326520 100755 --- a/enrol/manual/locallib.php +++ b/enrol/manual/locallib.php @@ -64,7 +64,7 @@ class enrol_manual_potential_participant extends user_selector_base { if (!$this->is_validating()) { $potentialmemberscount = $DB->count_records_sql($countfields . $sql, $params); - if ($potentialmemberscount > 100) { + if ($potentialmemberscount > user_selector_base::MAX_USERS_PER_PAGE) { return $this->too_many_results($search, $potentialmemberscount); } } @@ -127,7 +127,7 @@ class enrol_manual_current_participant extends user_selector_base { if (!$this->is_validating()) { $potentialmemberscount = $DB->count_records_sql($countfields . $sql, $params); - if ($potentialmemberscount > 100) { + if ($potentialmemberscount > user_selector_base::MAX_USERS_PER_PAGE) { return $this->too_many_results($search, $potentialmemberscount); } } diff --git a/mnet/service/enrol/locallib.php b/mnet/service/enrol/locallib.php index c54ea2d..9e330f2 100755 --- a/mnet/service/enrol/locallib.php +++ b/mnet/service/enrol/locallib.php @@ -493,7 +493,7 @@ class mnetservice_enrol_existing_users_selector extends user_selector_base { if (!$this->is_validating()) { $potentialmemberscount = $DB->count_records_sql($countfields . $sql, $params); - if ($potentialmemberscount > 100) { + if ($potentialmemberscount > user_selector_base::MAX_USERS_PER_PAGE) { return $this->too_many_results($search, $potentialmemberscount); } } @@ -580,7 +580,7 @@ class mnetservice_enrol_potential_users_selector extends user_selector_base { if (!$this->is_validating()) { $potentialmemberscount = $DB->count_records_sql($countfields . $sql, $params); - if ($potentialmemberscount > 100) { + if ($potentialmemberscount > user_selector_base::MAX_USERS_PER_PAGE) { return $this->too_many_results($search, $potentialmemberscount); } } diff --git a/user/selector/lib.php b/user/selector/lib.php index 9dd55f6..e6979d0 100755 --- a/user/selector/lib.php +++ b/user/selector/lib.php @@ -36,6 +36,8 @@ define('USER_SELECTOR_DEFAULT_ROWS', 20); * specified. */ abstract class user_selector_base { + const MAX_USERS_PER_PAGE = 100; + /** @var string The control name (and id) in the HTML. */ protected $name; /** @var array Extra fields to search on and return in addition to firstname and lastname. */