- common_config('group', 'maxaliases')
- ),
- 403,
- $this->format
- );
- return false;
- }
-
- foreach ($this->aliases as $alias) {
-
- $valid = Validate::string(
- $alias, array(
- 'min_length' => 1,
- 'max_length' => 64,
- 'format' => NICKNAME_FMT
- )
- );
-
- if (!$valid) {
- $this->clientError(
- // TRANS: Client error shown when providing an invalid alias during group creation.
- // TRANS: %s is the invalid alias.
- sprintf(_('Invalid alias: "%s".'), $alias),
- 403,
- $this->format
- );
- return false;
- }
- if ($this->groupNicknameExists($alias)) {
- $this->clientError(
- sprintf(
- // TRANS: Client error displayed when trying to use an alias during group creation that is already in use.
- // TRANS: %s is the alias that is already in use.
- _('Alias "%s" already in use. Try another one.'),
- $alias
- ),
- 403,
- $this->format
- );
- return false;
- }
-
- // XXX assumes alphanum nicknames
-
- if (strcmp($alias, $this->nickname) == 0) {
- $this->clientError(
- // TRANS: Client error displayed when trying to use an alias during group creation that is the same as the group's nickname.
- _('Alias can\'t be the same as nickname.'),
- 403,
- $this->format
- );
- return false;
- }