diff --git a/interface/lib/classes/aps_guicontroller.inc.php b/interface/lib/classes/aps_guicontroller.inc.php
index f6a0ff4e3d9a54d116c3457536652e7f53ffbfbf..1f186288699c2756bc4a063b786bbd317d3b0b54 100644
--- a/interface/lib/classes/aps_guicontroller.inc.php
+++ b/interface/lib/classes/aps_guicontroller.inc.php
@@ -211,8 +211,93 @@ class ApsGUIController extends ApsBase
return true;
}
-
-
+ public function createDatabaseForPackageInstance(&$settings, $websrv) {
+ global $app;
+
+ $app->uses('tools_sites');
+
+ $global_config = $app->getconf->get_global_config('sites');
+
+ $tmp = array();
+ $tmp['parent_domain_id'] = $websrv['domain_id'];
+ $tmp['sys_groupid'] = $websrv['sys_groupid'];
+ $dbname_prefix = $app->tools_sites->replacePrefix($global_config['dbname_prefix'], $tmp);
+ $dbuser_prefix = $app->tools_sites->replacePrefix($global_config['dbuser_prefix'], $tmp);
+ unset($tmp);
+
+ // get information if the webserver is a db server, too
+ $web_server = $app->db->queryOneRecord("SELECT server_id,server_name,db_server FROM server WHERE server_id = ".$app->functions->intval($websrv['server_id']));
+ if($web_server['db_server'] == 1) {
+ // create database on "localhost" (webserver)
+ $mysql_db_server_id = $app->functions->intval($websrv['server_id']);
+ $settings['main_database_host'] = 'localhost';
+ $mysql_db_remote_access = 'n';
+ $mysql_db_remote_ips = '';
+ } else {
+ //* get the default database server of the client
+ $client = $app->db->queryOneRecord("SELECT default_dbserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ".$app->functions->intval($websrv['sys_groupid']));
+ if(is_array($client) && $client['default_dbserver'] > 0 && $client['default_dbserver'] != $websrv['server_id']) {
+ $mysql_db_server_id = $app->functions->intval($client['default_dbserver']);
+ $dbserver_config = $web_config = $app->getconf->get_server_config($app->functions->intval($mysql_db_server_id), 'server');
+ $settings['main_database_host'] = $dbserver_config['ip_address'];
+ $mysql_db_remote_access = 'y';
+ $webserver_config = $app->getconf->get_server_config($app->functions->intval($websrv['server_id']), 'server');
+ $mysql_db_remote_ips = $webserver_config['ip_address'];
+ } else {
+ /* I left this in place for a fallback that should NEVER! happen.
+ * if we reach this point it means that there is NO default db server for the client
+ * AND the webserver has NO db service enabled.
+ * We have to abort the aps installation here... so I added a return false
+ * although this does not present any error message to the user.
+ */
+ return false;
+
+ /*$mysql_db_server_id = $websrv['server_id'];
+ $settings['main_database_host'] = 'localhost';
+ $mysql_db_remote_access = 'n';
+ $mysql_db_remote_ips = '';*/
+ }
+ }
+
+ if (empty($settings['main_database_name'])) {
+ //* Find a free db name for the app
+ for($n = 1; $n <= 1000; $n++) {
+ $mysql_db_name = $app->db->quote(($dbname_prefix != '' ? $dbname_prefix.'aps'.$n : uniqid('aps')));
+ $tmp = $app->db->queryOneRecord("SELECT count(database_id) as number FROM web_database WHERE database_name = '".$app->db->quote($mysql_db_name)."'");
+ if($tmp['number'] == 0) break;
+ }
+ $settings['main_database_name'] = $mysql_db_name;
+ }
+ if (empty($settings['main_database_login'])) {
+ //* Find a free db username for the app
+ for($n = 1; $n <= 1000; $n++) {
+ $mysql_db_user = $app->db->quote(($dbuser_prefix != '' ? $dbuser_prefix.'aps'.$n : uniqid('aps')));
+ $tmp = $app->db->queryOneRecord("SELECT count(database_user_id) as number FROM web_database_user WHERE database_user = '".$app->db->quote($mysql_db_user)."'");
+ if($tmp['number'] == 0) break;
+ }
+ $settings['main_database_login'] = $mysql_db_user;
+ }
+
+ //* Create the mysql database user if not existing
+ $tmp = $app->db->queryOneRecord("SELECT database_user_id FROM web_database_user WHERE database_user = '".$app->db->quote($settings['main_database_login'])."'");
+ if(!$tmp) {
+ $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `database_user`, `database_user_prefix`, `database_password`)
+ VALUES( ".$app->functions->intval($websrv['sys_userid']).", ".$app->functions->intval($websrv['sys_groupid']).", 'riud', '".$app->functions->intval($websrv['sys_perm_group'])."', '', 0, '".$settings['main_database_login']."', '".$app->db->quote($dbuser_prefix) . "', PASSWORD('".$settings['main_database_password']."'))";
+ $mysql_db_user_id = $app->db->datalogInsert('web_database_user', $insert_data, 'database_user_id');
+ }
+ else $mysql_db_user_id = $tmp['database_user_id'];
+
+ //* Create the mysql database if not existing
+ $tmp = $app->db->queryOneRecord("SELECT count(database_id) as number FROM web_database WHERE database_name = '".$app->db->quote($settings['main_database_name'])."'");
+ if($tmp['number'] == 0) {
+ $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `parent_domain_id`, `type`, `database_name`, `database_name_prefix`, `database_user_id`, `database_ro_user_id`, `database_charset`, `remote_access`, `remote_ips`, `backup_copies`, `active`, `backup_interval`)
+ VALUES( ".$app->functions->intval($websrv['sys_userid']).", ".$app->functions->intval($websrv['sys_groupid']).", 'riud', '".$app->functions->intval($websrv['sys_perm_group'])."', '', $mysql_db_server_id, ".$app->functions->intval($websrv['domain_id']).", 'mysql', '".$settings['main_database_name']."', '" . $app->db->quote($dbname_prefix) . "', '$mysql_db_user_id', 0, '', '$mysql_db_remote_access', '$mysql_db_remote_ips', ".$app->functions->intval($websrv['backup_copies']).", 'y', '".$app->functions->intval($websrv['backup_interval'])."')";
+ $app->db->datalogInsert('web_database', $insert_data, 'database_id');
+ }
+
+ return true;
+ }
+
/**
* Creates a new database record for the package instance and
* an install task
@@ -250,86 +335,15 @@ class ApsGUIController extends ApsBase
}
- //* Create the MySQL database for the application
+ //* Create the MySQL database for the application if necessary
$pkg = $app->db->queryOneRecord('SELECT * FROM aps_packages WHERE id = '.$app->db->quote($packageid).';');
$metafile = $this->interface_pkg_dir.'/'.$pkg['path'].'/APP-META.xml';
$sxe = $this->readInMetaFile($metafile);
$db_id = parent::getXPathValue($sxe, '//db:id');
if (!empty($db_id)) {
- $global_config = $app->getconf->get_global_config('sites');
-
- $tmp = array();
- $tmp['parent_domain_id'] = $websrv['domain_id'];
- $tmp['sys_groupid'] = $websrv['sys_groupid'];
- $dbname_prefix = $app->tools_sites->replacePrefix($global_config['dbname_prefix'], $tmp);
- $dbuser_prefix = $app->tools_sites->replacePrefix($global_config['dbuser_prefix'], $tmp);
- unset($tmp);
-
- // get information if the webserver is a db server, too
- $web_server = $app->db->queryOneRecord("SELECT server_id,server_name,db_server FROM server WHERE server_id = ".$app->functions->intval($websrv['server_id']));
- if($web_server['db_server'] == 1) {
- // create database on "localhost" (webserver)
- $mysql_db_server_id = $app->functions->intval($websrv['server_id']);
- $mysql_db_host = 'localhost';
- $mysql_db_remote_access = 'n';
- $mysql_db_remote_ips = '';
- } else {
- //* get the default database server of the client
- $client = $app->db->queryOneRecord("SELECT default_dbserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ".$app->functions->intval($websrv['sys_groupid']));
- if(is_array($client) && $client['default_dbserver'] > 0 && $client['default_dbserver'] != $websrv['server_id']) {
- $mysql_db_server_id = $app->functions->intval($client['default_dbserver']);
- $dbserver_config = $web_config = $app->getconf->get_server_config($app->functions->intval($mysql_db_server_id), 'server');
- $mysql_db_host = $dbserver_config['ip_address'];
- $mysql_db_remote_access = 'y';
- $webserver_config = $app->getconf->get_server_config($app->functions->intval($websrv['server_id']), 'server');
- $mysql_db_remote_ips = $webserver_config['ip_address'];
- } else {
- /* I left this in place for a fallback that should NEVER! happen.
- * if we reach this point it means that there is NO default db server for the client
- * AND the webserver has NO db service enabled.
- * We have to abort the aps installation here... so I added a return false
- * although this does not present any error message to the user.
- */
- return false;
-
- /*$mysql_db_server_id = $websrv['server_id'];
- $mysql_db_host = 'localhost';
- $mysql_db_remote_access = 'n';
- $mysql_db_remote_ips = '';*/
- }
- }
-
- //* Find a free db name for the app
- for($n = 1; $n <= 1000; $n++) {
- $mysql_db_name = $app->db->quote(($dbname_prefix != '' ? $dbname_prefix.'aps'.$n : uniqid('aps')));
- $tmp = $app->db->queryOneRecord("SELECT count(database_id) as number FROM web_database WHERE database_name = '".$app->db->quote($mysql_db_name)."'");
- if($tmp['number'] == 0) break;
- }
- //* Find a free db username for the app
- for($n = 1; $n <= 1000; $n++) {
- $mysql_db_user = $app->db->quote(($dbuser_prefix != '' ? $dbuser_prefix.'aps'.$n : uniqid('aps')));
- $tmp = $app->db->queryOneRecord("SELECT count(database_user_id) as number FROM web_database_user WHERE database_user = '".$app->db->quote($mysql_db_user)."'");
- if($tmp['number'] == 0) break;
- }
-
- $mysql_db_password = $settings['main_database_password'];
-
- //* Create the mysql database user
- $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `database_user`, `database_user_prefix`, `database_password`)
- VALUES( ".$app->functions->intval($websrv['sys_userid']).", ".$app->functions->intval($websrv['sys_groupid']).", 'riud', '".$app->functions->intval($websrv['sys_perm_group'])."', '', 0, '$mysql_db_user', '".$app->db->quote($dbuser_prefix) . "', PASSWORD('$mysql_db_password'))";
- $mysql_db_user_id = $app->db->datalogInsert('web_database_user', $insert_data, 'database_user_id');
-
- //* Create the mysql database
- $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `parent_domain_id`, `type`, `database_name`, `database_name_prefix`, `database_user_id`, `database_ro_user_id`, `database_charset`, `remote_access`, `remote_ips`, `backup_copies`, `active`, `backup_interval`)
- VALUES( ".$app->functions->intval($websrv['sys_userid']).", ".$app->functions->intval($websrv['sys_groupid']).", 'riud', '".$app->functions->intval($websrv['sys_perm_group'])."', '', $mysql_db_server_id, ".$app->functions->intval($websrv['domain_id']).", 'mysql', '$mysql_db_name', '" . $app->db->quote($dbname_prefix) . "', '$mysql_db_user_id', 0, '', '$mysql_db_remote_access', '$mysql_db_remote_ips', ".$app->functions->intval($websrv['backup_copies']).", 'y', '".$app->functions->intval($websrv['backup_interval'])."')";
- $app->db->datalogInsert('web_database', $insert_data, 'database_id');
-
- //* Add db details to package settings
- $settings['main_database_host'] = $mysql_db_host;
- $settings['main_database_name'] = $mysql_db_name;
- $settings['main_database_login'] = $mysql_db_user;
-
+ // mysql-database-name is updated inside if not set already
+ if (!$this->createDatabaseForPackageInstance($settings, $websrv)) return false;
}
//* Insert new package instance
@@ -348,15 +362,13 @@ class ApsGUIController extends ApsBase
$app->db->datalogUpdate('aps_instances', "instance_status = ".INSTANCE_INSTALL, 'id', $InstanceID);
}
-
-
/**
* Sets the status of an instance to "should be removed" and creates a
* datalog entry to give the ISPConfig server a real removal advice
*
* @param $instanceid the instance to delete
*/
- public function deleteInstance($instanceid)
+ public function deleteInstance($instanceid, $keepdatabase = false)
{
global $app;
/*
@@ -370,48 +382,20 @@ class ApsGUIController extends ApsBase
$app->db->datalogSave('aps', 'DELETE', 'id', $instanceid, array(), $datalog);
*/
- $sql = "SELECT web_database.database_id as database_id, web_database.database_user_id as `database_user_id` FROM aps_instances_settings, web_database WHERE aps_instances_settings.value = web_database.database_name AND aps_instances_settings.name = 'main_database_name' AND aps_instances_settings.instance_id = ".$instanceid." LIMIT 0,1";
- $tmp = $app->db->queryOneRecord($sql);
- if($tmp['database_id'] > 0) $app->db->datalogDelete('web_database', 'database_id', $tmp['database_id']);
-
- $database_user = $tmp['database_user_id'];
- $tmp = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `database_user_id` = '" . $app->functions->intval($database_user) . "' OR `database_ro_user_id` = '" . $app->functions->intval($database_user) . "'");
- if($tmp['cnt'] < 1) $app->db->datalogDelete('web_database_user', 'database_user_id', $database_user);
+ if (!$keepdatabase) {
+ $sql = "SELECT web_database.database_id as database_id, web_database.database_user_id as `database_user_id` FROM aps_instances_settings, web_database WHERE aps_instances_settings.value = web_database.database_name AND aps_instances_settings.name = 'main_database_name' AND aps_instances_settings.instance_id = ".$instanceid." LIMIT 0,1";
+ $tmp = $app->db->queryOneRecord($sql);
+ if($tmp['database_id'] > 0) $app->db->datalogDelete('web_database', 'database_id', $tmp['database_id']);
+
+ $database_user = $tmp['database_user_id'];
+ $tmp = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `database_user_id` = '" . $app->functions->intval($database_user) . "' OR `database_ro_user_id` = '" . $app->functions->intval($database_user) . "'");
+ if($tmp['cnt'] < 1) $app->db->datalogDelete('web_database_user', 'database_user_id', $database_user);
+ }
$app->db->datalogUpdate('aps_instances', "instance_status = ".INSTANCE_REMOVE, 'id', $instanceid);
}
-
-
- /**
- * Sets the status of an instance to "installation planned" and creates a
- * datalog entry to re-install the package. The existing package is simply overwritten.
- *
- * @param $instanceid the instance to delete
- */
- public function reinstallInstance($instanceid)
- {
- global $app;
-
- /*
- $app->db->query("UPDATE aps_instances SET instance_status = ".INSTANCE_INSTALL." WHERE id = ".$instanceid.";");
-
- $webserver_id = $this->getInstanceDataForDatalog($instanceid);
- if($webserver_id == '') return;
-
- // Create a sys_datalog entry for re-installation
- $datalog = array('instance_id' => $instanceid, 'server_id' => $webserver_id);
- $app->db->datalogSave('aps', 'INSERT', 'id', $instanceid, array(), $datalog);
- */
-
- $sql = "SELECT web_database.database_id as database_id FROM aps_instances_settings, web_database WHERE aps_instances_settings.value = web_database.database_name AND aps_instances_settings.value = aps_instances_settings.name = 'main_database_name' AND aps_instances_settings.instance_id = ".$app->db->quote($instanceid)." LIMIT 0,1";
- $tmp = $app->db->queryOneRecord($sql);
- if($tmp['database_id'] > 0) $app->db->datalogDelete('web_database', 'database_id', $tmp['database_id']);
-
- $app->db->datalogUpdate('aps_instances', "instance_status = ".INSTANCE_INSTALL, 'id', $instanceid);
- }
-
/**
* Read the settings to be filled when installing
*
@@ -608,6 +592,10 @@ class ApsGUIController extends ApsBase
if(isset($pkg_details['Requirements Database'])
&& $pkg_details['Requirements Database'] != '')
{
+ if (isset($postinput['main_database_host'])) $input['main_database_host'] = $postinput['main_database_host'];
+ if (isset($postinput['main_database_name'])) $input['main_database_name'] = $postinput['main_database_name'];
+ if (isset($postinput['main_database_login'])) $input['main_database_login'] = $postinput['main_database_login'];
+
if(isset($postinput['main_database_password']))
{
if($postinput['main_database_password'] == '') $error[] = $app->lng('error_no_database_pw');
diff --git a/interface/lib/classes/remote.d/aps.inc.php b/interface/lib/classes/remote.d/aps.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..78c066c5eb1298f06381d2b42be45bd186f9b5cb
--- /dev/null
+++ b/interface/lib/classes/remote.d/aps.inc.php
@@ -0,0 +1,318 @@
+
+Copyright (c) Profi Webdesign Dominik Müller
+
+*/
+
+class remoting_aps extends remoting {
+ //* Functions for APS
+ public function sites_aps_update_package_list($session_id)
+ {
+ global $app;
+
+ if(!$this->checkPerm($session_id, 'sites_aps_update_package')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+
+ $app->load('aps_crawler');
+ $aps = new ApsCrawler($app, false); // true = Interface mode, false = Server mode
+ $aps->startCrawler();
+ $aps->parseFolderToDB();
+ $aps->fixURLs();
+
+ return true;
+ }
+
+ public function sites_aps_available_packages_list($session_id, $params)
+ {
+ global $app;
+
+ if(!$this->checkPerm($session_id, 'sites_aps_available_packages_list')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+
+ $app->load('aps_base');
+
+ if (isset($params['all_packages']) && ($params['all_packages'] == true)) {
+ $where = '(aps_packages.package_status = '.PACKAGE_ENABLED.' OR aps_packages.package_status = '.PACKAGE_LOCKED.')';
+ }
+ else {
+ $where = 'aps_packages.package_status = '.PACKAGE_ENABLED;
+ }
+
+ $sql = 'SELECT * FROM aps_packages WHERE '.$where.' ORDER BY aps_packages.name, aps_packages.version';
+ return $app->db->queryAllRecords($sql);
+ }
+
+ public function sites_aps_get_package_details($session_id, $primary_id)
+ {
+ global $app;
+
+ if(!$this->checkPerm($session_id, 'sites_aps_get_package_details')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+
+ $app->load('aps_guicontroller');
+ $gui = new ApsGUIController($app);
+
+ // Package-ID Check
+ if (isset($primary_id))
+ {
+ $newest_pkg_id = $gui->getNewestPackageID($pkg_id);
+ if($newest_pkg_id != 0) $primary_id = $newest_pkg_id;
+ }
+
+ // 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;
+ }
+
+ // Get package details
+ $details = $gui->getPackageDetails($primary_id);
+ if (isset($details['error'])) {
+ $this->server->fault('package_error', $details['error']);
+ return false;
+ }
+
+ // encode all parts to ensure SOAP-XML-format
+ array_walk_recursive($details, function(&$item, &$key) { $item = utf8_encode($item); } );
+ // Special handling for license-text because of too much problems with soap-transport
+ $details['License content'] = base64_encode($details['License content']);
+
+ return $details;
+ }
+
+ public function sites_aps_get_package_file($session_id, $primary_id, $filename) {
+ global $app;
+
+ if(!$this->checkPerm($session_id, 'sites_aps_get_package_file')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+
+ $app->load('aps_guicontroller');
+ $gui = new ApsGUIController($app);
+
+ // Package-ID Check
+ if (isset($primary_id))
+ {
+ $newest_pkg_id = $gui->getNewestPackageID($pkg_id);
+ if($newest_pkg_id != 0) $primary_id = $newest_pkg_id;
+ }
+
+ // 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;
+ }
+
+ // Get package details
+ $details = $gui->getPackageDetails($primary_id);
+ if (isset($details['error'])) {
+ $this->server->fault('package_error', $details['error']);
+ return false;
+ }
+
+ // find file in details
+ $found = false;
+ if (basename($details['Icon']) == $filename) $found = true;
+ if (!$found && isset($details['Screenshots']) && is_array($details['Screenshots']))
+ foreach ($details['Screenshots'] as $screen) { if (basename($screen['ScreenPath']) == $filename) { $found = true; break; } }
+
+ if (!$found) {
+ $this->server->fault('package_error', 'File not found in package.');
+ return false;
+ }
+
+ return base64_encode(file_get_contents(ISPC_ROOT_PATH.'/web/sites/aps_meta_packages/'.$details['path'].'/'.$filename));
+ }
+
+ public function sites_aps_get_package_settings($session_id, $primary_id)
+ {
+ global $app;
+
+ if(!$this->checkPerm($session_id, 'sites_aps_get_package_details')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+
+ $app->load('aps_guicontroller');
+ $gui = new ApsGUIController($app);
+
+ // Package-ID Check
+ if (isset($primary_id))
+ {
+ $newest_pkg_id = $gui->getNewestPackageID($pkg_id);
+ if($newest_pkg_id != 0) $primary_id = $newest_pkg_id;
+ }
+
+ // 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;
+ }
+
+ // Get package settings
+ $settings = $gui->getPackageSettings($primary_id);
+ if (isset($settings['error'])) {
+ $this->server->fault('package_error', $settings['error']);
+ return false;
+ }
+
+ // encode all parts to ensure SOAP-XML-format
+ array_walk_recursive($settings, function(&$item, &$key) { $item = utf8_encode($item); } );
+
+ return $settings;
+ }
+
+ public function sites_aps_install_package($session_id, $primary_id, $params)
+ {
+ global $app;
+
+ if(!$this->checkPerm($session_id, 'sites_aps_install_package')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+
+ $app->load('aps_guicontroller');
+ $gui = new ApsGUIController($app);
+
+ // Package-ID Check
+ if (isset($primary_id))
+ {
+ $newest_pkg_id = $gui->getNewestPackageID($primary_id);
+ if($newest_pkg_id != 0) $primary_id = $newest_pkg_id;
+ }
+
+ // 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;
+ }
+
+ // Get package details
+ $details = $gui->getPackageDetails($primary_id);
+ if (isset($details['error'])) {
+ $this->server->fault('package_error', $details['error']);
+ return false;
+ }
+ $settings = $gui->getPackageSettings($primary_id);
+ if (isset($settings['error'])) {
+ $this->server->fault('package_error', $settings['error']);
+ return false;
+ }
+
+ // Check given Site/VHostDomain
+ if (!isset($params['main_domain'])) {
+ $this->server->fault('invalid parameters', 'No valid domain given.');
+ return false;
+ }
+
+ $sql = "SELECT * FROM web_domain WHERE domain = '".$app->db->quote($params['main_domain'])."'";
+ $domain = $app->db->queryOneRecord($sql);
+
+ if (!$domain) {
+ $this->server->fault('invalid parameters', 'No valid domain given.');
+ return false;
+ }
+
+ $domains = array($domain['domain']); // Simulate correct Domain-List
+ $result = $gui->validateInstallerInput($params, $details, $domains, $settings);
+ if(empty($result['error']))
+ {
+ return $gui->createPackageInstance($result['input'], $primary_id);
+ }
+
+ $this->server->fault('invalid parameters', implode('
', $result['error']));
+ return false;
+ }
+
+ public function sites_aps_instance_get($session_id, $primary_id)
+ {
+ global $app;
+
+ if(!$this->checkPerm($session_id, 'sites_aps_instance_get')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+
+ $sql = "SELECT * FROM aps_instances WHERE id = ".$app->functions->intval($primary_id);
+ $result = $app->db->queryOneRecord($sql);
+ return $result;
+ }
+
+ public function sites_aps_instance_settings_get($session_id, $primary_id)
+ {
+ global $app;
+
+ if(!$this->checkPerm($session_id, 'sites_aps_instance_get')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+
+ $sql = "SELECT * FROM aps_instances_settings WHERE instance_id = ".$app->functions->intval($primary_id);
+ $result = $app->db->queryAllRecords($sql);
+ return $result;
+ }
+
+ public function sites_aps_instance_delete($session_id, $primary_id, $params = array())
+ {
+ global $app;
+
+ if(!$this->checkPerm($session_id, 'sites_aps_instance_delete')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+
+ $app->load('aps_guicontroller');
+ $gui = new ApsGUIController($app);
+
+ // Check if Instance exists
+ $sql = "SELECT * FROM aps_instances WHERE id = ".$app->functions->intval($primary_id);
+ $result = $app->db->queryOneRecord($sql);
+
+ if (!$result) {
+ $this->server->fault('instance_error', 'No valid instance id given.');
+ return false;
+ }
+
+ $gui->deleteInstance($primary_id, (isset($params['keep_database']) && ($params['keep_database'] === true)));
+
+ return true;
+ }
+}
+
+?>
diff --git a/interface/lib/plugins/sites_web_vhost_domain_plugin.inc.php b/interface/lib/plugins/sites_web_vhost_domain_plugin.inc.php
index d063fbbecfc5c4ed3dd41f8d311205a551a60c29..b65c05bf2cd0546bcf853685a1e02b1278703c4d 100644
--- a/interface/lib/plugins/sites_web_vhost_domain_plugin.inc.php
+++ b/interface/lib/plugins/sites_web_vhost_domain_plugin.inc.php
@@ -212,8 +212,6 @@ class sites_web_vhost_domain_plugin {
if(is_array($records) && !empty($records)){
foreach($records as $rec){
$app->db->datalogUpdate('aps_instances_settings', "value = '".$app->db->quote($page_form->dataRecord["domain"])."'", 'id', $rec['id']);
- // Reinstall of package needed?
- //$app->db->datalogUpdate('aps_instances', "instance_status = '1'", 'id', $rec['instance_id']);
}
}
unset($records);
diff --git a/interface/web/sites/aps_do_operation.php b/interface/web/sites/aps_do_operation.php
index b4d949316623077aed39de67d28d3fe711e47587..ffc8c031d7b65b69d0f0fcee63cd1b524eefb849 100644
--- a/interface/web/sites/aps_do_operation.php
+++ b/interface/web/sites/aps_do_operation.php
@@ -84,29 +84,4 @@ else if($_GET['action'] == 'delete_instance')
//echo $app->lng('Installation_remove');
@header('Location:aps_installedpackages_list.php');
}
-else if($_GET['action'] == 'reinstall_instance')
- {
- // Make sure a valid package ID is given (also corresponding to the calling user)
- $client_id = 0;
- $is_admin = ($_SESSION['s']['user']['typ'] == 'admin') ? true : false;
- if(!$is_admin)
- {
- $cid = $app->db->queryOneRecord("SELECT client_id FROM client WHERE username = '".$app->db->quote($_SESSION['s']['user']['username'])."';");
- $client_id = $cid['client_id'];
- }
- // Assume that the given instance belongs to the currently calling client_id. Unimportant if status is admin
- if(!$gui->isValidInstanceID($_GET['id'], $client_id, $is_admin)) die($app->lng('Invalid ID'));
-
- // We've an InstanceID, so make sure the package is not enabled and InstanceStatus is still "installed"
- $check = $app->db->queryOneRecord("SELECT aps_instances.id FROM aps_instances, aps_packages
- WHERE aps_instances.package_id = aps_packages.id
- AND aps_instances.instance_status = ".INSTANCE_SUCCESS."
- AND aps_packages.package_status = ".PACKAGE_ENABLED."
- AND aps_instances.id = ".$app->db->quote($_GET['id']).";");
- if(!$check) die('Check failed'); // normally this might not happen at all, so just die
-
- $gui->reinstallInstance($_GET['id']);
- //echo $app->lng('Installation_task');
- @header('Location:aps_installedpackages_list.php');
- }
?>
diff --git a/interface/web/sites/aps_installedpackages_list.php b/interface/web/sites/aps_installedpackages_list.php
index 418cc43c1120103037421cb3c167f32f9d00d4ec..a0a934ef43afbae0d8eb83cddd27d58b9ccf13f9 100644
--- a/interface/web/sites/aps_installedpackages_list.php
+++ b/interface/web/sites/aps_installedpackages_list.php
@@ -125,10 +125,6 @@ if(is_array($records))
else $ils = $rec['install_location'];
$rec['install_location_short'] = $ils;
- // Also set a boolean-like variable for the reinstall button (vlibTemplate doesn't allow variable comparisons)
- // For a reinstall, the package must be already installed successfully and (still be) enabled
- if($rec['instance_status'] == INSTANCE_SUCCESS && $rec['package_status'] == PACKAGE_ENABLED)
- $rec['reinstall_possible'] = 'true';
// Of course an instance can only then be removed when it's not already tagged for removal
if($rec['instance_status'] != INSTANCE_REMOVE && $rec['instance_status'] != INSTANCE_INSTALL)
$rec['delete_possible'] = 'true';
diff --git a/interface/web/sites/lib/lang/ar_aps_instances_list.lng b/interface/web/sites/lib/lang/ar_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/ar_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/ar_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/bg_aps_instances_list.lng b/interface/web/sites/lib/lang/bg_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/bg_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/bg_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/br_aps_instances_list.lng b/interface/web/sites/lib/lang/br_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/br_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/br_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/cz_aps_instances_list.lng b/interface/web/sites/lib/lang/cz_aps_instances_list.lng
index 16e863ee9c23441513e2a05386e9756021039ee6..8f7c248a60d7db5a1e85af89de2ca3648a26ba8a 100644
--- a/interface/web/sites/lib/lang/cz_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/cz_aps_instances_list.lng
@@ -6,9 +6,7 @@ $wb['customer_txt'] = 'Klient';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Umístění instalace';
$wb['pkg_delete_confirmation'] = 'Opravdu chcete smazat tuto instalaci ?';
-$wb['pkg_reinstall_confirmation'] = 'Opravdu chcete přeinstalovat tento balíček se stejným nastavením ?';
$wb['filter_txt'] = 'Hledat';
$wb['delete_txt'] = 'Smazat';
-$wb['reinstall_txt'] = 'Přeinstalovat';
?>
diff --git a/interface/web/sites/lib/lang/de_aps_instances_list.lng b/interface/web/sites/lib/lang/de_aps_instances_list.lng
index e5f8b7b7f12728cbf57937ea40aa369f517176de..ba381e8bd7fb8fceac966ed51739a1be950d7f13 100644
--- a/interface/web/sites/lib/lang/de_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/de_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Kunde';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Installationsort';
$wb['pkg_delete_confirmation'] = 'Soll diese Installation wirklich gelöscht werden?';
-$wb['pkg_reinstall_confirmation'] = 'Soll das Paket wirklich mit den gleichen Einstellungen erneut installiert werden?';
$wb['filter_txt'] = 'Suche';
$wb['delete_txt'] = 'Löschen';
-$wb['reinstall_txt'] = 'Neuinstallieren';
?>
diff --git a/interface/web/sites/lib/lang/el_aps_instances_list.lng b/interface/web/sites/lib/lang/el_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/el_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/el_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/en_aps_instances_list.lng b/interface/web/sites/lib/lang/en_aps_instances_list.lng
index 611c37efa63656420e4a25c5beb71d9b11c3047d..ce6df1a3fd182725702b1921dbffa7062bfd4003 100644
--- a/interface/web/sites/lib/lang/en_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/en_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/es_aps_instances_list.lng b/interface/web/sites/lib/lang/es_aps_instances_list.lng
index f302a7a29ecb9acafcb3b1208b8124d2c2359a76..71ccd53fa5be0c547a7150af8bc2fe11718ddb1f 100644
--- a/interface/web/sites/lib/lang/es_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/es_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Cliente';
$wb['status_txt'] = 'Estado';
$wb['install_location_txt'] = 'Localización de instalación';
$wb['pkg_delete_confirmation'] = '¿Realmente quieres eliminar esta instalación?';
-$wb['pkg_reinstall_confirmation'] = '¿Realmente quieres reinstalar este paquete con la misma configuración?';
$wb['filter_txt'] = 'Buscar';
$wb['delete_txt'] = 'Eliminar';
-$wb['reinstall_txt'] = 'Reinstalar';
?>
diff --git a/interface/web/sites/lib/lang/fi_aps_instances_list.lng b/interface/web/sites/lib/lang/fi_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/fi_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/fi_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/fr_aps_instances_list.lng b/interface/web/sites/lib/lang/fr_aps_instances_list.lng
index 6a2dba1e84c72745faac5cfdb30e456f2e598556..63145b04f3a5d8e412ee9a92b7fd494b41df917d 100644
--- a/interface/web/sites/lib/lang/fr_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/fr_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Statut';
$wb['install_location_txt'] = 'Chemin d\'installation';
$wb['pkg_delete_confirmation'] = 'Etes-vous sûr de vouloir supprimer cette installation ?';
-$wb['pkg_reinstall_confirmation'] = 'Etes-vous sûr de vouloir réinstaller ce package avec la même configuration ?';
$wb['filter_txt'] = 'Chercher';
$wb['delete_txt'] = 'Supprimer';
-$wb['reinstall_txt'] = 'Réinstaller';
?>
diff --git a/interface/web/sites/lib/lang/hr_aps_instances_list.lng b/interface/web/sites/lib/lang/hr_aps_instances_list.lng
index 2d737a6f7a820cef9a1a254a41a4a018ea8a7971..5215f3596cc944be04bfeb2de3849d1c87fe6281 100644
--- a/interface/web/sites/lib/lang/hr_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/hr_aps_instances_list.lng
@@ -6,10 +6,8 @@ $wb['customer_txt'] = 'Klijent';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Lokacija instalacije';
$wb['pkg_delete_confirmation'] = 'Da li stvarno želite obrisati ovu instalaciju?';
-$wb['pkg_reinstall_confirmation'] = 'Da li stvarno želite reinstalirati ovaj paket sa istim postavkama?';
$wb['filter_txt'] = 'Traži';
$wb['delete_txt'] = 'Obriši';
-$wb['reinstall_txt'] = 'Reinstaliraj';
?>
diff --git a/interface/web/sites/lib/lang/hu_aps_instances_list.lng b/interface/web/sites/lib/lang/hu_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/hu_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/hu_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/id_aps_instances_list.lng b/interface/web/sites/lib/lang/id_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/id_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/id_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/it_aps_instances_list.lng b/interface/web/sites/lib/lang/it_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/it_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/it_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/ja_aps_instances_list.lng b/interface/web/sites/lib/lang/ja_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/ja_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/ja_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/nl_aps_instances_list.lng b/interface/web/sites/lib/lang/nl_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/nl_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/nl_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/pl_aps_instances_list.lng b/interface/web/sites/lib/lang/pl_aps_instances_list.lng
index 186dc7dc1a965f8af22f9627e4efa70ba6d27f61..b587dc74e8e4dd8fb0e96ba09889ad5a656e147a 100644
--- a/interface/web/sites/lib/lang/pl_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/pl_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Klient';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Lokalizacja instalacji';
$wb['pkg_delete_confirmation'] = 'Na pewno chcesz usunąć tę instalację?';
-$wb['pkg_reinstall_confirmation'] = 'Na pewno chcesz przeinstalować ten pakiet z tymi samymi ustawieniami?';
$wb['filter_txt'] = 'Szukaj';
$wb['delete_txt'] = 'Usuń';
-$wb['reinstall_txt'] = 'Przeinstaluj';
?>
diff --git a/interface/web/sites/lib/lang/pt_aps_instances_list.lng b/interface/web/sites/lib/lang/pt_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/pt_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/pt_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/ro_aps_instances_list.lng b/interface/web/sites/lib/lang/ro_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/ro_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/ro_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/ru_aps_instances_list.lng b/interface/web/sites/lib/lang/ru_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/ru_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/ru_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/se_aps_instances_list.lng b/interface/web/sites/lib/lang/se_aps_instances_list.lng
index a9428aa737cddf82caa51be17abb3a06d26ff1a1..ae2791d639dd06b1be0a9ba8706827651803ed68 100644
--- a/interface/web/sites/lib/lang/se_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/se_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Kund';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Installationsplats';
$wb['pkg_delete_confirmation'] = 'Vill du verkligen radera denna installation?';
-$wb['pkg_reinstall_confirmation'] = 'Vill du verkligen installera om det här paketet med samma inställningar?';
$wb['filter_txt'] = 'Sök';
$wb['delete_txt'] = 'Radera';
-$wb['reinstall_txt'] = 'Ominstallera';
?>
diff --git a/interface/web/sites/lib/lang/sk_aps_instances_list.lng b/interface/web/sites/lib/lang/sk_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/sk_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/sk_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/lang/tr_aps_instances_list.lng b/interface/web/sites/lib/lang/tr_aps_instances_list.lng
index 052d834a7174000d1bdc2e1d87354299a5906f2a..5742b7a6e9bb2f6063c4b62a5ba4bb5dbb3fcbb2 100644
--- a/interface/web/sites/lib/lang/tr_aps_instances_list.lng
+++ b/interface/web/sites/lib/lang/tr_aps_instances_list.lng
@@ -6,8 +6,6 @@ $wb['customer_txt'] = 'Client';
$wb['status_txt'] = 'Status';
$wb['install_location_txt'] = 'Install location';
$wb['pkg_delete_confirmation'] = 'Do you really want to delete this installation?';
-$wb['pkg_reinstall_confirmation'] = 'Do you really want to reinstall this package with the same settings?';
$wb['filter_txt'] = 'Search';
$wb['delete_txt'] = 'Delete';
-$wb['reinstall_txt'] = 'Reinstall';
?>
diff --git a/interface/web/sites/lib/remote.conf.php b/interface/web/sites/lib/remote.conf.php
index 30e41b929220b2ef939bccacaa71d1543ddc946d..5ba2b7d6fa15cd0bd02eac9b0ece38da936be4cc 100644
--- a/interface/web/sites/lib/remote.conf.php
+++ b/interface/web/sites/lib/remote.conf.php
@@ -8,6 +8,6 @@ $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';
?>
diff --git a/interface/web/sites/templates/aps_instances_list.htm b/interface/web/sites/templates/aps_instances_list.htm
index 2d9c50f6da77d6d2e8f37cd3fc0db96e8527cec1..19b47a05047d6df0bf23e293b328b199863e9c66 100644
--- a/interface/web/sites/templates/aps_instances_list.htm
+++ b/interface/web/sites/templates/aps_instances_list.htm
@@ -43,10 +43,7 @@
sites_aps_available_packages_list
+ + +sites_aps_get_package_settings
+ + + +sites_aps_instance_settings_get
+ @@ -226,7 +235,7 @@ - p>sites_web_domain_backup_list + diff --git a/remoting_client/API-docs/sites_aps_available_packages_list.html b/remoting_client/API-docs/sites_aps_available_packages_list.html new file mode 100644 index 0000000000000000000000000000000000000000..1d069debc9e4a3807d922bcac3d21501ce666bf3 --- /dev/null +++ b/remoting_client/API-docs/sites_aps_available_packages_list.html @@ -0,0 +1,29 @@ + +Description:
+Reads all available packages with state PACKAGE_ENABLED. If set param all_packages to true, also includes PACKAGE_LOCKED.
Input Variables:
+$session_id, $params
+Parameters (in $params):
+all_packages (boolean)
+Output:
+Returns array with all selected package records.
+ +Description:
+Gets all possible details for selected package.
Input Variables:
+$session_id, $primary_id
+Parameters (in $params):
+None
+Output:
+Returns array with all details of selected package.
+ +Description:
+Gets the file with given name (like screenshots or icon) of the selected package. Use sites_aps_get_package_details to get all available files of this package.
Input Variables:
+$session_id, $primary_id, $filename
+Parameters (in $params):
+None
+Output:
+ Returns base64_encoded file content of selected file.
Use the followoing example code to save file content over remote api:
file_put_contents($file, base64_decode(sites_aps_get_package_file($session_id, $primary_id, $filename)));
Description:
+Gets all possible settings for selected package.
Input Variables:
+$session_id, $primary_id
+Parameters (in $params):
+None
+Output:
+Returns array with all settings of selected package.
+ +Description:
+Starts installation of the selected package in given main_domains webfolder.
Input Variables:
+$session_id, $primary_id, $params
+Parameters (in $params):
+main_domain (varchar(255))
+Output:
+Returns new instance id or false.
+ +Description:
+Starts deletion of the selected APS instance. If param keep_database is set true, database will not be deleted.
Input Variables:
+$session_id, $primary_id, $params
+Parameters (in $params):
+keep_database (boolean)
+Output:
+Returns true if deletion is started.
+ +Description:
+Gets record of given instance id.
Input Variables:
+$session_id, $primary_id
+Parameters (in $params):
+None
+Output:
+Returns record of APS instance.
+ +Description:
+Gets record of given instance ids settings.
Input Variables:
+$session_id, $primary_id
+Parameters (in $params):
+None
+Output:
+Returns record of APS instance settings.
+ +Description:
+Update available package list. Starts the ApsCrawler in server mode. May take a while.
Input Variables:
+$session_id
+Parameters (in $params):
+None
+Output:
+always true
+ +