From 9a637a3516132a06481c6d1cfc925ac6b965ec3a Mon Sep 17 00:00:00 2001
From: Robert Anderson <randerson@lbsd.net>
Date: Fri, 8 May 2009 10:51:23 +0000
Subject: [PATCH] * Added admin group create function * Check type is defined
 before we try access it in the params

---
 webgui/ajax.php | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/webgui/ajax.php b/webgui/ajax.php
index 08f484e9..98b1bd50 100644
--- a/webgui/ajax.php
+++ b/webgui/ajax.php
@@ -113,14 +113,14 @@
 			if (count($items) > 1) {
 				$array_pos = $items[0];
 				$array_item = $items[1];
-				$array_type = $items[2];
 
 				# Initialize array
 				if (!isset($soapParams[$array_pos])) {
 					$soapParams[$array_pos] = array();
 				}
 				# Check if we have an explicit type
-				if (isset($array_type)) {
+				if (isset($items[2])) {
+					$array_type = $items[2];
 					# Check type
 					if ($array_type == "boolean") {
 						# Checkboxes/booleans are undefined if false
@@ -146,9 +146,17 @@
 	}
 
 	switch ($function) {
+		case "createAdminGroup":
+
+			$res = createAdminGroup($soapParams);
+			if (isset($res)) {
+				ajaxException($res);
+			}
+
+			break;
+
 		case "removeAdminGroup":
 
-			print_r($soapParams);
 			$res = removeAdminGroup($soapParams);
 			if (isset($res)) {
 				ajaxException($res);
-- 
GitLab