Commit c333d436 authored by Florian Schaal's avatar Florian Schaal
parents fd166764 842b5c34
......@@ -39,13 +39,15 @@ class remoting_aps extends remoting {
{
global $app;
if(!$this->checkPerm($session_id, 'sites_aps_update_package')) {
if(!$this->checkPerm($session_id, 'sites_aps_update_package_list')) {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
require_once '../../../lib/config.inc.php';
$app->load('aps_crawler');
$aps = new ApsCrawler($app, false); // true = Interface mode, false = Server mode
$aps = new ApsCrawler($app, true); // true = Interface mode, false = Server mode
$aps->startCrawler();
$aps->parseFolderToDB();
$aps->fixURLs();
......@@ -53,7 +55,7 @@ class remoting_aps extends remoting {
return true;
}
public function sites_aps_available_packages_list($session_id, $params)
public function sites_aps_available_packages_list($session_id, $params = array())
{
global $app;
......@@ -198,6 +200,36 @@ class remoting_aps extends remoting {
return $settings;
}
public function sites_aps_change_package_status($session_id, $primary_id, $params)
{
global $app;
if(!$this->checkPerm($session_id, 'sites_aps_change_package_status')) {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$app->load('aps_base');
$app->load('aps_guicontroller');
$gui = new ApsGUIController($app);
// Make sure an integer ID is given
if (!isset($primary_id) || !$gui->isValidPackageID($primary_id, true)) {// always adminflag
$this->server->fault('package_error', 'The given Package ID is not valid.');
return false;
}
if(!isset($params['package_status']) || (($params['package_status'] != PACKAGE_ENABLED) && ($params['package_status'] != PACKAGE_LOCKED))) {
$this->server->fault('package_error', 'Wrong new status: '.$params['package_status']);
return false;
}
$sql = "UPDATE aps_packages SET package_status = ? WHERE id = ?";
$app->db->query($sql, $params['package_status'], $app->functions->intval($primary_id));
return true;
}
public function sites_aps_install_package($session_id, $primary_id, $params)
{
global $app;
......
......@@ -8,5 +8,5 @@ $function_list['sites_web_domain_get,sites_web_domain_add,sites_web_domain_updat
$function_list['sites_web_domain_backup'] = 'Sites Backup functions';
$function_list['sites_web_aliasdomain_get,sites_web_aliasdomain_add,sites_web_aliasdomain_update,sites_web_aliasdomain_delete'] = 'Sites Aliasdomain functions';
$function_list['sites_web_subdomain_get,sites_web_subdomain_add,sites_web_subdomain_update,sites_web_subdomain_delete'] = 'Sites Subdomain functions';
$function_list['sites_aps_update_package_list,sites_aps_available_packages_list,sites_aps_install_package,sites_aps_get_package_details,sites_aps_get_package_file,sites_aps_get_package_settings,sites_aps_instance_get,sites_aps_instance_delete'] = 'Sites APS functions';
$function_list['sites_aps_update_package_list,sites_aps_available_packages_list,sites_aps_change_package_status,sites_aps_install_package,sites_aps_get_package_details,sites_aps_get_package_file,sites_aps_get_package_settings,sites_aps_instance_get,sites_aps_instance_delete'] = 'Sites APS functions';
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment