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 2013/02/21 20:12:37 UTC

svn commit: r1448776 - in /vcl/branches/vcl-2.3-bugfixes/web: .ht-inc/computers.php .ht-inc/conf-default.php .ht-inc/xmlrpcWrappers.php js/privileges.js

Author: jfthomps
Date: Thu Feb 21 19:12:36 2013
New Revision: 1448776

URL: http://svn.apache.org/r1448776
Log:
a few more minor bug fixes for 2.3.2

privileges.js: modified submitAddUserGroup - separated out usergrpchk0:0 from loop because it is handled differently - fixes problem where adding a new user group with the cascade box checked does not actually result in the user group getting cascaded added

computers.php: "modified" submitCompStateChange - only added a comment to highlight an extreme corner case where using the computer utilities to delete computers, where a computer has been selected with one hostname, and another computer has been selected that had the same hostname but was undeleted such that -DELETED-<compid> was added to the hostname, will result in a an SQL error because of a unique key violation

conf-default.php: added a comment explaining $xmlrpcBlockAPIUsers

xmlrpcWrappers.php:
-corrected header description of XMLRPCgetImages to include that description and usage are also returned now
-modified XMLRPCaddNode - is_null check for checking returned data from getNodeInfo was using $tmp instead of $nodeInfo
-modified XMLRPCaddUserGroupPriv - fixed problem where checking for privileges of a user group at a node where it had none was using the group name as an array key that did not exist in $np
-removed \n from end of items in header of XMLRPCgetUserGroups - was causing doxygen to display a warning
-modified XMLRPCeditUserGroup - query that got info about the user group was missing a comma after ownerid

Modified:
    vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/computers.php
    vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/conf-default.php
    vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/xmlrpcWrappers.php
    vcl/branches/vcl-2.3-bugfixes/web/js/privileges.js

