diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php index 2d31b89bbd63bd459b1721e911e979820bcb0e60..26623a98c7461dcc9c4221d8f22e2473d61267fd 100644 --- a/install/dist/lib/fedora.lib.php +++ b/install/dist/lib/fedora.lib.php @@ -1157,10 +1157,6 @@ class installer_dist extends installer_base { } } - //* Make the APS directories group writable - exec("chmod -R 770 $install_dir/interface/web/sites/aps_meta_packages"); - exec("chmod -R 770 $install_dir/server/aps_packages"); - //* make sure that the server config file (not the interface one) is only readable by the root user chmod($install_dir.'/server/lib/config.inc.php', 0600); chown($install_dir.'/server/lib/config.inc.php', 'root'); diff --git a/install/dist/lib/gentoo.lib.php b/install/dist/lib/gentoo.lib.php index 342a583facb64e433a8410abf136c570f7e34df2..b05e55b286e00a7b07c37abc3a28f4d3c0ea1c19 100644 --- a/install/dist/lib/gentoo.lib.php +++ b/install/dist/lib/gentoo.lib.php @@ -1045,10 +1045,6 @@ class installer extends installer_base } } - //* Make the APS directories group writable - exec("chmod -R 770 $install_dir/interface/web/sites/aps_meta_packages"); - exec("chmod -R 770 $install_dir/server/aps_packages"); - //* make sure that the server config file (not the interface one) is only readable by the root user chmod($install_dir.'/server/lib/config.inc.php', 0600); chown($install_dir.'/server/lib/config.inc.php', 'root'); diff --git a/install/dist/lib/opensuse.lib.php b/install/dist/lib/opensuse.lib.php index 07dd5cc690f36cb46d6556e1a67cd9dae38c416e..e74a074ce848abb3b045b2920fabbb3c0bbaa2c6 100644 --- a/install/dist/lib/opensuse.lib.php +++ b/install/dist/lib/opensuse.lib.php @@ -1147,10 +1147,6 @@ class installer_dist extends installer_base { } } - //* Make the APS directories group writable - exec("chmod -R 770 $install_dir/interface/web/sites/aps_meta_packages"); - exec("chmod -R 770 $install_dir/server/aps_packages"); - //* make sure that the server config file (not the interface one) is only readable by the root user chmod($install_dir.'/server/lib/config.inc.php', 0600); chown($install_dir.'/server/lib/config.inc.php', 'root'); diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 4d462e6d485e51a94ce24fddc98f6f2253242d13..c4396c36041921c25df7eccbd7e195c27c7385b9 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -705,22 +705,6 @@ class installer_base { $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); } - $query = "GRANT SELECT, UPDATE, DELETE ON ?? TO ?@?"; - if ($verbose){ - echo $query ."\n"; - } - if(!$this->dbmaster->query($query, $value['db'] . '.aps_instances', $value['user'], $host)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - - $query = "GRANT SELECT, DELETE ON ?? TO ?@?"; - if ($verbose){ - echo $query ."\n"; - } - if(!$this->dbmaster->query($query, $value['db'] . '.aps_instances_settings', $value['user'], $host)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - $query = "GRANT SELECT, INSERT, DELETE ON ?? TO ?@?"; if ($verbose){ echo $query ."\n"; @@ -3180,10 +3164,6 @@ class installer_base { } } - //* Make the APS directories group writable - exec("chmod -R 770 $install_dir/interface/web/sites/aps_meta_packages"); - exec("chmod -R 770 $install_dir/server/aps_packages"); - //* make sure that the server config file (not the interface one) is only readable by the root user chmod($install_dir.'/server/lib/config.inc.php', 0600); chown($install_dir.'/server/lib/config.inc.php', 'root'); diff --git a/install/sql/incremental/upd_dev_collection.sql b/install/sql/incremental/upd_dev_collection.sql index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f4f360f80e74a01ece22c547075b8db8694c5287 100644 --- a/install/sql/incremental/upd_dev_collection.sql +++ b/install/sql/incremental/upd_dev_collection.sql @@ -0,0 +1,7 @@ +-- Purge APS +DROP TABLE 'aps_instances'; +DROP TABLE 'aps_instances_settings'; +DROP TABLE 'aps_packages'; +DROP TABLE 'aps_settings'; +ALTER TABLE 'client' DROP COLUMN limit_aps; +ALTER TABLE 'client_template' DROP COLUMN limit_aps; diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql index 2901bb5af876f4643fae90caba7d242b354f706d..10e7b03b9ff31f3e9364dfce961511644a20a9dc 100644 --- a/install/sql/ispconfig3.sql +++ b/install/sql/ispconfig3.sql @@ -53,73 +53,6 @@ SET FOREIGN_KEY_CHECKS = 0; -- -------------------------------------------------------- -- -------------------------------------------------------- --- --- Table structure for table `aps_instances` --- - -CREATE TABLE IF NOT EXISTS `aps_instances` ( - `id` int(4) NOT NULL AUTO_INCREMENT, - `sys_userid` int(11) unsigned NOT NULL DEFAULT '0', - `sys_groupid` int(11) unsigned NOT NULL DEFAULT '0', - `sys_perm_user` varchar(5) DEFAULT NULL, - `sys_perm_group` varchar(5) DEFAULT NULL, - `sys_perm_other` varchar(5) DEFAULT NULL, - `server_id` int(11) NOT NULL DEFAULT '0', - `customer_id` int(4) NOT NULL DEFAULT '0', - `package_id` int(4) NOT NULL DEFAULT '0', - `instance_status` int(4) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) DEFAULT CHARSET=utf8 ; - --- -------------------------------------------------------- - --- --- Table structure for table `aps_instances_settings` --- - -CREATE TABLE IF NOT EXISTS `aps_instances_settings` ( - `id` int(4) NOT NULL AUTO_INCREMENT, - `server_id` int(11) NOT NULL DEFAULT '0', - `instance_id` int(4) NOT NULL DEFAULT '0', - `name` varchar(255) NOT NULL DEFAULT '', - `value` text, - PRIMARY KEY (`id`) -) DEFAULT CHARSET=utf8 ; - --- -------------------------------------------------------- - --- --- Table structure for table `aps_packages` --- - -CREATE TABLE IF NOT EXISTS `aps_packages` ( - `id` int(4) NOT NULL AUTO_INCREMENT, - `path` varchar(255) NOT NULL DEFAULT '', - `name` varchar(255) NOT NULL DEFAULT '', - `category` varchar(255) NOT NULL DEFAULT '', - `version` varchar(20) NOT NULL DEFAULT '', - `release` int(4) NOT NULL DEFAULT '0', - `package_url` TEXT, - `package_status` int(1) NOT NULL DEFAULT '2', - PRIMARY KEY (`id`) -) DEFAULT CHARSET=utf8 ; - --- -------------------------------------------------------- - --- --- Tabellenstruktur für Tabelle `aps_settings` --- - -CREATE TABLE IF NOT EXISTS `aps_settings` ( - `id` int(4) NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL DEFAULT '', - `value` text, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) DEFAULT CHARSET=utf8 ; - --- -------------------------------------------------------- - -- -- Table structure for table `attempts_login` -- @@ -220,7 +153,6 @@ CREATE TABLE `client` ( `limit_webdav_user` int(11) NOT NULL DEFAULT '0', `limit_backup` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'y', `limit_directive_snippets` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n', - `limit_aps` int(11) NOT NULL DEFAULT '-1', `default_dnsserver` int(11) unsigned NOT NULL DEFAULT '1', `db_servers` text, `limit_dns_zone` int(11) NOT NULL DEFAULT '-1', @@ -349,7 +281,6 @@ CREATE TABLE `client_template` ( `limit_webdav_user` int(11) NOT NULL default '0', `limit_backup` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'y', `limit_directive_snippets` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n', - `limit_aps` int(11) NOT NULL DEFAULT '-1', `dns_servers` text, `limit_dns_zone` int(11) NOT NULL default '-1', `default_slave_dnsserver` int(11) NOT NULL DEFAULT '0', @@ -2239,15 +2170,6 @@ CREATE TABLE `xmpp_user` ( -- DB-DATA -- -------------------------------------------------------- -- -------------------------------------------------------- - --- --- Dumping data for table `aps_settings` --- - -INSERT INTO `aps_settings` (`id`, `name`, `value`) VALUES(1, 'ignore-php-extension', ''); -INSERT INTO `aps_settings` (`id`, `name`, `value`) VALUES(2, 'ignore-php-configuration', ''); -INSERT INTO `aps_settings` (`id`, `name`, `value`) VALUES(3, 'ignore-webserver-module', ''); - -- -------------------------------------------------------- -- diff --git a/interface/lib/classes/aps_base.inc.php b/interface/lib/classes/aps_base.inc.php deleted file mode 100644 index e93a9a9743a00504d5427788aad17dd2efc46e14..0000000000000000000000000000000000000000 --- a/interface/lib/classes/aps_base.inc.php +++ /dev/null @@ -1,111 +0,0 @@ -log_prefix = $log_prefix; - $this->interface_mode = $interface_mode; - $this->fetch_url = 'apscatalog.com'; - $this->aps_version = '1.2'; - $this->packages_dir = ISPC_ROOT_PATH.'/aps_packages'; - $this->interface_pkg_dir = ISPC_ROOT_PATH.'/web/sites/aps_meta_packages'; - } - - - - /** - * Converts a given value to it's native representation in 1024 units - * - * @param $value the size to convert - * @return integer and string - */ - public function convertSize($value) - { - $unit = array('Bytes', 'KB', 'MB', 'GB', 'TB'); - return @round($value/pow(1024, ($i = floor(log($value, 1024)))), 2).' '.$unit[$i]; - } - - - - /** - * Determine a specific xpath from a given SimpleXMLElement handle. If the - * element is found, it's string representation is returned. If not, - * the return value will stay empty - * - * @param $xml_handle the SimpleXMLElement handle - * @param $query the XPath query - * @param $array define whether to return an array or a string - * @return $ret the return string - */ - protected function getXPathValue($xml_handle, $query, $array = false) - { - $ret = ''; - - $xp_result = @($xml_handle->xpath($query)) ? $xml_handle->xpath($query) : false; - if($xp_result !== false) $ret = (($array === false) ? (string)$xp_result[0] : $xp_result); - - return $ret; - } - -} - -?> diff --git a/interface/lib/classes/aps_crawler.inc.php b/interface/lib/classes/aps_crawler.inc.php deleted file mode 100644 index a8fe812d28b8fcdf3f1428566675c5394bf8d624..0000000000000000000000000000000000000000 --- a/interface/lib/classes/aps_crawler.inc.php +++ /dev/null @@ -1,652 +0,0 @@ -interface_mode) - { - if(!is_writable($this->interface_pkg_dir)) - throw new Exception('the folder '.basename($this->interface_pkg_dir).' is not writable'); - } - else - { - if(!is_writable($this->packages_dir)) - throw new Exception('the folder '.basename($this->packages_dir).' is not writable'); - } - - return true; - } - - catch(Exception $e) - { - $app->log($this->log_prefix.'Aborting execution because '.$e->getMessage(), LOGLEVEL_ERROR); - return false; - } - } - - - - /** - * Remove a directory recursively - * In case of error be silent - * - * @param $dir the directory to remove - */ - private function removeDirectory($dir) - { - if(is_dir($dir)) - { - $files = scandir($dir); - foreach($files as $file) - { - if($file != '.' && $file != '..') - if(filetype($dir.'/'.$file) == 'dir') $this->removeDirectory($dir.'/'.$file); - else @unlink($dir.'/'.$file); - } - reset($files); - @rmdir($dir); - } - } - - - /** - * Fetch HTML data from one or more given URLs - * If a string is given, a string is returned, if an array of URLs should - * be fetched, the responses of the parallel queries are returned as array - * - * @param $input the string or array to fetch - * @return $ret a query response string or array - */ - private function fetchPage($input) - { - $ret = array(); - $url = array(); - $conn = array(); - - // Make sure we are working with an array, further on - if(!is_array($input)) $url[] = $input; - else $url = $input; - - // Build the single cURL handles and add them to a multi handle - $mh = curl_multi_init(); - for($i = 0; $i < count($url); $i++) - { - $conn[$i] = curl_init('http://'.$this->fetch_url.$url[$i]); - curl_setopt($conn[$i], CURLOPT_RETURNTRANSFER, true); - curl_multi_add_handle($mh, $conn[$i]); - } - - $active = 0; - do curl_multi_exec($mh, $active); - while($active > 0); - - // Get the response(s) - for($i = 0; $i < count($url); $i++) - { - $ret[$i] = curl_multi_getcontent($conn[$i]); - curl_multi_remove_handle($mh, $conn[$i]); - curl_close($conn[$i]); - } - curl_multi_close($mh); - - if(count($url) == 1) $ret = $ret[0]; - - return $ret; - } - - - - /** - * Fetch binary data from a given array - * The data is retrieved in binary mode and - * then directly written to an output file - * - * @param $input a specially structed array - * @see $this->startUpdate() - */ - private function fetchFiles($input) - { - $fh = array(); - $url = array(); - $conn = array(); - - // Build the single cURL handles and add them to a multi handle - $mh = curl_multi_init(); - - // Process each app - for($i = 0; $i < count($input); $i++) - { - $conn[$i] = curl_init($input[$i]['url']); - $fh[$i] = fopen($input[$i]['localtarget'], 'wb'); - - curl_setopt($conn[$i], CURLOPT_BINARYTRANSFER, true); - curl_setopt($conn[$i], CURLOPT_FILE, $fh[$i]); - curl_setopt($conn[$i], CURLOPT_TIMEOUT, 0); - curl_setopt($conn[$i], CURLOPT_FAILONERROR, 1); - curl_setopt($conn[$i], CURLOPT_FOLLOWLOCATION, 1); - curl_setopt($conn[$i], CURLOPT_SSL_VERIFYHOST, 1); - curl_setopt($conn[$i], CURLOPT_SSL_VERIFYPEER, false); - - curl_multi_add_handle($mh, $conn[$i]); - } - - $active = 0; - do curl_multi_exec($mh, $active); - while($active > 0); - - // Close the handles - for($i = 0; $i < count($input); $i++) - { - fclose($fh[$i]); - curl_multi_remove_handle($mh, $conn[$i]); - curl_close($conn[$i]); - } - curl_multi_close($mh); - } - - - - /** - * A method to build query URLs out of a list of vendors - * - */ - private function formatVendorCallback($array_item) - { - $array_item = str_replace(' ', '%20', $array_item); - $array_item = str_replace('http://', '', $array_item); - $array_item = '/'.$this->aps_version.'.atom?vendor='.$array_item.'&pageSize=100'; - return $array_item; - } - - - - /** - * The main method which performs the actual crawling - */ - public function startCrawler() - { - global $app; - - try - { - // Make sure the requirements are given so that this script can execute - $req_ret = $this->checkRequirements(); - if(!$req_ret) return false; - - // Execute the open task and first fetch all vendors (APS catalog API 1.1, p. 12) - $app->log($this->log_prefix.'Fetching data from '.$this->fetch_url); - - $vendor_page = $this->fetchPage('/all-app/'); //$vendor_page = $this->fetchPage('/'.$this->aps_version.'/'); - preg_match_all("/\ /1.atom?vendor=typo3.org&pageSize=100 - //array_walk($vendors, array($this, 'formatVendorCallback')); - if(is_array($vendors)) { - foreach($vendors as $key => $array_item) { - $vendors[$key] = $this->formatVendorCallback($array_item); - } - } - - // Process all vendors in chunks of 50 entries - $vendor_chunks = array_chunk($vendors, 50); - //var_dump($vendor_chunks); - - // Get all known apps from the database and the highest known version - // Note: A dirty hack is used for numerical sorting of the VARCHAR field Version: +0 -> cast - // A longer but typesafe way would be: ORDER BY CAST(REPLACE(Version, '.', '') AS UNSIGNED) DESC - $existing_apps = array(); - $tmpres = $app->db->query("SELECT name as `Name`, CONCAT(version, '-', CAST(`release` AS CHAR)) AS CurrentVersion FROM aps_packages ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(version,'.0.0.0'),'.',4)) DESC, `release` DESC"); - while($tmp = $tmpres->get()) { - if(!array_key_exists($tmp['Name'], $existing_apps)) $existing_apps[$tmp['Name']] = $tmp; - } - $tmpres->free(); - unset($tmp); - //var_dump($existing_apps); - - // Used for statistics later - $apps_in_repo = 0; - $apps_updated = 0; - $apps_downloaded = 0; - - $apps_to_dl = array(); - - for($i = 0; $i < count($vendor_chunks); $i++) - { - // Fetch all apps for the current chunk of vendors - $apps = $this->fetchPage($vendor_chunks[$i]); - - for($j = 0; $j < count($apps); $j++) - { - // Before parsing, make sure it's worth the work by checking if at least one app exists - $apps_count = substr_count($apps[$j], '0'); - if($apps_count == 0) // obviously this vendor provides one or more apps - { - try { - // Rename namespaces and register them - $xml = str_replace("xmlns=", "ns=", $apps[$j]); - $sxe = new SimpleXMLElement($xml); - $namespaces = $sxe->getDocNamespaces(true); - foreach($namespaces as $ns => $url) $sxe->registerXPathNamespace($ns, $url); - - //Find highest version - $app_version = "0.0.0"; - $entry_pos = 1; - for ($p = 1; ; $p++) { - $app_version_tmp = parent::getXPathValue($sxe, 'entry[position()=' . $p . ']/a:version'); - if (strlen($app_version_tmp) < 1) break; - if (version_compare($app_version_tmp, $app_version) >= 0) { - $app_version = $app_version_tmp; - $entry_pos = $p; - } - } - - // Fetching values of interest - //$app_name = parent::getXPathValue($sxe, 'entry[position()=1]/a:name'); - //$app_version = parent::getXPathValue($sxe, 'entry[position()=1]/a:version'); - //$app_release = parent::getXPathValue($sxe, 'entry[position()=1]/a:release'); - $app_name = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/a:name"); - $app_version = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/a:version"); - $app_release = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/a:release"); - - // Find out a (possibly) existing package version - $ex_ver = ''; - /* - array_walk($existing_apps, - create_function('$v, $k, $ex_ver', 'if($v["Name"] == "'.$app_name.'") $ex_ver = $v["CurrentVersion"];'), &$ex_ver); - */ - if(is_array($existing_apps)) { - foreach($existing_apps as $k => $v) { - if($v["Name"] == $app_name) $ex_ver = $v["CurrentVersion"]; - } - } - - $new_ver = $app_version.'-'.$app_release; - $local_intf_folder = $this->interface_pkg_dir.'/'.$app_name.'-'.$new_ver.'.app.zip/'; - - // Proceed if a newer or at least equal version has been found with server mode or - // interface mode is activated and there are no valid APP-META.xml and PKG_URL existing yet - if((!$this->interface_mode && version_compare($new_ver, $ex_ver) >= 0) || ($this->interface_mode && (!file_exists($local_intf_folder.'APP-META.xml') || filesize($local_intf_folder.'APP-META.xml') == 0 || !file_exists($local_intf_folder.'PKG_URL') || filesize($local_intf_folder.'PKG_URL') == 0))){ - // Check if we already have an old version of this app - if(!empty($ex_ver) && version_compare($new_ver, $ex_ver) == 1) $apps_updated++; - - //$app_dl = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='aps']/@href"); - //$app_filesize = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='aps']/@length"); - //$app_metafile = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='meta']/@href"); - $app_dl = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='aps']/@href"); - $app_filesize = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='aps']/@length"); - $app_metafile = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='meta']/@href"); - - //$this->app_download_url_list[$app_name.'-'.$new_ver.'.app.zip'] = $app_dl; - // Skip ASP.net packages because they can't be used at all - $asp_handler = parent::getXPathValue($sxe, '//aspnet:handler'); - $asp_permissions = parent::getXPathValue($sxe, '//aspnet:permissions'); - $asp_version = parent::getXPathValue($sxe, '//aspnet:version'); - if(!empty($asp_handler) || !empty($asp_permissions) || !empty($asp_version)) continue; - - // Interface mode (download only parts) - if($this->interface_mode) - { - // Delete an obviously out-dated version from the system and DB - if(!empty($ex_ver) && version_compare($new_ver, $ex_ver) == 1) - { - $old_folder = $this->interface_pkg_dir.'/'.$app_name.'-'.$ex_ver.'.app.zip'; - if(file_exists($old_folder)) $this->removeDirectory($old_folder); - - $tmp = $app->db->queryOneRecord("SELECT id FROM aps_packages WHERE name = ? AND CONCAT(version, '-', CAST(`release` AS CHAR)) = ?", $app_name, $ex_ver); - $app->db->datalogUpdate('aps_packages', array("package_status" => PACKAGE_OUTDATED), 'id', $tmp['id']); - unset($tmp); - } - - // Create the local folder if not yet existing - if(!file_exists($local_intf_folder)) @mkdir($local_intf_folder, 0777, true); - - // Save the package URL in an extra file because it's not part of the APP-META.xml file - @file_put_contents($local_intf_folder.'PKG_URL', $app_dl); - - // Download the meta file - $local_metafile = $local_intf_folder.'APP-META.xml'; - if(!file_exists($local_metafile) || filesize($local_metafile) == 0) - { - $apps_to_dl[] = array('name' => 'APP-META.xml', - 'url' => $app_metafile, - 'filesize' => 0, - 'localtarget' => $local_metafile); - $apps_downloaded++; - } - - // Download package license - //$license = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='eula']/@href"); - $license = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='eula']/@href"); - if($license != '') - { - $local_license = $local_intf_folder.'LICENSE'; - if(!file_exists($local_license) || filesize($local_license) == 0) - { - $apps_to_dl[] = array('name' => basename($license), - 'url' => $license, - 'filesize' => 0, - 'localtarget' => $local_license); - } - } - - // Download package icon - //$icon = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='icon']/@href"); - $icon = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='icon']/@href"); - if($icon != '') - { - $local_icon = $local_intf_folder.basename($icon); - if(!file_exists($local_icon) || filesize($local_icon) == 0) - { - $apps_to_dl[] = array('name' => basename($icon), - 'url' => $icon, - 'filesize' => 0, - 'localtarget' => $local_icon); - } - } - - // Download available screenshots - //$screenshots = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='screenshot']", true); - $screenshots = parent::getXPathValue($sxe, "entry[position()=" . $entry_pos . "]/link[@a:type='screenshot']", true); - if(!empty($screenshots)) - { - foreach($screenshots as $screen) - { - $local_screen = $local_intf_folder.basename($screen['href']); - if(!file_exists($local_screen) || filesize($local_screen) == 0) - { - $apps_to_dl[] = array('name' => basename($screen['href']), - 'url' => $screen['href'], - 'filesize' => 0, - 'localtarget' => $local_screen); - } - } - } - } - else // Server mode (download whole ZIP archive) - { - // Delete an obviously out-dated version from the system - if(!empty($ex_ver) && version_compare($new_ver, $ex_ver) == 1) - { - $old_file = $this->packages_dir.'/'.$app_name.'-'.$ex_ver.'.app.zip'; - if(file_exists($old_file)) $this->removeDirectory($old_file); - } - - // Attention: $new_ver can also be == $ex_ver (according to version_compare >= 0) - $local_zip = $this->packages_dir.'/'.$app_name.'-'.$new_ver.'.app.zip'; - - // Before re-downloading a file, make sure it's not yet existing on HDD (due to DB inconsistency) - if((file_exists($local_zip) && (filesize($local_zip) == $app_filesize)) === false) - { - $apps_to_dl[] = array('name' => $app_name, - 'url' => $app_dl, - 'filesize' => $app_filesize, - 'localtarget' => $local_zip); - $apps_downloaded++; - } - } - } - - unset($sxe); - $apps_in_repo++; - } catch (Exception $e) { - // We dont want the crawler to fail on xml parse errors - $app->log($this->log_prefix.$e->getMessage(), LOGLEVEL_WARN); - //echo 'Caught exception: ', $e->getMessage(), "\n"; - } - } - } - //var_dump($apps); - //echo print_r($apps_to_dl).'
-------------------
'; - - // For memory reasons, unset the current vendor and his apps - unset($apps); - } - - // Shuffle the download array (in order to compensate unexpected php aborts) - shuffle($apps_to_dl); - - // After collecting all provisioned apps, download them - $apps_to_dl_chunks = array_chunk($apps_to_dl, 10); - - for($i = 0; $i < count($apps_to_dl_chunks); $i++) - { - $this->fetchFiles($apps_to_dl_chunks[$i]); - - // Check the integrity of all downloaded files - // but exclude cases where no filesize is available (i.e. screenshot or metafile download) - for($j = 0; $j < count($apps_to_dl_chunks[$i]); $j++) - { - if($apps_to_dl_chunks[$i][$j]['filesize'] != 0 && - $apps_to_dl_chunks[$i][$j]['filesize'] != filesize($apps_to_dl_chunks[$i][$j]['localtarget'])) - { - $app->log($this->log_prefix.' The filesize of the package "'. - $apps_to_dl_chunks[$i][$j]['name'].'" is wrong. Download failure?', LOGLEVEL_WARN); - } - } - } - - $app->log($this->log_prefix.'Processed '.$apps_in_repo. - ' apps from the repo. Downloaded '.$apps_updated. - ' updates, '.$apps_downloaded.' new apps'); - - $prevapp = ''; - $res = $app->db->query("SELECT `id`, `name`, `version`, `release`, `package_status` FROM `aps_packages` WHERE 1 ORDER BY `name` ASC, INET_ATON(SUBSTRING_INDEX(CONCAT(version,'.0.0.0'),'.',4)) DESC, `release` DESC"); - while($curapp = $res->get()) { - if($curapp['name'] != $prevapp) { - $prevapp = $curapp['name']; - continue; - } - if($curapp['package_status'] != PACKAGE_OUTDATED) { - $app->log($this->log_prefix.'Tagging ' . $curapp['name'] . ' ' . $curapp['version'] . '-' . $curapp['release'] . ' as outdated.'); - $app->db->query("UPDATE `aps_packages` SET `package_status` = ? WHERE `id` = ?", PACKAGE_OUTDATED, $curapp['id']); - $app->db->datalogUpdate('aps_packages', array("package_status" => PACKAGE_OUTDATED), 'id', $curapp['id']); - } - } - $res->free(); - unset($curapp); - unset($prevapp); - } - - catch(Exception $e) - { - $app->log($this->log_prefix.$e->getMessage(), LOGLEVEL_ERROR); - return false; - } - } - - - - /** - * Read in all possible packages from the interface packages folder and - * check if they are not ASP.net code (as this can't be processed). - * - * Note: There's no need to check if the packages to register are newer - * than those in the database because this already happended in startCrawler() - */ - public function parseFolderToDB() - { - global $app; - - try - { - // This method must be used in interface mode - if(!$this->interface_mode) return false; - - $pkg_list = array(); - - // Read in every package having a correct filename - $temp_handle = @dir($this->interface_pkg_dir); - if(!$temp_handle) throw new Exception('The temp directory is not accessible'); - while($folder = $temp_handle->read()) - if(substr($folder, -8) == '.app.zip') $pkg_list[] = $folder; - $temp_handle->close(); - - // If no packages are available -> exception (because at this point there should exist packages) - if(empty($pkg_list)) throw new Exception('No packages to read in'); - - // Get registered packages and mark non-existant packages with an error code to omit the install - $existing_packages = array(); - $path_query = $app->db->queryAllRecords('SELECT path AS Path FROM aps_packages'); - foreach($path_query as $path) $existing_packages[] = $path['Path']; - $diff = array_diff($existing_packages, $pkg_list); - foreach($diff as $todelete) { - $tmp = $app->db->queryOneRecord("SELECT id FROM aps_packages WHERE path = ?", $todelete); - $app->db->datalogUpdate('aps_packages', array("package_status" => PACKAGE_ERROR_NOMETA), 'id', $tmp['id']); - unset($tmp); - } - - // Register all new packages - $new_packages = array_diff($pkg_list, $existing_packages); - foreach($new_packages as $pkg) - { - // Load in meta file if existing and register its namespaces - $metafile = $this->interface_pkg_dir.'/'.$pkg.'/APP-META.xml'; - if(!file_exists($metafile)) - { - $app->log($this->log_prefix.'Cannot read metadata from '.$pkg, LOGLEVEL_ERROR); - continue; - } - - $metadata = file_get_contents($metafile); - $metadata = str_replace("xmlns=", "ns=", $metadata); - $sxe = new SimpleXMLElement($metadata); - $namespaces = $sxe->getDocNamespaces(true); - foreach($namespaces as $ns => $url) $sxe->registerXPathNamespace($ns, $url); - - // Insert the new package - $pkg_name = parent::getXPathValue($sxe, 'name'); - $pkg_category = parent::getXPathValue($sxe, '//category'); - $pkg_version = parent::getXPathValue($sxe, 'version'); - $pkg_release = parent::getXPathValue($sxe, 'release'); - //$pkg_url = $this->app_download_url_list[$pkg]; - $pkg_url = @file_get_contents($this->interface_pkg_dir.'/'.$pkg.'/PKG_URL'); - - // Insert only if data is complete - if($pkg != '' && $pkg_name != '' && $pkg_category != '' && $pkg_version != '' && $pkg_release != '' && $pkg_url){ - $insert_data = array( - "path" => $pkg, - "name" => $pkg_name, - "category" => $pkg_category, - "version" => $pkg_version, - "release" => $pkg_release, - "package_url" => $pkg_url, - "package_status" => PACKAGE_ENABLED - ); - $app->db->datalogInsert('aps_packages', $insert_data, 'id'); - } else { - if(file_exists($this->interface_pkg_dir.'/'.$pkg)) $this->removeDirectory($this->interface_pkg_dir.'/'.$pkg); - } - } - } - - catch(Exception $e) - { - $app->log($this->log_prefix.$e->getMessage(), LOGLEVEL_ERROR); - $app->error($e->getMessage()); - return false; - } - } - - - - /** - * Add missing package URLs to database - */ - public function fixURLs() - { - global $app; - - try - { - // This method must be used in interface mode - if(!$this->interface_mode) return false; - - $incomplete_pkgs = $app->db->queryAllRecords("SELECT * FROM aps_packages WHERE package_url = ?", ''); - if(is_array($incomplete_pkgs) && !empty($incomplete_pkgs)){ - foreach($incomplete_pkgs as $incomplete_pkg){ - $pkg_url = @file_get_contents($this->interface_pkg_dir.'/'.$incomplete_pkg['path'].'/PKG_URL'); - if($pkg_url != ''){ - $app->db->datalogUpdate('aps_packages', array("package_url" => $pkg_url), 'id', $incomplete_pkg['id']); - } - } - } - } - - catch(Exception $e) - { - $app->log($this->log_prefix.$e->getMessage(), LOGLEVEL_ERROR); - $app->error($e->getMessage()); - return false; - } - } - -} - -?> diff --git a/interface/lib/classes/aps_guicontroller.inc.php b/interface/lib/classes/aps_guicontroller.inc.php deleted file mode 100644 index b1ebf9d189520f667c06af8c56c3202d788635a4..0000000000000000000000000000000000000000 --- a/interface/lib/classes/aps_guicontroller.inc.php +++ /dev/null @@ -1,950 +0,0 @@ -getDocNamespaces(true); - foreach($namespaces as $ns => $url) $sxe->registerXPathNamespace($ns, $url); - - return $sxe; - } - - - - /** - * Applies a RegEx pattern onto a location path in order to secure it against - * code injections and invalid input - * - * @param $location_unfiltered the file path to secure - * @return $location - */ - private function secureLocation($location_unfiltered) - { - // Filter invalid slashes from string - $location = preg_replace(array('#/+#', '#\.+#', '#\0+#', '#\\\\+#'), - array('/', '', '', '/'), - $location_unfiltered); - - // Remove a beginning or trailing slash - if(substr($location, -1) == '/') $location = substr($location, 0, strlen($location) - 1); - if(substr($location, 0, 1) == '/') $location = substr($location, 1); - - return $location; - } - - - - /** - * Gets the CustomerID (ClientID) which belongs to a specific domain - * - * @param $domain the domain - * @return $customerid - */ - private function getCustomerIDFromDomain($domain) - { - global $app; - $customerid = 0; - - $customerdata = $app->db->queryOneRecord("SELECT client_id FROM sys_group, web_domain - WHERE web_domain.sys_groupid = sys_group.groupid - AND web_domain.domain = ?", $domain); - if(!empty($customerdata)) $customerid = $customerdata['client_id']; - - return $customerid; - } - - - - /** - * Returns the server_id for an already installed instance. Is actually - * just a little helper method to avoid redundant code - * - * @param $instanceid the instance to process - * @return $webserver_id the server_id - */ - private function getInstanceDataForDatalog($instanceid) - { - global $app; - $webserver_id = ''; - - $websrv = $app->db->queryOneRecord("SELECT server_id FROM web_domain - WHERE domain = (SELECT value FROM aps_instances_settings - WHERE name = 'main_domain' AND instance_id = ?)", $instanceid); - - // If $websrv is empty, an error has occured. Domain no longer existing? Settings table damaged? - // Anyhow, remove this instance record because it's not useful at all - if(empty($websrv)) - { - $app->db->query("DELETE FROM aps_instances WHERE id = ?", $instanceid); - $app->db->query("DELETE FROM aps_instances_settings WHERE instance_id = ?", $instanceid); - } - else $webserver_id = $websrv['server_id']; - - return $webserver_id; - } - - - - /** - * Finds out if there is a newer package version for - * a given (possibly valid) package ID - * - * @param $id the ID to check - * @return $newer_pkg_id the newer package ID - */ - public function getNewestPackageID($id) - { - global $app; - - if(preg_match('/^[0-9]+$/', $id) != 1) return 0; - - $result = $app->db->queryOneRecord("SELECT id, name, - CONCAT(version, '-', CAST(`release` AS CHAR)) AS current_version - FROM aps_packages - WHERE name = (SELECT name FROM aps_packages WHERE id = ?) - AND package_status = 2 - ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(version,'.0.0.0'),'.',4)) DESC, `release` DESC", $id); - - if(!empty($result) && ($id != $result['id'])) return $result['id']; - - return 0; - } - - /** - * Validates a given package ID - * - * @param $id the ID to check - * @param $is_admin a flag to allow locked IDs too (for admin calls) - * @return boolean - */ - public function isValidPackageID($id, $is_admin = false) - { - global $app; - - if(preg_match('/^[0-9]+$/', $id) != 1) return false; - - $sql_ext = (!$is_admin) ? - 'package_status = '.PACKAGE_ENABLED.' AND' : - '(package_status = '.PACKAGE_ENABLED.' OR package_status = '.PACKAGE_LOCKED.') AND'; - - $result = $app->db->queryOneRecord("SELECT id FROM aps_packages WHERE ".$sql_ext." id = ?", $id); - if(!$result) return false; - - return true; - } - - - - /** - * Validates a given instance ID - * - * @param $id the ID to check - * @param $client_id the calling client ID - * @param $is_admin a flag to ignore the client ID check for admins - * @return boolean - */ - public function isValidInstanceID($id, $client_id, $is_admin = false) - { - global $app; - - if(preg_match('/^[0-9]+$/', $id) != 1) return false; - - // Only filter if not admin - $params = array(); - $sql_ext = ''; - if(!$is_admin) { - $sql_ext = 'customer_id = ? AND '; - $params[] = $client_id; - } - $params[] = $id; - - $result = $app->db->queryOneRecord('SELECT id FROM aps_instances WHERE '.$sql_ext.' id = ?', true, $params); - if(!$result) return false; - - 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 = ?", $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 = ''; - - // If we are dealing with chrooted PHP-FPM, use a network connection instead because the MySQL socket file - // does not exist within the chroot. - $php_fpm_chroot = $app->db->queryOneRecord("SELECT php_fpm_chroot FROM web_domain WHERE domain_id = ?", $websrv['domain_id']); - if ($php_fpm_chroot['php_fpm_chroot'] === 'y') { - $settings['main_database_host'] = '127.0.0.1'; - $mysql_db_remote_access = 'y'; - $mysql_db_remote_ips = '127.0.0.1'; - } - } 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 = ?", $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 = ($dbname_prefix != '' ? $dbname_prefix.'aps'.$n : uniqid('aps')); - $tmp = $app->db->queryOneRecord("SELECT count(database_id) as number FROM web_database WHERE database_name = ?", $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 = ($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 = ?", $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 = ?", $settings['main_database_login']); - if(!$tmp) { - $tmppw = $app->db->queryOneRecord("SELECT PASSWORD(?) as `crypted`", $settings['main_database_password']); - $insert_data = array("sys_userid" => $websrv['sys_userid'], - "sys_groupid" => $websrv['sys_groupid'], - "sys_perm_user" => 'riud', - "sys_perm_group" => $websrv['sys_perm_group'], - "sys_perm_other" => '', - "server_id" => 0, - "database_user" => $settings['main_database_login'], - "database_user_prefix" => $dbuser_prefix, - "database_password" => $tmppw['crypted'] - ); - $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 = ?", $settings['main_database_name']); - if($tmp['number'] == 0) { - $insert_data = array("sys_userid" => $websrv['sys_userid'], - "sys_groupid" => $websrv['sys_groupid'], - "sys_perm_user" => 'riud', - "sys_perm_group" => $websrv['sys_perm_group'], - "sys_perm_other" => '', - "server_id" => $mysql_db_server_id, - "parent_domain_id" => $websrv['domain_id'], - "type" => 'mysql', - "database_name" => $settings['main_database_name'], - "database_name_prefix" => $dbname_prefix, - "database_user_id" => $mysql_db_user_id, - "database_ro_user_id" => 0, - "database_charset" => '', - "remote_access" => $mysql_db_remote_access, - "remote_ips" => $mysql_db_remote_ips, - "backup_copies" => $websrv['backup_copies'], - "backup_format_web" => $websrv['backup_format_web'], - "backup_format_db" => $websrv['backup_format_db'], - "active" => 'y', - "backup_interval" => $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 - * - * @param $settings the settings to enter into the DB - * @param $packageid the PackageID - */ - public function createPackageInstance($settings, $packageid) - { - global $app; - - $app->uses('tools_sites'); - - $webserver_id = 0; - $websrv = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain = ?", $this->getMainDomain($settings['main_domain'])); - if(!empty($websrv)) $webserver_id = $websrv['server_id']; - $customerid = $this->getCustomerIDFromDomain($this->getMainDomain($settings['main_domain'])); - - if(empty($settings) || empty($webserver_id)) return false; - - //* Get server config of the web server - $app->uses("getconf"); - $web_config = $app->getconf->get_server_config($app->functions->intval($websrv["server_id"]), 'web'); - - //* Set PHP mode to php-fcgi and enable suexec in website on apache servers / set PHP mode to PHP-FPM on nginx servers - if($web_config['server_type'] == 'apache') { - if(($websrv['php'] != 'fast-cgi' || $websrv['suexec'] != 'y') && $websrv['php'] != 'php-fpm') { - $app->db->datalogUpdate('web_domain', array("php" => 'fast-cgi', "suexec" => 'y'), 'domain_id', $websrv['domain_id']); - } - } else { - // nginx - if($websrv['php'] != 'php-fpm' && $websrv['php'] != 'fast-cgi') { - $app->db->datalogUpdate('web_domain', array("php" => 'php-fpm'), 'domain_id', $websrv['domain_id']); - } - } - - - //* Create the MySQL database for the application if necessary - $pkg = $app->db->queryOneRecord('SELECT * FROM aps_packages WHERE id = ?', $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)) { - // mysql-database-name is updated inside if not set already - if (!$this->createDatabaseForPackageInstance($settings, $websrv)) return false; - } - - //* Insert new package instance - $insert_data = array( - "sys_userid" => $websrv['sys_userid'], - "sys_groupid" => $websrv['sys_groupid'], - "sys_perm_user" => 'riud', - "sys_perm_group" => $websrv['sys_perm_group'], - "sys_perm_other" => '', - "server_id" => $webserver_id, - "customer_id" => $customerid, - "package_id" => $packageid, - "instance_status" => INSTANCE_PENDING - ); - $InstanceID = $app->db->datalogInsert('aps_instances', $insert_data, 'id'); - - //* Insert all package settings - if(is_array($settings)) { - foreach($settings as $key => $value) { - $insert_data = array( - "server_id" => $webserver_id, - "instance_id" => $InstanceID, - "name" => $key, - "value" => $value - ); - $app->db->datalogInsert('aps_instances_settings', $insert_data, 'id'); - } - } - - //* Set package status to install afetr we inserted the settings - $app->db->datalogUpdate('aps_instances', array("instance_status" => INSTANCE_INSTALL), 'id', $InstanceID); - - return $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, $keepdatabase = false) - { - global $app; - - 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 = ? LIMIT 0,1"; - $tmp = $app->db->queryOneRecord($sql, $instanceid); - 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` = ? OR `database_ro_user_id` = ?", $database_user, $database_user); - if($tmp['cnt'] < 1) $app->db->datalogDelete('web_database_user', 'database_user_id', $database_user); - } - - $app->db->datalogUpdate('aps_instances', array("instance_status" => INSTANCE_REMOVE), 'id', $instanceid); - - } - - /** - * Read the settings to be filled when installing - * - * @param $id the internal ID of the package - * @return array - */ - public function getPackageSettings($id) - { - global $app; - - $pkg = $app->db->queryOneRecord('SELECT * FROM aps_packages WHERE id = ?', $id); - - // Load in meta file if existing and register its namespaces - $metafile = $this->interface_pkg_dir.'/'.$pkg['path'].'/APP-META.xml'; - if(!file_exists($metafile)) - return array('error' => 'The metafile for '.$settings['Name'].' couldn\'t be found'); - - $sxe = $this->readInMetaFile($metafile); - - $groupsettings = parent::getXPathValue($sxe, '//settings/group/setting', true); - if(empty($groupsettings)) return array(); - - $settings = array(); - foreach($groupsettings as $setting) - { - $setting_id = strval($setting['id']); - - if($setting['type'] == 'string' || $setting['type'] == 'email' || $setting['type'] == 'integer' - || $setting['type'] == 'float' || $setting['type'] == 'domain-name') - { - $settings[] = array('SettingID' => $setting_id, - 'SettingName' => $setting->name, - 'SettingDescription' => $setting->description, - 'SettingType' => $setting['type'], - 'SettingInputType' => 'string', - 'SettingDefaultValue' => strval($setting['default-value']), - 'SettingRegex' => $setting['regex'], - 'SettingMinLength' => $setting['min-length'], - 'SettingMaxLength' => $setting['max-length']); - } - else if($setting['type'] == 'password') - { - $settings[] = array('SettingID' => $setting_id, - 'SettingName' => $setting->name, - 'SettingDescription' => $setting->description, - 'SettingType' => 'password', - 'SettingInputType' => 'password', - 'SettingDefaultValue' => '', - 'SettingRegex' => $setting['regex'], - 'SettingMinLength' => $setting['min-length'], - 'SettingMaxLength' => $setting['max-length']); - } - else if($setting['type'] == 'boolean') - { - $settings[] = array('SettingID' => $setting_id, - 'SettingName' => $setting->name, - 'SettingDescription' => $setting->description, - 'SettingType' => 'boolean', - 'SettingInputType' => 'checkbox', - 'SettingDefaultValue' => strval($setting['default-value'])); - } - else if($setting['type'] == 'enum') - { - $choices = array(); - foreach($setting->choice as $choice) - { - $choices[] = array('EnumID' => strval($choice['id']), - 'EnumName' => $choice->name); - } - $settings[] = array('SettingID' => $setting_id, - 'SettingName' => $setting->name, - 'SettingDescription' => $setting->description, - 'SettingType' => 'enum', - 'SettingInputType' => 'select', - 'SettingDefaultValue' => strval($setting['default-value']), - 'SettingChoices' => $choices); - } - } - - return $settings; - } - - - - /** - * Validates the user input according to the settings array and - * delivers errors if occurring - * - * @param $input the user $_POST array - * @param $pkg_details the package details - * @param $settings the package settings array - * @return array in this structure: - * array(2) { - * ["input"]=> ... - * ["errors"]=> ... - * } - */ - public function validateInstallerInput($postinput, $pkg_details, $domains, $settings = array()) - { - global $app; - - $ret = array(); - $input = array(); - $error = array(); - - // Main domain (obligatory) - if(isset($postinput['main_domain'])) - { - if(!in_array($postinput['main_domain'], $domains)) $error[] = $app->lng('error_main_domain'); - else $input['main_domain'] = $postinput['main_domain']; - } - else $error[] = $app->lng('error_main_domain'); - - if(isset($postinput['admin_password'])) - { - $app->uses('validate_password'); - - $passwordError = $app->validate_password->password_check('', $postinput['admin_password'], ''); - if ($passwordError) { - $error[] = $passwordError; - } - } - - // Main location (not obligatory but must be supplied) - if(isset($postinput['main_location'])) - { - $temp_errstr = ''; - // It can be empty but if the user did write something, check it - $userinput = false; - if(strlen($postinput['main_location']) > 0) $userinput = true; - - // Filter invalid input slashes (twice!) - $main_location = $this->secureLocation($postinput['main_location']); - $main_location = $this->secureLocation($main_location); - // Only allow digits, words, / and - - $main_location = preg_replace("/[^\d\w\/\-]/i", "", $main_location); - if($userinput && (strlen($main_location) == 0)) $temp_errstr = $app->lng('error_inv_main_location'); - - // Find out document_root and make sure no apps are installed twice to one location - if(in_array($postinput['main_domain'], $domains)) - { - $docroot = $app->db->queryOneRecord("SELECT document_root, web_folder FROM web_domain - WHERE domain = ?", $this->getMainDomain($postinput['main_domain'])); - if(trim($docroot['web_folder']) == '') { - $new_path = $docroot['document_root']; - } else { - $new_path = $docroot['document_root'] . '/' . $docroot['web_folder']; - } - if(substr($new_path, -1) != '/') $new_path .= '/'; - $new_path .= $main_location; - - // Get the $customerid which belongs to the selected domain - $customerid = $this->getCustomerIDFromDomain($this->getMainDomain($postinput['main_domain'])); - - // First get all domains used for an install, then their loop them - // and get the corresponding document roots as well as the defined - // locations. If an existing doc_root + location matches with the - // new one -> error - $instance_domains = $app->db->queryAllRecords("SELECT instance_id, s.value AS domain - FROM aps_instances AS i, aps_instances_settings AS s - WHERE i.id = s.instance_id AND s.name = 'main_domain' - AND i.customer_id = ?", $customerid); - for($i = 0; $i < count($instance_domains); $i++) - { - $used_path = ''; - - $doc_root = $app->db->queryOneRecord("SELECT document_root FROM web_domain - WHERE domain = ?", $instance_domains[$i]['domain']); - - // Probably the domain settings were changed later, so make sure the doc_root - // is not empty for further validation - if(!empty($doc_root)) - { - $used_path = $doc_root['document_root']; - if(substr($used_path, -1) != '/') $used_path .= '/'; - - $location_for_domain = $app->db->queryOneRecord("SELECT value - FROM aps_instances_settings WHERE name = 'main_location' - AND instance_id = ?", $instance_domains[$i]['instance_id']); - - // The location might be empty but the DB return must not be false! - if($location_for_domain) $used_path .= $location_for_domain['value']; - - // If user is trying to install into exactly the same path, give an error - if($new_path == $used_path) - { - $temp_errstr = $app->lng('error_used_location'); - break; - } - - // If the new path is _below_ an existing path, give an error because the - // installation will delete the files of the existing APS installation - if (mb_substr($used_path, 0, mb_strlen($new_path)) === $new_path) { - $temp_errstr = $app->lng('error_used_location'); - break; - } - - // If the new path is _within_ an existing path, give an error. Even if - // installation would proceed fine in theory, deleting the "lower" package - // in the future would also inadvertedly delete the "nested" package - if (mb_substr($new_path, 0, mb_strlen($used_path)) === $used_path) { - $temp_errstr = $app->lng('error_used_location'); - break; - } - } - } - } - else $temp_errstr = $app->lng('error_main_domain'); - - if($temp_errstr == '') $input['main_location'] = htmlspecialchars($main_location); - else $error[] = $temp_errstr; - } - else $error[] = $app->lng('error_no_main_location'); - - // License (the checkbox must be set) - if(isset($pkg_details['License need agree']) - && $pkg_details['License need agree'] == 'true') - { - if(isset($postinput['license']) && $postinput['license'] == 'on') $input['license'] = 'true'; - else $error[] = $app->lng('error_license_agreement'); - } - - // Database - 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'); - else if(strlen($postinput['main_database_password']) > 8) - $input['main_database_password'] = htmlspecialchars($postinput['main_database_password']); - else $error[] = $app->lng('error_short_database_pw'); - } - else $error[] = $app->lng('error_no_database_pw'); - } - - // Validate the package settings - foreach($settings as $setting) - { - $temp_errstr = ''; - $setting_id = strval($setting['SettingID']); - - // We assume that every setting must be set - if((isset($postinput[$setting_id]) && ($postinput[$setting_id] != '')) - || ($setting['SettingType'] == 'boolean')) - { - if($setting['SettingType'] == 'string' || $setting['SettingType'] == 'password') - { - if($app->functions->intval($setting['SettingMinLength'], true) != 0 - && strlen($postinput[$setting_id]) < $app->functions->intval($setting['SettingMinLength'], true)) - $temp_errstr = sprintf($app->lng('error_short_value_for'), $setting['setting_name']); - - if($app->functions->intval($setting['SettingMaxLength'], true) != 0 - && strlen($postinput[$setting_id]) > $app->functions->intval($setting['SettingMaxLength'], true)) - $temp_errstr = sprintf($app->lng('error_long_value_for'), $setting['setting_name']); - - if(isset($setting['SettingRegex']) - && !preg_match("/".$setting['SettingRegex']."/", $postinput[$setting_id])) - $temp_errstr = sprintf($app->lng('error_inv_value_for'), $setting['setting_name']); - } - else if($setting['SettingType'] == 'email') - { - if(filter_var(strtolower($postinput[$setting_id]), FILTER_VALIDATE_EMAIL) === false) - $temp_errstr = sprintf($app->lng('error_inv_email_for'), $setting['setting_name']); - } - else if($setting['SettingType'] == 'domain-name') - { - if(!preg_match("^(http|https)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\?\'\\\+&%\$#\=~_\-]+))*$", - $postinput[$setting_id])) - $temp_errstr = sprintf($app->lng('error_inv_domain_for'), $setting['setting_name']); - } - else if($setting['SettingType'] == 'integer') - { - if(filter_var($postinput[$setting_id], FILTER_VALIDATE_INT) === false) - $temp_errstr = sprintf($app->lng('error_inv_integer_for'), $setting['setting_name']); - } - else if($setting['SettingType'] == 'float') - { - if(filter_var($postinput[$setting_id], FILTER_VALIDATE_FLOAT) === false) - $temp_errstr = sprintf($app->lng('error_inv_float_for'), $setting['setting_name']); - } - else if($setting['SettingType'] == 'boolean') - { - // If we have a boolean value set, it must be either true or false - if(!isset($postinput[$setting_id])) $postinput[$setting_id] = 'false'; - else if(isset($postinput[$setting_id]) && $postinput[$setting_id] != 'true') - $postinput[$setting_id] = 'true'; - } - else if($setting['SettingType'] == 'enum') - { - $found = false; - for($i = 0; $i < count($setting['SettingChoices']); $i++) - { - if($setting['SettingChoices'][$i]['EnumID'] == $postinput[$setting_id]) - $found = true; - } - if(!$found) $temp_errstr = sprintf($app->lng('error_inv_value_for'), $setting['SettingName']); - } - - if($temp_errstr == '') $input[$setting_id] = $postinput[$setting_id]; - else $error[] = $temp_errstr; - } - else $error[] = sprintf($app->lng('error_no_value_for'), $setting['SettingName']); - } - - $ret['input'] = $input; - $ret['error'] = array_unique($error); - - return $ret; - } - - - - /** - * Read the metadata of a package and returns some content - * - * @param $id the internal ID of the package - * @return array - */ - public function getPackageDetails($id) - { - global $app; - - $pkg = $app->db->queryOneRecord('SELECT * FROM aps_packages WHERE id = ?', $id); - - // Load in meta file if existing and register its namespaces - $metafile = $this->interface_pkg_dir.'/'.$pkg['path'].'/APP-META.xml'; - if(!file_exists($metafile)) - return array('error' => 'The metafile for '.$pkg['name'].' couldn\'t be found'); - - $metadata = file_get_contents($metafile); - $metadata = str_replace("xmlns=", "ns=", $metadata); - $sxe = new SimpleXMLElement($metadata); - $namespaces = $sxe->getDocNamespaces(true); - foreach($namespaces as $ns => $url) $sxe->registerXPathNamespace($ns, $url); - - $pkg['Summary'] = htmlspecialchars(parent::getXPathValue($sxe, '//summary')); - $pkg['Homepage'] = parent::getXPathValue($sxe, '//homepage'); - $pkg['Description'] = nl2br(htmlspecialchars(trim(parent::getXPathValue($sxe, '//description')))); - $pkg['Config script'] = strtoupper(parent::getXPathValue($sxe, '//configuration-script-language')); - $installed_size = parent::getXPathValue($sxe, '//installed-size'); - $pkg['Installed Size'] = (!empty($installed_size)) ? parent::convertSize((int)$installed_size) : ''; - - // License - $pkg['License need agree'] = parent::getXPathValue($sxe, '//license/@must-accept'); - $pkg['License name'] = parent::getXPathValue($sxe, '//license/text/name'); // might be empty - $pkg['License type'] = 'file'; // default type - $pkg['License content'] = ''; // default license filename on local system - $license_url = parent::getXPathValue($sxe, '//license/text/url'); - if(!empty($license_url)) - { - $pkg['License type'] = 'url'; - $pkg['License content'] = htmlspecialchars($license_url); - } - else - { - $lic = @file_get_contents($this->interface_pkg_dir.'/'.$pkg['path'].'/LICENSE'); - $pkg['License content'] = htmlentities($lic, ENT_QUOTES, 'ISO-8859-1'); - } - - // Languages - $languages = parent::getXPathValue($sxe, '//languages/language', true); - $pkg['Languages'] = (is_array($languages)) ? implode(' ', $languages) : ''; - - // Icon - $icon = parent::getXPathValue($sxe, '//icon/@path'); - if(!empty($icon)) - { - // Using parse_url() to filter malformed URLs - $path = dirname(parse_url($_SERVER['PHP_SELF'], PHP_URL_PATH)).'/'. - basename($this->interface_pkg_dir).'/'.$pkg['path'].'/'.basename((string)$icon); - // nginx: if $_SERVER['PHP_SELF'] is doubled, remove /sites/aps_packagedetails_show.php from beginning of path - $path = preg_replace('@^/sites/aps_packagedetails_show.php(.*)@', '$1', $path); - $pkg['Icon'] = $path; - } - else $pkg['Icon'] = ''; - - // Screenshots - $screenshots = parent::getXPathValue($sxe, '//screenshot', true); - if(!empty($screenshots)) - { - foreach($screenshots as $screen) - { - // Using parse_url() to filter malformed URLs - $path = dirname(parse_url($_SERVER['PHP_SELF'], PHP_URL_PATH)).'/'. - basename($this->interface_pkg_dir).'/'.$pkg['path'].'/'.basename((string)$screen['path']); - // nginx: if $_SERVER['PHP_SELF'] is doubled, remove /sites/aps_packagedetails_show.php from beginning of path - $path = preg_replace('@^/sites/aps_packagedetails_show.php(.*)@', '$1', $path); - - $pkg['Screenshots'][] = array('ScreenPath' => $path, - 'ScreenDescription' => htmlspecialchars(trim((string)$screen->description))); - } - } - else $pkg['Screenshots'] = ''; // if no screenshots are available, set the variable though - - // Changelog - $changelog = parent::getXPathValue($sxe, '//changelog/version', true); - if(!empty($changelog)) - { - foreach($changelog as $change) - { - $entries = array(); - foreach($change->entry as $entry) $entries[] = htmlspecialchars(trim((string)$entry)); - - $pkg['Changelog'][] = array('ChangelogVersion' => (string)$change['version'], - 'ChangelogDescription' => implode('
', $entries)); - } - } - - else $pkg['Changelog'] = ''; - - // PHP extensions - $php_extensions = parent::getXPathValue($sxe, '//php:extension', true); - $php_ext = ''; - if(!empty($php_extensions)) - { - foreach($php_extensions as $extension) - { - if(strtolower($extension) == 'php') continue; - $php_ext .= $extension.' '; - } - } - $pkg['Requirements PHP extensions'] = trim($php_ext); - - // PHP bool options - $pkg['Requirements PHP settings'] = array(); - $php_bool_options = array('allow-url-fopen', 'file-uploads', 'magic-quotes-gpc', - 'register-globals', 'safe-mode', 'short-open-tag'); - foreach($php_bool_options as $option) - { - $value = parent::getXPathValue($sxe, '//php:'.$option); - if(!empty($value)) - { - $option = str_replace('-', '_', $option); - $value = str_replace(array('false', 'true'), array('off', 'on'), $value); - $pkg['Requirements PHP settings'][] = array('PHPSettingName' => $option, - 'PHPSettingValue' => $value); - } - } - - // PHP integer value settings - $memory_limit = parent::getXPathValue($sxe, '//php:memory-limit'); - if(!empty($memory_limit)) - $pkg['Requirements PHP settings'][] = array('PHPSettingName' => 'memory_limit', - 'PHPSettingValue' => parent::convertSize((int)$memory_limit)); - - $max_exec_time = parent::getXPathValue($sxe, '//php:max-execution-time'); - if(!empty($max_exec_time)) - $pkg['Requirements PHP settings'][] = array('PHPSettingName' => 'max-execution-time', - 'PHPSettingValue' => $max_exec_time); - - $post_max_size = parent::getXPathValue($sxe, '//php:post-max-size'); - if(!empty($post_max_size)) - $pkg['Requirements PHP settings'][] = array('PHPSettingName' => 'post_max_size', - 'PHPSettingValue' => parent::convertSize((int)$post_max_size)); - - // Get supported PHP versions - $pkg['Requirements Supported PHP versions'] = ''; - $php_min_version = parent::getXPathValue($sxe, '//php:version/@min'); - $php_max_not_including = parent::getXPathValue($sxe, '//php:version/@max-not-including'); - if(!empty($php_min_version) && !empty($php_max_not_including)) - $pkg['Requirements Supported PHP versions'] = $php_min_version.' - '.$php_max_not_including; - else if(!empty($php_min_version)) - $pkg['Requirements Supported PHP versions'] = '> '.$php_min_version; - else if(!empty($php_max_not_including)) - $pkg['Requirements Supported PHP versions'] = '< '.$php_min_version; - - // Database - $db_id = parent::getXPathValue($sxe, '//db:id'); - $db_server_type = parent::getXPathValue($sxe, '//db:server-type'); - $db_min_version = parent::getXPathValue($sxe, '//db:server-min-version'); - if(!empty($db_id)) - { - $db_server_type = str_replace('postgresql', 'PostgreSQL', $db_server_type); - $db_server_type = str_replace('microsoft:sqlserver', 'MSSQL', $db_server_type); - $db_server_type = str_replace('mysql', 'MySQL', $db_server_type); - - $pkg['Requirements Database'] = $db_server_type; - if(!empty($db_min_version)) $pkg['Requirements Database'] .= ' > '.$db_min_version; - } - else $pkg['Requirements Database'] = ''; - - return $pkg; - } - -} - -?> diff --git a/interface/lib/classes/db_mysql.inc.php b/interface/lib/classes/db_mysql.inc.php index feab66cd936bbbbb8df15d49e39c9564fb13e6b0..429b5099881341046dc21f53cd6d84d38e11f2ab 100644 --- a/interface/lib/classes/db_mysql.inc.php +++ b/interface/lib/classes/db_mysql.inc.php @@ -258,7 +258,7 @@ class db private function _query($sQuery = '') { global $app; - + $aArgs = func_get_args(); if ($sQuery == '') { @@ -354,7 +354,7 @@ class db * @return array result row or NULL if none found */ public function queryOneRecord($sQuery = '') { - + $aArgs = func_get_args(); if(!empty($aArgs)) { $sQuery = array_shift($aArgs); @@ -363,7 +363,7 @@ class db } array_unshift($aArgs, $sQuery); } - + $oResult = call_user_func_array([&$this, 'query'], $aArgs); if(!$oResult) return null; @@ -750,7 +750,7 @@ class db foreach($insert_data as $key => $val) { $key_str .= '??,'; $params[] = $key; - + $val_str .= '?,'; $v_params[] = $val; } @@ -764,7 +764,7 @@ class db $this->query("INSERT INTO ?? $insert_data_str", $tablename); $app->log("deprecated use of passing values to datalogInsert() - table " . $tablename, 1); } - + $old_rec = array(); $index_value = $this->insertID(); if(!$index_value && isset($insert_data[$index_field])) { @@ -848,7 +848,7 @@ class db $result = $this->queryAllRecords("SELECT COUNT( * ) AS cnt, sys_datalog.action, sys_datalog.dbtable FROM sys_datalog, server WHERE server.server_id = sys_datalog.server_id AND sys_datalog.user = ? AND sys_datalog.datalog_id > server.updated GROUP BY sys_datalog.dbtable, sys_datalog.action", $login); foreach($result as $row) { - if(!$row['dbtable'] || in_array($row['dbtable'], array('aps_instances', 'aps_instances_settings', 'mail_access', 'mail_content_filter'))) continue; // ignore some entries, maybe more to come + if(!$row['dbtable'] || in_array($row['dbtable'], array('mail_access', 'mail_content_filter'))) continue; // ignore some entries, maybe more to come $return['entries'][] = array('table' => $row['dbtable'], 'action' => $row['action'], 'count' => $row['cnt'], 'text' => $app->lng('datalog_status_' . $row['action'] . '_' . $row['dbtable'])); $return['count'] += $row['cnt']; } unset($result); diff --git a/interface/lib/classes/remote.d/aps.inc.php b/interface/lib/classes/remote.d/aps.inc.php deleted file mode 100644 index c2f8789ed132f94d53d3b67168df2cb3cbc0ec22..0000000000000000000000000000000000000000 --- a/interface/lib/classes/remote.d/aps.inc.php +++ /dev/null @@ -1,359 +0,0 @@ - -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_list')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - - $app->load('aps_crawler'); - - $aps = new ApsCrawler($app, true); // true = Interface mode, false = Server mode - $aps->startCrawler(); - $aps->parseFolderToDB(); - $aps->fixURLs(); - - return true; - } - - public function sites_aps_available_packages_list($session_id, $params = array()) - { - global $app; - - if(!$this->checkPerm($session_id, 'sites_aps_available_packages_list')) { - throw new SoapFault('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')) { - throw new SoapFault('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 - throw new SoapFault('package_error', 'The given Package ID is not valid.'); - return false; - } - - // Get package details - $details = $gui->getPackageDetails($primary_id); - if (isset($details['error'])) { - throw new SoapFault('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')) { - throw new SoapFault('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 - throw new SoapFault('package_error', 'The given Package ID is not valid.'); - return false; - } - - // Get package details - $details = $gui->getPackageDetails($primary_id); - if (isset($details['error'])) { - throw new SoapFault('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) { - throw new SoapFault('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')) { - throw new SoapFault('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 - throw new SoapFault('package_error', 'The given Package ID is not valid.'); - return false; - } - - // Get package settings - $settings = $gui->getPackageSettings($primary_id); - if (isset($settings['error'])) { - throw new SoapFault('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_change_package_status($session_id, $primary_id, $params) - { - global $app; - - if(!$this->checkPerm($session_id, 'sites_aps_change_package_status')) { - throw new SoapFault('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 - throw new SoapFault('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))) { - throw new SoapFault('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; - - if(!$this->checkPerm($session_id, 'sites_aps_install_package')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - - $app->uses('remoting_lib'); - $app->remoting_lib->loadUserProfile(0); - - $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 - throw new SoapFault('package_error', 'The given Package ID is not valid.'); - return false; - } - - // Get package details - $details = $gui->getPackageDetails($primary_id); - if (isset($details['error'])) { - throw new SoapFault('package_error', $details['error']); - return false; - } - $settings = $gui->getPackageSettings($primary_id); - if (isset($settings['error'])) { - throw new SoapFault('package_error', $settings['error']); - return false; - } - - // Check given Site/VHostDomain - if (!isset($params['main_domain'])) { - throw new SoapFault('invalid parameters', 'No valid domain given.'); - return false; - } - - if (substr($params['main_domain'], 0, 4) == 'www.') { - $domain = substr($params['main_domain'], 4); - $sql = "SELECT * FROM web_domain WHERE domain = ? AND subdomain=?"; - $domain = $app->db->queryOneRecord($sql, $domain, 'www'); - } - else { - $sql = "SELECT * FROM web_domain WHERE domain = ?"; - $domain = $app->db->queryOneRecord($sql, $params['main_domain']); - } - - if (!$domain) { - throw new SoapFault('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); - } - - throw new SoapFault('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')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - - $sql = "SELECT * FROM aps_instances WHERE id = ?"; - $result = $app->db->queryOneRecord($sql, $app->functions->intval($primary_id)); - return $result; - } - - public function sites_aps_instance_settings_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'sites_aps_instance_get')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - - $sql = "SELECT * FROM aps_instances_settings WHERE instance_id = ?"; - $result = $app->db->queryAllRecords($sql, $app->functions->intval($primary_id)); - 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')) { - throw new SoapFault('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 = ?"; - $result = $app->db->queryOneRecord($sql, $primary_id); - - if (!$result) { - throw new SoapFault('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 56dc825fd41b75b6acc03d9e07824f30b5150919..9c534af78403942de72c291bf240d6615ee97c4a 100644 --- a/interface/lib/plugins/sites_web_vhost_domain_plugin.inc.php +++ b/interface/lib/plugins/sites_web_vhost_domain_plugin.inc.php @@ -192,19 +192,9 @@ class sites_web_vhost_domain_plugin { unset($records); unset($rec); - // Update APS instances - $records = $app->db->queryAllRecords("SELECT instance_id FROM aps_instances_settings WHERE name = 'main_domain' AND value = ?", $page_form->oldDataRecord["domain"]); - if(is_array($records) && !empty($records)){ - foreach($records as $rec){ - $app->db->datalogUpdate('aps_instances', array("sys_userid" => $web_rec['sys_userid'], "sys_groupid" => $web_rec['sys_groupid'], "customer_id" => $client_id), 'id', $rec['instance_id']); - } - } - unset($records); - unset($rec); - } - //* If the domain name has been changed, we will have to change all subdomains + APS instances + //* If the domain name has been changed, we will have to change all subdomains if(!empty($page_form->dataRecord["domain"]) && !empty($page_form->oldDataRecord["domain"]) && $app->functions->idn_encode($page_form->dataRecord["domain"]) != $page_form->oldDataRecord["domain"]) { //* Change SSL Domain $tmp=$app->db->queryOneRecord("SELECT ssl_domain FROM web_domain WHERE domain_id = ?", $page_form->id); @@ -221,16 +211,6 @@ class sites_web_vhost_domain_plugin { unset($records); unset($rec); unset($subdomain); - - // Update APS instances - $records = $app->db->queryAllRecords("SELECT id, instance_id FROM aps_instances_settings WHERE name = 'main_domain' AND value = ?", $page_form->oldDataRecord["domain"]); - if(is_array($records) && !empty($records)){ - foreach($records as $rec){ - $app->db->datalogUpdate('aps_instances_settings', array("value" => $app->functions->idn_encode($page_form->dataRecord["domain"])), 'id', $rec['id']); - } - } - unset($records); - unset($rec); } //* Set allow_override if empty diff --git a/interface/web/admin/lib/lang/br_remote_user.lng b/interface/web/admin/lib/lang/br_remote_user.lng index 520b95e18f4caf7fe7609586b22452416d15eaf4..5f13e479c631b51ab726d881a4475e7957d07a29 100644 --- a/interface/web/admin/lib/lang/br_remote_user.lng +++ b/interface/web/admin/lib/lang/br_remote_user.lng @@ -41,7 +41,6 @@ $wb['Sites Domain functions'] = 'Funções de domínios de sites'; $wb['Sites Backup functions'] = 'Funções de backup de sites'; $wb['Sites Aliasdomain functions'] = 'Funções de alias de domínios de sites'; $wb['Sites Subdomain functions'] = 'Funções de subdomínios de sites'; -$wb['Sites APS functions'] = 'Funções de apps e complementos'; $wb['Sites WebDAV-User functions'] = 'Funções de usuários webdav'; $wb['DNS zone functions'] = 'Funções de zonas dns'; $wb['DNS a functions'] = 'Funções de registro A dns'; diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php index 523507b108a981ad24c6315488a45479c4e955c9..f7a93d36e86d9da81cc4a79537a9c2bc9a6f550a 100644 --- a/interface/web/client/form/client.tform.php +++ b/interface/web/client/form/client.tform.php @@ -1502,20 +1502,6 @@ $form["tabs"]['limits'] = array ( 'valuelimit' => 'client:limit_openvz_vm_template_id', 'value' => array(0 => ' ') ), - 'limit_aps' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_aps_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), //################################# // END Datatable fields //################################# diff --git a/interface/web/client/form/client_template.tform.php b/interface/web/client/form/client_template.tform.php index 4a3405bbe5f622a8fce3328a3d16156626269021..2418194dee462b701df0d055bc917f95f1aa41c6 100644 --- a/interface/web/client/form/client_template.tform.php +++ b/interface/web/client/form/client_template.tform.php @@ -906,20 +906,6 @@ $form["tabs"]['limits'] = array ( 'valuelimit' => 'client:limit_openvz_vm_template_id', 'value' => array(0 => ' ') ), - 'limit_aps' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_aps_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), 'limit_domainmodule' => array ( 'datatype' => 'INTEGER', 'formtype' => 'TEXT', diff --git a/interface/web/client/form/reseller.tform.php b/interface/web/client/form/reseller.tform.php index 174c18081df4ff04139ec21642e045d71c1d899a..769cbbcac26f597cf6be45bb6c37be7b523fdccc 100644 --- a/interface/web/client/form/reseller.tform.php +++ b/interface/web/client/form/reseller.tform.php @@ -1481,20 +1481,6 @@ $form["tabs"]['limits'] = array ( ), 'value' => array(0 => ' ') ), - 'limit_aps' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_aps_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), 'customer_no_template' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', diff --git a/interface/web/client/lib/lang/ar_client.lng b/interface/web/client/lib/lang/ar_client.lng index 2fcd02606f3472c42252bb5d18b434717993f9cd..6644df08bc2c5c98c20d847991d8175850462250 100644 --- a/interface/web/client/lib/lang/ar_client.lng +++ b/interface/web/client/lib/lang/ar_client.lng @@ -142,9 +142,6 @@ $wb['customer_no_error_unique'] = 'The customer no. must be unique (or empty).'; $wb['paypal_email_error_isemail'] = 'Please enter a valid PayPal email address.'; $wb['paypal_email_txt'] = 'PayPal Email'; $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; -$wb['aps_limits_txt'] = 'APS Installer Limits'; -$wb['limit_aps_txt'] = 'Max. number of APS instances'; -$wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; $wb['default_slave_dnsserver_txt'] = 'Default Secondary DNS Server'; $wb['locked_txt'] = 'Locked (disables everything except DNS)'; $wb['canceled_txt'] = 'Canceled (disables client login)'; diff --git a/interface/web/client/lib/lang/ar_client_template.lng b/interface/web/client/lib/lang/ar_client_template.lng index eb073b00e527789a9eddb1c92812bac751c3163a..419f18935fe621d6c2b5182efab81b9a8c19b6ba 100644 --- a/interface/web/client/lib/lang/ar_client_template.lng +++ b/interface/web/client/lib/lang/ar_client_template.lng @@ -85,9 +85,6 @@ $wb['database_limits_txt'] = 'Database Limits'; $wb['cron_job_limits_txt'] = 'Cron Job Limits'; $wb['dns_limits_txt'] = 'DNS Limits'; $wb['virtualization_limits_txt'] = 'Virtualization Limits'; -$wb['aps_limits_txt'] = 'APS Installer Limits'; -$wb['limit_aps_txt'] = 'Max. number of APS instances'; -$wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; $wb['client_limits_txt'] = 'Client Limits'; $wb['default_mailserver_txt'] = 'Default Mailserver'; diff --git a/interface/web/client/lib/lang/ar_reseller.lng b/interface/web/client/lib/lang/ar_reseller.lng index 333c8bdb96cf18be0d11e582bcfde3b1aecd57a8..4a04ada426e017b7813e83b454b415371d894791 100644 --- a/interface/web/client/lib/lang/ar_reseller.lng +++ b/interface/web/client/lib/lang/ar_reseller.lng @@ -141,9 +141,6 @@ $wb['bank_code_txt'] = 'Bank code'; $wb['bank_name_txt'] = 'Bank name'; $wb['bank_account_iban_txt'] = 'IBAN'; $wb['bank_account_swift_txt'] = 'BIC / Swift'; -$wb['aps_limits_txt'] = 'APS Installer Limits'; -$wb['limit_aps_txt'] = 'Max. number of APS instances'; -$wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; $wb['default_slave_dnsserver_txt'] = 'Default Secondary DNS Server'; $wb['locked_txt'] = 'Locked'; $wb['canceled_txt'] = 'Canceled'; diff --git a/interface/web/client/lib/lang/bg_client.lng b/interface/web/client/lib/lang/bg_client.lng index dcaba08f8b8576bec2bc52805df75341325dbbac..a48e9de66eed4b5d030132f4e1230f098792e921 100644 --- a/interface/web/client/lib/lang/bg_client.lng +++ b/interface/web/client/lib/lang/bg_client.lng @@ -142,9 +142,6 @@ $wb['customer_no_error_unique'] = 'The customer no. must be unique (or empty).'; $wb['paypal_email_error_isemail'] = 'Please enter a valid PayPal email address.'; $wb['paypal_email_txt'] = 'PayPal Email'; $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; -$wb['aps_limits_txt'] = 'APS Installer Limits'; -$wb['limit_aps_txt'] = 'Max. number of APS instances'; -$wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; $wb['default_slave_dnsserver_txt'] = 'Default Secondary DNS Server'; $wb['locked_txt'] = 'Locked (disables everything except DNS)'; $wb['canceled_txt'] = 'Canceled (disables client login)'; diff --git a/interface/web/client/lib/lang/bg_client_template.lng b/interface/web/client/lib/lang/bg_client_template.lng index 82c6c582a10e59b51e27c91a5e55d565495bb34a..b7312c150eb3052f0727f6afd1d62ee5f2a49e55 100644 --- a/interface/web/client/lib/lang/bg_client_template.lng +++ b/interface/web/client/lib/lang/bg_client_template.lng @@ -85,9 +85,6 @@ $wb['force_suexec_txt'] = 'SuEXEC forced'; $wb['limit_hterror_txt'] = 'Custom error docs available'; $wb['limit_wildcard_txt'] = 'Wildcard subdomain available'; $wb['limit_ssl_txt'] = 'SSL available'; -$wb['aps_limits_txt'] = 'APS Installer Limits'; -$wb['limit_aps_txt'] = 'Max. number of APS instances'; -$wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; $wb['client_limits_txt'] = 'Client Limits'; $wb['default_mailserver_txt'] = 'Default Mailserver'; diff --git a/interface/web/client/lib/lang/bg_reseller.lng b/interface/web/client/lib/lang/bg_reseller.lng index 528b2c7897efa1989b61e0d2af7e140ef0bd9e1d..cde60d491130045c18ff0290737ea70e8842b472 100644 --- a/interface/web/client/lib/lang/bg_reseller.lng +++ b/interface/web/client/lib/lang/bg_reseller.lng @@ -141,9 +141,6 @@ $wb['bank_code_txt'] = 'Bank code'; $wb['bank_name_txt'] = 'Bank name'; $wb['bank_account_iban_txt'] = 'IBAN'; $wb['bank_account_swift_txt'] = 'BIC / Swift'; -$wb['aps_limits_txt'] = 'APS Installer Limits'; -$wb['limit_aps_txt'] = 'Max. number of APS instances'; -$wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; $wb['default_slave_dnsserver_txt'] = 'Default Secondary DNS Server'; $wb['locked_txt'] = 'Locked'; $wb['canceled_txt'] = 'Canceled'; diff --git a/interface/web/client/lib/lang/br_client.lng b/interface/web/client/lib/lang/br_client.lng index 46ad85698b8d8d49d22ecfd4de9cece5aa717be6..65adc19f70887d677b8e9555221dc77e01d4e845 100644 --- a/interface/web/client/lib/lang/br_client.lng +++ b/interface/web/client/lib/lang/br_client.lng @@ -146,9 +146,6 @@ $wb['customer_no_error_unique'] = 'O código do cliente deve ser exclusivo ou n $wb['paypal_email_error_isemail'] = 'Por favor, insira um e-mail do PayPal válido.'; $wb['paypal_email_txt'] = 'e-Mail do PayPal'; $wb['err_msg_master_tpl_set'] = 'Todas as configurações de limites serão ignoradas se for selecionado a opção de gabarito personalizado.'; -$wb['aps_limits_txt'] = 'Limites de instalações de APPs'; -$wb['limit_aps_txt'] = 'Limite de instâncias de APPs'; -$wb['limit_aps_error_notint'] = 'O limite de instâncias de APPs deve ser um número.'; $wb['default_slave_dnsserver_txt'] = 'Servidor dns secundário padrão'; $wb['locked_txt'] = 'Locked (disables everything except DNS)'; $wb['canceled_txt'] = 'Cancelado (desabilita o acesso do cliente.)'; diff --git a/interface/web/client/lib/lang/br_client_template.lng b/interface/web/client/lib/lang/br_client_template.lng index c09c622bb2794a0cdf689ea31849ee75da65cf92..e44fb2cf9a5e1596fd11693c8cb9018a432179af 100644 --- a/interface/web/client/lib/lang/br_client_template.lng +++ b/interface/web/client/lib/lang/br_client_template.lng @@ -92,9 +92,6 @@ $wb['database_limits_txt'] = 'Limites de banco de dados'; $wb['cron_job_limits_txt'] = 'Limite de tarefas no cron'; $wb['dns_limits_txt'] = 'Limites de DNS'; $wb['virtualization_limits_txt'] = 'Limites de virtualização'; -$wb['aps_limits_txt'] = 'Limites de instalações de aplicações - APPs'; -$wb['limit_aps_txt'] = 'Limite de instâncias para APPs'; -$wb['limit_aps_error_notint'] = 'O limite de instância para APPs deve ser um número.'; $wb['limit_domainmodule_txt'] = 'Limites de módulos de domínio'; $wb['client_limits_txt'] = 'Limites de clientes'; $wb['limit_database_quota_txt'] = 'Cotas de banco de dados'; diff --git a/interface/web/client/lib/lang/br_reseller.lng b/interface/web/client/lib/lang/br_reseller.lng index 322235d36b21299c2bf22c464da498bd92a613fd..b077f07b96df9d18b037c6526552a689272608ad 100644 --- a/interface/web/client/lib/lang/br_reseller.lng +++ b/interface/web/client/lib/lang/br_reseller.lng @@ -144,9 +144,6 @@ $wb['bank_code_txt'] = 'Código do banco'; $wb['bank_name_txt'] = 'Nome do banco'; $wb['bank_account_iban_txt'] = 'IBAN'; $wb['bank_account_swift_txt'] = 'BIC/Swift'; -$wb['aps_limits_txt'] = 'Limites de instaladores de APPs'; -$wb['limit_aps_txt'] = 'Limite de instâncias de APPs'; -$wb['limit_aps_error_notint'] = 'O limite de instâncias de APPs deve ser um número.'; $wb['default_slave_dnsserver_txt'] = 'Servidor DNS secundário padrão'; $wb['locked_txt'] = 'Bloqueado'; $wb['canceled_txt'] = 'Cancelado'; diff --git a/interface/web/client/lib/lang/ca_client.lng b/interface/web/client/lib/lang/ca_client.lng index e4cc2f2dbe8abe53e47b862059d98c0a6ed859ec..0161fcb9da10dfd91170cc5afa55e3b953466dda 100644 --- a/interface/web/client/lib/lang/ca_client.lng +++ b/interface/web/client/lib/lang/ca_client.lng @@ -140,9 +140,6 @@ $wb['customer_no_error_unique'] = 'Le numéro client doit être unique (ou vide) $wb['paypal_email_error_isemail'] = 'Saisissez un compte Paypal valide.'; $wb['paypal_email_txt'] = 'Compte Paypal'; $wb['err_msg_master_tpl_set'] = 'Les paramètres de limites personnalisés seront ignorés si un modèle maître autre que \\"custom\\" est sélectionné.'; -$wb['aps_limits_txt'] = 'Nombre max d\'Installeur APS'; -$wb['limit_aps_txt'] = 'Nombre max d\'instances APS'; -$wb['limit_aps_error_notint'] = 'La limite d\'instances APS doit être un nombre'; $wb['default_slave_dnsserver_txt'] = 'Serveur DNS secondaire par défaut'; $wb['locked_txt'] = 'Locked (disables everything except DNS)'; $wb['canceled_txt'] = 'Canceled (Désactive connexion Ispconfig)'; diff --git a/interface/web/client/lib/lang/ca_client_template.lng b/interface/web/client/lib/lang/ca_client_template.lng index 6827753b5707b1043e0708242847fa3dbfb78a2d..5fc062e10f9f4a19ca4819213dcbe5a69e314286 100644 --- a/interface/web/client/lib/lang/ca_client_template.lng +++ b/interface/web/client/lib/lang/ca_client_template.lng @@ -84,9 +84,6 @@ $wb['database_limits_txt'] = 'Limite de bases de données'; $wb['cron_job_limits_txt'] = 'Limite de tâches CRON'; $wb['dns_limits_txt'] = 'Limite DNS'; $wb['virtualization_limits_txt'] = 'Limite de virtualisations'; -$wb['aps_limits_txt'] = 'Limite d\'installeurs APS'; -$wb['limit_aps_txt'] = 'Nombre max d\'instances APS'; -$wb['limit_aps_error_notint'] = 'La limite d\'instances APS doit être un nombre.'; $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; $wb['client_limits_txt'] = 'Client Limits'; $wb['default_mailserver_txt'] = 'Default Mailserver'; diff --git a/interface/web/client/lib/lang/ca_reseller.lng b/interface/web/client/lib/lang/ca_reseller.lng index 411096ef5402dab83ac64fbe3f5c7e2f37007a40..a146606af86d75adb95a6b06decb3dfcee0d0e25 100644 --- a/interface/web/client/lib/lang/ca_reseller.lng +++ b/interface/web/client/lib/lang/ca_reseller.lng @@ -138,9 +138,6 @@ $wb['bank_code_txt'] = 'Code banque'; $wb['bank_name_txt'] = 'Nom de la banque'; $wb['bank_account_iban_txt'] = 'IBAN'; $wb['bank_account_swift_txt'] = 'BIC / Swift'; -$wb['aps_limits_txt'] = 'Limites d\'installeur APS'; -$wb['limit_aps_txt'] = 'Nombre max d\'instances APS'; -$wb['limit_aps_error_notint'] = 'La limite d\'instances APS doit être un nombre.'; $wb['default_slave_dnsserver_txt'] = 'Serveur DNS secondaire par défaut'; $wb['locked_txt'] = 'Locked'; $wb['canceled_txt'] = 'Canceled'; diff --git a/interface/web/client/lib/lang/cz_client.lng b/interface/web/client/lib/lang/cz_client.lng index 5d26a51cdabb6bdb8d8a1067de85224f18dddd6f..cd6b1bbe221d61c00076ab38233a93b46deca763 100644 --- a/interface/web/client/lib/lang/cz_client.lng +++ b/interface/web/client/lib/lang/cz_client.lng @@ -140,9 +140,6 @@ $wb['customer_no_error_unique'] = 'Zákaznické číslo musí být jedinečné ( $wb['paypal_email_error_isemail'] = 'Zadejte prosím platnou PayPal e-mail addresu.'; $wb['paypal_email_txt'] = 'PayPal e-mail'; $wb['err_msg_master_tpl_set'] = 'Nelze nastavit vlastní limity, pokud chtete nastavit vlatní limity musí být \\"hlavní šablona\\" nastavena na volbu \\"Custom\\".'; -$wb['aps_limits_txt'] = 'APS limity instalátoru'; -$wb['limit_aps_txt'] = 'Max. počet APS instalací'; -$wb['limit_aps_error_notint'] = 'Limit pro APS instalace musí být číslo.'; $wb['default_slave_dnsserver_txt'] = 'Výchozí sekundární DNS server'; $wb['locked_txt'] = 'Locked (disables everything except DNS)'; $wb['canceled_txt'] = 'Zrušeno (zakáže přihlášení klienta)'; diff --git a/interface/web/client/lib/lang/cz_client_template.lng b/interface/web/client/lib/lang/cz_client_template.lng index 1f5d03df62cb19b29a2ebfb9306bab4fdc28ffea..c4755b24a478e24b849e8c801b0b1c0be6ca7625 100644 --- a/interface/web/client/lib/lang/cz_client_template.lng +++ b/interface/web/client/lib/lang/cz_client_template.lng @@ -84,9 +84,6 @@ $wb['database_limits_txt'] = 'Databázové limity'; $wb['cron_job_limits_txt'] = 'Cron pracovní limity'; $wb['dns_limits_txt'] = 'DNS limity'; $wb['virtualization_limits_txt'] = 'Virtualizace limity'; -$wb['aps_limits_txt'] = 'APS limity instalátoru'; -$wb['limit_aps_txt'] = 'Max. počet APS instalací'; -$wb['limit_aps_error_notint'] = 'Limit pro APS instalace musí být číslo.'; $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; $wb['client_limits_txt'] = 'Klientské limity'; $wb['default_mailserver_txt'] = 'Výchozí E-mailový server'; diff --git a/interface/web/client/lib/lang/cz_reseller.lng b/interface/web/client/lib/lang/cz_reseller.lng index d9ddb4c5c496a483d61ef97207118f39ba46e5fc..5a07b765e2e7e5b1f320d318ef8bcb02ef3a4d18 100644 --- a/interface/web/client/lib/lang/cz_reseller.lng +++ b/interface/web/client/lib/lang/cz_reseller.lng @@ -138,9 +138,6 @@ $wb['bank_code_txt'] = 'Kód banky'; $wb['bank_name_txt'] = 'Název banky'; $wb['bank_account_iban_txt'] = 'IBAN'; $wb['bank_account_swift_txt'] = 'BIC / Swift'; -$wb['aps_limits_txt'] = 'APS limity instalátoru'; -$wb['limit_aps_txt'] = 'Max. počet APS instalací'; -$wb['limit_aps_error_notint'] = 'Limit pro APS instalace musí být číslo.'; $wb['default_slave_dnsserver_txt'] = 'Výchozí sekundární DNS server'; $wb['locked_txt'] = 'Zamčený účet'; $wb['canceled_txt'] = 'Zrušený účet'; diff --git a/interface/web/client/lib/lang/de_client.lng b/interface/web/client/lib/lang/de_client.lng index ca22ce638cf7c28d3dd33e717df4e8c25bbfd3a0..1cdd109ac1ce75b96f0509ede00d19ed37643305 100644 --- a/interface/web/client/lib/lang/de_client.lng +++ b/interface/web/client/lib/lang/de_client.lng @@ -143,9 +143,6 @@ $wb['email_error_isemail'] = 'Bitte geben Sie eine gültige E-Mail Adresse an.'; $wb['paypal_email_error_isemail'] = 'Bitte geben Sie eine gültige PayPal E-Mail Adresse an.'; $wb['paypal_email_txt'] = 'PayPal E-Mail'; $wb['err_msg_master_tpl_set'] = 'Die hier eingestellten Werte werden ignoriert, wenn als Mastervorlage nicht -Custom- ausgewählt ist!'; -$wb['aps_limits_txt'] = 'APS Installationsassistent Limits'; -$wb['limit_aps_txt'] = 'Max. Anzahl an APS-Instanzen'; -$wb['limit_aps_error_notint'] = 'Das APS Instanzen Limit muss eine Zahl sein.'; $wb['default_slave_dnsserver_txt'] = 'Standard Secondary DNS Server'; $wb['locked_txt'] = 'Locked (disables everything except DNS)'; $wb['canceled_txt'] = 'Gekündigt (verhindert Kundenlogin)'; diff --git a/interface/web/client/lib/lang/de_client_template.lng b/interface/web/client/lib/lang/de_client_template.lng index a26ef401cf909724116c1efe1973cbd0fff3a13a..4463ebec5f04f13dd24363e5722a00b9a2eae7eb 100644 --- a/interface/web/client/lib/lang/de_client_template.lng +++ b/interface/web/client/lib/lang/de_client_template.lng @@ -86,9 +86,6 @@ $wb['database_limits_txt'] = 'Datenbank Limits'; $wb['cron_job_limits_txt'] = 'Cronjob Limits'; $wb['dns_limits_txt'] = 'DNS Limits'; $wb['virtualization_limits_txt'] = 'Virtualisierungs Limits'; -$wb['aps_limits_txt'] = 'APS Installationsassistent Limits'; -$wb['limit_aps_txt'] = 'Max. Anzahl an APS-Instanzen'; -$wb['limit_aps_error_notint'] = 'Das APS Instanzen Limit muss eine Zahl sein.'; $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; $wb['client_limits_txt'] = 'Client Limits'; $wb['default_mailserver_txt'] = 'Default Mailserver'; diff --git a/interface/web/client/lib/lang/de_reseller.lng b/interface/web/client/lib/lang/de_reseller.lng index 9f68b18cf50c4f33ac987026b17781ec192da0dd..e83ad4ba128187055c61ece6e25c9e24944e369a 100644 --- a/interface/web/client/lib/lang/de_reseller.lng +++ b/interface/web/client/lib/lang/de_reseller.lng @@ -142,9 +142,6 @@ $wb['bank_code_txt'] = 'BLZ'; $wb['bank_name_txt'] = 'Bank'; $wb['bank_account_iban_txt'] = 'IBAN'; $wb['bank_account_swift_txt'] = 'BIC'; -$wb['aps_limits_txt'] = 'APS Installationsassistent Limits'; -$wb['limit_aps_txt'] = 'Max. Anzahl an APS-Instanzen'; -$wb['limit_aps_error_notint'] = 'Das APS Instanzen Limit muss eine Zahl sein.'; $wb['default_slave_dnsserver_txt'] = 'Standard Secondary DNS Server'; $wb['locked_txt'] = 'Gesperrt'; $wb['canceled_txt'] = 'Gekündigt'; diff --git a/interface/web/client/lib/lang/dk_client.lng b/interface/web/client/lib/lang/dk_client.lng index b1e549dd9129065e21ab1e82fc125ce56e40785c..ac823a9643d1be28fe48a95179b8fe6601213ede 100644 --- a/interface/web/client/lib/lang/dk_client.lng +++ b/interface/web/client/lib/lang/dk_client.lng @@ -140,9 +140,6 @@ $wb['customer_no_error_unique'] = 'Kunde nr. skal være unikke (eller tomt).'; $wb['paypal_email_error_isemail'] = 'Indtast en gyldig PayPal e-mail adresse.'; $wb['paypal_email_txt'] = 'PayPal E-mail'; $wb['err_msg_master_tpl_set'] = 'Alle brugerdefinerede grænse indstillinger ignoreres, hvis nogen anden master skabelonen end \\"custom\\" er valgt.'; -$wb['aps_limits_txt'] = 'APS Installer Begrænsninger'; -$wb['limit_aps_txt'] = 'Max. antal af APS forekomster'; -$wb['limit_aps_error_notint'] = 'APS forekomster grænse skal være et tal.'; $wb['default_slave_dnsserver_txt'] = 'Standard Sekundær DNS Server'; $wb['locked_txt'] = 'Locked (disables everything except DNS)'; $wb['canceled_txt'] = 'Annulleret (deaktivere kunde log ind)'; diff --git a/interface/web/client/lib/lang/dk_client_template.lng b/interface/web/client/lib/lang/dk_client_template.lng index 501d9e2841aa38c10a227fbdf7627ed8e0c7ad80..08c8fe6f0a9c447cea8b3a773a50d155b2778445 100644 --- a/interface/web/client/lib/lang/dk_client_template.lng +++ b/interface/web/client/lib/lang/dk_client_template.lng @@ -84,9 +84,6 @@ $wb['database_limits_txt'] = 'Database Begrænsninger'; $wb['cron_job_limits_txt'] = 'Cron Job Begrænsninger'; $wb['dns_limits_txt'] = 'DNS Begrænsninger'; $wb['virtualization_limits_txt'] = 'Virtualisering Begrænsninger'; -$wb['aps_limits_txt'] = 'APS Installer Begrænsninger'; -$wb['limit_aps_txt'] = 'Max. antal af APS instances'; -$wb['limit_aps_error_notint'] = 'APS forekomst grænse skal være et tal.'; $wb['limit_domainmodule_txt'] = 'Domænemodul Begrænsning'; $wb['client_limits_txt'] = 'Kunde Begrænsninger'; $wb['default_mailserver_txt'] = 'Default Mailserver'; diff --git a/interface/web/client/lib/lang/dk_reseller.lng b/interface/web/client/lib/lang/dk_reseller.lng index 12004df7619c4a0adfc66ecb2091e7da94fa06e8..96e879e7fe3fd03baf09b1bf14f1809d077eeb3c 100644 --- a/interface/web/client/lib/lang/dk_reseller.lng +++ b/interface/web/client/lib/lang/dk_reseller.lng @@ -138,9 +138,6 @@ $wb['bank_code_txt'] = 'Bank kode'; $wb['bank_name_txt'] = 'Bank navn'; $wb['bank_account_iban_txt'] = 'IBAN'; $wb['bank_account_swift_txt'] = 'BIC/Swift'; -$wb['aps_limits_txt'] = 'APS Installer Begrænsninger'; -$wb['limit_aps_txt'] = 'Max. antal af APS instances'; -$wb['limit_aps_error_notint'] = 'APS forekomst-grænse skal være et tal.'; $wb['default_slave_dnsserver_txt'] = 'Standard Sekundær DNS Server'; $wb['locked_txt'] = 'Låst'; $wb['canceled_txt'] = 'Annulleret'; diff --git a/interface/web/client/lib/lang/el_client.lng b/interface/web/client/lib/lang/el_client.lng index 51f75bff055ae1f0e8020ab46de3d508f61c17ac..50374f92549e52e58d697b8b24391b2efaaa3b68 100644 --- a/interface/web/client/lib/lang/el_client.lng +++ b/interface/web/client/lib/lang/el_client.lng @@ -142,9 +142,6 @@ $wb['customer_no_error_unique'] = 'The customer no. must be unique (or empty).'; $wb['paypal_email_error_isemail'] = 'Please enter a valid PayPal email address.'; $wb['paypal_email_txt'] = 'PayPal Email'; $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.'; -$wb['aps_limits_txt'] = 'APS Installer Limits'; -$wb['limit_aps_txt'] = 'Max. number of APS instances'; -$wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; $wb['default_slave_dnsserver_txt'] = 'Default Secondary DNS Server'; $wb['locked_txt'] = 'Locked (disables everything except DNS)'; $wb['canceled_txt'] = 'Canceled (disables client login)'; diff --git a/interface/web/client/lib/lang/el_client_template.lng b/interface/web/client/lib/lang/el_client_template.lng index e5f50f513e32d11d0ecc87f39250c29c8a7071a7..b5c13f6cb6eb0183023db7fe5c13283b6b9df98d 100644 --- a/interface/web/client/lib/lang/el_client_template.lng +++ b/interface/web/client/lib/lang/el_client_template.lng @@ -85,9 +85,6 @@ $wb['database_limits_txt'] = 'Database Limits'; $wb['cron_job_limits_txt'] = 'Cron Job Limits'; $wb['dns_limits_txt'] = 'DNS Limits'; $wb['virtualization_limits_txt'] = 'Virtualization Limits'; -$wb['aps_limits_txt'] = 'APS Installer Limits'; -$wb['limit_aps_txt'] = 'Max. number of APS instances'; -$wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; $wb['client_limits_txt'] = 'Client Limits'; $wb['default_mailserver_txt'] = 'Default Mailserver'; diff --git a/interface/web/client/lib/lang/el_reseller.lng b/interface/web/client/lib/lang/el_reseller.lng index 3b7bc470bcaecaa37603cb3a5c2f804084d76b16..ad70663f90f9b6e5ff752cac39364c84e1ef46d6 100644 --- a/interface/web/client/lib/lang/el_reseller.lng +++ b/interface/web/client/lib/lang/el_reseller.lng @@ -141,9 +141,6 @@ $wb['bank_code_txt'] = 'Bank code'; $wb['bank_name_txt'] = 'Bank name'; $wb['bank_account_iban_txt'] = 'IBAN'; $wb['bank_account_swift_txt'] = 'BIC / Swift'; -$wb['aps_limits_txt'] = 'APS Installer Limits'; -$wb['limit_aps_txt'] = 'Max. number of APS instances'; -$wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; $wb['default_slave_dnsserver_txt'] = 'Default Secondary DNS Server'; $wb['locked_txt'] = 'Locked'; $wb['canceled_txt'] = 'Canceled'; diff --git a/interface/web/client/lib/lang/en_client.lng b/interface/web/client/lib/lang/en_client.lng index 797161d7916f6c13efda59e2193fbbbae633b936..22fc7dc178d21e288926a8a3ff452f6b089688d9 100644 --- a/interface/web/client/lib/lang/en_client.lng +++ b/interface/web/client/lib/lang/en_client.lng @@ -147,9 +147,6 @@ $wb["customer_no_error_unique"] = 'The customer no. must be unique (or empty).'; $wb['paypal_email_error_isemail'] = 'Please enter a valid PayPal email address.'; $wb['paypal_email_txt'] = 'PayPal Email'; $wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than "custom" is selected.'; -$wb['aps_limits_txt'] = 'APS Installer Limits'; -$wb['limit_aps_txt'] = 'Max. number of APS instances'; -$wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; $wb["default_slave_dnsserver_txt"] = 'Default Secondary DNS Server'; $wb['locked_txt'] = 'Locked (disables everything except DNS)'; $wb['canceled_txt'] = 'Canceled (disables client login)'; diff --git a/interface/web/client/lib/lang/en_client_template.lng b/interface/web/client/lib/lang/en_client_template.lng index 786daee90dc9c144f430520044b941587e46174c..9120f00f6ed52305406d6769a61f2f12b8fe930d 100644 --- a/interface/web/client/lib/lang/en_client_template.lng +++ b/interface/web/client/lib/lang/en_client_template.lng @@ -92,9 +92,6 @@ $wb["database_limits_txt"] = 'Database Limits'; $wb["cron_job_limits_txt"] = 'Cron Job Limits'; $wb["dns_limits_txt"] = 'DNS Limits'; $wb["virtualization_limits_txt"] = 'Virtualization Limits'; -$wb['aps_limits_txt'] = 'APS Installer Limits'; -$wb['limit_aps_txt'] = 'Max. number of APS instances'; -$wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; $wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; $wb['client_limits_txt'] = 'Client Limits'; $wb['limit_database_quota_txt'] = 'Database quota'; diff --git a/interface/web/client/lib/lang/en_reseller.lng b/interface/web/client/lib/lang/en_reseller.lng index 789229460ff72ff9150876be5a102d1f7837c873..87466717a06cb3a58532440c783816deee82327d 100644 --- a/interface/web/client/lib/lang/en_reseller.lng +++ b/interface/web/client/lib/lang/en_reseller.lng @@ -146,9 +146,6 @@ $wb["bank_code_txt"] = 'Bank code'; $wb["bank_name_txt"] = 'Bank name'; $wb["bank_account_iban_txt"] = 'IBAN'; $wb["bank_account_swift_txt"] = 'BIC / Swift'; -$wb['aps_limits_txt'] = 'APS Installer Limits'; -$wb['limit_aps_txt'] = 'Max. number of APS instances'; -$wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; $wb["default_slave_dnsserver_txt"] = 'Default Secondary DNS Server'; $wb['locked_txt'] = 'Locked'; $wb['canceled_txt'] = 'Canceled'; diff --git a/interface/web/client/lib/lang/es_client.lng b/interface/web/client/lib/lang/es_client.lng index eae85315b68df4ae44d6ba5bb314aaa901c0ec90..369a04a9a3166933433de1f251967c8ff9df60e9 100644 --- a/interface/web/client/lib/lang/es_client.lng +++ b/interface/web/client/lib/lang/es_client.lng @@ -3,7 +3,6 @@ $wb['active_template_additional_txt'] = 'Añadidos activos'; $wb['add_additional_template_txt'] = 'Añadir plantillas adicionales'; $wb['added_by_txt'] = 'Creado por'; $wb['added_date_txt'] = 'Fecha de creación'; -$wb['aps_limits_txt'] = 'Límites de instaladores APS'; $wb['bank_account_iban_txt'] = 'IBAN'; $wb['bank_account_number_txt'] = 'Nº de cuenta bancaria.'; $wb['bank_account_owner_txt'] = 'Propietario de la cuenta bancaria'; @@ -56,8 +55,6 @@ $wb['internet_txt'] = 'Internet'; $wb['invalid_vat_id'] = 'El número de IVA no es correcto.'; $wb['ip_address_txt'] = 'ip_address'; $wb['language_txt'] = 'Idioma'; -$wb['limit_aps_error_notint'] = 'La cantidad máxima de instancias de APS debe ser un número.'; -$wb['limit_aps_txt'] = 'Cantidad máxima de instancias de APS'; $wb['limit_backup_txt'] = 'Copias de seguridad disponibles'; $wb['limit_cgi_txt'] = 'CGI disponible'; $wb['limit_client_error'] = 'Ha alcanzado el número máximo de clientes.'; diff --git a/interface/web/client/lib/lang/es_client_template.lng b/interface/web/client/lib/lang/es_client_template.lng index 4fd6f650f3bfd55aa0a35aecacd791a858f59a47..f1d3171f11b660ee82d512557591ff4761c7fa15 100644 --- a/interface/web/client/lib/lang/es_client_template.lng +++ b/interface/web/client/lib/lang/es_client_template.lng @@ -1,5 +1,4 @@ (müşteri oturumu devre dışı)'; diff --git a/interface/web/client/lib/lang/tr_client_template.lng b/interface/web/client/lib/lang/tr_client_template.lng index 30911764483f05a10fbc7b0c62ce6c83c58b6dd4..5ca92db77f996680ecffc66cf63d495a73064cec 100644 --- a/interface/web/client/lib/lang/tr_client_template.lng +++ b/interface/web/client/lib/lang/tr_client_template.lng @@ -92,9 +92,6 @@ $wb['database_limits_txt'] = 'Veritabanı Sınırları'; $wb['cron_job_limits_txt'] = 'Zamanlanmış Görev Sınırları'; $wb['dns_limits_txt'] = 'DNS Sınırları'; $wb['virtualization_limits_txt'] = 'Sanallaştırma Sınırları'; -$wb['aps_limits_txt'] = 'APS Yükleyici Sınırları'; -$wb['limit_aps_txt'] = 'En fazla APS kopyası sayısı'; -$wb['limit_aps_error_notint'] = 'APS kopyaları sınırı bir sayı olmalıdır.'; $wb['limit_domainmodule_txt'] = 'Etki Alanı Modülü Sınırı'; $wb['client_limits_txt'] = 'Müşteri Sınırları'; $wb['limit_database_quota_txt'] = 'Veritabanı Kotası'; diff --git a/interface/web/client/lib/lang/tr_reseller.lng b/interface/web/client/lib/lang/tr_reseller.lng index d7bc06429e137f5cd6abf3a3205870f7bee8866d..e6c2f7903b86ed0221425c59fd7dce84c790996b 100644 --- a/interface/web/client/lib/lang/tr_reseller.lng +++ b/interface/web/client/lib/lang/tr_reseller.lng @@ -146,9 +146,6 @@ $wb['bank_code_txt'] = 'Banka Kodu'; $wb['bank_name_txt'] = 'Banka Adı'; $wb['bank_account_iban_txt'] = 'IBAN'; $wb['bank_account_swift_txt'] = 'BIC / Swift'; -$wb['aps_limits_txt'] = 'APS Yükleyici Sınırları'; -$wb['limit_aps_txt'] = 'En Fazla APS Kopyası Sayısı'; -$wb['limit_aps_error_notint'] = 'APS kopyaları sınırı bir sayı olmalıdır.'; $wb['default_slave_dnsserver_txt'] = 'Varsayılan İkincil DNS Sunucusu'; $wb['locked_txt'] = 'Kilitli'; $wb['canceled_txt'] = 'İptal edilmiş'; diff --git a/interface/web/client/templates/client_edit_limits.htm b/interface/web/client/templates/client_edit_limits.htm index db0b3708045e8a9bc03d522aa83c19b5fd256e65..76a689ca6b5734640f80d4f474e166ebf010afa4 100644 --- a/interface/web/client/templates/client_edit_limits.htm +++ b/interface/web/client/templates/client_edit_limits.htm @@ -422,23 +422,6 @@ -
- -
-
-
- -
-
-
-
-
diff --git a/interface/web/client/templates/client_template_edit_limits.htm b/interface/web/client/templates/client_template_edit_limits.htm index a3e4b63e9aa99454d5e107a2a249022712498134..a6e7c8ddd8a3e2f46ba617d16e98b65313e01eee 100644 --- a/interface/web/client/templates/client_template_edit_limits.htm +++ b/interface/web/client/templates/client_template_edit_limits.htm @@ -318,7 +318,7 @@
- + @@ -379,24 +379,6 @@ - -
- -
-
-
- -
-
-
-
-
diff --git a/interface/web/client/templates/reseller_edit_limits.htm b/interface/web/client/templates/reseller_edit_limits.htm index c0a25939dfaa91a2abddf4af56d015e833b1f294..7b710a074837a88c1791bb301151ffa961c41301 100644 --- a/interface/web/client/templates/reseller_edit_limits.htm +++ b/interface/web/client/templates/reseller_edit_limits.htm @@ -362,7 +362,7 @@
- + @@ -423,24 +423,6 @@ - -
- -
-
-
- -
-
-
-
-
\ No newline at end of file diff --git a/interface/web/sites/templates/aps_packagedetails_show.htm b/interface/web/sites/templates/aps_packagedetails_show.htm deleted file mode 100644 index 9419617d74b7bc54eeb4fd90a1ca2de828577e5b..0000000000000000000000000000000000000000 --- a/interface/web/sites/templates/aps_packagedetails_show.htm +++ /dev/null @@ -1,138 +0,0 @@ -

