Skip to content

Commit

Permalink
Remove the 4 character minimum for group name length. Fixes ticket #1…
Browse files Browse the repository at this point in the history
…396.
  • Loading branch information
bharat committed Sep 23, 2010
1 parent 790bf4e commit 7116f82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions modules/user/controllers/admin_users.php
Expand Up @@ -381,8 +381,8 @@ private function _get_group_edit_form_admin($group) {
$form_group->inputs["name"]->error_messages("conflict", t("There is already a group with that name"))
->error_messages("required", t("You must enter a group name"))
->error_messages("length",
t("The group name must be between %min_length and %max_length characters",
array("min_length" => 4, "max_length" => 255)));
t("The group name must be less than %max_length characters",
array("max_length" => 255)));
$form_group->submit("")->value(t("Save"));
return $form;
}
Expand All @@ -392,9 +392,7 @@ private function _get_group_add_form_admin() {
$form_group = $form->group("add_group")->label(t("Add group"));
$form_group->input("name")->label(t("Name"))->id("g-name");
$form_group->inputs["name"]->error_messages("conflict", t("There is already a group with that name"))
->error_messages("required", t("You must enter a group name"))
->error_messages("length", t("The group name must be at least %min_length characters",
array("min_length" => 4)));
->error_messages("required", t("You must enter a group name"));
$form_group->submit("")->value(t("Add group"));
return $form;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/user/models/group.php
Expand Up @@ -41,7 +41,7 @@ public function validate(Validation $array=null) {
// validate() is recursive, only modify the rules on the outermost call.
if (!$array) {
$this->rules = array(
"name" => array("rules" => array("required", "length[4,255]"),
"name" => array("rules" => array("required", "length[1,255]"),
"callbacks" => array(array($this, "valid_name"))));
}

Expand Down

0 comments on commit 7116f82

Please sign in to comment.