fix bugs found in initial testing

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@582 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
David Goodwin 16 years ago
parent 9ee45c69c8
commit 3ed6989c23

@ -27,28 +27,37 @@
* }
*
* Note, the requirement that your XmlRpc client provides cookies with each request.
* If it does not do this, then your authentication details will not persist across requests.
* If it does not do this, then your authentication details will not persist across requests, and
* this XMLRPC interface will not work.
*/
require_once(dirname(__FILE__) . '/common.php');
require_once('Zend/XmlRpc/Server.php');
$server = new Zend_XmlRpc_Server();
session_start();
/**
* @param string $username
* @param string $password
* @return boolean true on success, else false.
*/
function login($username, $password) {
if(UserHandler::login($username, $password)) {
session_regenerate_id();
$_SESSION['authenticated'] = true;
$_SESSION['username'] = $username;
return true;
}
return false;
}
if(!isset($_SESSION['authenticated'])) {
$server->addFunction('login', 'login');
}
else {
$server->addClass('user', 'UserProxy');
$server->addClass('vacation', 'VacationProxy');
$server->addClass('alias', 'AliasProxy');
$server->setClass('UserProxy', 'user');
$server->setClass('VacationProxy', 'vacation');
$server->setClass('AliasProxy', 'alias');
}
echo $server->handle();

Loading…
Cancel
Save