- - {tmpl_var name='pkg_name'} - - {tmpl_var name='pkg_name'} -

-{tmpl_var name='pkg_summary'} -

 

- -
-
- - - -
-

 

 

- - -
- - -
- -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{tmpl_var name='version_txt'}{tmpl_var name='pkg_version'} (Release {tmpl_var name='pkg_release'})
{tmpl_var name='category_txt'}{tmpl_var name='pkg_category'}
{tmpl_var name='description_txt'}{tmpl_var name='pkg_description'}
{tmpl_var name='homepage_txt'} - {tmpl_var name='pkg_homepage'} -
{tmpl_var name='installed_size_txt'}{tmpl_var name='pkg_installed_size'}
{tmpl_var name='supported_languages_txt'}{tmpl_var name='pkg_languages'}
{tmpl_var name='config_script_txt'}{tmpl_var name='pkg_config_script'}
{tmpl_var name='license_txt'} - {tmpl_var name='pkg_license_name'}
- {tmpl_var name='pkg_license_content'} - -
-
-
- - {tmpl_var name='ScreenDescription'}
- {tmpl_var name='ScreenDescription'}

-
-
-
    - -
  • {tmpl_var name='ChangelogVersion'}
  • -
      - -
    • {tmpl_var name='ChangelogDescription'}
    • -
      -
    -
    -