Modified: vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/computers.php
URL: http://svn.apache.org/viewvc/vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/computers.php?rev=1448776&r1=1448775&r2=1448776&view=diff
==============================================================================
--- vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/computers.php (original)
+++ vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/computers.php Thu Feb 21 19:12:36 2013
@@ -3711,6 +3711,8 @@ function submitCompStateChange() {
 	}
 	# set to deleted
 	elseif($data['stateid'] == 999) {
+		# TODO this will throw an error if two computers will end up with the
+		# same hostname after -UNDELETED-ID gets removed
 		$compids = implode(',', $data['computerids']);
 		$query = "UPDATE computer "
 		       . "SET deleted = 1, "

Modified: vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/conf-default.php
URL: http://svn.apache.org/viewvc/vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/conf-default.php?rev=1448776&r1=1448775&r2=1448776&view=diff
==============================================================================
--- vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/conf-default.php (original)
+++ vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/conf-default.php Thu Feb 21 19:12:36 2013
@@ -98,6 +98,7 @@ define("ALLOWADDSHIBUSERS", 0); // this 
 
 $ENABLE_ITECSAUTH = 0;     // use ITECS accounts (also called "Non-NCSU" accounts)
 
+# adding to this array grants access to call XMLRPCblockAllocation, XMLRPCprocessBlockTime, and XMLRPCautoCapture which are called by vcld
 $xmlrpcBlockAPIUsers = array(3, # 3 = vclsystem
 );
 

Modified: vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/xmlrpcWrappers.php
URL: http://svn.apache.org/viewvc/vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/xmlrpcWrappers.php?rev=1448776&r1=1448775&r2=1448776&view=diff
==============================================================================
--- vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/xmlrpcWrappers.php (original)
+++ vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/xmlrpcWrappers.php Thu Feb 21 19:12:36 2013
@@ -108,9 +108,11 @@ function XMLRPCtest($string) {
 ///
 /// \fn XMLRPCgetImages()
 ///
-/// \return an array of image arrays, each with 2 indices:\n
+/// \return an array of image arrays, each with these indices:\n
 /// \b id - id of the image\n
-/// \b name - name of the image
+/// \b name - name of the image\n
+/// \b description - description of image\n
+/// \b usage - usage instructions for image
 ///
 /// \brief gets the images to which the user has access
 ///
@@ -1608,7 +1610,7 @@ function XMLRPCaddNode($nodeName, $paren
 	}
 	if(in_array("nodeAdmin", $user['privileges'])) {
 		$nodeInfo = getNodeInfo($parentNode);
-		if(is_null($tmp)) {
+		if(is_null($nodeInfo)) {
 			return array('status' => 'error',
 			             'errorcode' => 78,
 			             'errormsg' => 'Invalid nodeid specified');
@@ -1821,7 +1823,8 @@ function XMLRPCaddUserGroupPriv($name, $
 	array_push($usertypes["users"], "cascade");
 
 	$diff = array_diff($perms, $usertypes['users']);
-	if(count($diff) || (count($perms) == 1 && $perms[0] == 'cascade')) {
+	if(! count($perms) || count($diff) ||
+	   (count($perms) == 1 && $perms[0] == 'cascade')) {
 		return array('status' => 'error',
 		             'errorcode' => 66,
 		             'errormsg' => 'Invalid or missing permissions list supplied');
@@ -1830,9 +1833,13 @@ function XMLRPCaddUserGroupPriv($name, $
 	$cnp = getNodeCascadePrivileges($nodeid, "usergroups");
 	$np = getNodePrivileges($nodeid, "usergroups", $cnp);
 
-	$diff = array_diff($perms, $np['usergroups'][$name]['privs']);
-	if(empty($diff))
-		return array('status' => 'success');
+	if(array_key_exists($name, $np['usergroups'])) {
+		$diff = array_diff($perms, $np['usergroups'][$name]['privs']);
+		if(empty($diff))
+			return array('status' => 'success');
+	}
+	else
+		$diff = $perms;
 
 	updateUserOrGroupPrivs($groupid, $nodeid, $diff, array(), "group");
 	return array('status' => 'success');
@@ -2156,22 +2163,22 @@ function _XMLRPCchangeResourceGroupPriv_
 /// \return an array with two indices, one named 'status' which will have a
 /// value of 'success', the other named 'groups' which will be an array of
 /// arrays, each one having the following keys:\n
-/// \li \b id\n
-/// \li \b name\n
-/// \li \b groupaffiliation\n
-/// \li \b groupaffiliationid\n
-/// \li \b ownerid\n
-/// \li \b owner\n
-/// \li \b affiliation\n
-/// \li \b editgroupid\n
-/// \li \b editgroup\n
-/// \li \b editgroupaffiliationid\n
-/// \li \b editgroupaffiliation\n
-/// \li \b custom\n
-/// \li \b courseroll\n
-/// \li \b initialmaxtime\n
-/// \li \b maxextendtime\n
-/// \li \b overlapResCount\n
+/// \li \b id
+/// \li \b name
+/// \li \b groupaffiliation
+/// \li \b groupaffiliationid
+/// \li \b ownerid
+/// \li \b owner
+/// \li \b affiliation
+/// \li \b editgroupid
+/// \li \b editgroup
+/// \li \b editgroupaffiliationid
+/// \li \b editgroupaffiliation
+/// \li \b custom
+/// \li \b courseroll
+/// \li \b initialmaxtime
+/// \li \b maxextendtime
+/// \li \b overlapResCount
 ///
 /// \brief builds a list of user groups
 ///
@@ -2430,7 +2437,7 @@ function XMLRPCeditUserGroup($name, $aff
 		return $rc;
 
 	# get info about group
-	$query = "SELECT ownerid "
+	$query = "SELECT ownerid, "
 	       .        "affiliationid, "
 	       .        "custom, "
 	       .        "courseroll "

Modified: vcl/branches/vcl-2.3-bugfixes/web/js/privileges.js
URL: http://svn.apache.org/viewvc/vcl/branches/vcl-2.3-bugfixes/web/js/privileges.js?rev=1448776&r1=1448775&r2=1448776&view=diff
==============================================================================
--- vcl/branches/vcl-2.3-bugfixes/web/js/privileges.js (original)
+++ vcl/branches/vcl-2.3-bugfixes/web/js/privileges.js Thu Feb 21 19:12:36 2013
@@ -447,7 +447,10 @@ function submitAddUserGroup() {
 	var obj = dijit.byId('blockgrpchk');
 	if(obj.checked)
 		perms.push('block');
-	for(var i = 0; obj = dijit.byId('usergrpck0:' + i); i++) {
+	obj = dijit.byId('usergrpck0:0');
+	if(obj.checked)
+		perms.push('cascade');
+	for(var i = 1; obj = dijit.byId('usergrpck0:' + i); i++) {
 		if(obj.checked)
 			perms.push(obj.name);
 	}