You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2016/09/22 19:02:07 UTC
svn commit: r1761991 - in /vcl/trunk/web/.ht-inc: authmethods/itecsauth.php
authmethods/ldapauth.php utils.php
Author: jfthomps
Date: Thu Sep 22 19:02:07 2016
New Revision: 1761991
URL: http://svn.apache.org/viewvc?rev=1761991&view=rev
Log:
VCL-993 - web code should handle user.IMtypeid being NULL
utils.php: modified getUserInfo: changed query to use LEFT JOIN for the IMtype table
itecsauth.php: modified updateITECSUser: changed query to use LEFT JOIN for the IMtype table
ldapauth.php: modified updateLDAPUser: changed query to use LEFT JOIN for the IMtype table
Modified:
vcl/trunk/web/.ht-inc/authmethods/itecsauth.php
vcl/trunk/web/.ht-inc/authmethods/ldapauth.php
vcl/trunk/web/.ht-inc/utils.php
Modified: vcl/trunk/web/.ht-inc/authmethods/itecsauth.php
URL: http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/authmethods/itecsauth.php?rev=1761991&r1=1761990&r2=1761991&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/authmethods/itecsauth.php (original)
+++ vcl/trunk/web/.ht-inc/authmethods/itecsauth.php Thu Sep 22 19:02:07 2016
@@ -180,12 +180,11 @@ function updateITECSUser($userid) {
. "u.mapserial AS mapserial, "
. "COALESCE(u.rdpport, 3389) AS rdpport, "
. "u.showallgroups "
- . "FROM user u, "
- . "IMtype i, "
- . "affiliation af "
- . "WHERE u.IMtypeid = i.id AND "
- . "u.affiliationid = af.id AND "
- . "u.uid = {$userData['uid']}";
+ . "FROM affiliation af, "
+ . "user u "
+ . "LEFT JOIN IMtype i ON (u.IMtypeid = i.id) "
+ . "WHERE u.affiliationid = af.id AND "
+ . "u.uid = {$userData['uid']}";
$qh = doQuery($query, 255);
// if get a row
// update db
@@ -233,11 +232,10 @@ function updateITECSUser($userid) {
. "COALESCE(u.rdpport, 3389) AS rdpport, "
. "u.showallgroups, "
. "u.lastupdated AS lastupdated "
- . "FROM user u, "
- . "IMtype i, "
- . "affiliation af "
- . "WHERE u.IMtypeid = i.id AND "
- . "u.affiliationid = af.id AND "
+ . "FROM affiliation af, "
+ . "user u "
+ . "LEFT JOIN IMtype i ON (u.IMtypeid = i.id) "
+ . "WHERE u.affiliationid = af.id AND "
. "u.id = $id";
$qh = doQuery($query, 101);
$user = mysql_fetch_assoc($qh);
Modified: vcl/trunk/web/.ht-inc/authmethods/ldapauth.php
URL: http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/authmethods/ldapauth.php?rev=1761991&r1=1761990&r2=1761991&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/authmethods/ldapauth.php (original)
+++ vcl/trunk/web/.ht-inc/authmethods/ldapauth.php Thu Sep 22 19:02:07 2016
@@ -197,11 +197,10 @@ function updateLDAPUser($authtype, $user
. "u.mapserial AS mapserial, "
. "COALESCE(u.rdpport, 3389) AS rdpport, "
. "u.showallgroups "
- . "FROM user u, "
- . "IMtype i, "
- . "affiliation af "
- . "WHERE u.IMtypeid = i.id AND "
- . "af.id = $affilid AND ";
+ . "FROM affiliation af, "
+ . "user u "
+ . "LEFT JOIN IMtype i ON (u.IMtypeid = i.id) "
+ . "WHERE af.id = $affilid AND ";
if(array_key_exists('numericid', $userData) &&
is_numeric($userData['numericid']))
$query = $qbase . "u.uid = {$userData['numericid']}";
@@ -272,11 +271,10 @@ function updateLDAPUser($authtype, $user
. "u.usepublickeys, "
. "u.sshpublickeys, "
. "u.lastupdated AS lastupdated "
- . "FROM user u, "
- . "IMtype i, "
- . "affiliation af "
- . "WHERE u.IMtypeid = i.id AND "
- . "u.affiliationid = af.id AND "
+ . "FROM affiliation af, "
+ . "user u "
+ . "LEFT JOIN IMtype i ON (u.IMtypeid = i.id) "
+ . "WHERE u.affiliationid = af.id AND "
. "u.id = $id";
$qh = doQuery($query, 101);
if(! $user = mysql_fetch_assoc($qh))
Modified: vcl/trunk/web/.ht-inc/utils.php
URL: http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/utils.php?rev=1761991&r1=1761990&r2=1761991&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/utils.php (original)
+++ vcl/trunk/web/.ht-inc/utils.php Thu Sep 22 19:02:07 2016
@@ -3631,11 +3631,10 @@ function getUserInfo($id, $noupdate=0, $
. "u.usepublickeys, "
. "u.sshpublickeys, "
. "af.shibonly "
- . "FROM user u, "
- . "IMtype i, "
- . "affiliation af "
- . "WHERE u.IMtypeid = i.id AND "
- . "u.affiliationid = af.id AND ";
+ . "FROM affiliation af, "
+ . "user u "
+ . "LEFT JOIN IMtype i ON (u.IMtypeid = i.id) "
+ . "WHERE u.affiliationid = af.id AND ";
if($numeric)
$query .= "u.id = $id";
else