-
{tmpl_var name='php_extensions_txt'}{tmpl_var name='pkg_requirements_php_extensions'}
{tmpl_var name='php_settings_txt'} - {tmpl_var name='PHPSettingName'} = {tmpl_var name='PHPSettingValue'}
-
{tmpl_var name='supported_php_versions_txt'}{tmpl_var name='pkg_requirements_supported_php_versions'}
{tmpl_var name='database_txt'}{tmpl_var name='pkg_requirements_database'}
-
-
- diff --git a/interface/web/sites/templates/aps_packages_list.htm b/interface/web/sites/templates/aps_packages_list.htm deleted file mode 100644 index fa3582ed7435709debb13b750e4a1007676cfc6b..0000000000000000000000000000000000000000 --- a/interface/web/sites/templates/aps_packages_list.htm +++ /dev/null @@ -1,53 +0,0 @@ -

{tmpl_var name="list_head_txt"}

- - -

{tmpl_var name="list_head_txt"} ({tmpl_var name='package_count'})

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{tmpl_var name='name_txt'}{tmpl_var name='version_txt'}{tmpl_var name='category_txt'}{tmpl_var name='status_txt'} 
{tmpl_var name='name'}{tmpl_var name='version'}-{tmpl_var name='release'}{tmpl_var name='category'}{tmpl_var name='package_status'} 
{tmpl_var name='globalsearch_noresults_text_txt'}
{tmpl_var name='paging'}
-
- -
\ No newline at end of file diff --git a/interface/web/sites/templates/aps_update_packagelist.htm b/interface/web/sites/templates/aps_update_packagelist.htm deleted file mode 100644 index a73d8b3c5bfcb258d17e0a442bf5489dc554c415..0000000000000000000000000000000000000000 --- a/interface/web/sites/templates/aps_update_packagelist.htm +++ /dev/null @@ -1,12 +0,0 @@ - -

