Author: jfthomps
Date: Fri May 27 12:37:31 2011
New Revision: 1128281

URL: http://svn.apache.org/viewvc?rev=1128281&view=rev
Log:
VCL-475

modified addShibUser to return id of newly added user instead of adding the id 
to the passed in $user array and returning the whole array; modified 
updateShibUser to then add that id to the $user array and return the whole array

Modified:
    incubator/vcl/trunk/web/.ht-inc/authmethods/shibauth.php

Modified: incubator/vcl/trunk/web/.ht-inc/authmethods/shibauth.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/authmethods/shibauth.php?rev=1128281&r1=1128280&r2=1128281&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/authmethods/shibauth.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/authmethods/shibauth.php Fri May 27 
12:37:31 2011
@@ -77,9 +77,11 @@ function updateShibUser($userid) {
               . "WHERE unityid = '$userid' AND "
               .       "affiliationid = $affilid";
        $qh = doQuery($query, 101);
-       if(! $row = mysql_fetch_assoc($qh))
+       if(! $row = mysql_fetch_assoc($qh)) {
                # add user to our db
-               return addShibUser($user);
+               $user['id'] = addShibUser($user);
+               return $user;
+       }
 
        # update user's data in db
        $user['id'] = $row['id'];
@@ -109,8 +111,7 @@ function updateShibUser($userid) {
 /// \b lastname\n
 /// \b email
 ///
-/// \return an array with all of the values from $user along with an additional
-/// key named 'id' that is the new user's id from the user table
+/// \return id from user table for user
 ///
 /// \brief adds $user to the user table
 ///
@@ -143,7 +144,7 @@ function addShibUser($user) {
        doQuery($query, 101, 'vcl', 1);
        if(mysql_affected_rows($mysql_link_vcl)) {
                $user['id'] = mysql_insert_id($mysql_link_vcl);
-               return $user;
+               return $user['id'];
        }
        else
                return NULL;


Reply via email to