From 6c3ad77ea5749d9a1951a5587c576772ff896073 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20S=CC=8Ckoda?= Date: Mon, 23 Sep 2013 20:54:55 +0200 Subject: [PATCH] MDL-41176 fix obvious bugs and typos in new user API --- lib/classes/user.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/classes/user.php b/lib/classes/user.php index 40328847c2d..badf8540047 100644 --- a/lib/classes/user.php +++ b/lib/classes/user.php @@ -39,7 +39,7 @@ class core_user { const NOREPLY_USER = -10; /** - * Suppport user id. + * Support user id. */ const SUPPORT_USER = -20; @@ -160,9 +160,11 @@ class core_user { self::$supportuser = self::get_dummy_user_record(); self::$supportuser->id = self::SUPPORT_USER; self::$supportuser->email = $CFG->supportemail; - self::$supportuser->firstname = $CFG->supportname ? $CFG->supportname : $supportuser->firstname; + if ($CFG->supportname) { + self::$supportuser->firstname = $CFG->supportname; + } self::$supportuser->username = 'support'; - self::$supportuser->maildisplay = true; + self::$supportuser->maildisplay = '1'; // Show to all. } // Send support msg to admin user if nothing is set above. @@ -191,7 +193,7 @@ class core_user { /** * Return true is user id is greater than self::NOREPLY_USER and - * alternetely check db. + * alternatively check db. * * @param int $userid user id. * @param bool $checkdb if true userid will be checked in db. By default it's false, and @@ -199,6 +201,8 @@ class core_user { * @return bool true is real user else false. */ public static function is_real_user($userid, $checkdb = false) { + global $DB; + if ($userid < 0) { return false; } -- 2.43.0