- - - {tmpl_var name="legend_txt"} - -
- - -
diff --git a/interface/web/sites/web_vhost_domain_del.php b/interface/web/sites/web_vhost_domain_del.php index 8de9aa5f0f6df56c6f195a03422a683c8ba34a4f..c27363b0b0d825a87f61da0fcd36366493a03100 100644 --- a/interface/web/sites/web_vhost_domain_del.php +++ b/interface/web/sites/web_vhost_domain_del.php @@ -107,27 +107,13 @@ class page_action extends tform_actions { $app->db->datalogDelete('web_backup', 'backup_id', $rec['backup_id']); } - //* Delete all records that belog to this web. - $web_domain = $app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id = ?", $this->id); - if($web_domain['domain'] != ''){ - $aps_instances = $app->db->queryAllRecords("SELECT instance_id FROM aps_instances_settings WHERE name = 'main_domain' AND value = ?", $web_domain['domain']); - if(is_array($aps_instances) && !empty($aps_instances)){ - foreach($aps_instances as $aps_instance){ - if($aps_instance['instance_id'] > 0){ - $app->db->datalogDelete('aps_instances_settings', 'instance_id', $aps_instance['instance_id']); - $app->db->datalogDelete('aps_instances', 'id', $aps_instance['instance_id']); - } - } - } - } - //* Remove parent_domain_id from databases $records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE parent_domain_id = ?", $this->id); foreach($records as $rec) { $app->db->datalogUpdate('web_database', array('parent_domain_id' => 0), 'database_id', $rec['database_id']); } } - + //* Delete all web folders $records = $app->db->queryAllRecords("SELECT web_folder_id FROM web_folder WHERE parent_domain_id = ?", $this->id); foreach($records as $rec) { diff --git a/interface/web/tools/import_vpopmail.php b/interface/web/tools/import_vpopmail.php index 7ae4efb58b6f87388e9233584de3b434b5027ddd..cae6caf94a054a41da257dda8d637eed6b77f1bb 100644 --- a/interface/web/tools/import_vpopmail.php +++ b/interface/web/tools/import_vpopmail.php @@ -110,7 +110,7 @@ function start_import() { $country = 'FI'; //* add client - $sql = "INSERT INTO `client` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `company_name`, `company_id`, `contact_name`, `customer_no`, `vat_id`, `street`, `zip`, `city`, `state`, `country`, `telephone`, `mobile`, `fax`, `email`, `internet`, `icq`, `notes`, `bank_account_owner`, `bank_account_number`, `bank_code`, `bank_name`, `bank_account_iban`, `bank_account_swift`, `default_mailserver`, `limit_maildomain`, `limit_mailbox`, `limit_mailalias`, `limit_mailaliasdomain`, `limit_mailforward`, `limit_mailcatchall`, `limit_mailrouting`, `limit_mailfilter`, `limit_fetchmail`, `limit_mailquota`, `limit_spamfilter_wblist`, `limit_spamfilter_user`, `limit_spamfilter_policy`, `default_webserver`, `limit_web_ip`, `limit_web_domain`, `limit_web_quota`, `web_php_options`, `limit_cgi`, `limit_ssi`, `limit_perl`, `limit_ruby`, `limit_python`, `force_suexec`, `limit_hterror`, `limit_wildcard`, `limit_ssl`, `limit_web_subdomain`, `limit_web_aliasdomain`, `limit_ftp_user`, `limit_shell_user`, `ssh_chroot`, `limit_webdav_user`, `limit_aps`, `default_dnsserver`, `limit_dns_zone`, `limit_dns_slave_zone`, `limit_dns_record`, `default_dbserver`, `limit_database`, `limit_cron`, `limit_cron_type`, `limit_cron_frequency`, `limit_traffic_quota`, `limit_client`, `limit_mailmailinglist`, `limit_openvz_vm`, `limit_openvz_vm_template_id`, `parent_client_id`, `username`, `password`, `language`, `usertheme`, `template_master`, `template_additional`, `created_at`, `id_rsa`, `ssh_rsa`) + $sql = "INSERT INTO `client` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `company_name`, `company_id`, `contact_name`, `customer_no`, `vat_id`, `street`, `zip`, `city`, `state`, `country`, `telephone`, `mobile`, `fax`, `email`, `internet`, `icq`, `notes`, `bank_account_owner`, `bank_account_number`, `bank_code`, `bank_name`, `bank_account_iban`, `bank_account_swift`, `default_mailserver`, `limit_maildomain`, `limit_mailbox`, `limit_mailalias`, `limit_mailaliasdomain`, `limit_mailforward`, `limit_mailcatchall`, `limit_mailrouting`, `limit_mailfilter`, `limit_fetchmail`, `limit_mailquota`, `limit_spamfilter_wblist`, `limit_spamfilter_user`, `limit_spamfilter_policy`, `default_webserver`, `limit_web_ip`, `limit_web_domain`, `limit_web_quota`, `web_php_options`, `limit_cgi`, `limit_ssi`, `limit_perl`, `limit_ruby`, `limit_python`, `force_suexec`, `limit_hterror`, `limit_wildcard`, `limit_ssl`, `limit_web_subdomain`, `limit_web_aliasdomain`, `limit_ftp_user`, `limit_shell_user`, `ssh_chroot`, `limit_webdav_user`, `default_dnsserver`, `limit_dns_zone`, `limit_dns_slave_zone`, `limit_dns_record`, `default_dbserver`, `limit_database`, `limit_cron`, `limit_cron_type`, `limit_cron_frequency`, `limit_traffic_quota`, `limit_client`, `limit_mailmailinglist`, `limit_openvz_vm`, `limit_openvz_vm_template_id`, `parent_client_id`, `username`, `password`, `language`, `usertheme`, `template_master`, `template_additional`, `created_at`, `id_rsa`, `ssh_rsa`) VALUES(1, 1, 'riud', 'riud', '', '', '', ?, '', '', '', '', '', '', ?, '', '', '', '', 'http://', '', '', '', '', '', '', '', '', 1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, 0, 0, 0, 1, NULL, -1, -1, 'no,fast-cgi,cgi,mod,suphp', 'n', 'n', 'n', 'n', 'n', 'y', 'n', 'n', 'n', -1, -1, -1, 0, 'no,jailkit', 0, 0, 1, -1, -1, -1, 1, -1, 0, 'url', 5, -1, 0, -1, 0, 0, 0, ?, ?, ?, 'default', 0, '', NOW(), '', '')"; $app->db->query($sql, $pw_domain,$country, $pw_domain, $pw_crypt_password, $conf['language']); $client_id = $app->db->insertID(); @@ -298,7 +298,7 @@ function start_import() { "source" => $email, "destination" => $target, "type" => 'forward', - "active" => 'y' + "active" => 'y' ); $app->db->datalogInsert('mail_forwarding', $sql, 'forwarding_id'); } diff --git a/remoting_client/API-docs/navigation.html b/remoting_client/API-docs/navigation.html index 89ef7bc8e4fbe9a7617a77a56fb812440b442997..48c7957b8d63408f605fac5102de95187d0ef93d 100644 --- a/remoting_client/API-docs/navigation.html +++ b/remoting_client/API-docs/navigation.html @@ -207,16 +207,6 @@

