<?php // $Header: /cvsroot/tikiwiki/tiki/commxmlrpc.php,v 1.14.2.2 2005/08/18 09:13:33 mose Exp $ // Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. # $Header: /cvsroot/tikiwiki/tiki/commxmlrpc.php,v 1.14.2.2 2005/08/18 09:13:33 mose Exp $ include_once "lib/init/initlib.php"; include_once 'db/tiki-db.php'; include_once 'lib/tikilib.php'; include_once 'lib/userslib.php'; include_once "XML/Server.php"; include_once 'lib/commcenter/commlib.php'; $tikilib = new Tikilib($dbTiki); $userlib = new Userslib($dbTiki); if ($tikilib->get_preference("feature_comm", 'n') != 'y') { die; } $map = array("sendPage" => array("function" => "sendPage"), "sendArticle" => array("function" => "sendArticle")); $s = new XML_RPC_Server($map); /* Validates the user and returns user information */ function sendPage($params) { // Get the page and store it in received_pages global $tikilib, $userlib, $commlib; $pp = $params->getParam(0); $site = $pp->scalarval(); $pp = $params->getParam(1); $username = $pp->scalarval(); $pp = $params->getParam(2); $password = $pp->scalarval();
<?php # $Header: /cvsroot/tikiwiki/tiki/xmlrpc.php,v 1.18.2.4 2005/11/15 14:57:50 mose Exp $ include_once "lib/init/initlib.php"; require_once 'db/tiki-db.php'; require_once 'lib/tikilib.php'; require_once 'lib/userslib.php'; require_once "XML/Server.php"; include_once 'lib/blogs/bloglib.php'; $tikilib = new Tikilib($dbTiki); $userlib = new Userslib($dbTiki); if ($tikilib->get_preference("feature_xmlrpc", 'n') != 'y') { die; } $map = array("blogger.newPost" => array("function" => "newPost"), "blogger.getUserInfo" => array("function" => "getUserInfo"), "blogger.getPost" => array("function" => "getPost"), "blogger.editPost" => array("function" => "editPost"), "blogger.deletePost" => array("function" => "deletePost"), "blogger.getRecentPosts" => array("function" => "getRecentPosts"), "blogger.getUserInfo" => array("function" => "getUserInfo"), "blogger.getUsersBlogs" => array("function" => "getUserBlogs")); $s = new XML_RPC_Server($map); function check_individual($user, $blogid, $permName) { global $userlib; // If the user is admin he can do everything if ($userlib->user_has_permission($user, 'tiki_p_blog_admin')) { return true; } // If no individual permissions for the object then ok if (!$userlib->object_has_one_permission($blogid, 'blog')) { return true; } // If the object has individual permissions then check // Now get all the permissions that are set for this type of permissions 'image gallery' if ($userlib->object_has_permission($user, $blogId, 'blog', $permName)) { return true;