mirror of https://github.com/BOINC/boinc.git
web: tweaks to last commit
This commit is contained in:
parent
278f3fd370
commit
3b4a604498
|
@ -135,6 +135,17 @@ class BoincUser {
|
|||
$email_addr = BoincDb::escape_string($email_addr);
|
||||
return self::lookup("email_addr='$email_addr'");
|
||||
}
|
||||
static function lookup_name($name) {
|
||||
$name = BoincDb::escape_string($name);
|
||||
$users = BoincUser::enum("name='$name'");
|
||||
switch (sizeof($users)) {
|
||||
case 1:
|
||||
return $users[0];
|
||||
case 0:
|
||||
return null;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
static function count($clause) {
|
||||
$db = BoincDb::get();
|
||||
return $db->count('user', $clause);
|
||||
|
|
|
@ -205,7 +205,7 @@ function do_send($logged_in_user) {
|
|||
pm_form($replyto, $userid, tra("Could not find user with id %1", $userid));
|
||||
}
|
||||
} else {
|
||||
$user = BoincUser:lookup_name($username);
|
||||
$user = BoincUser::lookup_name($username);
|
||||
if ($user == null) {
|
||||
pm_form($replyto, $userid, tra("Could not find user with username %1", $username));
|
||||
} elseif ($user == -1) { // Non-unique username
|
||||
|
|
Loading…
Reference in New Issue