Function __global->cns_check_name_valid
Definitions
sources/cns_members_action2.php
- Check a username is valid for adding, and possibly also the password.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: object
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| &$username | ?SHORT_TEXT | Yes | No | required parameter | N/A | N/A | The username (may get altered) (null: nothing to check) |
| $member_id | ?MEMBER | No | No | Null | N/A | N/A | The member (null: member not actually added yet; this ID is only given for the duplication check, to make sure it doesn't think we are duplicating with ourself) |
| $password | ?SHORT_TEXT | No | No | Null | N/A | N/A | The password (null: nothing to check) |
| $email_address | No | No | Null | N/A | N/A | The e-mail address that will go with the password (null: unknown) | |
| $dob | ?TIME | No | No | Null | N/A | N/A | The date of birth that will go with the password (null: unknown) |
| $return_errors | boolean | No | No | False | N/A | N/A | Whether to return errors instead of dying on them |
Returns
- Error (null: none)
- Type: ?Tempcode
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Check a username is valid for adding, and possibly also the password.
*
* @param ?SHORT_TEXT $username The username (may get altered) (null: nothing to check)
* @param ?MEMBER $member_id The member (null: member not actually added yet; this ID is only given for the duplication check, to make sure it doesn't think we are duplicating with ourself)
* @param ?SHORT_TEXT $password The password (null: nothing to check)
* @param ?EMAIL $email_address The e-mail address that will go with the password (null: unknown)
* @param ?TIME $dob The date of birth that will go with the password (null: unknown)
* @param boolean $return_errors Whether to return errors instead of dying on them
* @return ?Tempcode Error (null: none)
*/
function cns_check_name_valid(?string &$username, ?int $member_id = null, ?string $password = null, ?string $email_address = null, ?int $dob = null, bool $return_errors = false) : ?object
* Check a username is valid for adding, and possibly also the password.
*
* @param ?SHORT_TEXT $username The username (may get altered) (null: nothing to check)
* @param ?MEMBER $member_id The member (null: member not actually added yet; this ID is only given for the duplication check, to make sure it doesn't think we are duplicating with ourself)
* @param ?SHORT_TEXT $password The password (null: nothing to check)
* @param ?EMAIL $email_address The e-mail address that will go with the password (null: unknown)
* @param ?TIME $dob The date of birth that will go with the password (null: unknown)
* @param boolean $return_errors Whether to return errors instead of dying on them
* @return ?Tempcode Error (null: none)
*/
function cns_check_name_valid(?string &$username, ?int $member_id = null, ?string $password = null, ?string $email_address = null, ?int $dob = null, bool $return_errors = false) : ?object

