added base class file for sql as well as updated users to use class
This commit is contained in:
parent
eda629c1ab
commit
9014f722c4
2 changed files with 12 additions and 1 deletions
11
code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sql.php
Normal file
11
code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sql.php
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
class Sql{
|
||||||
|
|
||||||
|
public function db_query( $query, $values = array() )
|
||||||
|
{
|
||||||
|
echo "tst";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ public function checkUser($username)
|
||||||
return "Username must be 5 or more characters.";
|
return "Username must be 5 or more characters.";
|
||||||
} elseif (!preg_match('/^[a-z0-9\.]*$/', $username)) {
|
} elseif (!preg_match('/^[a-z0-9\.]*$/', $username)) {
|
||||||
return "Username can only contain numbers and letters.";
|
return "Username can only contain numbers and letters.";
|
||||||
} elseif (db_query("SELECT COUNT(*) FROM {users} WHERE name = :name", array(
|
} elseif (sql::db_query("SELECT COUNT(*) FROM {users} WHERE name = :name", array(
|
||||||
':name' => $username
|
':name' => $username
|
||||||
))->fetchField()) {
|
))->fetchField()) {
|
||||||
return "Username " . $username . " is in use.";
|
return "Username " . $username . " is in use.";
|
||||||
|
|
Loading…
Reference in a new issue