Author: jfthomps
Date: Tue Nov 16 19:08:49 2010
New Revision: 1035750

URL: http://svn.apache.org/viewvc?rev=1035750&view=rev
Log:
VCL-414
modify XMLRPCaddUserGroup to accept a paramter specifying value for custom field

utils.php - modified validateAPIgroupInput - if custom is passed in data array, 
do not validate owner and managingGroup

xmlrpcWrappers.php - modified XMLRPCaddUserGroup - pass custom as part of array 
to validateAPIgroupInput

Modified:
    incubator/vcl/trunk/web/.ht-inc/utils.php
    incubator/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php

Modified: incubator/vcl/trunk/web/.ht-inc/utils.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/utils.php?rev=1035750&r1=1035749&r2=1035750&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/utils.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/utils.php Tue Nov 16 19:08:49 2010
@@ -8323,7 +8323,8 @@ function printXMLRPCerror($errcode) {
 /// \fn validateAPIgroupInput($items, $exists)
 ///
 /// \param $items - array of data to validate; the following items can be
-/// validated:\n
+/// validated, if 'custom' is included and is 0, owner and managingGroup are
+/// not validated:\n
 /// \b name - if specified, affiliation must also be specified\n
 /// \b affiliation - if specified, name must also be specified\n
 /// \b owner \n
@@ -8347,6 +8348,9 @@ function printXMLRPCerror($errcode) {
 ///
 
////////////////////////////////////////////////////////////////////////////////
 function validateAPIgroupInput($items, $exists) {
+       $custom = 1;
+       if(array_key_exists('custom', $items))
+               $custom = $items['custom'];
        # initialMaxTime
        if(array_key_exists('initialMaxTime', $items)) {
                if(! is_numeric($items['initialMaxTime']) ||
@@ -8414,7 +8418,7 @@ function validateAPIgroupInput($items, $
                }
        }
        # owner
-       if(array_key_exists('owner', $items)) {
+       if($custom && array_key_exists('owner', $items)) {
                if(! validateUserid(mysql_real_escape_string($items['owner']))) 
{
                        return array('status' => 'error',
                                     'errorcode' => 20,
@@ -8422,7 +8426,7 @@ function validateAPIgroupInput($items, $
                }
        }
        # managingGroup
-       if(array_key_exists('managingGroup', $items)) {
+       if($custom && array_key_exists('managingGroup', $items)) {
                $parts = explode('@', $items['managingGroup']);
                if(count($parts) != 2) {
                        return array('status' => 'error',

Modified: incubator/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php?rev=1035750&r1=1035749&r2=1035750&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php Tue Nov 16 19:08:49 2010
@@ -1180,7 +1180,8 @@ function XMLRPCaddUserGroup($name, $affi
                          'managingGroup' => $managingGroup,
                          'initialMaxTime' => $initialMaxTime,
                          'totalMaxTime' => $totalMaxTime,
-                         'maxExtendTime' => $maxExtendTime);
+                         'maxExtendTime' => $maxExtendTime,
+                         'custom' => $custom);
        $rc = validateAPIgroupInput($validate, 0);
        if($rc['status'] == 'error')
                return $rc;


Reply via email to