[opw-web] class_user: Fix isMentorAnyProgram() for not-logged-in users
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [opw-web] class_user: Fix isMentorAnyProgram() for not-logged-in users
- Date: Mon, 22 Sep 2014 14:11:50 +0000 (UTC)
commit e05009403f9cbc1b46d4dad2620cb6ab45bfdfbb
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Mon Sep 22 10:11:22 2014 -0400
class_user: Fix isMentorAnyProgram() for not-logged-in users
classes/class_user.php | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/classes/class_user.php b/classes/class_user.php
index fb427ee..1e49709 100644
--- a/classes/class_user.php
+++ b/classes/class_user.php
@@ -563,6 +563,9 @@ class user
function isMentorAnyProgram() {
global $db;
+ if (!$this->is_logged_in)
+ return false;
+
$sql = "SELECT COUNT(*) as count FROM {$db->prefix}roles " .
"WHERE username = ? and role = 'm'";
$row = $db->query($sql, $this->username, true);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]