webUsers derived from Users, with www dependent functionality to check if username already in use or email already in use
--HG-- branch : quitta-gsoc-2013hg/feature/sse2
parent
76e46c9fc4
commit
4034c83382
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class WebUsers extends Users{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function checkUserNameExists
|
||||||
|
*
|
||||||
|
* @takes $username
|
||||||
|
* @return string Info: Returns true or false if the user is in the web db.
|
||||||
|
*/
|
||||||
|
protected function checkUserNameExists($username){
|
||||||
|
global $cfg;
|
||||||
|
$dbw = new DBLayer($cfg['db']['web']);
|
||||||
|
return $dbw->execute("SELECT * FROM ams_user WHERE Login = :name",array('name' => $username))->rowCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function checkEmailExists
|
||||||
|
*
|
||||||
|
* @takes $username
|
||||||
|
* @return string Info: Returns true or false if the user is in the www db.
|
||||||
|
*/
|
||||||
|
protected function checkEmailExists($email){
|
||||||
|
global $cfg;
|
||||||
|
$dbw = new DBLayer($cfg['db']['web']);
|
||||||
|
return $dbw->execute("SELECT * FROM ams_user WHERE Email = :email",array('email' => $email))->rowCount();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue