Skip to content
Snippets Groups Projects
ajax.php 29.6 KiB
Newer Older
		# WiSPLocationMembers.js functions
		case "getWiSPLocationMembers":

			$res = getWiSPLocationMembers($soapParams);
			$rawData = $res[0]; $numResults = $res[1];

			$res = new json_response;
			$res->setID('ID');
			$res->addField('ID','int');
			$res->addField('Username','string');
			$res->parseArray($rawData);
			$res->setDatasetSize($numResults);

			echo json_encode($res->export());

			break;

		case "removeWiSPLocationMember":

			$res = removeWiSPLocationMember($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
		# WiSPLocations.js functions
		case "updateWiSPLocation":

			$res = updateWiSPLocation($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
		case "createWiSPLocation":
			$res = createWiSPLocation($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
		case "removeWiSPLocation":
			$res = removeWiSPLocation($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
Robert Anderson's avatar
Robert Anderson committed
			break;

		case "getWiSPLocations":
			$res = getWiSPLocations($soapParams);
			$rawData = $res[0]; $numResults = $res[1];

			$res = new json_response;
			$res->setID('ID');
			$res->addField('ID','int');
			$res->addField('Name','string');
			$res->parseArray($rawData);
			$res->setDatasetSize($numResults);

			echo json_encode($res->export());
			break;

		case "getWiSPLocation":
			$rawData = getWiSPLocation($soapParams);

			$res = new json_response;
			$res->setID('ID');
			$res->addField('ID','int');
			$res->addField('Name','string');
			$res->parseHash($rawData);

			echo json_encode($res->export());
			break;

		# AdminUsers.js functions
		case "updateAdminUser":

			$res = updateAdminUser($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
			}

			break;

		case "createAdminUser":

			$res = createAdminUser($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
			}

			break;

		case "removeAdminUser":

			$res = removeAdminUser($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
			$res = getAdminUsers($soapParams);
Robert Anderson's avatar
Robert Anderson committed
			$rawData = $res[0]; $numResults = $res[1];

			$res = new json_response;
			$res->setID('ID');
			$res->addField('ID','int');
			$res->addField('Username','string');
			$res->addField('Disabled','boolean');
Robert Anderson's avatar
Robert Anderson committed
			$res->parseArray($rawData);
			$res->setDatasetSize($numResults);

			echo json_encode($res->export());
			break;

		case "getAdminUser":
			$rawData = getAdminUser($soapParams);

			$res = new json_response;
			$res->setID('ID');
			$res->addField('ID','int');
			$res->addField('Username','string');
			$res->addField('Disabled','boolean');
			$res->parseHash($rawData);

			echo json_encode($res->export());
			break;

		# AdminRealms.js functions
		case "updateAdminRealm":

			$res = updateAdminRealm($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
			}

			break;

		case "createAdminRealm":

			$res = createAdminRealm($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
			}

			break;

		case "removeAdminRealm":

			$res = removeAdminRealm($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
		case "getAdminRealms":

Robert Anderson's avatar
Robert Anderson committed
			$res = getAdminRealms($soapParams);
			$rawData = $res[0]; $numResults = $res[1];

			$res = new json_response;
			$res->setID('ID');
			$res->addField('ID','int');
			$res->addField('Name','string');
			$res->addField('Disabled','boolean');
Robert Anderson's avatar
Robert Anderson committed
			$res->parseArray($rawData);
			$res->setDatasetSize($numResults);

			echo json_encode($res->export());
			break;

		case "getAdminRealm":
			$rawData = getAdminRealm($soapParams);

			$res = new json_response;
			$res->setID('ID');
			$res->addField('ID','int');
			$res->addField('Name','string');
			$res->addField('Disabled','boolean');
			$res->parseHash($rawData);

			echo json_encode($res->export());
			break;

		# AdminGroups.js functions
		case "updateAdminGroup":

			$res = updateAdminGroup($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
			}

			break;

		case "createAdminGroup":

			$res = createAdminGroup($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
			}

			break;

		case "removeAdminGroup":

			$res = removeAdminGroup($soapParams);
			if (isset($res)) {
				ajaxException($res);
Robert Anderson's avatar
Robert Anderson committed
			} else {
				jsonSuccess();
		case "getAdminGroups":

Robert Anderson's avatar
Robert Anderson committed
			$res = getAdminGroups($soapParams);
			$rawData = $res[0]; $numResults = $res[1];

			$res = new json_response;
			$res->setID('ID');
			$res->addField('ID','int');
			$res->addField('Name','string');
			$res->addField('Priority','int');
			$res->addField('Disabled','boolean');
			$res->addField('Comment','string');
Robert Anderson's avatar
Robert Anderson committed
			$res->parseArray($rawData);
			$res->setDatasetSize($numResults);

			echo json_encode($res->export());
		case "getAdminGroup":
			$rawData = getAdminGroup($soapParams);

			$res = new json_response;
			$res->setID('ID');
			$res->addField('ID','int');
			$res->addField('Name','string');
			$res->addField('Priority','int');
			$res->addField('Disabled','boolean');
			$res->addField('Comment','string');
			$res->parseHash($rawData);

			echo json_encode($res->export());
		case "getWiSPResellers":
			$rawData = array (
				array(
					'ID' => 10,
					'Name' => 'TestReseller1'
				)
			);

			$numResults = 1;

			$res = new json_response;
			$res->setID('ID');
			$res->addField('ID','int');
			$res->addField('Name','string');
			$res->parseArray($rawData);
			$res->setDatasetSize($numResults);

			echo json_encode($res->export());
			break;

		case "getAdminRealms":

			$res = getAdminRealms($soapParams);
			$rawData = $res[0]; $numResults = $res[1];

			$res = new json_response;
			$res->setID('ID');
			$res->addField('ID','int');
			$res->addField('Name','string');
			$res->addField('Disabled','boolean');
Robert Anderson's avatar
Robert Anderson committed
			$res->parseArray($rawData);
			$res->setDatasetSize($numResults);

			echo json_encode($res->export());
			break;

# vim: ts=4