You are here

function regcode_errormsg in Registration codes 8

Same name and namespace in other branches
  1. 6.2 regcode.module \regcode_errormsg()
  2. 7.2 regcode.module \regcode_errormsg()
  3. 7 regcode.module \regcode_errormsg()

Returns text message requested by given identifier/constant.

Parameters

int $err: The error message code.

Return value

string The text of the message.

1 call to regcode_errormsg()
regcode_code_element_validate in ./regcode.module
Validates the content of the code-field on user registration.

File

./regcode.module, line 145
Main functionality and hooks of regcode module.

Code

function regcode_errormsg($err) {
  $messages = [
    REGCODE_VALIDITY_NOTEXISTING => t('Registration code does not exist'),
    REGCODE_VALIDITY_NOTAVAILABLE => t('Registration code is not available'),
    REGCODE_VALIDITY_TAKEN => t('Registration code has already been used'),
    REGCODE_VALIDITY_EXPIRED => t('Registration code has expired'),
  ];
  return isset($messages[$err]) ? $messages[$err] : FALSE;
}