Blank UID = friend
Signed-off-by: Denis Roy <denis.roy@eclipse.org>
diff --git a/web-api/friends_decorator.php b/web-api/friends_decorator.php
index 9c69596..fe2b397 100644
--- a/web-api/friends_decorator.php
+++ b/web-api/friends_decorator.php
@@ -30,14 +30,15 @@
$ldap = new LDAPConnection();
$uid = $ldap->getUIDFromMail($id);
-
- # Can't use Friends class for this as efficiently
- $sql = "SELECT COUNT(1) AS RecordCount FROM friends where uid = " . $App->returnQuotedString($uid) . " and is_benefit = 1";
- $result = $App->eclipse_sql($sql);
- if($myrow = mysql_fetch_array($result)) {
- if ($myrow["RecordCount"] > 0) {
- $file_name = "../images/friend-on.png";
- }
+
+ if($uid !== "") {
+ $sql = "SELECT COUNT(1) AS RecordCount FROM friends where uid = " . $App->returnQuotedString($uid) . " and is_benefit = 1";
+ $result = $App->eclipse_sql($sql);
+ if($myrow = mysql_fetch_array($result)) {
+ if ($myrow["RecordCount"] > 0) {
+ $file_name = "../images/friend-on.png";
+ }
+ }
}
}