WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. The GNU General Public License is contained in the file COPYING. */ session_start(); include "../include/projectlib.inc.php"; include "../include/classes.php"; includeHeaders(); $Connect = processInputData(); isLoggedin(); $authorise = isAuthorize(); $filterValue = ""; if (isset($_GET['Submit'])) { if (isset($_GET['cboFilter'])) { $filterValue = $_GET['cboFilter']; } } else { $filterValue = ""; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <?php
function processRESTarg($index, $type, $defaultvalue = NULL) { if (!array_key_exists("PATH_INFO", $_SERVER)) { return $defaultvalue; } $pathdata = explode("/", $_SERVER["PATH_INFO"]); if (!array_key_exists($index + 1, $pathdata)) { return $defaultvalue; } return processInputData($pathdata[$index + 1], $type, $defaultvalue); }
function XMLRPCtest($string) { $string = processInputData($string, ARG_STRING); return array('status' => 'success', 'message' => 'RPC call worked successfully', 'string' => $string); }
function xmlRPChandler($function, $args, $blah) { global $user, $remoteIP; header("Content-type: text/xml"); $apiversion = processInputData($_SERVER['HTTP_X_APIVERSION'], ARG_NUMERIC); if ($function == 'XMLRPCaffiliations') { $keyid = 0; } elseif ($apiversion == 1) { $keyid = $user['xmlrpckeyid']; } else { $keyid = $user['id']; } if (function_exists($function)) { $saveargs = mysql_escape_string(serialize($args)); $query = "INSERT INTO xmlrpcLog " . "(xmlrpcKeyid, " . "timestamp, " . "IPaddress, " . "method, " . "apiversion, " . "comments) " . "VALUES " . "({$keyid}, " . "NOW(), " . "'{$remoteIP}', " . "'{$function}', " . "{$apiversion}, " . "'{$saveargs}')"; doQuery($query, 101); } else { printXMLRPCerror(2); dbDisconnect(); semUnlock(); exit; } if (count($args)) { return call_user_func_array($function, $args); } else { return $function(); } }
function XMLRPCgetUserGroups($groupType = 0, $affiliationid = 0) { global $user; $groupType = processInputData($groupType, ARG_NUMERIC, 0, 0); $affiliationid = processInputData($affiliationid, ARG_NUMERIC, 0, 0); $groups = getUserGroups($groupType, $affiliationid); // Filter out any groups to which the user does not have access. $usergroups = array(); foreach ($groups as $id => $group) { if ($group['ownerid'] == $user['id'] || array_key_exists("editgroupid", $group) && array_key_exists($group['editgroupid'], $user["groups"]) || array_key_exists($id, $user["groups"])) { array_push($usergroups, $group); } } return array("status" => "success", "groups" => $usergroups); }