check if unique values already exists for user and Character registration and send notification mail to moderators
This commit is contained in:
parent
f394946fa2
commit
babfe5b017
11 changed files with 290 additions and 34 deletions
|
|
@ -390,6 +390,31 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a Character name already exists.
|
||||
*
|
||||
* @param string $name Character name to check
|
||||
* @return boolean Whether Character name exists or not
|
||||
*/
|
||||
public function characterNameExists($name)
|
||||
{
|
||||
$data = $this->db->query(
|
||||
'SELECT count(id) AS c '.
|
||||
'FROM characters '.
|
||||
'WHERE name = ? OR url = ?',
|
||||
'ss',
|
||||
$name,
|
||||
\nre\core\Linker::createLinkParam($name)
|
||||
);
|
||||
if(!empty($data)) {
|
||||
return ($data[0]['c'] > 0);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a new Character.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue