[opw-web] class_user: Fix isMentorAnyProgram() for not-logged-in users



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]