server_get

server_get_php_versions

server_get_serverid_by_ip

-

sites_aps_available_packages_list

-

sites_aps_change_package_status

-

sites_aps_get_package_details

-

sites_aps_get_package_file

-

sites_aps_get_package_settings

-

sites_aps_install_package

-

sites_aps_instance_get

-

sites_aps_instance_delete

-

sites_aps_instance_settings_get

-

sites_aps_update_package_list

sites_cron_add

sites_cron_delete

sites_cron_get

diff --git a/remoting_client/API-docs/sites_aps_available_packages_list.html b/remoting_client/API-docs/sites_aps_available_packages_list.html deleted file mode 100644 index 1d069debc9e4a3807d922bcac3d21501ce666bf3..0000000000000000000000000000000000000000 --- a/remoting_client/API-docs/sites_aps_available_packages_list.html +++ /dev/null @@ -1,29 +0,0 @@ - -ISPCOnfig 3 remote API documentation - - - - - - - - - - -
-

sites_aps_available_packages_list($session_id, $params);

-
-

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.

- -
- - diff --git a/remoting_client/API-docs/sites_aps_change_package_status.html b/remoting_client/API-docs/sites_aps_change_package_status.html deleted file mode 100644 index bc8ad380ed9a47ff9e49c93e417fb2f6e2f4ae38..0000000000000000000000000000000000000000 --- a/remoting_client/API-docs/sites_aps_change_package_status.html +++ /dev/null @@ -1,29 +0,0 @@ - -ISPConfig 3 remote API documentation - - - - - - - - - - -
-

