check if unique values already exists for user and Character registration and send notification mail to moderators

This commit is contained in:
coderkun 2014-04-16 13:42:19 +02:00
commit babfe5b017
11 changed files with 290 additions and 34 deletions

View file

@ -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.
*