Example #1
0
	function saveJsonAction() {
		try {
			@$client_id = DevblocksPlatform::importGPC($_REQUEST['client_id'], 'string', '');
			@$client_secret = DevblocksPlatform::importGPC($_REQUEST['client_secret'], 'string', '');
			
			if(empty($client_id) || empty($client_secret))
				throw new Exception("Both the API Auth Token and URL are required.");
			
			DevblocksPlatform::setPluginSetting('wgm.issues', 'client_id', $client_id);
			DevblocksPlatform::setPluginSetting('wgm.issues', 'client_secret', $client_secret);
			
		    echo json_encode(array('status' => true, 'message' => 'Saved!'));
		    return;
			
		} catch (Exception $e) {
			echo json_encode(array('status' => false, 'error' => $e->getMessage()));
			return;
		}
	}