sites_aps_change_package_status($session_id, $primary_id, $params);

-
-

Description:

-

Changes the status for specified APS package. Supply the APS package ID in $primary_id.


-

Input Variables:

-

$session_id, $primary_id, $params

-

Parameters (in $params):

-

package_status  (int) - can be 1 (= PACKAGE_LOCKED) or 2 (= PACKAGE_ENABLED)

-

Output:

-

Returns true package status was changed.

- -
- - diff --git a/remoting_client/API-docs/sites_aps_get_package_details.html b/remoting_client/API-docs/sites_aps_get_package_details.html deleted file mode 100644 index 56049d8b13901b1c33e752d9d36f6657c65c48a0..0000000000000000000000000000000000000000 --- a/remoting_client/API-docs/sites_aps_get_package_details.html +++ /dev/null @@ -1,29 +0,0 @@ - -ISPCOnfig 3 remote API documentation - - - - - - - - - - -
-

sites_aps_get_package_details($session_id, $primary_id);

-
-

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.

- -
- - diff --git a/remoting_client/API-docs/sites_aps_get_package_file.html b/remoting_client/API-docs/sites_aps_get_package_file.html deleted file mode 100644 index 9a6472db07616a91483d8fb894d97a4555036c2f..0000000000000000000000000000000000000000 --- a/remoting_client/API-docs/sites_aps_get_package_file.html +++ /dev/null @@ -1,29 +0,0 @@ - -ISPCOnfig 3 remote API documentation - - - - - - - - - - -
-

