Author: jfthomps
Date: Tue Oct 14 19:00:45 2014
New Revision: 1631838

URL: http://svn.apache.org/r1631838
Log:
VCL-178 - enable checkuser flag for per reservation instead of image only

xmlrpcWrappers.php: modified XMLRPCaddRequest and XMLRPCaddRequestWithEnding: 
added check to verify user has access to set nousercheck flag if it is set to 1

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

Modified: vcl/trunk/web/.ht-inc/xmlrpcWrappers.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php?rev=1631838&r1=1631837&r2=1631838&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/xmlrpcWrappers.php (original)
+++ vcl/trunk/web/.ht-inc/xmlrpcWrappers.php Tue Oct 14 19:00:45 2014
@@ -217,7 +217,14 @@ function XMLRPCaddRequest($imageid, $sta
                                         . "have, and you are allowed $max "
                                         . "overlapping reservations at a 
time");
        }
-       if($nousercheck != 0 && $nousercheck != 1)
+
+       if($nousercheck == 1) {
+               $groupid = getUserGroupID('Allow No User Check', 1);
+               $members = getUserGroupMembers($groupid);
+               if(! array_key_exists($user['id'], $members))
+                       $nousercheck = 0;
+       }
+       else
                $nousercheck = 0;
 
        $images = getImages();
@@ -331,7 +338,14 @@ function XMLRPCaddRequestWithEnding($ima
                                         . "have, and you are allowed $max "
                                         . "overlapping reservations at a 
time");
        }
-       if($nousercheck != 0 && $nousercheck != 1)
+
+       if($nousercheck == 1) {
+               $groupid = getUserGroupID('Allow No User Check', 1);
+               $members = getUserGroupMembers($groupid);
+               if(! array_key_exists($user['id'], $members))
+                       $nousercheck = 0;
+       }
+       else
                $nousercheck = 0;
 
        $images = getImages();


Reply via email to