Update to use LDAP instead of Bugzilla ID
Signed-off-by: droy <denis.roy@eclipse.org>
diff --git a/web-api/friends_decorator.php b/web-api/friends_decorator.php
index 8bf327b..9c69596 100644
--- a/web-api/friends_decorator.php
+++ b/web-api/friends_decorator.php
@@ -17,6 +17,7 @@
*/
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php");
+require_once("/home/data/httpd/eclipse-php-classes/system/ldapconnection.class.php");
$App = new App();
# sensible defaults
@@ -27,8 +28,11 @@
if (isset($_GET['email']) && !empty($_GET['email'])) {
$id = filter_var($_GET['email'], FILTER_SANITIZE_EMAIL);
+ $ldap = new LDAPConnection();
+ $uid = $ldap->getUIDFromMail($id);
+
# Can't use Friends class for this as efficiently
- $sql = "SELECT COUNT(1) AS RecordCount FROM v_friends_bugzillainfo WHERE login_name = " . $App->returnQuotedString($id);
+ $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) {