sites_aps_get_package_file($session_id, $primary_id, $filename);

-
-

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)));

- -
- - diff --git a/remoting_client/API-docs/sites_aps_get_package_settings.html b/remoting_client/API-docs/sites_aps_get_package_settings.html deleted file mode 100644 index 4a47c9b9dd9715c3b0a8b714cf23be0d280c50d6..0000000000000000000000000000000000000000 --- a/remoting_client/API-docs/sites_aps_get_package_settings.html +++ /dev/null @@ -1,29 +0,0 @@ - -ISPCOnfig 3 remote API documentation - - - - - - - - - - -
-

sites_aps_get_package_settings($session_id, $primary_id);

-
-

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.

- -
- - diff --git a/remoting_client/API-docs/sites_aps_install_package.html b/remoting_client/API-docs/sites_aps_install_package.html deleted file mode 100644 index 340dc8253f84cedd4258c620d179b7917998ea55..0000000000000000000000000000000000000000 --- a/remoting_client/API-docs/sites_aps_install_package.html +++ /dev/null @@ -1,29 +0,0 @@ - -ISPCOnfig 3 remote API documentation - - - - - - - - - - -
-

sites_aps_install_package($session_id, $primary_id, $params);

-
-

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.

- -
- - diff --git a/remoting_client/API-docs/sites_aps_instance_delete.html b/remoting_client/API-docs/sites_aps_instance_delete.html deleted file mode 100644 index 654a3c5df9235e838be97738f4bfd4019b252805..0000000000000000000000000000000000000000 --- a/remoting_client/API-docs/sites_aps_instance_delete.html +++ /dev/null @@ -1,29 +0,0 @@ - -ISPCOnfig 3 remote API documentation - - - - - - - - - - -
-

sites_aps_instance_delete($session_id, $primary_id, $params);

-
-

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.

- -
- - diff --git a/remoting_client/API-docs/sites_aps_instance_get.html b/remoting_client/API-docs/sites_aps_instance_get.html deleted file mode 100644 index 64bfbe51e813eb77face9b944205531423ad50e1..0000000000000000000000000000000000000000 --- a/remoting_client/API-docs/sites_aps_instance_get.html +++ /dev/null @@ -1,29 +0,0 @@ - -ISPCOnfig 3 remote API documentation - - - - - - - - - - -
-

sites_aps_instance_get($session_id, $primary_id);

-
-

Description:

-

Gets record of given instance id.


-

Input Variables:

-

$session_id, $primary_id

-

Parameters (in $params):

-

None

-

Output:

-

Returns record of APS instance.

- -
- - diff --git a/remoting_client/API-docs/sites_aps_instance_settings_get.html b/remoting_client/API-docs/sites_aps_instance_settings_get.html deleted file mode 100644 index bf793d892d69d1f2d3c77b3dd165ad5da14a3e24..0000000000000000000000000000000000000000 --- a/remoting_client/API-docs/sites_aps_instance_settings_get.html +++ /dev/null @@ -1,29 +0,0 @@ - -ISPCOnfig 3 remote API documentation - - - - - - - - - - -
-

sites_aps_instance_settings_get($session_id, $primary_id);

-
-

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.

- -
- - diff --git a/remoting_client/API-docs/sites_aps_update_package_list.html b/remoting_client/API-docs/sites_aps_update_package_list.html deleted file mode 100644 index e581a723008927ce5e1f2512ef1c27603f221ef3..0000000000000000000000000000000000000000 --- a/remoting_client/API-docs/sites_aps_update_package_list.html +++ /dev/null @@ -1,29 +0,0 @@ - -ISPCOnfig 3 remote API documentation - - - - - - - - - - -
-

sites_aps_update_package_list($session_id);

-
-

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

- -
- - diff --git a/server/aps_packages/empty.dir b/server/aps_packages/empty.dir deleted file mode 100644 index 95ba9ef37cca69318bcba17e67cd44ae84bd41e1..0000000000000000000000000000000000000000 --- a/server/aps_packages/empty.dir +++ /dev/null @@ -1 +0,0 @@ -This empty directory is needed by ISPConfig. diff --git a/server/lib/classes/aps_base.inc.php b/server/lib/classes/aps_base.inc.php deleted file mode 100644 index e93a9a9743a00504d5427788aad17dd2efc46e14..0000000000000000000000000000000000000000 --- a/server/lib/classes/aps_base.inc.php +++ /dev/null @@ -1,111 +0,0 @@ -log_prefix = $log_prefix; - $this->interface_mode = $interface_mode; - $this->fetch_url = 'apscatalog.com'; - $this->aps_version = '1.2'; - $this->packages_dir = ISPC_ROOT_PATH.'/aps_packages'; - $this->interface_pkg_dir = ISPC_ROOT_PATH.'/web/sites/aps_meta_packages'; - } - - - - /** - * Converts a given value to it's native representation in 1024 units - * - * @param $value the size to convert - * @return integer and string - */ - public function convertSize($value) - { - $unit = array('Bytes', 'KB', 'MB', 'GB', 'TB'); - return @round($value/pow(1024, ($i = floor(log($value, 1024)))), 2).' '.$unit[$i]; - } - - - - /** - * Determine a specific xpath from a given SimpleXMLElement handle. If the - * element is found, it's string representation is returned. If not, - * the return value will stay empty - * - * @param $xml_handle the SimpleXMLElement handle - * @param $query the XPath query - * @param $array define whether to return an array or a string - * @return $ret the return string - */ - protected function getXPathValue($xml_handle, $query, $array = false) - { - $ret = ''; - - $xp_result = @($xml_handle->xpath($query)) ? $xml_handle->xpath($query) : false; - if($xp_result !== false) $ret = (($array === false) ? (string)$xp_result[0] : $xp_result); - - return $ret; - } - -} - -?> diff --git a/server/lib/classes/aps_installer.inc.php b/server/lib/classes/aps_installer.inc.php deleted file mode 100644 index 922f32e61288664e8b8dd464e4f3d3f2e8cb9d99..0000000000000000000000000000000000000000 --- a/server/lib/classes/aps_installer.inc.php +++ /dev/null @@ -1,707 +0,0 @@ -log('Aborting execution because '.$e->getMessage(), 1); - return false; - } - } - - - - /** - * Get a file from a ZIP archive and either return it's content or - * extract it to a given destination - * - * @param $zipfile the ZIP file to work with - * @param $subfile the file from which to get the content - * @param $destfolder the optional extraction destination - * @param $destname the optional target file name when extracting - * @return string or boolean - */ - private function getContentFromZIP($zipfile, $subfile, $destfolder = '', $destname = '') - { - try - { - $zip = new ZipArchive; - $res = $zip->open(realpath($zipfile)); - if(!$res) throw new Exception('Cannot open ZIP file '.$zipfile); - - // If no destination is given, the content is returned, otherwise - // the $subfile is extracted to $destination - if($destfolder == '') - { - $fh = $zip->getStream($subfile); - if(!$fh) throw new Exception('Cannot read '.$subfile.' from '.$zipfile); - - $subfile_content = ''; - while(!feof($fh)) $subfile_content .= fread($fh, 8192); - - fclose($fh); - - return $subfile_content; - } - else - { - // extractTo would be suitable but has no target name parameter - //$ind = $zip->locateName($subfile); - //$ex = $zip->extractTo($destination, array($zip->getNameIndex($ind))); - if($destname == '') $destname = basename($subfile); - $ex = @copy('zip://'.$zipfile.'#'.$subfile, $destfolder.$destname); - if(!$ex) throw new Exception('Cannot extract '.$subfile.' to '.$destfolder); - } - - $zip->close(); - - } - - catch(Exception $e) - { - // The exception message is only interesting for debugging reasons - // echo $e->getMessage(); - return false; - } - } - - - - /** - * Extract the complete directory of a ZIP file - * - * @param $filename the file to unzip - * @param $directory the ZIP inside directory to unzip - * @param $destination the place where to extract the data - * @return boolean - */ - private function extractZip($filename, $directory, $destination) - { - if(!file_exists($filename)) return false; - - // Fix the paths - if(substr($directory, -1) == '/') $directory = substr($directory, 0, strlen($directory) - 1); - if(substr($destination, -1) != '/') $destination .= '/'; - - // Read and extract the ZIP file - $ziphandle = zip_open(realpath($filename)); - if(is_resource($ziphandle)) - { - while($entry = zip_read($ziphandle)) - { - if(substr(zip_entry_name($entry), 0, strlen($directory)) == $directory) - { - // Modify the relative ZIP file path - $new_path = substr(zip_entry_name($entry), strlen($directory)); - - if(substr($new_path, -1) == '/') // Identifier for directories - { - if(!file_exists($destination.$new_path)) mkdir($destination.$new_path, 0777, true); - } - else // Handle files - { - if(zip_entry_open($ziphandle, $entry)) - { - $new_dir = dirname($destination.$new_path); - if(!file_exists($new_dir)) mkdir($new_dir, 0777, true); - - $file = fopen($destination.$new_path, 'wb'); - if($file) - { - while($line = zip_entry_read($entry)) fwrite($file, $line); - fclose($file); - } - else return false; - } - } - } - } - - zip_close($ziphandle); - return true; - } - - return false; - } - - /** - * Setup the path environment variables for the install script - * - * @param $parent_mapping the SimpleXML instance with the current mapping position - * @param $url the relative path within the mapping tree - * @param $path the absolute path within the mapping tree - */ - private function processMappings($parent_mapping, $url, $path) - { - if($parent_mapping && $parent_mapping != null) - { - $writable = parent::getXPathValue($parent_mapping, 'php:permissions/@writable'); - $readable = parent::getXPathValue($parent_mapping, 'php:permissions/@readable'); - - // set the write permission - if($writable == 'true') - { - if(is_dir($path)) chmod($path, 0775); - else chmod($path, 0664); - } - - // set non-readable permission - if($readable == 'false') - { - if(is_dir($path)) chmod($path, 0333); - else chmod($path, 0222); - } - } - - // Set the environment variables - $env = str_replace('/', '_', $url); - $this->putenv[] = 'WEB_'.$env.'_DIR='.$path; - - // Step recursively into further mappings - if($parent_mapping && $parent_mapping != null) - { - foreach($parent_mapping->mapping as $mapping) - { - if($url == '/') $this->processMappings($mapping, $url.$mapping['url'], $path.$mapping['url']); - else $this->processMappings($mapping, $url.'/'.$mapping['url'], $path.'/'.$mapping['url']); - } - } - } - - - - /** - * Setup the environment with data for the install location - * - * @param $task an array containing all install related data - */ - private function prepareLocation($task) - { - global $app; - - // Get the domain name to use for the installation - // Would be possible in one query too, but we use 2 for easier debugging - $main_domain = $app->db->queryOneRecord("SELECT value FROM aps_instances_settings WHERE name = 'main_domain' AND instance_id = ?", $task['instance_id']); - $this->domain = $main_domain['value']; - - // Get the document root - $domain_res = $app->db->queryOneRecord("SELECT document_root, web_folder, type FROM web_domain WHERE domain = ?", $this->domain); - $this->document_root = $domain_res['document_root']; - - // Get the sub location - $location_res = $app->db->queryOneRecord("SELECT value FROM aps_instances_settings WHERE name = 'main_location' AND instance_id = ?", $task['instance_id']); - $this->sublocation = $location_res['value']; - - // Make sure the document_root ends with / - if(substr($this->document_root, -1) != '/') $this->document_root .= '/'; - - // Attention: ISPConfig Special: web files are in subfolder 'web' -> append it: - if(($domain_res['type'] == 'vhostsubdomain') || ($domain_res['type'] == 'vhostalias')) - $this->document_root .= $domain_res['web_folder'] . '/'; - else $this->document_root .= 'web/'; - - // If a subfolder is given, make sure it's path doesn't begin with / i.e. /phpbb - if(substr($this->sublocation, 0, 1) == '/') $this->sublocation = substr($this->sublocation, 1); - - // If the package isn't installed to a subfolder, remove the / at the end of the document root - if(empty($this->sublocation)) $this->document_root = substr($this->document_root, 0, strlen($this->document_root) - 1); - - // Set environment variables, later processed by the package install script - $this->putenv[] = 'BASE_URL_SCHEME=http'; - // putenv('BASE_URL_PORT') -> omitted as it's 80 by default - $this->putenv[] = 'BASE_URL_HOST='.$this->domain; - $this->putenv[] = 'BASE_URL_PATH='.$this->sublocation.'/'; - } - - - - /** - * Setup a database (if needed) and the appropriate environment variables - * - * @param $task an array containing all install related data - * @param $sxe a SimpleXMLElement handle, holding APP-META.xml - */ - private function prepareDatabase($task, $sxe) - { - global $app; - - $db_id = parent::getXPathValue($sxe, '//db:id'); - if(empty($db_id)) return; // No database needed - - $mysqlver_res = $app->db->queryOneRecord('SELECT VERSION() as ver'); - $mysqlver = $mysqlver_res['ver']; - - $tmp = $app->db->queryOneRecord("SELECT value FROM aps_instances_settings WHERE name = 'main_database_password' AND instance_id = ?", $task['instance_id']); - $newdb_pw = $tmp['value']; - - $tmp = $app->db->queryOneRecord("SELECT value FROM aps_instances_settings WHERE name = 'main_database_host' AND instance_id = ?", $task['instance_id']); - $newdb_host = $tmp['value']; - - $tmp = $app->db->queryOneRecord("SELECT value FROM aps_instances_settings WHERE name = 'main_database_name' AND instance_id = ?", $task['instance_id']); - $newdb_name = $tmp['value']; - - $tmp = $app->db->queryOneRecord("SELECT value FROM aps_instances_settings WHERE name = 'main_database_login' AND instance_id = ?", $task['instance_id']); - $newdb_login = $tmp['value']; - - /* Test if the new mysql connection is laready working to ensure that db servers in multiserver - setups get enough time to create the database */ - if($this->handle_type == 'install') { - for($n = 1; $n < 15; $n++) { - $link = mysqli_connect($newdb_host, $newdb_login, $newdb_pw); - if (!$link) { - unset($link); - sleep(5); - } else { - unset($link); - break; - } - } - } - - $this->putenv[] = 'DB_'.$db_id.'_TYPE=mysql'; - $this->putenv[] = 'DB_'.$db_id.'_NAME='.$newdb_name; - $this->putenv[] = 'DB_'.$db_id.'_LOGIN='.$newdb_login; - $this->putenv[] = 'DB_'.$db_id.'_PASSWORD='.$newdb_pw; - $this->putenv[] = 'DB_'.$db_id.'_HOST='.$newdb_host; - $this->putenv[] = 'DB_'.$db_id.'_PORT=3306'; - $this->putenv[] = 'DB_'.$db_id.'_VERSION='.$mysqlver; - } - - - - /** - * Extract all needed files from the package - * - * @param $task an array containing all install related data - * @param $sxe a SimpleXMLElement handle, holding APP-META.xml - * @return boolean - */ - private function prepareFiles($task, $sxe) - { - global $app; - - // Basically set the mapping for APS version 1.0, if not available -> newer way - $mapping = $sxe->mapping; - $mapping_path = $sxe->mapping['path']; - $mapping_url = $sxe->mapping['url']; - if(empty($mapping)) - { - $mapping = $sxe->service->provision->{'url-mapping'}->mapping; - $mapping_path = $sxe->service->provision->{'url-mapping'}->mapping['path']; - $mapping_url = $sxe->service->provision->{'url-mapping'}->mapping['url']; - } - - try - { - // Make sure we have a valid mapping path (at least /) - if(empty($mapping_path)) throw new Exception('Unable to determine a mapping path'); - - $this->local_installpath = $this->document_root.$this->sublocation.'/'; - - // Now delete an existing folder (affects install and removal in the same way) - @chdir($this->local_installpath); - if(file_exists($this->local_installpath)){ - // make sure we don't delete error and stats folders - if($this->local_installpath == $this->document_root.'/'){ - if(is_dir($this->document_root)){ - $files = array_diff(scandir($this->document_root), array('.', '..', 'error', 'stats')); - foreach($files as $file){ - if(is_dir($this->document_root.'/'.$file)){ - $app->file->removeDirectory($this->document_root.'/'.$file); - } else { - @unlink($this->document_root.'/'.$file); - } - } - } else { - @unlink($this->document_root); - mkdir($this->document_root, 0777, true); - } - } else { - $app->system->exec_safe("rm -Rf ?*", $this->local_installpath); - } - } else { - mkdir($this->local_installpath, 0777, true); - } - - if($this->handle_type == 'install') - { - // Now check if the needed folder is there - if(!file_exists($this->local_installpath)) - throw new Exception('Unable to create a new folder for the package '.$task['path']); - - // Extract all files and assign them a new owner - if( ($this->extractZip($this->packages_dir.'/'.$task['path'], $mapping_path, $this->local_installpath) === false) - || ($this->extractZip($this->packages_dir.'/'.$task['path'], 'scripts', $this->local_installpath.'install_scripts/') === false) ) - { - // Clean already extracted data - $app->system->exec_safe("rm -Rf ?*", $this->local_installpath); - throw new Exception('Unable to extract the package '.$task['path']); - } - - $this->processMappings($mapping, $mapping_url, $this->local_installpath); - - // Set the appropriate file owner - $main_domain = $app->db->queryOneRecord("SELECT value FROM aps_instances_settings WHERE name = 'main_domain' AND instance_id = ?", $task['instance_id']); - $owner_res = $app->db->queryOneRecord("SELECT system_user, system_group FROM web_domain WHERE domain = ?", $main_domain['value']); - $this->file_owner_user = $owner_res['system_user']; - $this->file_owner_group = $owner_res['system_group']; - $app->system->exec_safe('chown -R ?:? ?', $this->file_owner_user, $this->file_owner_group, $this->local_installpath); - - //* Chown stats directory back - if(is_dir($this->local_installpath.'stats')) { - $app->system->exec_safe('chown -R root:root ?', $this->local_installpath.'stats'); - } - } - } - catch(Exception $e) - { - $app->dbmaster->query('UPDATE aps_instances SET instance_status = ? WHERE id = ?', INSTANCE_ERROR, $task['instance_id']); - $app->log($e->getMessage(), 1); - return false; - } - - return true; - } - - - - /** - * Get all user config variables and set them to environment variables - * - * @param $task an array containing all install related data - */ - private function prepareUserInputData($task) - { - global $app; - - $userdata = $app->db->queryAllRecords("SELECT name, value FROM aps_instances_settings WHERE instance_id = ?", $task['instance_id']); - if(empty($userdata)) return false; - - foreach($userdata as $data) - { - // Skip unnecessary data - if($data['name'] == 'main_location' - || $data['name'] == 'main_domain' - || $data['name'] == 'main_database_password' - || $data['name'] == 'main_database_name' - || $data['name'] == 'main_database_host' - || $data['name'] == 'main_database_login' - || $data['name'] == 'license') continue; - - $this->putenv[] = 'SETTINGS_'.$data['name'].'='.$data['value']; - } - } - - - - /** - * Fetch binary data from a given array - * The data is retrieved in binary mode and - * then directly written to an output file - * - * @param $input a specially structed array - * @see $this->startUpdate() - */ - private function fetchFiles($input) - { - $fh = array(); - $url = array(); - $conn = array(); - - // Build the single cURL handles and add them to a multi handle - $mh = curl_multi_init(); - - // Process each app - for($i = 0; $i < count($input); $i++) - { - $conn[$i] = curl_init($input[$i]['url']); - $fh[$i] = fopen($input[$i]['localtarget'], 'wb'); - - curl_setopt($conn[$i], CURLOPT_BINARYTRANSFER, true); - curl_setopt($conn[$i], CURLOPT_FILE, $fh[$i]); - curl_setopt($conn[$i], CURLOPT_TIMEOUT, 0); - curl_setopt($conn[$i], CURLOPT_FAILONERROR, 1); - curl_setopt($conn[$i], CURLOPT_FOLLOWLOCATION, 1); - curl_setopt($conn[$i], CURLOPT_SSL_VERIFYPEER, 0); - - curl_multi_add_handle($mh, $conn[$i]); - } - - $active = 0; - do curl_multi_exec($mh, $active); - while($active > 0); - - // Close the handles - for($i = 0; $i < count($input); $i++) - { - fclose($fh[$i]); - curl_multi_remove_handle($mh, $conn[$i]); - curl_close($conn[$i]); - } - curl_multi_close($mh); - } - - - - /** - * The installation script should be executed - * - * @param $task an array containing all install related data - * @param $sxe a SimpleXMLElement handle, holding APP-META.xml - * @return boolean - */ - private function doInstallation($task, $sxe) - { - global $app; - - try - { - // Check if the install directory exists - if(!is_dir($this->local_installpath.'install_scripts/')) - throw new Exception('The install directory '.$this->local_installpath.' is not existing'); - - // Set the executable bit to the configure script - $cfgscript = @(string)$sxe->service->provision->{'configuration-script'}['name']; - if(!$cfgscript) $cfgscript = 'configure'; - chmod($this->local_installpath.'install_scripts/'.$cfgscript, 0755); - - // Change to the install folder (import for the exec() below!) - chdir($this->local_installpath.'install_scripts/'); - - // Set the enviroment variables - foreach($this->putenv as $var) { - putenv($var); - } - - $shell_retcode = true; - $shell_ret = array(); - $app->system->exec_safe('php ? install 2>&1', $this->local_installpath.'install_scripts/'.$cfgscript); - $shell_ret = $app->system->last_exec_out(); - $shell_retcode = $app->system->last_exec_retcode(); - $shell_ret = array_filter($shell_ret); - $shell_ret_str = implode("\n", $shell_ret); - - // Although $shell_retcode might be 0, there can be PHP errors. Filter them: - if(substr_count($shell_ret_str, 'Warning: ') > 0) $shell_retcode = 1; - - // If an error has occurred, the return code is != 0 - if($shell_retcode != 0) throw new Exception($shell_ret_str); - else - { - // The install succeeded, chown newly created files too - $app->system->exec_safe('chown -R ?:? ?', $this->file_owner_user, $this->file_owner_group, $this->local_installpath); - - //* Chown stats directory back - if(is_dir($this->local_installpath.'stats')) { - $app->system->exec_safe('chown -R root:root ?', $this->local_installpath.'stats'); - } - - $app->dbmaster->query('UPDATE aps_instances SET instance_status = ? WHERE id = ?', INSTANCE_SUCCESS, $task['instance_id']); - } - } - - catch(Exception $e) - { - $app->dbmaster->query('UPDATE aps_instances SET instance_status = ? WHERE id = ?', INSTANCE_ERROR, $task['instance_id']); - $app->log($e->getMessage(), 1); - return false; - } - - return true; - } - - - - /** - * Cleanup: Remove install scripts, remove tasks and update the database - * - * @param $task an array containing all install related data - * @param $sxe a SimpleXMLElement handle, holding APP-META.xml - */ - private function cleanup($task, $sxe) - { - global $app; - chdir($this->local_installpath); - $app->system->exec_safe("rm -Rf ?", $this->local_installpath.'install_scripts'); - } - - - - /** - * The main method which performs the actual package installation - * - * @param $instanceid the instanceID to install - * @param $type the type of task to perform (installation, removal) - */ - public function installHandler($instanceid, $type) - { - global $app; - - // Set the given handle type, currently supported: install, delete - if($type == 'install' || $type == 'delete') $this->handle_type = $type; - else return false; - - // Get all instance metadata - $task = $app->db->queryOneRecord("SELECT * FROM aps_instances AS i INNER JOIN aps_packages AS p ON i.package_id = p.id WHERE i.id = ?", $instanceid); - if(!$task) return false; // formerly: throw new Exception('The InstanceID doesn\'t exist.'); - if(!isset($task['instance_id'])) $task['instance_id'] = $instanceid; - - // Download aps package - if(!file_exists($this->packages_dir.'/'.$task['path']) || filesize($this->packages_dir.'/'.$task['path']) == 0) { - $ch = curl_init(); - $fh = fopen($this->packages_dir.'/'.$task['path'], 'wb'); - curl_setopt($ch, CURLOPT_FILE, $fh); - //curl_setopt($ch, CURLOPT_HEADER, 0); - curl_setopt($ch, CURLOPT_URL, $task['package_url']); - curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); - curl_setopt($ch, CURLOPT_TIMEOUT, 0); - curl_setopt($ch, CURLOPT_FAILONERROR, 1); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); - if(curl_exec($ch) === false) $app->log(curl_error($ch), 1); - fclose($fh); - curl_close($ch); - } - - /* - $app_to_dl[] = array('name' => $task['path'], - 'url' => $task['package_url'], - 'filesize' => 0, - 'localtarget' => $this->packages_dir.'/'.$task['path']); - - $this->fetchFiles($app_to_dl); - */ - - // Make sure the requirements are given so that this script can execute - $req_ret = $this->checkRequirements(); - if(!$req_ret) return false; - - $metafile = $this->getContentFromZIP($this->packages_dir.'/'.$task['path'], 'APP-META.xml'); - // Check if the meta file is existing - if(!$metafile) - { - $app->dbmaster->query('UPDATE aps_instances SET instance_status = ? WHERE id = ?', INSTANCE_ERROR, $task['instance_id']); - $app->log('Unable to find the meta data file of package '.$task['path'], 1); - return false; - } - - // Rename namespaces and register them - $metadata = str_replace("xmlns=", "ns=", $metafile); - $sxe = new SimpleXMLElement($metadata); - $namespaces = $sxe->getDocNamespaces(true); - foreach($namespaces as $ns => $url) $sxe->registerXPathNamespace($ns, $url); - - // Setup the environment with data for the install location - $this->prepareLocation($task); - - // Create the database if necessary - $this->prepareDatabase($task, $sxe); - - // Unpack the install scripts from the packages - if($this->prepareFiles($task, $sxe) && $this->handle_type == 'install') - { - // Setup the variables from the install script - $this->prepareUserInputData($task); - - // Do the actual installation - $this->doInstallation($task, $sxe); - - // Remove temporary files - $this->cleanup($task, $sxe); - } - - // Finally delete the instance entry + settings - if($this->handle_type == 'delete') - { - $app->db->query('DELETE FROM aps_instances WHERE id = ?', $task['instance_id']); - $app->db->query('DELETE FROM aps_instances_settings WHERE instance_id = ?', $task['instance_id']); - if ($app->dbmaster != $app->db) { - $app->dbmaster->query('DELETE FROM aps_instances WHERE id = ?', $task['instance_id']); - $app->dbmaster->query('DELETE FROM aps_instances_settings WHERE instance_id = ?', $task['instance_id']); - } - } - - unset($sxe); - } - -} - -?> diff --git a/server/lib/classes/db_mysql.inc.php b/server/lib/classes/db_mysql.inc.php index df38086ebee7ff73d67ba437c36e7172b7a15c77..948d4990d5f4fc5e23925dbf1c2ef45b7fa1345d 100644 --- a/server/lib/classes/db_mysql.inc.php +++ b/server/lib/classes/db_mysql.inc.php @@ -258,7 +258,7 @@ class db private function _query($sQuery = '') { global $app; - + $aArgs = func_get_args(); if ($sQuery == '') { @@ -354,7 +354,7 @@ class db * @return array result row or NULL if none found */ public function queryOneRecord($sQuery = '') { - + $aArgs = func_get_args(); if(!empty($aArgs)) { $sQuery = array_shift($aArgs); @@ -363,7 +363,7 @@ class db } array_unshift($aArgs, $sQuery); } - + $oResult = call_user_func_array([&$this, 'query'], $aArgs); if(!$oResult) return null; @@ -750,7 +750,7 @@ class db foreach($insert_data as $key => $val) { $key_str .= '??,'; $params[] = $key; - + $val_str .= '?,'; $v_params[] = $val; } @@ -764,7 +764,7 @@ class db $this->query("INSERT INTO ?? $insert_data_str", $tablename); $app->log("deprecated use of passing values to datalogInsert() - table " . $tablename, 1); } - + $old_rec = array(); $index_value = $this->insertID(); if(!$index_value && isset($insert_data[$index_field])) { @@ -848,7 +848,7 @@ class db $result = $this->queryAllRecords("SELECT COUNT( * ) AS cnt, sys_datalog.action, sys_datalog.dbtable FROM sys_datalog, server WHERE server.server_id = sys_datalog.server_id AND sys_datalog.user = ? AND sys_datalog.datalog_id > server.updated GROUP BY sys_datalog.dbtable, sys_datalog.action", $login); foreach($result as $row) { - if(!$row['dbtable'] || in_array($row['dbtable'], array('aps_instances', 'aps_instances_settings', 'mail_access', 'mail_content_filter'))) continue; // ignore some entries, maybe more to come + if(!$row['dbtable'] || in_array($row['dbtable'], array('mail_access', 'mail_content_filter'))) continue; // ignore some entries, maybe more to come $return['entries'][] = array('table' => $row['dbtable'], 'action' => $row['action'], 'count' => $row['cnt'], 'text' => $app->lng('datalog_status_' . $row['action'] . '_' . $row['dbtable'])); $return['count'] += $row['cnt']; } unset($result); diff --git a/server/mods-available/web_module.inc.php b/server/mods-available/web_module.inc.php index 609e9212dc3a6fd6b6a74c2fcb3b9622039a915c..b55d53048354db23d573602b496f0cff8ad8cbd6 100644 --- a/server/mods-available/web_module.inc.php +++ b/server/mods-available/web_module.inc.php @@ -54,18 +54,6 @@ class web_module { 'web_backup_insert', 'web_backup_update', 'web_backup_delete', - 'aps_instance_insert', - 'aps_instance_update', - 'aps_instance_delete', - 'aps_instance_setting_insert', - 'aps_instance_setting_update', - 'aps_instance_setting_delete', - 'aps_package_insert', - 'aps_package_update', - 'aps_package_delete', - 'aps_setting_insert', - 'aps_setting_update', - 'aps_setting_delete', 'directive_snippets_update' ); @@ -113,10 +101,6 @@ class web_module { $app->modules->registerTableHook('web_folder', 'web_module', 'process'); $app->modules->registerTableHook('web_folder_user', 'web_module', 'process'); $app->modules->registerTableHook('web_backup', 'web_module', 'process'); - $app->modules->registerTableHook('aps_instances', 'web_module', 'process'); - $app->modules->registerTableHook('aps_instances_settings', 'web_module', 'process'); - $app->modules->registerTableHook('aps_packages', 'web_module', 'process'); - $app->modules->registerTableHook('aps_settings', 'web_module', 'process'); $app->modules->registerTableHook('directive_snippets', 'web_module', 'process'); // Register service @@ -169,31 +153,12 @@ class web_module { if($action == 'u') $app->plugins->raiseEvent('web_backup_update', $data); if($action == 'd') $app->plugins->raiseEvent('web_backup_delete', $data); break; - case 'aps_instances': - if($action == 'i') $app->plugins->raiseEvent('aps_instance_insert', $data); - if($action == 'u') $app->plugins->raiseEvent('aps_instance_update', $data); - if($action == 'd') $app->plugins->raiseEvent('aps_instance_delete', $data); - break; - case 'aps_instances_settings': - if($action == 'i') $app->plugins->raiseEvent('aps_instance_setting_insert', $data); - if($action == 'u') $app->plugins->raiseEvent('aps_instance_setting_update', $data); - if($action == 'd') $app->plugins->raiseEvent('aps_instance_setting_delete', $data); - break; - case 'aps_packages': - if($action == 'i') $app->plugins->raiseEvent('aps_package_insert', $data); - if($action == 'u') $app->plugins->raiseEvent('aps_package_update', $data); - if($action == 'd') $app->plugins->raiseEvent('aps_package_delete', $data); - break; - case 'aps_settings': - if($action == 'i') $app->plugins->raiseEvent('aps_setting_insert', $data); - if($action == 'u') $app->plugins->raiseEvent('aps_setting_update', $data); - if($action == 'd') $app->plugins->raiseEvent('aps_setting_delete', $data); - break; case 'directive_snippets': if($action == 'i') $app->plugins->raiseEvent('directive_snippets_insert', $data); if($action == 'u') $app->plugins->raiseEvent('directive_snippets_update', $data); if($action == 'd') $app->plugins->raiseEvent('directive_snippets_delete', $data); break; + } // end switch } // end function @@ -229,7 +194,7 @@ class web_module { } else { $cmd = $app->system->getinitcommand($daemon, 'reload'); } - + if($web_config['server_type'] == 'nginx'){ $app->log("Checking nginx configuration...", LOGLEVEL_DEBUG); exec('nginx -t 2>&1', $retval['output'], $retval['retval']); @@ -240,16 +205,16 @@ class web_module { return $retval; } } - + exec($cmd.' 2>&1', $retval['output'], $retval['retval']); - + // if restart failed despite successful syntax check => try again if($web_config['server_type'] == 'nginx' && $retval['retval'] > 0){ sleep(2); exec($cmd.' 2>&1', $retval['output'], $retval['retval']); } $app->log("Restarting httpd: $cmd", LOGLEVEL_DEBUG); - + // nginx: do a syntax check because on some distributions, the init script always returns 0 - even if the syntax is not ok (how stupid is that?) //if($web_config['server_type'] == 'nginx' && $retval['retval'] == 0){ //exec('nginx -t 2>&1', $retval['output'], $retval['retval']); @@ -272,7 +237,7 @@ class web_module { } else { $path_parts = pathinfo($init_script); $initcommand = $app->system->getinitcommand($path_parts['basename'], $action, $path_parts['dirname']); - + if($action == 'reload' && $init_script == $conf['init_scripts'].'/'.$web_config['php_fpm_init_script']) { // we have to do a workaround because of buggy ubuntu fpm reload handling // @see: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1242376 @@ -289,7 +254,7 @@ class web_module { } */ unset($tmp); - } + } } /* if($action == 'reload') { diff --git a/server/plugins-available/aps_plugin.inc.php b/server/plugins-available/aps_plugin.inc.php deleted file mode 100644 index 00eb6b794b194cf333a54324a4bc00eac2baf02f..0000000000000000000000000000000000000000 --- a/server/plugins-available/aps_plugin.inc.php +++ /dev/null @@ -1,128 +0,0 @@ -plugins->registerEvent('aps_instance_insert', $this->plugin_name, 'install'); - $app->plugins->registerEvent('aps_instance_update', $this->plugin_name, 'install'); - $app->plugins->registerEvent('aps_instance_delete', $this->plugin_name, 'delete'); - } - - - - /** - * (Re-)install a package - */ - public function install($event_name, $data) - { - global $app, $conf; - - //* dont run the installer on a mirror server to prevent - // that the pplication gets installed twice. - if($conf['mirror_server_id'] > 0) return true; - - $app->log("Starting APS install", LOGLEVEL_DEBUG); - if(!isset($data['new']['id'])) return false; - $instanceid = $data['new']['id']; - - if($data['new']['instance_status'] == INSTANCE_INSTALL) { - $aps = new ApsInstaller($app); - $app->log("Running installHandler", LOGLEVEL_DEBUG); - $aps->installHandler($instanceid, 'install'); - } - - if($data['new']['instance_status'] == INSTANCE_REMOVE) { - $aps = new ApsInstaller($app); - $app->log("Running installHandler", LOGLEVEL_DEBUG); - $aps->installHandler($instanceid, 'delete'); - } - } - - - - /** - * Update an existing instance (currently unused) - */ - /* - public function update($event_name, $data) - { - } - */ - - - - /** - * Uninstall an instance - */ - public function delete($event_name, $data) - { - global $app, $conf; - - if(!isset($data['new']['id'])) return false; - $instanceid = $data['new']['id']; - - if($data['new']['instance_status'] == INSTANCE_REMOVE) { - $aps = new ApsInstaller($app); - $aps->installHandler($instanceid, 'install'); - } - } - -} - -?>