diff --git a/install/dist/lib/debian60.lib.php b/install/dist/lib/debian60.lib.php index d792c5a7b9466054ba29f371a23c79db1abce64f..61c3073417ea765a69a0e0952d8ac4c9be765943 100644 --- a/install/dist/lib/debian60.lib.php +++ b/install/dist/lib/debian60.lib.php @@ -91,6 +91,7 @@ class installer extends installer_base { } else { copy('tpl/debian6_dovecot2.conf.master', $config_dir.'/'.$configfile); } + replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0); } else { if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot.conf.master')) { copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot.conf.master', $config_dir.'/'.$configfile); @@ -115,6 +116,9 @@ class installer extends installer_base { chmod($config_dir.'/'.$configfile, 0600); chown($config_dir.'/'.$configfile, 'root'); chgrp($config_dir.'/'.$configfile, 'root'); + + // Dovecot shall ignore mounts in website directory + exec("doveadm mount add '/var/www/*' ignore"); } diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php index 2d3cc3079c9de87c37e33bd6ad7cb5f630840e80..114ce647fc4431678247d16226f7c14a39f84931 100644 --- a/install/dist/lib/fedora.lib.php +++ b/install/dist/lib/fedora.lib.php @@ -461,6 +461,9 @@ class installer_dist extends installer_base { exec("chmod 600 $config_dir/$configfile"); exec("chown root:root $config_dir/$configfile"); + + // Dovecot shall ignore mounts in website directory + exec("doveadm mount add '/var/www/*' ignore"); } diff --git a/install/dist/lib/opensuse.lib.php b/install/dist/lib/opensuse.lib.php index 7d97977849c516e72f15af2a4692c65c6321851d..fd4b5175a56b1d7a0d28553c46ac36c08406eaee 100644 --- a/install/dist/lib/opensuse.lib.php +++ b/install/dist/lib/opensuse.lib.php @@ -496,6 +496,9 @@ class installer_dist extends installer_base { exec("chmod 600 $config_dir/$configfile"); exec("chown root:root $config_dir/$configfile"); + + // Dovecot shall ignore mounts in website directory + exec("doveadm mount add '/srv/www/*' ignore"); } @@ -554,7 +557,9 @@ class installer_dist extends installer_base { unset($content); // Add the clamav user to the vscan group - exec('groupmod --add-user clamav vscan'); + //exec('groupmod --add-user clamav vscan'); + $command = 'usermod -a -G clamav vscan'; + caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); } @@ -1076,18 +1081,22 @@ class installer_dist extends installer_base { // and must be fixed as this will allow the apache user to read the ispconfig files. // Later this must run as own apache server or via suexec! if($conf['apache']['installed'] == true){ - $command = 'groupmod --add-user '.$conf['apache']['user'].' ispconfig'; + //$command = 'groupmod --add-user '.$conf['apache']['user'].' ispconfig'; + $command = 'usermod -a -G ispconfig '.$conf['apache']['user']; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); if(is_group('ispapps')){ - $command = 'groupmod --add-user '.$conf['apache']['user'].' ispapps'; + //$command = 'groupmod --add-user '.$conf['apache']['user'].' ispapps'; + $command = 'usermod -a -G ispapps '.$conf['apache']['user']; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); } } if($conf['nginx']['installed'] == true){ - $command = 'groupmod --add-user '.$conf['nginx']['user'].' ispconfig'; + //$command = 'groupmod --add-user '.$conf['nginx']['user'].' ispconfig'; + $command = 'usermod -a -G ispconfig '.$conf['nginx']['user']; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); if(is_group('ispapps')){ - $command = 'groupmod --add-user '.$conf['nginx']['user'].' ispapps'; + //$command = 'groupmod --add-user '.$conf['nginx']['user'].' ispapps'; + $command = 'usermod -a -G ispapps '.$conf['nginx']['user']; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); } } diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php index 4d5fe875ec6390c444440cf32681d113330f334a..5686ac18a5d30b74d1cb00d177bceda0ee8e49a7 100644 --- a/install/lib/install.lib.php +++ b/install/lib/install.lib.php @@ -637,6 +637,11 @@ function replaceLine($filename, $search_pattern, $new_line, $strict = 0, $append $out .= $line; } } + if (!$found) { + if (trim($line) == $new_line) { + $found = 1; + } + } } if($found == 0) { //* add \n if the last line does not end with \n or \r @@ -718,6 +723,32 @@ function get_ispconfig_port_number() { } } +/* +* Get the port number of the ISPConfig apps vhost +*/ + +function get_apps_vhost_port_number() { + global $conf; + if($conf['nginx']['installed'] == true){ + $ispconfig_vhost_file = $conf['nginx']['vhost_conf_dir'].'/apps.vhost'; + $regex = '/listen (\d+)/'; + } else { + $ispconfig_vhost_file = $conf['apache']['vhost_conf_dir'].'/apps.vhost'; + $regex = '/\/'; + } + + if(is_file($ispconfig_vhost_file)) { + $tmp = file_get_contents($ispconfig_vhost_file); + preg_match($regex, $tmp, $matches); + $port_number = @intval($matches[1]); + if($port_number > 0) { + return $port_number; + } else { + return '8081'; + } + } +} + /* * Get the port number of the ISPConfig controlpanel vhost */ diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 83895d908600af35d807a86002a3873560736b0e..5ebb669b61fa6b8c0a0b7307e0396b3cadfad0e8 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -474,7 +474,15 @@ 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 ON ".$value['db'].".`aps_instances` TO '".$value['user']."'@'".$host."' "; + $query = "GRANT SELECT, UPDATE, DELETE ON ".$value['db'].".`aps_instances` TO '".$value['user']."'@'".$host."' "; + if ($verbose){ + echo $query ."\n"; + } + if(!$this->dbmaster->query($query)) { + $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 ".$value['db'].".`aps_instances_settings` TO '".$value['user']."'@'".$host."' "; if ($verbose){ echo $query ."\n"; } @@ -972,6 +980,7 @@ class installer_base { } else { copy('tpl/debian_dovecot2.conf.master', $config_dir.'/'.$configfile); } + replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0); } else { if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot.conf.master')) { copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot.conf.master', $config_dir.'/'.$configfile); @@ -996,6 +1005,9 @@ class installer_base { chmod($config_dir.'/'.$configfile, 0600); chown($config_dir.'/'.$configfile, 'root'); chgrp($config_dir.'/'.$configfile, 'root'); + + // Dovecot shall ignore mounts in website directory + exec("doveadm mount add '/var/www/*' ignore"); } @@ -1527,7 +1539,8 @@ class installer_base { if(!is_user($apps_vhost_user)) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - $command = 'adduser '.$conf['apache']['user'].' '.$apps_vhost_group; + //$command = 'adduser '.$conf['apache']['user'].' '.$apps_vhost_group; + $command = 'usermod -a -G '.$apps_vhost_group.' '.$conf['apache']['user']; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); if(!@is_dir($install_dir)){ @@ -1542,6 +1555,11 @@ class installer_base { $vhost_conf_dir = $conf['apache']['vhost_conf_dir']; $vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir']; $apps_vhost_servername = ($conf['web']['apps_vhost_servername'] == '')?'':'ServerName '.$conf['web']['apps_vhost_servername']; + + //* Get the apps vhost port + if($this->is_update == true) { + $conf['web']['apps_vhost_port'] = get_apps_vhost_port_number(); + } // Dont just copy over the virtualhost template but add some custom settings $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_apps.vhost.master', 'tpl/apache_apps.vhost.master'); diff --git a/install/sql/incremental/upd_0068.sql b/install/sql/incremental/upd_0068.sql new file mode 100644 index 0000000000000000000000000000000000000000..e7a00181127bf1d992981d7e9ff664253bbb851b --- /dev/null +++ b/install/sql/incremental/upd_0068.sql @@ -0,0 +1,4 @@ +ALTER TABLE `dbispconfig`.`web_domain` ADD UNIQUE `serverdomain` ( `server_id` , `domain` ); +DROP INDEX rr ON dns_rr; +ALTER TABLE `dns_rr` CHANGE `name` `name` VARCHAR( 128 ) NOT NULL ; +CREATE INDEX `rr` ON dns_rr (`zone`,`type`,`name`); \ No newline at end of file diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql index d43f956d35c72fd7f539bf64844a65cd8752f2e6..d255aaa06962f9e7c02ed657b0606f2a597d52f2 100644 --- a/install/sql/ispconfig3.sql +++ b/install/sql/ispconfig3.sql @@ -229,7 +229,7 @@ CREATE TABLE `client` ( `language` char(2) NOT NULL DEFAULT 'en', `usertheme` varchar(32) NOT NULL DEFAULT 'default', `template_master` int(11) unsigned NOT NULL DEFAULT '0', - `template_additional` text NOT NULL DEFAULT '', + `template_additional` text NOT NULL, `created_at` bigint(20) DEFAULT NULL, `locked` enum('n','y') NOT NULL DEFAULT 'n', `canceled` enum('n','y') NOT NULL DEFAULT 'n', @@ -450,7 +450,7 @@ CREATE TABLE `dns_rr` ( `stamp` timestamp NOT NULL default CURRENT_TIMESTAMP, `serial` int(10) unsigned default NULL, PRIMARY KEY (`id`), - UNIQUE KEY `rr` (`zone`,`name`,`type`,`data`) + KEY `rr` (`zone`,`type`,`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -736,8 +736,8 @@ CREATE TABLE `mail_domain` ( `server_id` int(11) unsigned NOT NULL default '0', `domain` varchar(255) NOT NULL default '', `dkim` ENUM( 'n', 'y' ) NOT NULL default 'n', - `dkim_private` mediumtext NOT NULL default '', - `dkim_public` mediumtext NOT NULL default '', + `dkim_private` mediumtext NOT NULL, + `dkim_public` mediumtext NOT NULL, `active` enum('n','y') NOT NULL, PRIMARY KEY (`domain_id`), KEY `server_id` (`server_id`,`domain`), @@ -1689,7 +1689,7 @@ CREATE TABLE `sys_user` ( `typ` varchar(16) NOT NULL default 'user', `active` tinyint(1) NOT NULL default '1', `language` varchar(2) NOT NULL default 'en', - `groups` TEXT NOT NULL default '', + `groups` TEXT NOT NULL, `default_group` int(11) unsigned NOT NULL default '0', `client_id` int(11) unsigned NOT NULL default '0', `id_rsa` VARCHAR( 2000 ) NOT NULL default '', @@ -1867,7 +1867,8 @@ CREATE TABLE `web_domain` ( `rewrite_rules` mediumtext, `added_date` date NOT NULL DEFAULT '0000-00-00', `added_by` varchar(255) DEFAULT NULL, - PRIMARY KEY (`domain_id`) + PRIMARY KEY (`domain_id`), + UNIQUE KEY `serverdomain` ( `server_id` , `domain` ) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- diff --git a/install/tpl/debian_dovecot2.conf.master b/install/tpl/debian_dovecot2.conf.master index 5b04c61a45163c443df75b7fcadd09396cb7b79e..030b2370217d33f28ee65eb88c9eee5c04ca2238 100644 --- a/install/tpl/debian_dovecot2.conf.master +++ b/install/tpl/debian_dovecot2.conf.master @@ -4,6 +4,7 @@ auth_mechanisms = plain login disable_plaintext_auth = no log_timestamp = "%Y-%m-%d %H:%M:%S " mail_privileged_group = vmail +postmaster_address = postmaster@example.com ssl_cert = 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()=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 = ''; @@ -315,9 +330,12 @@ class ApsCrawler extends ApsBase // 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()=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 @@ -365,7 +383,8 @@ class ApsCrawler extends ApsBase } // Download package license - $license = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='eula']/@href"); + //$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'; @@ -379,7 +398,8 @@ class ApsCrawler extends ApsBase } // Download package icon - $icon = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='icon']/@href"); + //$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); @@ -393,7 +413,8 @@ class ApsCrawler extends ApsBase } // Download available screenshots - $screenshots = parent::getXPathValue($sxe, "entry[position()=1]/link[@a:type='screenshot']", true); + //$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) diff --git a/interface/lib/classes/db_mysql.inc.php b/interface/lib/classes/db_mysql.inc.php index f0e7a602994884a7828cdac5ca133c17607c46fe..e0d3517b91ec308e2584e78da60403282e5db617 100644 --- a/interface/lib/classes/db_mysql.inc.php +++ b/interface/lib/classes/db_mysql.inc.php @@ -861,6 +861,9 @@ class db extends mysqli case 'blob': return 'blob'; break; + case 'date': + return 'date'; + break; } } diff --git a/interface/lib/classes/functions.inc.php b/interface/lib/classes/functions.inc.php index a964634cdcd1c6b78d1ee551783604126b7f70e7..8a287a47c595fb624ea74db1aeb38c242dcaf353 100644 --- a/interface/lib/classes/functions.inc.php +++ b/interface/lib/classes/functions.inc.php @@ -229,7 +229,8 @@ class functions { if(preg_match($regex, $result['ip'])) $ips[] = $result['ip']; } } - + + /* $results = $app->db->queryAllRecords("SELECT xfer FROM dns_slave WHERE xfer != ''"); if(!empty($results) && is_array($results)){ foreach($results as $result){ @@ -260,6 +261,8 @@ class functions { } } } + */ + $results = $app->db->queryAllRecords("SELECT remote_ips FROM web_database WHERE remote_ips != ''"); if(!empty($results) && is_array($results)){ foreach($results as $result){ diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php index cbe693fed704eae7472855cf6eac488ac38841ed..5541fcb83543cbcd4b57a6457a7c6d5bb2549649 100644 --- a/interface/lib/classes/remoting.inc.php +++ b/interface/lib/classes/remoting.inc.php @@ -180,8 +180,11 @@ class remoting { $session_id = $app->db->quote($session_id); $sql = "DELETE FROM remote_session WHERE remote_session = '$session_id'"; - $app->db->query($sql); - return $app->db->affectedRows() == 1; + if($app->db->query($sql) != false) { + return true; + } else { + return false; + } } //** protected functions ----------------------------------------------------------------------------------- diff --git a/interface/lib/classes/tform_actions.inc.php b/interface/lib/classes/tform_actions.inc.php index bb9e78e011d4a8254025fad791a0960dbd99db80..df00265ca574fc72fdd2b77c74ead879b7338269 100644 --- a/interface/lib/classes/tform_actions.inc.php +++ b/interface/lib/classes/tform_actions.inc.php @@ -314,6 +314,7 @@ class tform_actions { //$this->dataRecord = $app->db->queryOneRecord("SELECT * FROM ".$liste["table"]." WHERE ".$liste["table_idx"]." = ".$this->id); $this->dataRecord = $app->tform->getDataRecord($this->id); + $app->plugin->raiseEvent($_SESSION['s']['module']['name'].':'.$app->tform->formDef['name'].':'.'on_check_delete', $this); $this->onBeforeDelete(); $app->plugin->raiseEvent($_SESSION['s']['module']['name'].':'.$app->tform->formDef['name'].':'.'on_before_delete', $this); diff --git a/interface/lib/classes/tform_base.inc.php b/interface/lib/classes/tform_base.inc.php index 65f10c5216126f02edce4053bfb003e707fd1854..e295d5550ca18cdb1e40e212e61d5f8bca462c88 100644 --- a/interface/lib/classes/tform_base.inc.php +++ b/interface/lib/classes/tform_base.inc.php @@ -1367,7 +1367,7 @@ class tform_base { } function getAuthSQL($perm, $table = '') { - if($_SESSION["s"]["user"]["typ"] == 'admin') { + if($_SESSION["s"]["user"]["typ"] == 'admin' || $_SESSION['s']['user']['mailuser_id'] > 0) { return '1'; } else { if ($table != ''){ diff --git a/interface/lib/classes/tform_tpl_generator.inc.php b/interface/lib/classes/tform_tpl_generator.inc.php index 635aa0467b6c1408b404fd7ceae6fc5697cf4e24..a2da27606e1f5ab1a78f177ffcbe648448c59336 100644 --- a/interface/lib/classes/tform_tpl_generator.inc.php +++ b/interface/lib/classes/tform_tpl_generator.inc.php @@ -271,9 +271,9 @@ class tform_tpl_generator { $defaultValue = 'NULL'; break; case 'DATE': - $type = 'int64'; + $type = 'date'; $typevalue = ''; - $defaultValue = ($field["default"] != '')?$field["default"]:'0'; + $defaultValue = ($field["default"] != '')?$field["default"]:'0000-00-00'; break; } diff --git a/interface/lib/classes/tools_monitor.inc.php b/interface/lib/classes/tools_monitor.inc.php index 19f2ccd5a9969951bf0405f23e86e67bc64bd084..fe316cee2e6292d26745209a330edb56a316a4db 100644 --- a/interface/lib/classes/tools_monitor.inc.php +++ b/interface/lib/classes/tools_monitor.inc.php @@ -415,7 +415,9 @@ class tools_monitor { } else { $data = unserialize($record['data']); - $html .= nl2br($data['output']); + // improve view @Author + //-- $html .= nl2br($data['output']); + $html .= '' . $data['output'] . ''; } $html .= ''; diff --git a/interface/lib/classes/validate_cron.inc.php b/interface/lib/classes/validate_cron.inc.php index 7e95e18182a9d36ada114cf745a9c66562bb031c..27db600820dadecafa17223f52388d108df299b5 100644 --- a/interface/lib/classes/validate_cron.inc.php +++ b/interface/lib/classes/validate_cron.inc.php @@ -52,7 +52,7 @@ class validate_cron { if($parsed["scheme"] != "http" && $parsed["scheme"] != "https") return $this->get_error($validator['errmsg']); - if(preg_match("'^([a-z0-9][a-z0-9-]{0,62}\.)+([a-z]{2,30})$'i", $parsed["host"]) == false) return $this->get_error($validator['errmsg']); + if(preg_match("'^([a-z0-9][a-z0-9\-]{0,62}\.)+([A-Za-z0-9\-]{2,30})$'i", $parsed["host"]) == false) return $this->get_error($validator['errmsg']); } } 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 4ca9f1f9387fb30c66905bb8dbb878a3f4ff4632..670c5d693c8d0503778ac1e88f57a1a9f7e32562 100644 --- a/interface/lib/plugins/sites_web_vhost_domain_plugin.inc.php +++ b/interface/lib/plugins/sites_web_vhost_domain_plugin.inc.php @@ -80,10 +80,14 @@ class sites_web_vhost_domain_plugin { $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".$app->functions->intval(@$page_form->dataRecord["client_group_id"])); $client_id = $app->functions->intval($client["client_id"]); } else { + $client_group_id = $page_form->dataRecord["client_group_id"]; $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".$app->functions->intval($page_form->dataRecord["client_group_id"])); $client_id = $app->functions->intval($client["client_id"]); } + $tmp = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE default_group = $client_group_id"); + $client_user_id = $app->functions->intval(($tmp['userid'] > 0)?$tmp['userid']:1); + // Set the values for document_root, system_user and system_group $system_user = $app->db->quote('web'.$page_form->id); $system_group = $app->db->quote('client'.$client_id); diff --git a/interface/web/admin/form/system_config.tform.php b/interface/web/admin/form/system_config.tform.php index 889e6d53ac7afb23c21a43c1d2f79f99edeba6e8..76079b12747ece7e3df5316800db9d54789f6349 100644 --- a/interface/web/admin/form/system_config.tform.php +++ b/interface/web/admin/form/system_config.tform.php @@ -128,7 +128,7 @@ $form["tabs"]['sites'] = array ( 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[0-9a-zA-Z\:\/\-\.\[\]]{0,255}$/', + 'regex' => '/^[0-9a-zA-Z\:\/\-\.\_\[\]\?\=\&]{0,255}$/', 'errmsg'=> 'phpmyadmin_url_error_regex'), ), 'default' => '', diff --git a/interface/web/admin/templates/remote_user_edit.htm b/interface/web/admin/templates/remote_user_edit.htm index 69dd61ccfec51315f93cd12d1b83907537d6dccb..347835f8c9372e7ca5c9066cfcc909981b8a5bfa 100644 --- a/interface/web/admin/templates/remote_user_edit.htm +++ b/interface/web/admin/templates/remote_user_edit.htm @@ -13,7 +13,7 @@

{tmpl_var name='password_strength_txt'}

@@ -22,7 +22,7 @@
- +
diff --git a/interface/web/admin/templates/users_user_edit.htm b/interface/web/admin/templates/users_user_edit.htm index 186322e43cc5e74ec66c9d14197c0bdfcadd6d97..b973a34b7922635afa0f781972c6b0d2bdeada9d 100644 --- a/interface/web/admin/templates/users_user_edit.htm +++ b/interface/web/admin/templates/users_user_edit.htm @@ -11,7 +11,7 @@

{tmpl_var name='password_strength_txt'}

@@ -20,7 +20,7 @@
- +
diff --git a/interface/web/client/templates/client_edit_address.htm b/interface/web/client/templates/client_edit_address.htm index 6149a42d71ab1d7cea4f1e47571e5ee6ff7994de..ea4b5911dee68dd38cbe2b46faf317a16c91144d 100644 --- a/interface/web/client/templates/client_edit_address.htm +++ b/interface/web/client/templates/client_edit_address.htm @@ -30,7 +30,7 @@

{tmpl_var name='password_strength_txt'}

@@ -39,7 +39,7 @@
- +
diff --git a/interface/web/client/templates/reseller_edit_address.htm b/interface/web/client/templates/reseller_edit_address.htm index 5495d0adc78f1b5ee47044460107853b192efc07..4156254c4d158b980015b2a4329f46ab175d1573 100644 --- a/interface/web/client/templates/reseller_edit_address.htm +++ b/interface/web/client/templates/reseller_edit_address.htm @@ -30,7 +30,7 @@

{tmpl_var name='password_strength_txt'}

@@ -39,7 +39,7 @@
- +
diff --git a/interface/web/dns/form/dns_a.tform.php b/interface/web/dns/form/dns_a.tform.php index 7d4d276e8abc45572f0591afaf284e407a0d37ae..b7def7d1ea61a0ba0c339b4378084a08c0c0ea49 100644 --- a/interface/web/dns/form/dns_a.tform.php +++ b/interface/web/dns/form/dns_a.tform.php @@ -86,7 +86,7 @@ $form["tabs"]['dns'] = array ( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[\a-zA-Z0-9\.\-\*]{0,64}$/', + 'regex' => '/^[a-zA-Z0-9\.\-\*]{0,64}$/', 'errmsg'=> 'name_error_regex'), ), 'default' => '', diff --git a/interface/web/dns/form/dns_aaaa.tform.php b/interface/web/dns/form/dns_aaaa.tform.php index c03423b8b5020b77cf323cf5725468e89327a349..0550aa4269b0a39dab1e7480d2ee71d7887cdf7c 100644 --- a/interface/web/dns/form/dns_aaaa.tform.php +++ b/interface/web/dns/form/dns_aaaa.tform.php @@ -79,7 +79,7 @@ $form["tabs"]['dns'] = array ( 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-\*]{0,64}$/', + 'regex' => '/^[a-zA-Z0-9\.\-\*]{0,64}$/', 'errmsg'=> 'name_error_regex'), ), 'default' => '', diff --git a/interface/web/dns/form/dns_alias.tform.php b/interface/web/dns/form/dns_alias.tform.php index b97889bb39db089b491e9caa14729912e887614b..3325814dc17cc5dcbbf0062343048fb99279f483 100644 --- a/interface/web/dns/form/dns_alias.tform.php +++ b/interface/web/dns/form/dns_alias.tform.php @@ -88,7 +88,7 @@ $form["tabs"]['dns'] = array ( 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'name_error_empty'), 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{1,255}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{1,255}$/', 'errmsg'=> 'name_error_regex'), ), 'default' => '', @@ -117,7 +117,7 @@ $form["tabs"]['dns'] = array ( 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'data_error_empty'), 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{1,255}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{1,255}$/', 'errmsg'=> 'data_error_regex'), ), 'default' => '', diff --git a/interface/web/dns/form/dns_cname.tform.php b/interface/web/dns/form/dns_cname.tform.php index b9d246c9513a78ed39bb87821763feba7e62635e..e2a86dea8593bc10a69b0e6e89d57ad2c63478e9 100644 --- a/interface/web/dns/form/dns_cname.tform.php +++ b/interface/web/dns/form/dns_cname.tform.php @@ -86,7 +86,7 @@ $form["tabs"]['dns'] = array ( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-\*]{0,255}$/', + 'regex' => '/^[a-zA-Z0-9\.\-\*]{0,255}$/', 'errmsg'=> 'name_error_regex'), ), 'default' => '', @@ -115,7 +115,7 @@ $form["tabs"]['dns'] = array ( 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'data_error_empty'), 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{1,255}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{1,255}$/', 'errmsg'=> 'data_error_regex'), ), 'default' => '', diff --git a/interface/web/dns/form/dns_hinfo.tform.php b/interface/web/dns/form/dns_hinfo.tform.php index c64dea02dad7a2f594b633b7e8ae0a6cdfa110ca..6e815f5cd867b98421bca01c85fb15f614ed0f53 100644 --- a/interface/web/dns/form/dns_hinfo.tform.php +++ b/interface/web/dns/form/dns_hinfo.tform.php @@ -88,7 +88,7 @@ $form["tabs"]['dns'] = array ( 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'name_error_empty'), 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{1,64}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{1,64}$/', 'errmsg'=> 'name_error_regex'), ), 'default' => '', diff --git a/interface/web/dns/form/dns_mx.tform.php b/interface/web/dns/form/dns_mx.tform.php index 34268f9ef9503a6c51e4e4536673a4b6cfc80510..6e0c7e3236ae70750d6efcb1f62d27c06f774da0 100644 --- a/interface/web/dns/form/dns_mx.tform.php +++ b/interface/web/dns/form/dns_mx.tform.php @@ -87,7 +87,7 @@ $form["tabs"]['dns'] = array ( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-\*]{0,255}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{0,255}$/', 'errmsg'=> 'name_error_regex'), ), 'default' => '', @@ -116,7 +116,7 @@ $form["tabs"]['dns'] = array ( 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'data_error_empty'), 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{1,255}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{1,255}$/', 'errmsg'=> 'data_error_regex'), ), 'default' => '', diff --git a/interface/web/dns/form/dns_ns.tform.php b/interface/web/dns/form/dns_ns.tform.php index 3eb39a927a775956222fba0d9499bd7057c9a55f..502097773929dfb2263e8651f36a4fca117e23db 100644 --- a/interface/web/dns/form/dns_ns.tform.php +++ b/interface/web/dns/form/dns_ns.tform.php @@ -86,7 +86,7 @@ $form["tabs"]['dns'] = array ( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{0,255}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{0,255}$/', 'errmsg'=> 'name_error_regex'), ), 'default' => '', @@ -115,7 +115,7 @@ $form["tabs"]['dns'] = array ( 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'data_error_empty'), 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{1,255}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{1,255}$/', 'errmsg'=> 'data_error_regex'), ), 'default' => '', diff --git a/interface/web/dns/form/dns_ptr.tform.php b/interface/web/dns/form/dns_ptr.tform.php index 3ba441b17a62ef3fb401a566037b6a6a50bf3199..b7499928846a63823c4c2ebdd2d62d919990b9dd 100644 --- a/interface/web/dns/form/dns_ptr.tform.php +++ b/interface/web/dns/form/dns_ptr.tform.php @@ -86,7 +86,7 @@ $form["tabs"]['dns'] = array ( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{1,256}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{1,256}$/', 'errmsg'=> 'name_error_regex'), ), 'default' => '', @@ -115,7 +115,7 @@ $form["tabs"]['dns'] = array ( 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'data_error_empty'), 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{1,256}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{1,256}$/', 'errmsg'=> 'data_error_regex'), ), 'default' => '', diff --git a/interface/web/dns/form/dns_rp.tform.php b/interface/web/dns/form/dns_rp.tform.php index 86c43ed3286d0c4e18932aece91b4ff843778f62..3b7808e71651a97aa1b06cbb0007e0dcdd6516ef 100644 --- a/interface/web/dns/form/dns_rp.tform.php +++ b/interface/web/dns/form/dns_rp.tform.php @@ -86,7 +86,7 @@ $form["tabs"]['dns'] = array ( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{0,255}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{0,255}$/', 'errmsg'=> 'name_error_regex'), ), 'default' => '', diff --git a/interface/web/dns/form/dns_slave.tform.php b/interface/web/dns/form/dns_slave.tform.php index c5187317b8b373f96b5ee797f9d6b5e0485b5b7b..a416aed8b4cb5b83982d98272be150d808841710 100644 --- a/interface/web/dns/form/dns_slave.tform.php +++ b/interface/web/dns/form/dns_slave.tform.php @@ -96,7 +96,7 @@ $form["tabs"]['dns_slave'] = array ( 'errmsg'=> 'origin_error_unique'), */ 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-\/]{2,255}\.[a-zA-Z0-9\-]{2,10}[\.]{0,1}$/', + 'regex' => '/^[a-zA-Z0-9\.\-\/]{2,255}\.[a-zA-Z0-9\-]{2,10}[\.]{0,1}$/', 'errmsg'=> 'origin_error_regex'), ), 'default' => '', @@ -121,6 +121,11 @@ $form["tabs"]['dns_slave'] = array ( 'xfer' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISIP', + 'allowempty' => 'y', + 'separator' => ',', + 'errmsg'=> 'xfer_error_regex'), + ), 'default' => '', 'value' => '', 'width' => '30', diff --git a/interface/web/dns/form/dns_soa.tform.php b/interface/web/dns/form/dns_soa.tform.php index fd41c87c99f4c6b2f2d4eb5120bfe7361ee01354..e4237e08bcb21e5ed69481bed098b9584f4c59bc 100644 --- a/interface/web/dns/form/dns_soa.tform.php +++ b/interface/web/dns/form/dns_soa.tform.php @@ -95,7 +95,7 @@ $form["tabs"]['dns_soa'] = array ( 1 => array ( 'type' => 'UNIQUE', 'errmsg'=> 'origin_error_unique'), 2 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-\/]{2,255}\.[a-zA-Z0-9\-]{2,30}[\.]{0,1}$/', + 'regex' => '/^[a-zA-Z0-9\.\-\/]{2,255}\.[a-zA-Z0-9\-]{2,30}[\.]{0,1}$/', 'errmsg'=> 'origin_error_regex'), ), 'default' => '', @@ -115,7 +115,7 @@ $form["tabs"]['dns_soa'] = array ( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{1,255}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{1,255}$/', 'errmsg'=> 'ns_error_regex'), ), 'default' => '', @@ -137,7 +137,7 @@ $form["tabs"]['dns_soa'] = array ( 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'mbox_error_empty'), 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[[a-zA-Z0-9\.\-\_]{0,255}\.$/', + 'regex' => '/^[a-zA-Z0-9\.\-\_]{0,255}\.$/', 'errmsg'=> 'mbox_error_regex'), ), 'default' => '', diff --git a/interface/web/dns/form/dns_srv.tform.php b/interface/web/dns/form/dns_srv.tform.php index b737bbd97a1bddfef5c226d4c38f61d6a815281e..368ecbf076c4a65abfc85b6b99587cd1d6b70d15 100644 --- a/interface/web/dns/form/dns_srv.tform.php +++ b/interface/web/dns/form/dns_srv.tform.php @@ -86,7 +86,7 @@ $form["tabs"]['dns'] = array ( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{0,255}$/', + 'regex' => '/^[a-zA-Z0-9\.\-]{0,255}$/', 'errmsg'=> 'name_error_regex'), ), 'default' => '', diff --git a/interface/web/dns/form/dns_txt.tform.php b/interface/web/dns/form/dns_txt.tform.php index 159629b20367510eb91e69b472fd9a73992f64c9..489c5e813850af3dfbda2770732aac74aeb588de 100644 --- a/interface/web/dns/form/dns_txt.tform.php +++ b/interface/web/dns/form/dns_txt.tform.php @@ -86,7 +86,7 @@ $form["tabs"]['dns'] = array ( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{0,255}$/', + 'regex' => '/^[a-zA-Z0-9\.\-\_]{0,255}$/', 'errmsg'=> 'name_error_regex'), ), 'default' => '', diff --git a/interface/web/help/templates/faq_manage_questions_list.htm b/interface/web/help/templates/faq_manage_questions_list.htm index 0fa724c55526c0a3acf9f74c4ad21f78dd12d3f0..e7b5eafe829d3598fef5382703cd910224c24997 100644 --- a/interface/web/help/templates/faq_manage_questions_list.htm +++ b/interface/web/help/templates/faq_manage_questions_list.htm @@ -25,12 +25,12 @@ - {tmpl_var name='hf_question'} - {tmpl_var name='hf_section'} - + {tmpl_var name='hf_question'} + {tmpl_var name='hf_section'} + {tmpl_var name="faq_delete_txt"} - + {tmpl_var name="faq_edit_txt"} diff --git a/interface/web/js/jquery.tipsy.js b/interface/web/js/jquery.tipsy.js index 5e9c6948297731d7a17dac1658adc19a5588b389..dcb1bb5e6d2b74430b890812b71cd4585efb89b0 100644 --- a/interface/web/js/jquery.tipsy.js +++ b/interface/web/js/jquery.tipsy.js @@ -1,426 +1,438 @@ -// tipsy, facebook style tooltips for jquery -// version 1.0.0a -// (c) 2008-2010 jason frame [jason@onehackoranother.com] -// released under the MIT license - -(function($) { - - function maybeCall(thing, ctx) { - return (typeof thing == 'function') ? (thing.call(ctx)) : thing; - }; - - function Tipsy(element, options) { - this.$element = $(element); - this.options = options; - this.enabled = true; - this.fixTitle(); - }; - - Tipsy.prototype = { - show: function() { - var title = this.getTitle(); - if (title && this.enabled) { - var $tip = this.tip(); - - $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title); - $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity - $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body); - - var pos = $.extend({}, this.$element.offset(), { - width: this.$element[0].offsetWidth, - height: this.$element[0].offsetHeight - }); - - var actualWidth = $tip[0].offsetWidth, - actualHeight = $tip[0].offsetHeight, - gravity = maybeCall(this.options.gravity, this.$element[0]); - - var tp; - switch (gravity.charAt(0)) { - case 'n': - tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; - break; - case 's': - tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; - break; - case 'e': - tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset}; - break; - case 'w': - tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset}; - break; - } - - if (gravity.length == 2) { - if (gravity.charAt(1) == 'w') { - tp.left = pos.left + pos.width / 2 - 15; - } else { - tp.left = pos.left + pos.width / 2 - actualWidth + 15; - } - } - - $tip.css(tp).addClass('tipsy-' + gravity); - $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0); - if (this.options.className) { - $tip.addClass(maybeCall(this.options.className, this.$element[0])); - } - - if (this.options.fade) { - $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}); - } else { - $tip.css({visibility: 'visible', opacity: this.options.opacity}); - } - } - }, - - hide: function() { - if (this.options.fade) { - this.tip().stop().fadeOut(function() { $(this).remove(); }); - } else { - this.tip().remove(); - } - }, - - fixTitle: function() { - var $e = this.$element; - if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') { - $e.attr('original-title', $e.attr('title') || '').removeAttr('title'); - } - }, - - getTitle: function() { - var title, $e = this.$element, o = this.options; - this.fixTitle(); - var title, o = this.options; - if (typeof o.title == 'string') { - title = $e.attr(o.title == 'title' ? 'original-title' : o.title); - } else if (typeof o.title == 'function') { - title = o.title.call($e[0]); - } - title = ('' + title).replace(/(^\s*|\s*$)/, ""); - return title || o.fallback; - }, - - tip: function() { - if (!this.$tip) { - this.$tip = $('
').html('
'); - } - return this.$tip; - }, - - validate: function() { - if (!this.$element[0].parentNode) { - this.hide(); - this.$element = null; - this.options = null; - } - }, - - enable: function() { this.enabled = true; }, - disable: function() { this.enabled = false; }, - toggleEnabled: function() { this.enabled = !this.enabled; } - }; - - $.fn.tipsy = function(options) { - - if (options === true) { - return this.data('tipsy'); - } else if (typeof options == 'string') { - var tipsy = this.data('tipsy'); - if (tipsy) tipsy[options](); - return this; - } - - options = $.extend({}, $.fn.tipsy.defaults, options); - - function get(ele) { - var tipsy = $.data(ele, 'tipsy'); - if (!tipsy) { - tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options)); - $.data(ele, 'tipsy', tipsy); - } - return tipsy; - } - - function enter() { - var tipsy = get(this); - tipsy.hoverState = 'in'; - if (options.delayIn == 0) { - tipsy.show(); - } else { - tipsy.fixTitle(); - setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn); - } - }; - - function leave() { - var tipsy = get(this); - tipsy.hoverState = 'out'; - if (options.delayOut == 0) { - tipsy.hide(); - } else { - setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut); - } - }; - - if (!options.live) this.each(function() { get(this); }); - - if (options.trigger != 'manual') { - var binder = options.live ? 'live' : 'bind', - eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', - eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; - this[binder](eventIn, enter)[binder](eventOut, leave); - } - - return this; - - }; - - $.fn.tipsy.defaults = { - className: null, - delayIn: 0, - delayOut: 0, - fade: false, - fallback: '', - gravity: 'n', - html: false, - live: false, - offset: 0, - opacity: 0.8, - title: 'title', - trigger: 'hover' - }; - - // Overwrite this method to provide options on a per-element basis. - // For example, you could store the gravity in a 'tipsy-gravity' attribute: - // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' }); - // (remember - do not modify 'options' in place!) - $.fn.tipsy.elementOptions = function(ele, options) { - return $.metadata ? $.extend({}, options, $(ele).metadata()) : options; - }; - - $.fn.tipsy.autoNS = function() { - return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n'; - }; - - $.fn.tipsy.autoWE = function() { - return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w'; - }; - - /** - * yields a closure of the supplied parameters, producing a function that takes - * no arguments and is suitable for use as an autogravity function like so: - * - * @param margin (int) - distance from the viewable region edge that an - * element should be before setting its tooltip's gravity to be away - * from that edge. - * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer - * if there are no viewable region edges effecting the tooltip's - * gravity. It will try to vary from this minimally, for example, - * if 'sw' is preferred and an element is near the right viewable - * region edge, but not the top edge, it will set the gravity for - * that element's tooltip to be 'se', preserving the southern - * component. - */ - $.fn.tipsy.autoBounds = function(margin, prefer) { - return function() { - var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)}, - boundTop = $(document).scrollTop() + margin, - boundLeft = $(document).scrollLeft() + margin, - $this = $(this); - - if ($this.offset().top < boundTop) dir.ns = 'n'; - if ($this.offset().left < boundLeft) dir.ew = 'w'; - if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e'; - if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's'; - - return dir.ns + (dir.ew ? dir.ew : ''); - } - }; - -})(jQuery); - - - -(function( $ ) { - $.widget( "ui.combobox", { - _create: function() { - var elwidth = this.element.width(); - var elheight = this.element.height(); - var input, - self = this, - select = this.element, - internal = false, - selected = select.children( ":selected" ), - value = selected.val() ? selected.text() : "", - wrapper = this.wrapper = $( "" ) - .addClass( "ui-combobox" ) - .insertAfter( select ); - - input = $( "" ).css( { "width": (select.is(':visible') ? (elwidth > 15 ? elwidth - 15 : 1) : 350), "height": (elheight > 0 ? elheight : 16) }); - select.hide(); - input.appendTo( wrapper ) - .val( value ) - .addClass( "ui-state-default ui-combobox-input" ) - .autocomplete({ - delay: 0, - minLength: 0, - source: function( request, response ) { - var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" ); - response( select.children( "option" ).map(function() { - var text = $( this ).text(); - //if ( this.value && ( !request.term || matcher.test(text) ) ) - if ( (!request.term || matcher.test(text)) && $(this).css('display') != 'none' ) - return { - label: (text == "" ? " " : text.replace( - new RegExp( - "(?![^&;]+;)(?!<[^<>]*)(" + - $.ui.autocomplete.escapeRegex(request.term) + - ")(?![^<>]*>)(?![^&;]+;)", "gi" - ), "$1" )), - 'value': (text ? text : ''), - 'class': (select.hasClass('flags') ? 'country-' + ($(this).val() ? $(this).val().toUpperCase() : '') : $(this).attr('class')), - option: this - }; - }) ); - }, - select: function( event, ui ) { - ui.item.option.selected = true; - self._trigger( "selected", event, { - item: ui.item.option - }); - if((select.onchange || false) && typeof select.onchange == 'function') { - select.onchange( { target: select } ); - } else if($(select).attr('onchange')) { - eval($(select).attr('onchange')); - } else { - if(!ui.item.internal) { - internal = true; - $(select).change(); - } - } - if (jQuery(".panel #Filter").length > 0) { - jQuery(".panel #Filter").trigger('click'); - } - }, - change: function( event, ui ) { - if ( !ui.item ) { - var matcher = new RegExp( "" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "", "i" ), - matchtext = $(this).val(); - valid = false; - select.children( "option" ).each(function() { - if( (($(this).text() == "" && matchtext == "") || $( this ).text().match( matcher )) && $(this).css('display') != 'none' ) { - select.val($(this).val()); - this.selected = valid = true; - return false; - } - }); - if ( !valid ) { - // remove invalid value, as it didn't match anything - $( this ).val( "" ); - select.val( "" ); - input.data( "autocomplete" ).term = ""; - return false; - } - } - } - }) - .keypress(function(event) { - if(event.keyCode == 13) { - event.preventDefault(); - var matcher = new RegExp( "" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "", "i" ), - matchtext = $(this).val(); - valid = false, - selected = false; - select.children( "option" ).each(function() { - if( (($(this).val() == "" && matchtext == "") || $( this ).text().match( matcher )) && $(this).css('display') != 'none' ) { - valid = true; - selected = $(this); - return false; - } - }); - if(!valid) return false; - - $(this).autocomplete('option','select').call($(this), event, { item: { option: selected.get(0), internal: true } }); - } - }) - .addClass( "ui-widget ui-widget-content ui-corner-left" ) - .click(function() { - // close if already visible - if ( input.autocomplete( "widget" ).is( ":visible" ) ) { - //input.autocomplete( "close" ); - return; - } - - // pass empty string as value to search for, displaying all results - input.autocomplete( "search", "" ); - input.focus(); - }); - if(select.hasClass('flags')) input.addClass('flags'); - - input.data( "autocomplete" )._renderItem = function( ul, item ) { - var el = $( "
  • " ) - .data( "item.autocomplete", item ) - .append( "" + item.label + "" ) - .appendTo( ul ); - if(item && item['class'] && el) el.addClass(item['class']); - return el; - }; - select.change(function(e) { - if(internal == true) { - internal = false; - return; - } - var matchtext = $(this).val().toLowerCase(); - valid = false, - selected = false, - selected_val = ""; - select.children( "option" ).each(function() { - if( (($(this).val() == "" && matchtext == "") || $( this ).val().toLowerCase() == matchtext) && $(this).css('display') != 'none' ) { - valid = true; - selected = $(this); - selected_val = $(this).text(); - return false; - } - }); - if(!valid) return false; - - input.val(selected_val).autocomplete('option','select').call(input, (e ? e : {target: select}), { item: { option: selected.get(0), internal: true } }); - }); - - $( "" ) - .attr( "tabIndex", -1 ) - .attr( "title", "Show All Items" ) - .appendTo( wrapper ) - .button({ - icons: { - primary: "ui-icon-triangle-1-s" - }, - text: false - }) - .removeClass( "ui-corner-all" ) - .addClass( "ui-corner-right ui-combobox-toggle" ) - .css( { "width": 15, "height": (elheight > 0 ? elheight : 16) }) - .click(function() { - // close if already visible - if ( input.autocomplete( "widget" ).is( ":visible" ) ) { - input.autocomplete( "close" ); - return; - } - - // work around a bug (likely same cause as #5265) - $( this ).blur(); - - // pass empty string as value to search for, displaying all results - input.autocomplete( "search", "" ); - input.focus(); - }); - }, - - destroy: function() { - this.wrapper.remove(); - this.element.show(); - $.Widget.prototype.destroy.call( this ); - } - }); -})( jQuery ); +// tipsy, facebook style tooltips for jquery +// version 1.0.0a +// (c) 2008-2010 jason frame [jason@onehackoranother.com] +// released under the MIT license + +(function($) { + + function maybeCall(thing, ctx) { + return (typeof thing == 'function') ? (thing.call(ctx)) : thing; + }; + + function Tipsy(element, options) { + this.$element = $(element); + this.options = options; + this.enabled = true; + this.fixTitle(); + }; + + Tipsy.prototype = { + show: function() { + var title = this.getTitle(); + if (title && this.enabled) { + var $tip = this.tip(); + + $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title); + $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity + $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body); + + var pos = $.extend({}, this.$element.offset(), { + width: this.$element[0].offsetWidth, + height: this.$element[0].offsetHeight + }); + + var actualWidth = $tip[0].offsetWidth, + actualHeight = $tip[0].offsetHeight, + gravity = maybeCall(this.options.gravity, this.$element[0]); + + var tp; + switch (gravity.charAt(0)) { + case 'n': + tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; + break; + case 's': + tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; + break; + case 'e': + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset}; + break; + case 'w': + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset}; + break; + } + + if (gravity.length == 2) { + if (gravity.charAt(1) == 'w') { + tp.left = pos.left + pos.width / 2 - 15; + } else { + tp.left = pos.left + pos.width / 2 - actualWidth + 15; + } + } + + $tip.css(tp).addClass('tipsy-' + gravity); + $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0); + if (this.options.className) { + $tip.addClass(maybeCall(this.options.className, this.$element[0])); + } + + if (this.options.fade) { + $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}); + } else { + $tip.css({visibility: 'visible', opacity: this.options.opacity}); + } + } + }, + + hide: function() { + if (this.options.fade) { + this.tip().stop().fadeOut(function() { $(this).remove(); }); + } else { + this.tip().remove(); + } + }, + + fixTitle: function() { + var $e = this.$element; + if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') { + $e.attr('original-title', $e.attr('title') || '').removeAttr('title'); + } + }, + + getTitle: function() { + var title, $e = this.$element, o = this.options; + this.fixTitle(); + var title, o = this.options; + if (typeof o.title == 'string') { + title = $e.attr(o.title == 'title' ? 'original-title' : o.title); + } else if (typeof o.title == 'function') { + title = o.title.call($e[0]); + } + title = ('' + title).replace(/(^\s*|\s*$)/, ""); + return title || o.fallback; + }, + + tip: function() { + if (!this.$tip) { + this.$tip = $('
    ').html('
    '); + } + return this.$tip; + }, + + validate: function() { + if (!this.$element[0].parentNode) { + this.hide(); + this.$element = null; + this.options = null; + } + }, + + enable: function() { this.enabled = true; }, + disable: function() { this.enabled = false; }, + toggleEnabled: function() { this.enabled = !this.enabled; } + }; + + $.fn.tipsy = function(options) { + + if (options === true) { + return this.data('tipsy'); + } else if (typeof options == 'string') { + var tipsy = this.data('tipsy'); + if (tipsy) tipsy[options](); + return this; + } + + options = $.extend({}, $.fn.tipsy.defaults, options); + + function get(ele) { + var tipsy = $.data(ele, 'tipsy'); + if (!tipsy) { + tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options)); + $.data(ele, 'tipsy', tipsy); + } + return tipsy; + } + + function enter() { + var tipsy = get(this); + tipsy.hoverState = 'in'; + if (options.delayIn == 0) { + tipsy.show(); + } else { + tipsy.fixTitle(); + setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn); + } + }; + + function leave() { + var tipsy = get(this); + tipsy.hoverState = 'out'; + if (options.delayOut == 0) { + tipsy.hide(); + } else { + setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut); + } + }; + + if (!options.live) this.each(function() { get(this); }); + + if (options.trigger != 'manual') { + var binder = options.live ? 'live' : 'bind', + eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', + eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; + this[binder](eventIn, enter)[binder](eventOut, leave); + } + + return this; + + }; + + $.fn.tipsy.defaults = { + className: null, + delayIn: 0, + delayOut: 0, + fade: false, + fallback: '', + gravity: 'n', + html: false, + live: false, + offset: 0, + opacity: 0.8, + title: 'title', + trigger: 'hover' + }; + + // Overwrite this method to provide options on a per-element basis. + // For example, you could store the gravity in a 'tipsy-gravity' attribute: + // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' }); + // (remember - do not modify 'options' in place!) + $.fn.tipsy.elementOptions = function(ele, options) { + return $.metadata ? $.extend({}, options, $(ele).metadata()) : options; + }; + + $.fn.tipsy.autoNS = function() { + return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n'; + }; + + $.fn.tipsy.autoWE = function() { + return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w'; + }; + + /** + * yields a closure of the supplied parameters, producing a function that takes + * no arguments and is suitable for use as an autogravity function like so: + * + * @param margin (int) - distance from the viewable region edge that an + * element should be before setting its tooltip's gravity to be away + * from that edge. + * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer + * if there are no viewable region edges effecting the tooltip's + * gravity. It will try to vary from this minimally, for example, + * if 'sw' is preferred and an element is near the right viewable + * region edge, but not the top edge, it will set the gravity for + * that element's tooltip to be 'se', preserving the southern + * component. + */ + $.fn.tipsy.autoBounds = function(margin, prefer) { + return function() { + var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)}, + boundTop = $(document).scrollTop() + margin, + boundLeft = $(document).scrollLeft() + margin, + $this = $(this); + + if ($this.offset().top < boundTop) dir.ns = 'n'; + if ($this.offset().left < boundLeft) dir.ew = 'w'; + if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e'; + if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's'; + + return dir.ns + (dir.ew ? dir.ew : ''); + } + }; + +})(jQuery); + + + +(function( $ ) { + $.widget( "ui.combobox", { + _create: function() { + var elwidth = this.element.width(); + var elheight = this.element.height(); + var input, + self = this, + select = this.element, + internal = false, + selected = select.children( ":selected" ), + value = selected.val() ? selected.text() : "", + wrapper = this.wrapper = $( "" ) + .addClass( "ui-combobox" ) + .insertAfter( select ); + + input = $( "" ).css( { "width": (select.is(':visible') ? (elwidth > 15 ? elwidth - 15 : 1) : 350), "height": (elheight > 0 ? elheight : 16) }); + select.hide(); + input.appendTo( wrapper ) + .val( value ) + .addClass( "ui-state-default ui-combobox-input" ) + .autocomplete({ + delay: 0, + minLength: 0, + source: function( request, response ) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" ); + response( select.children( "option" ).map(function() { + var text = $( this ).text(); + //if ( this.value && ( !request.term || matcher.test(text) ) ) + if ( (!request.term || matcher.test(text)) && $(this).css('display') != 'none' ) + return { + label: (text == "" ? " " : text.replace( + new RegExp( + "(?![^&;]+;)(?!<[^<>]*)(" + + $.ui.autocomplete.escapeRegex(request.term) + + ")(?![^<>]*>)(?![^&;]+;)", "gi" + ), "$1" )), + 'value': (text ? text : ''), + 'class': (select.hasClass('flags') ? 'country-' + ($(this).val() ? $(this).val().toUpperCase() : '') : $(this).attr('class')), + option: this + }; + }) ); + }, + select: function( event, ui ) { + ui.item.option.selected = true; + self._trigger( "selected", event, { + item: ui.item.option + }); + if((select.onchange || false) && typeof select.onchange == 'function') { + select.onchange( { target: select } ); + } else if($(select).attr('onchange')) { + eval($(select).attr('onchange')); + } else { + if(!ui.item.internal) { + internal = true; + $(select).change(); + } + } + if (jQuery(".panel #Filter").length > 0) { + jQuery(".panel #Filter").trigger('click'); + } + }, + change: function( event, ui ) { + if ( !ui.item ) { + var matcher = new RegExp( "" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "", "i" ), + matchtext = $(this).val(); + valid = false; + select.children( "option" ).each(function() { + if( (($(this).text() == "" && matchtext == "") || $( this ).text().match( matcher )) && $(this).css('display') != 'none' ) { + select.val($(this).val()); + this.selected = valid = true; + return false; + } + }); + if ( !valid ) { + // remove invalid value, as it didn't match anything + $( this ).val( "" ); + select.val( "" ); + input.data( "autocomplete" ).term = ""; + return false; + } + } + } + }) + .keypress(function(event) { + if(select.attr('disabled')) { + event.preventDefault(); + return false; + } + if(event.keyCode == 13) { + event.preventDefault(); + var matcher = new RegExp( "" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "", "i" ), + matchtext = $(this).val(); + valid = false, + selected = false; + select.children( "option" ).each(function() { + if( (($(this).val() == "" && matchtext == "") || $( this ).text().match( matcher )) && $(this).css('display') != 'none' ) { + valid = true; + selected = $(this); + return false; + } + }); + if(!valid) return false; + + $(this).autocomplete('option','select').call($(this), event, { item: { option: selected.get(0), internal: true } }); + } + }) + .addClass( "ui-widget ui-widget-content ui-corner-left" ) + .click(function() { + if(select.attr('disabled')) { + event.preventDefault(); + return false; + } + // close if already visible + if ( input.autocomplete( "widget" ).is( ":visible" ) ) { + //input.autocomplete( "close" ); + return; + } + + // pass empty string as value to search for, displaying all results + input.autocomplete( "search", "" ); + input.focus(); + }); + if(select.hasClass('flags')) input.addClass('flags'); + + input.data( "autocomplete" )._renderItem = function( ul, item ) { + var el = $( "
  • " ) + .data( "item.autocomplete", item ) + .append( "
    " + item.label + "" ) + .appendTo( ul ); + if(item && item['class'] && el) el.addClass(item['class']); + return el; + }; + select.change(function(e) { + if(internal == true) { + internal = false; + return; + } + var matchtext = $(this).val().toLowerCase(); + valid = false, + selected = false, + selected_val = ""; + select.children( "option" ).each(function() { + if( (($(this).val() == "" && matchtext == "") || $( this ).val().toLowerCase() == matchtext) && $(this).css('display') != 'none' ) { + valid = true; + selected = $(this); + selected_val = $(this).text(); + return false; + } + }); + if(!valid) return false; + + input.val(selected_val).autocomplete('option','select').call(input, (e ? e : {target: select}), { item: { option: selected.get(0), internal: true } }); + }); + + $( "" ) + .attr( "tabIndex", -1 ) + .attr( "title", "Show All Items" ) + .appendTo( wrapper ) + .button({ + icons: { + primary: "ui-icon-triangle-1-s" + }, + text: false + }) + .removeClass( "ui-corner-all" ) + .addClass( "ui-corner-right ui-combobox-toggle" ) + .css( { "width": 15, "height": (elheight > 0 ? elheight : 16) }) + .click(function() { + if(select.attr('disabled')) { + event.preventDefault(); + return false; + } + // close if already visible + if ( input.autocomplete( "widget" ).is( ":visible" ) ) { + input.autocomplete( "close" ); + return; + } + + // work around a bug (likely same cause as #5265) + $( this ).blur(); + + // pass empty string as value to search for, displaying all results + input.autocomplete( "search", "" ); + input.focus(); + }); + }, + + destroy: function() { + this.wrapper.remove(); + this.element.show(); + $.Widget.prototype.destroy.call( this ); + } + }); +})( jQuery ); diff --git a/interface/web/js/scrigo.js.php b/interface/web/js/scrigo.js.php index 2da73cbded894c5c94f5b13b0fcfe99c34a5a3c6..a69b7c2d242b26537f3a99505b1c8ea26bdfd6f1 100644 --- a/interface/web/js/scrigo.js.php +++ b/interface/web/js/scrigo.js.php @@ -123,7 +123,7 @@ function loadContentRefresh(pagename) { reportError('Ajax Request was not successful.'+pagename); } }); - setTimeout( "loadContentRefresh('"+pagename+"&refresh="+document.getElementById('refreshinterval').value+"')", document.getElementById('refreshinterval').value*1000 ); + setTimeout( "loadContentRefresh('"+pagename+"&refresh="+document.getElementById('refreshinterval').value+"')", document.getElementById('refreshinterval').value*1000*60 ); } } diff --git a/interface/web/login/lib/lang/en.lng b/interface/web/login/lib/lang/en.lng index 768eaba6a6c4783dd56c568e593931f335da1911..e540ef2dba6aad41203b40c23c83677d38ec3baa 100644 --- a/interface/web/login/lib/lang/en.lng +++ b/interface/web/login/lib/lang/en.lng @@ -7,13 +7,11 @@ $wb['pass_reset_txt'] = 'A new password will be generated and send to your $wb['pw_reset'] = 'The password has been reset and send to your email address.'; $wb['pw_error'] = 'Username or email address does not match.'; $wb['pw_error_noinput'] = 'Please enter email address and username.'; - $wb['pw_reset_mail_msg'] = 'The password to your ISPConfig 3 control panel account has been reset. The new password is: '; $wb['pw_reset_mail_title'] = 'ISPConfig 3 Control panel password has been reset.'; - $wb['user_regex_error'] = 'Username contains unallowed characters or is longer than 64 characters.'; $wb['pw_error_length'] = 'The password length is > 64 characters.'; - +$wb['email_error'] = 'Email contains unallowed characters or has a invalid format.'; $wb['login_txt'] = "Login"; $wb['username_txt'] = "Username"; $wb['password_txt'] = "Password"; @@ -23,9 +21,7 @@ $wb['pw_reset_txt'] = "Password reset"; $wb['pw_button_txt'] = "Resend password"; $wb['email_txt'] = "Email"; $wb['back_txt'] = 'Back'; - $wb['error_maintenance_mode'] = 'This ISPConfig installation is currently under maintenance. We should be back shortly. Thank you for your patience.'; - $wb['theme_not_compatible'] = 'The chosen theme is not compatible with the current ISPConfig version. Please check for a new version of the theme.
    The default theme as been activated automatically.'; $wb['stay_logged_in_txt'] = 'Keep me logged in'; ?> \ No newline at end of file diff --git a/interface/web/mail/form/mail_user.tform.php b/interface/web/mail/form/mail_user.tform.php index ce3c195f62fc9b2485731e8b53ae4c34a96819ce..14e9afef8b702b6f397b16706afc7ab92df52094 100644 --- a/interface/web/mail/form/mail_user.tform.php +++ b/interface/web/mail/form/mail_user.tform.php @@ -160,7 +160,7 @@ $form["tabs"]['mailuser'] = array( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i', + 'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}(,\s*\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,}$/i', 'errmsg'=> 'cc_error_isemail'), ), 'default' => '', diff --git a/interface/web/mail/lib/lang/de_mail_user.lng b/interface/web/mail/lib/lang/de_mail_user.lng index f9f66f669e0b5ecf31044fcee769537a287828a6..3ee74a5b501f3a97c56c69e8a5f906fb63331f22 100644 --- a/interface/web/mail/lib/lang/de_mail_user.lng +++ b/interface/web/mail/lib/lang/de_mail_user.lng @@ -16,7 +16,7 @@ $wb['quota_txt'] = 'Beschränkung'; $wb['server_id_txt'] = 'Server ID'; $wb['password_txt'] = 'Passwort'; $wb['maildir_txt'] = 'E-Mail Verzeichnis'; -$wb['postfix_txt'] = 'Aktiviere Empfang'; +$wb['postfix_txt'] = 'Aktiviere SMTP (in/out)'; $wb['access_txt'] = 'Aktiviere Zugriff'; $wb['policy_txt'] = 'Spamfilter'; $wb['no_policy'] = '- nicht aktiviert -'; @@ -54,5 +54,5 @@ $wb['no_backup_txt'] = 'inaktiv'; $wb['daily_backup_txt'] = 'taeglich'; $wb['weekly_backup_txt'] = 'woechentlich'; $wb['monthly_backup_txt'] = 'monatlich'; - +$wb['cc_note_txt'] = '(Mehrere E-Mail-Adressen mit Kommas trennen)'; ?> diff --git a/interface/web/mail/lib/lang/en_mail_user.lng b/interface/web/mail/lib/lang/en_mail_user.lng index fd2b110085c2f0288daeb1af67b4a2de75059f0d..389dad0c6d0268325e0e92c4e20d7d3dc82a1c94 100644 --- a/interface/web/mail/lib/lang/en_mail_user.lng +++ b/interface/web/mail/lib/lang/en_mail_user.lng @@ -21,7 +21,7 @@ $wb["quota_txt"] = 'Quota (0 for unlimited)'; $wb["server_id_txt"] = 'Aerver_id'; $wb["password_txt"] = 'Password'; $wb["maildir_txt"] = 'Maildir'; -$wb["postfix_txt"] = 'Enable Receiving'; +$wb["postfix_txt"] = 'Enable SMTP (in/out)'; $wb["access_txt"] = 'Enable Access'; $wb["policy_txt"] = 'Spamfilter'; $wb["no_policy"] = '- not enabled -'; @@ -54,4 +54,5 @@ $wb['daily_backup_txt'] = 'Daily'; $wb['weekly_backup_txt'] = 'Weekly'; $wb['monthly_backup_txt'] = 'Monthly'; $wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.'; +$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)'; ?> diff --git a/interface/web/mail/templates/mail_mailinglist_edit.htm b/interface/web/mail/templates/mail_mailinglist_edit.htm index 6a37951b8362dc563aba28f45dea02125ef9336f..d9ec0ca6f0ab94b5c0199edec0d3abed52f66140 100644 --- a/interface/web/mail/templates/mail_mailinglist_edit.htm +++ b/interface/web/mail/templates/mail_mailinglist_edit.htm @@ -60,7 +60,7 @@

    {tmpl_var name='password_strength_txt'}

    @@ -69,7 +69,7 @@
    - +
    diff --git a/interface/web/mail/templates/mail_user_mailbox_edit.htm b/interface/web/mail/templates/mail_user_mailbox_edit.htm index 2647e249984d8f6e19ee83df0c0dd3f80bac7a5b..f946502dbd11d9b4a1bc79114d9c244cee736928 100644 --- a/interface/web/mail/templates/mail_user_mailbox_edit.htm +++ b/interface/web/mail/templates/mail_user_mailbox_edit.htm @@ -23,7 +23,7 @@

    {tmpl_var name='password_strength_txt'}

    @@ -32,7 +32,7 @@
    - +
    @@ -42,7 +42,7 @@
    -   {tmpl_var name='name_optional_txt'} +   {tmpl_var name='name_optional_txt'} {tmpl_var name='cc_note_txt'}
    diff --git a/interface/web/mailuser/form/mail_user_cc.tform.php b/interface/web/mailuser/form/mail_user_cc.tform.php index 6458bb730a9a7bb8c450d089917bb759c8cf80dd..5f1d9ef7a93335449dcfdfb5efe1ef2a29ab1e38 100644 --- a/interface/web/mailuser/form/mail_user_cc.tform.php +++ b/interface/web/mailuser/form/mail_user_cc.tform.php @@ -69,7 +69,8 @@ $form["tabs"]['mailuser'] = array ( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-z\-]{2,10}){0,1}$/i', + //'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-z\-]{2,10}){0,1}$/i', + 'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}(,\s*\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,}$/i', 'errmsg'=> 'cc_error_isemail'), ), 'default' => '', diff --git a/interface/web/mailuser/lib/lang/de_mail_user_cc.lng b/interface/web/mailuser/lib/lang/de_mail_user_cc.lng index b85077ea7cb0a489ec6e0f5110093a0c9a363684..e43d39c1697bb0e67578a3c634048db25cc3831a 100644 --- a/interface/web/mailuser/lib/lang/de_mail_user_cc.lng +++ b/interface/web/mailuser/lib/lang/de_mail_user_cc.lng @@ -4,4 +4,6 @@ $wb['cc_txt'] = 'Kopie senden an'; $wb['email_txt'] = 'E-Mail'; $wb['cc_error_isemail'] = 'E-Mail Adresse ungültig im -Kopie senden an- Feld'; $wb['email_is_cc_error'] = 'E-Mail Adresse und '; +$wb['name_optional_txt'] = '(optional)'; +$wb['cc_note_txt'] = '(Mehrere E-Mail-Adressen mit Kommas trennen)'; ?> diff --git a/interface/web/mailuser/lib/lang/en_mail_user_cc.lng b/interface/web/mailuser/lib/lang/en_mail_user_cc.lng index 0073c71647eb0196b2be0aebc83018484100d7cd..3437d50d195c8bdef543e2a688f5527250585415 100644 --- a/interface/web/mailuser/lib/lang/en_mail_user_cc.lng +++ b/interface/web/mailuser/lib/lang/en_mail_user_cc.lng @@ -4,4 +4,6 @@ $wb["cc_txt"] = 'Send copy to'; $wb["email_txt"] = 'Email'; $wb["cc_error_isemail"] = 'Email address invalid in -Send copy to- field'; $wb["email_is_cc_error"] = 'Email address and send copy to address can not be the same.'; +$wb["name_optional_txt"] = '(Optional)'; +$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)'; ?> \ No newline at end of file diff --git a/interface/web/mailuser/mail_user_spamfilter_edit.php b/interface/web/mailuser/mail_user_spamfilter_edit.php index dfc397dda342d8d19e759ad0e2f979707bcd2b06..3ea2aa57d55f363c75e57fddebccd755e6ab1025 100644 --- a/interface/web/mailuser/mail_user_spamfilter_edit.php +++ b/interface/web/mailuser/mail_user_spamfilter_edit.php @@ -51,7 +51,8 @@ $app->load('tform_actions'); class page_action extends tform_actions { function onShow() { - + global $app; + $this->id = $app->functions->intval($_SESSION['s']['user']['mailuser_id']); parent::onShow(); diff --git a/interface/web/mailuser/templates/mail_user_cc_edit.htm b/interface/web/mailuser/templates/mail_user_cc_edit.htm index ba715c89ae1569baa7cf0135124d0b186291a9ba..3b82c464797d34306563c0674d02fb996de85a55 100644 --- a/interface/web/mailuser/templates/mail_user_cc_edit.htm +++ b/interface/web/mailuser/templates/mail_user_cc_edit.htm @@ -11,7 +11,7 @@
    -   {tmpl_var name='name_optional_txt'} +   {tmpl_var name='name_optional_txt'} {tmpl_var name='cc_note_txt'}
    diff --git a/interface/web/mailuser/templates/mail_user_password_edit.htm b/interface/web/mailuser/templates/mail_user_password_edit.htm index 01d1227ce77a349e9d4ea92cc1a81fcfb3f9f636..b28d3a35e616abbf4452ef10ef7d23b895c2044c 100644 --- a/interface/web/mailuser/templates/mail_user_password_edit.htm +++ b/interface/web/mailuser/templates/mail_user_password_edit.htm @@ -11,7 +11,7 @@

    {tmpl_var name='password_strength_txt'}

    @@ -20,7 +20,7 @@
    - +
    diff --git a/interface/web/sites/aps_install_package.php b/interface/web/sites/aps_install_package.php index 2e2e7bc761d837e9233a6e923031ebbe971769d0..5d623226908c7d21e34ad1e1a5a609c5cfa2b35d 100644 --- a/interface/web/sites/aps_install_package.php +++ b/interface/web/sites/aps_install_package.php @@ -86,7 +86,7 @@ if(isset($settings['error'])) $app->error($settings['error']); $domains = array(); $domain_for_user = ''; if(!$adminflag) $domain_for_user = "AND (sys_userid = '".$app->db->quote($_SESSION['s']['user']['userid'])."' - OR sys_groupid = '".$app->db->quote($_SESSION['s']['user']['userid'])."' )"; + OR sys_groupid = '".$app->db->quote($_SESSION['s']['user']['default_group'])."' )"; $domains_assoc = $app->db->queryAllRecords("SELECT domain FROM web_domain WHERE document_root != '' AND (type = 'vhost' OR type = 'vhostsubdomain' OR type = 'vhostalias') AND active = 'y' ".$domain_for_user." ORDER BY domain;"); if(!empty($domains_assoc)) foreach($domains_assoc as $domain) $domains[] = $domain['domain']; diff --git a/interface/web/sites/lib/lang/en_web_vhost_domain.lng b/interface/web/sites/lib/lang/en_web_vhost_domain.lng index 9f410e07c6ed7f41fc60458813f8aecfc10f2900..4caad667455b830d34ff3b21bd363e6e163ac2ed 100644 --- a/interface/web/sites/lib/lang/en_web_vhost_domain.lng +++ b/interface/web/sites/lib/lang/en_web_vhost_domain.lng @@ -132,5 +132,5 @@ $wb['web_folder_invalid_txt'] = 'The web folder is invalid, please choose a diff $wb['web_folder_unique_txt'] = 'The web folder is already used, please choose a different one.'; $wb['host_txt'] = 'Hostname'; $wb['domain_error_wildcard'] = 'Wildcard subdomains are not allowed.'; - +$wb['subdomain_error_empty'] = 'The subdommain field is empty or contains invalid characters.'; ?> diff --git a/interface/web/sites/shell_user_edit.php b/interface/web/sites/shell_user_edit.php index 5a54b339e6948175efdf43899299936993af1543..3c72a5f843c0a25c2871da16d592630a1facb433 100644 --- a/interface/web/sites/shell_user_edit.php +++ b/interface/web/sites/shell_user_edit.php @@ -169,7 +169,6 @@ class page_action extends tform_actions { $sql = "UPDATE shell_user SET server_id = $server_id, dir = '$dir', puser = '$uid', pgroup = '$gid', sys_groupid = '$sys_groupid' WHERE shell_user_id = ".$this->id; $app->db->query($sql); - die($sql); } diff --git a/interface/web/sites/templates/database_user_edit.htm b/interface/web/sites/templates/database_user_edit.htm index 0d42647880b1d1f664c9ef799e20d854fc049ac4..9bcf886ad0a45746666ca8fcebab312d9c9c740e 100644 --- a/interface/web/sites/templates/database_user_edit.htm +++ b/interface/web/sites/templates/database_user_edit.htm @@ -28,7 +28,7 @@

    {tmpl_var name='password_strength_txt'}

    @@ -37,7 +37,7 @@
    - +
    diff --git a/interface/web/sites/templates/ftp_user_edit.htm b/interface/web/sites/templates/ftp_user_edit.htm index c33401103d9f7cb3e54fb2f1bbd3765acff12d10..24a0dc36f7556f914431c657e3e8a94b7302784b 100644 --- a/interface/web/sites/templates/ftp_user_edit.htm +++ b/interface/web/sites/templates/ftp_user_edit.htm @@ -18,7 +18,7 @@

    {tmpl_var name='password_strength_txt'}

    @@ -27,7 +27,7 @@
    - +
    diff --git a/interface/web/sites/templates/shell_user_edit.htm b/interface/web/sites/templates/shell_user_edit.htm index 1aa663b7bee5be5b2feab2f079fbe2367ef40734..364b05ecfac3bfa298f938734da0e407738de747 100644 --- a/interface/web/sites/templates/shell_user_edit.htm +++ b/interface/web/sites/templates/shell_user_edit.htm @@ -26,7 +26,7 @@

    {tmpl_var name='password_strength_txt'}

    @@ -35,7 +35,7 @@
    - +
    diff --git a/interface/web/sites/templates/web_folder_user_edit.htm b/interface/web/sites/templates/web_folder_user_edit.htm index bb6291375b9c649bd903a906e7a6b65b57cc1c4f..7defdde1fa5bc55d939b987736aab8a62f2a98d8 100644 --- a/interface/web/sites/templates/web_folder_user_edit.htm +++ b/interface/web/sites/templates/web_folder_user_edit.htm @@ -17,7 +17,7 @@

    {tmpl_var name='password_strength_txt'}

    @@ -26,7 +26,7 @@
    - +
    diff --git a/interface/web/sites/templates/web_vhost_domain_advanced.htm b/interface/web/sites/templates/web_vhost_domain_advanced.htm index 2b680db04bb8d72848509e0f000d98c32d6a7f66..d2c3bb871caa7777281211ebc52bf6ac9a49a27a 100644 --- a/interface/web/sites/templates/web_vhost_domain_advanced.htm +++ b/interface/web/sites/templates/web_vhost_domain_advanced.htm @@ -88,7 +88,7 @@
    -  {tmpl_var name="available_apache_directive_snippets_txt"}

     {tmpl_var name="apache_directive_snippets_txt"} +  {tmpl_var name="available_apache_directive_snippets_txt"}

     {tmpl_var name="apache_directive_snippets_txt"}
    ----
     {tmpl_var name='variables_txt'}: {DOCROOT}
    diff --git a/interface/web/sites/templates/webdav_user_edit.htm b/interface/web/sites/templates/webdav_user_edit.htm index 9a75015f4c2aed9b17367cb47b0fb202195ece9a..c0f658bd3b6927d7b199d5c29d18241d105d55bf 100644 --- a/interface/web/sites/templates/webdav_user_edit.htm +++ b/interface/web/sites/templates/webdav_user_edit.htm @@ -26,7 +26,7 @@

    {tmpl_var name='password_strength_txt'}

    @@ -35,7 +35,7 @@
    - +
    diff --git a/interface/web/sites/web_vhost_domain_edit.php b/interface/web/sites/web_vhost_domain_edit.php index b671c330ea9c0090a759755828e6f31b63da917d..bd020dfa0b335f8ec61f13e3b7defa822583eb16 100644 --- a/interface/web/sites/web_vhost_domain_edit.php +++ b/interface/web/sites/web_vhost_domain_edit.php @@ -719,6 +719,14 @@ class page_action extends tform_actions { /* check if the domain module is used - and check if the selected domain can be used! */ if($app->tform->getCurrentTab() == 'domain') { + if($this->_vhostdomain_type == 'subdomain') { + // Check that domain (the subdomain part) is not empty + if(!preg_match('/^[a-zA-Z0-9].*/',$this->dataRecord['domain'])) { + $app->tform->errorMessage .= $app->tform->lng("subdomain_error_empty")."
    "; + } + } + + /* check if the domain module is used - and check if the selected domain can be used! */ $app->uses('ini_parser,getconf'); $settings = $app->getconf->get_global_config('domains'); if ($settings['use_domain_module'] == 'y') { @@ -769,15 +777,15 @@ class page_action extends tform_actions { $client['web_servers_ids'] = explode(',', $client['web_servers']); - if($client['limit_cgi'] != 'y') $this->dataRecord['cgi'] = '-'; - if($client['limit_ssi'] != 'y') $this->dataRecord['ssi'] = '-'; - if($client['limit_perl'] != 'y') $this->dataRecord['perl'] = '-'; - if($client['limit_ruby'] != 'y') $this->dataRecord['ruby'] = '-'; - if($client['limit_python'] != 'y') $this->dataRecord['python'] = '-'; + if($client['limit_cgi'] != 'y') $this->dataRecord['cgi'] = 'n'; + if($client['limit_ssi'] != 'y') $this->dataRecord['ssi'] = 'n'; + if($client['limit_perl'] != 'y') $this->dataRecord['perl'] = 'n'; + if($client['limit_ruby'] != 'y') $this->dataRecord['ruby'] = 'n'; + if($client['limit_python'] != 'y') $this->dataRecord['python'] = 'n'; if($client['force_suexec'] == 'y') $this->dataRecord['suexec'] = 'y'; - if($client['limit_hterror'] != 'y') $this->dataRecord['errordocs'] = '-'; - if($client['limit_wildcard'] != 'y' && $this->dataRecord['subdomain'] == '*') $this->dataRecord['subdomain'] = '-'; - if($client['limit_ssl'] != 'y') $this->dataRecord['ssl'] = '-'; + if($client['limit_hterror'] != 'y') $this->dataRecord['errordocs'] = 'n'; + if($client['limit_wildcard'] != 'y' && $this->dataRecord['subdomain'] == '*') $this->dataRecord['subdomain'] = 'n'; + if($client['limit_ssl'] != 'y') $this->dataRecord['ssl'] = 'n'; // only generate quota and traffic warnings if value has changed if($this->id > 0) { @@ -867,15 +875,15 @@ class page_action extends tform_actions { $this->dataRecord['web_folder'] = $tmp['web_folder']; // cannot be changed! // set the settings to current if not provided (or cleared due to limits) - if($this->dataRecord['cgi'] == '-') $this->dataRecord['cgi'] = $tmp['cgi']; - if($this->dataRecord['ssi'] == '-') $this->dataRecord['ssi'] = $tmp['ssi']; - if($this->dataRecord['perl'] == '-') $this->dataRecord['perl'] = $tmp['perl']; - if($this->dataRecord['ruby'] == '-') $this->dataRecord['ruby'] = $tmp['ruby']; - if($this->dataRecord['python'] == '-') $this->dataRecord['python'] = $tmp['python']; - if($this->dataRecord['suexec'] == '-') $this->dataRecord['suexec'] = $tmp['suexec']; - if($this->dataRecord['errordocs'] == '-') $this->dataRecord['errordocs'] = $tmp['errordocs']; - if($this->dataRecord['subdomain'] == '-') $this->dataRecord['subdomain'] = $tmp['subdomain']; - if($this->dataRecord['ssl'] == '-') $this->dataRecord['ssl'] = $tmp['ssl']; + if($this->dataRecord['cgi'] == 'n') $this->dataRecord['cgi'] = $tmp['cgi']; + if($this->dataRecord['ssi'] == 'n') $this->dataRecord['ssi'] = $tmp['ssi']; + if($this->dataRecord['perl'] == 'n') $this->dataRecord['perl'] = $tmp['perl']; + if($this->dataRecord['ruby'] == 'n') $this->dataRecord['ruby'] = $tmp['ruby']; + if($this->dataRecord['python'] == 'n') $this->dataRecord['python'] = $tmp['python']; + if($this->dataRecord['suexec'] == 'n') $this->dataRecord['suexec'] = $tmp['suexec']; + if($this->dataRecord['errordocs'] == 'n') $this->dataRecord['errordocs'] = $tmp['errordocs']; + if($this->dataRecord['subdomain'] == 'n') $this->dataRecord['subdomain'] = $tmp['subdomain']; + if($this->dataRecord['ssl'] == 'n') $this->dataRecord['ssl'] = $tmp['ssl']; unset($tmp); // When the record is inserted @@ -1120,7 +1128,6 @@ class page_action extends tform_actions { } } - } $page = new page_action; diff --git a/interface/web/tools/lib/lang/de_resync.lng b/interface/web/tools/lib/lang/de_resync.lng index d18f2ff6f944150695b82353e44a28e8d1900243..8461f2066ebd6f653fcda90d3641e24bf2816286 100644 --- a/interface/web/tools/lib/lang/de_resync.lng +++ b/interface/web/tools/lib/lang/de_resync.lng @@ -9,6 +9,7 @@ $wb['resync_db_txt'] = 'Datenbanken'; $wb['resync_mailbox_txt'] = 'E-Mail Konten'; $wb['resync_dkim_txt'] = 'DKIM-Keys'; $wb['resync_dns_txt'] = 'DNS Einträge'; +$wb['resync_client_txt'] = 'Kunden'; $wb['btn_start_txt'] = 'Start'; $wb['btn_cancel_txt'] = 'Zurück'; ?> diff --git a/interface/web/tools/templates/user_settings.htm b/interface/web/tools/templates/user_settings.htm index 27be28c531cab502d88718f0d8e4a0f49340938e..d6f57d020628eeccc5d205cd72b12688eda4eaac 100644 --- a/interface/web/tools/templates/user_settings.htm +++ b/interface/web/tools/templates/user_settings.htm @@ -7,7 +7,7 @@

    {tmpl_var name='password_strength_txt'}

    @@ -16,7 +16,7 @@
    - +
    diff --git a/remoting_client/API-docs/sites_database_add.html b/remoting_client/API-docs/sites_database_add.html index 411f75dc3af8ecb60bb2c835665c985385e5939b..acf53e7bc0102aa57c5d3e8a002c4c91f3a8bfee 100644 --- a/remoting_client/API-docs/sites_database_add.html +++ b/remoting_client/API-docs/sites_database_add.html @@ -20,6 +20,7 @@

    $session_id, $client_id, $params

    Parameters (in $params):

    server_id  (int(11))

    +

    website_id  (int(11))

    type  (varchar(16))

    database_name  (varchar(64))

    database_user_id  (int(11))

    diff --git a/remoting_client/API-docs/sites_web_aliasdomain_update.html b/remoting_client/API-docs/sites_web_aliasdomain_update.html index a40259496381147b46ae61c4c1b534fa86541bdd..53daaa2b2b363f4354ff428daf7ebaa383545a88 100644 --- a/remoting_client/API-docs/sites_web_aliasdomain_update.html +++ b/remoting_client/API-docs/sites_web_aliasdomain_update.html @@ -47,6 +47,7 @@

    ssl_organisation_unit  (varchar(255))

    ssl_country  (varchar(255))

    ssl_domain  (varchar(255))

    +

    ssl_key  (mediumtext)

    ssl_request  (mediumtext)

    ssl_cert  (mediumtext)

    ssl_bundle  (mediumtext)

    diff --git a/remoting_client/API-docs/sites_web_domain_add.html b/remoting_client/API-docs/sites_web_domain_add.html index de4780670abea09ea3d70e2b2b1627307c9d8af2..02704b6901f65353db4c89e58a02462944432fc1 100644 --- a/remoting_client/API-docs/sites_web_domain_add.html +++ b/remoting_client/API-docs/sites_web_domain_add.html @@ -47,6 +47,7 @@

    ssl_organisation_unit  (varchar(255))

    ssl_country  (varchar(255))

    ssl_domain  (varchar(255))

    +

    ssl_key  (mediumtext)

    ssl_request  (mediumtext)

    ssl_cert  (mediumtext)

    ssl_bundle  (mediumtext)

    diff --git a/remoting_client/examples/sites_database_add.php b/remoting_client/examples/sites_database_add.php index c3918671438d111eb315c1f2651238e22c39f00f..3c827769904ab9f0fbf4270e5e91c64cd62d4f8a 100644 --- a/remoting_client/examples/sites_database_add.php +++ b/remoting_client/examples/sites_database_add.php @@ -19,6 +19,7 @@ try { $params = array( 'server_id' => 1, 'type' => 'mysql', + 'website_id' => 1, 'database_name' => 'db_name2', 'database_user_id' => '1', 'database_ro_user_id' => '0', diff --git a/remoting_client/examples/sites_web_domain_add.php b/remoting_client/examples/sites_web_domain_add.php index fa08aa60efa76583cecb7ad55a722967e8ad7609..b8010e2873c30ff274092c2b2f233a24bd908070 100644 --- a/remoting_client/examples/sites_web_domain_add.php +++ b/remoting_client/examples/sites_web_domain_add.php @@ -44,6 +44,7 @@ try { 'ssl_country' => '', 'ssl_domain' => '', 'ssl_request' => '', + 'ssl_key' => '', 'ssl_cert' => '', 'ssl_bundle' => '', 'ssl_action' => '', @@ -52,6 +53,8 @@ try { 'allow_override' => 'All', 'apache_directives' => '', 'php_open_basedir' => '/', + 'pm_max_requests' => 0, + 'pm_process_idle_timeout' => 10, 'custom_php_ini' => '', 'backup_interval' => '', 'backup_copies' => 1, diff --git a/server/conf/php-fcgi-starter.master b/server/conf/php-fcgi-starter.master index 97a162872474a4f5ffdac9e5c0e15d4f3685e1e5..ea025811b6011579d901343719d50003e9599337 100644 --- a/server/conf/php-fcgi-starter.master +++ b/server/conf/php-fcgi-starter.master @@ -13,4 +13,5 @@ exec \ -d open_basedir="" \ -d upload_tmp_dir=/tmp \ -d session.save_path=/tmp \ +-d sendmail_path="/usr/sbin/sendmail -t -i -fwebmaster@" \ $1 \ No newline at end of file diff --git a/server/conf/php_fpm_pool.conf.master b/server/conf/php_fpm_pool.conf.master index b8fce1750d0d0df4333d9e1d962fddf31c5ffbe2..37edbb7f4832901bd10c7f5454e5d0e734ba4968 100644 --- a/server/conf/php_fpm_pool.conf.master +++ b/server/conf/php_fpm_pool.conf.master @@ -32,6 +32,7 @@ chdir = / php_admin_value[open_basedir] = php_admin_value[session.save_path] = /tmp php_admin_value[upload_tmp_dir] = /tmp +php_admin_value[sendmail_path] = "/usr/sbin/sendmail -t -i -fwebmaster@" diff --git a/server/conf/sieve_filter.master b/server/conf/sieve_filter.master index 09d7fa943109725d4cb42b80a09ba206c6321f50..e161a9f4999bf97b404ba42ada39d83c6b72559d 100644 --- a/server/conf/sieve_filter.master +++ b/server/conf/sieve_filter.master @@ -2,7 +2,9 @@ require ["fileinto", "regex", "vacation"]; # Send a copy of email to -redirect ""; + +redirect ""; + diff --git a/server/conf/sieve_filter_1.2.master b/server/conf/sieve_filter_1.2.master index a88dc2d6009b7d9e82b61371ffbcc8a696e7ed99..08473e69c0ed3088a00b3d000646cae07f009357 100644 --- a/server/conf/sieve_filter_1.2.master +++ b/server/conf/sieve_filter_1.2.master @@ -2,7 +2,9 @@ require ["fileinto", "regex", "date", "relational", "vacation"]; # Send a copy of email to -redirect ""; + +redirect ""; + diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master index 035f3a52a6fbd3bb44f91d76f0e11c80b6c34d58..271d3fd71410729e73bf69954697a6b227a8f1b6 100644 --- a/server/conf/vhost.conf.master +++ b/server/conf/vhost.conf.master @@ -142,6 +142,11 @@ PerlOptions +ParseHeaders Options +ExecCGI + + PerlResponseHandler ModPerl::Registry + PerlOptions +ParseHeaders + Options +ExecCGI + SetHandler perl-script @@ -179,7 +184,7 @@ # Clear PHP settings of this website - + SetHandler None @@ -231,7 +236,7 @@ # FcgidMaxProcesses 1000 FcgidMaxRequestsPerProcess FcgidMinProcessesPerClass 0 - FcgidMaxProcessesPerClass 100 + FcgidMaxProcessesPerClass 10 FcgidConnectTimeout 3 FcgidIOTimeout 600 FcgidBusyTimeout 3600 @@ -250,6 +255,9 @@ AddHandler fcgid-script .php .php3 .php4 .php5 FCGIWrapper .php + FCGIWrapper .php3 + FCGIWrapper .php4 + FCGIWrapper .php5 Options +ExecCGI AllowOverride @@ -262,6 +270,9 @@ AddHandler fcgid-script .php .php3 .php4 .php5 FCGIWrapper .php + FCGIWrapper .php3 + FCGIWrapper .php4 + FCGIWrapper .php5 Options +ExecCGI AllowOverride @@ -282,7 +293,7 @@ Allow from all - AddHandler php5-fcgi .php + AddHandler php5-fcgi .php .php3 .php4 .php5 Action php5-fcgi /php5-fcgi Alias /php5-fcgi {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} @@ -308,6 +319,7 @@ RewriteCond %{HTTP_HOST} $ [NC] RewriteCond %{REQUEST_URI} !^/webdav/ + RewriteCond %{REQUEST_URI} !^/php5-fcgi/ RewriteCond %{REQUEST_URI} !^ RewriteRule ^/(.*)$ $1 diff --git a/server/lib/classes/aps_installer.inc.php b/server/lib/classes/aps_installer.inc.php index 5fac926c913108d07dd03fedb01f91956dfa417e..23c4b5fa632c6353dfad53eef2036f72c99d6676 100644 --- a/server/lib/classes/aps_installer.inc.php +++ b/server/lib/classes/aps_installer.inc.php @@ -740,6 +740,10 @@ class ApsInstaller extends ApsBase { $app->db->query('DELETE FROM aps_instances WHERE id = "'.$app->db->quote($task['instance_id']).'";'); $app->db->query('DELETE FROM aps_instances_settings WHERE instance_id = "'.$app->db->quote($task['instance_id']).'";'); + if ($app->dbmaster != $app->db) { + $app->dbmaster->query('DELETE FROM aps_instances WHERE id = "'.$app->db->quote($task['instance_id']).'";'); + $app->dbmaster->query('DELETE FROM aps_instances_settings WHERE instance_id = "'.$app->db->quote($task['instance_id']).'";'); + } } unset($sxe); diff --git a/server/lib/classes/cron.d/100-monitor_email_quota.inc.php b/server/lib/classes/cron.d/100-monitor_email_quota.inc.php index 1939a5916c0cc787a102bdf9eb4fce2745617a5e..62e97b4e33a039a39e720d51b963cddbd356a5e0 100644 --- a/server/lib/classes/cron.d/100-monitor_email_quota.inc.php +++ b/server/lib/classes/cron.d/100-monitor_email_quota.inc.php @@ -83,7 +83,9 @@ class cronjob_monitor_email_quota extends cronjob { $filename = $mb['maildir'].'/.quotausage'; if(file_exists($filename) && !is_link($filename)) { $quotafile = file($filename); - $data[$email]['used'] = trim($quotafile['1']); + preg_match('/storage.*?([0-9]+)/s', implode('',$quotafile), $storage_value); + $data[$email]['used'] = $storage_value[1]; + $app->log("Mail storage $email: " . $storage_value[1], LOGLEVEL_DEBUG); unset($quotafile); } else { exec('du -s '.escapeshellcmd($mb['maildir']), $out); diff --git a/server/lib/classes/cron.d/100-monitor_raid.inc.php b/server/lib/classes/cron.d/100-monitor_raid.inc.php index 9edd061cbe919032e63ef522851688cf52aef62d..86a6908ab44afb32fbace36ec2946a154fadb108 100644 --- a/server/lib/classes/cron.d/100-monitor_raid.inc.php +++ b/server/lib/classes/cron.d/100-monitor_raid.inc.php @@ -177,7 +177,9 @@ class cronjob_monitor_raid extends cronjob { system('which tw_cli', $retval); if($retval === 0) { - $data['output'] = shell_exec('tw_cli info c0'); + // TYPOWORX FIX | Determine Controler-ID + $availableControlers = shell_exec('tw_cli info | grep -Eo "c[0-9]+'); + $data['output'] = shell_exec('tw_cli info ' . $availableControlers); $state = 'ok'; if(is_array($data['output'])) { diff --git a/server/lib/classes/cron.d/300-quota_notify.inc.php b/server/lib/classes/cron.d/300-quota_notify.inc.php index 1d24e7c76556a9b1b829b46f613066f08278eaee..e8b64fae45c4f9e9f5500e098c696a203170e4b4 100644 --- a/server/lib/classes/cron.d/300-quota_notify.inc.php +++ b/server/lib/classes/cron.d/300-quota_notify.inc.php @@ -214,10 +214,10 @@ class cronjob_quota_notify extends cronjob { $domain = $rec['domain']; $username = $rec['system_user']; - $rec['used'] = $monitor_data['user'][$username]['used']; - $rec['soft'] = $monitor_data['user'][$username]['soft']; - $rec['hard'] = $monitor_data['user'][$username]['hard']; - $rec['files'] = $monitor_data['user'][$username]['files']; + $rec['used'] = @$monitor_data['user'][$username]['used']; + $rec['soft'] = @$monitor_data['user'][$username]['soft']; + $rec['hard'] = @$monitor_data['user'][$username]['hard']; + $rec['files'] = @$monitor_data['user'][$username]['files']; if (!is_numeric($rec['used'])){ if ($rec['used'][0] > $rec['used'][1]){ diff --git a/server/lib/classes/cron.d/500-backup.inc.php b/server/lib/classes/cron.d/500-backup.inc.php index f932744af465e63d1b8ddee7b44d15ee12b31f69..627cdd58c3f98c973e67b5e82fe98cf7a5fd279c 100644 --- a/server/lib/classes/cron.d/500-backup.inc.php +++ b/server/lib/classes/cron.d/500-backup.inc.php @@ -199,6 +199,9 @@ class cronjob_backup extends cronjob { $web_backup_dir = realpath($backup_dir.'/web'.$web_id); if(is_dir($web_backup_dir)) { exec('sudo -u '.escapeshellarg($web_user).' rm -f '.escapeshellarg($web_backup_dir.'/*')); + $sql = "DELETE FROM web_backup WHERE server_id = ".intval($conf['server_id'])." AND parent_domain_id = ".intval($web_id); + $app->db->query($sql); + if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql); } } } diff --git a/server/lib/classes/system.inc.php b/server/lib/classes/system.inc.php index 6ee95556fc17c3868316e8a827c1d9536f336d0f..92881ba331cd09b7f0a429db3d0f7f5e2cb5c5b0 100644 --- a/server/lib/classes/system.inc.php +++ b/server/lib/classes/system.inc.php @@ -1526,7 +1526,11 @@ class system{ function maildirmake($maildir_path, $user = '', $subfolder = '', $group = '') { - global $app; + global $app, $conf; + + // load the server configuration options + $app->uses("getconf"); + $mail_config = $app->getconf->get_server_config($conf["server_id"], 'mail'); if($subfolder != '') { $dir = escapeshellcmd($maildir_path.'/.'.$subfolder); @@ -1571,25 +1575,30 @@ class system{ //* Add the subfolder to the subscriptions and courierimapsubscribed files if($subfolder != '') { + // Courier - if(!is_file($maildir_path.'/courierimapsubscribed')) { - $tmp_file = escapeshellcmd($maildir_path.'/courierimapsubscribed'); - touch($tmp_file); - chmod($tmp_file, 0744); - chown($tmp_file, 'vmail'); - chgrp($tmp_file, 'vmail'); + if($mail_config['pop3_imap_daemon'] == 'courier') { + if(!is_file($maildir_path.'/courierimapsubscribed')) { + $tmp_file = escapeshellcmd($maildir_path.'/courierimapsubscribed'); + touch($tmp_file); + chmod($tmp_file, 0744); + chown($tmp_file, 'vmail'); + chgrp($tmp_file, 'vmail'); + } + $this->replaceLine($maildir_path.'/courierimapsubscribed', 'INBOX.'.$subfolder, 'INBOX.'.$subfolder, 1, 1); } - $this->replaceLine($maildir_path.'/courierimapsubscribed', 'INBOX.'.$subfolder, 'INBOX.'.$subfolder, 1, 1); // Dovecot - if(!is_file($maildir_path.'/subscriptions')) { - $tmp_file = escapeshellcmd($maildir_path.'/subscriptions'); - touch($tmp_file); - chmod($tmp_file, 0744); - chown($tmp_file, 'vmail'); - chgrp($tmp_file, 'vmail'); + if($mail_config['pop3_imap_daemon'] == 'dovecot') { + if(!is_file($maildir_path.'/subscriptions')) { + $tmp_file = escapeshellcmd($maildir_path.'/subscriptions'); + touch($tmp_file); + chmod($tmp_file, 0744); + chown($tmp_file, 'vmail'); + chgrp($tmp_file, 'vmail'); + } + $this->replaceLine($maildir_path.'/subscriptions', $subfolder, $subfolder, 1, 1); } - $this->replaceLine($maildir_path.'/subscriptions', $subfolder, $subfolder, 1, 1); } $app->log('Created Maildir '.$maildir_path.' with subfolder: '.$subfolder, LOGLEVEL_DEBUG); diff --git a/server/mods-available/rescue_core_module.inc.php b/server/mods-available/rescue_core_module.inc.php index 94d7ba6f88140c211c91b2aa7b674ceb0943a2b7..56982737d79518cfb2d49a94decd5e486188f416 100644 --- a/server/mods-available/rescue_core_module.inc.php +++ b/server/mods-available/rescue_core_module.inc.php @@ -275,6 +275,17 @@ class rescue_core_module { /* Set the new try counter */ $this->_rescueData['webserver']['try_counter'] = $tryCount; + + if ($tryCount > 2 && $conf['serverconfig']['web']['server_type'] != 'nginx') { + if($app->system->is_user('apache')) { + $app->log("Clearing semaphores table for user apache.",LOGLEVEL_WARN); + exec("ipcs -s | grep apache | awk '{ print $2 }' | xargs ipcrm sem"); + } + if($app->system->is_user('www-data')) { + $app->log("Clearing semaphores table for user apache.",LOGLEVEL_WARN); + exec("ipcs -s | grep www-data | awk '{ print $2 }' | xargs ipcrm sem"); + } + } /* if 5 times will not work, we have to give up... */ if ($tryCount > 5){ diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index c43040be43076074e5af67989692637c11721466..14b27c4e6761ee6f8d40a53dbfed1231faebcb47 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -983,6 +983,8 @@ class apache2_plugin { // Make sure we only have Unix linebreaks $vhost_data['apache_directives'] = str_replace("\r\n", "\n", $vhost_data['apache_directives']); $vhost_data['apache_directives'] = str_replace("\r", "\n", $vhost_data['apache_directives']); + $trans = array('{DOCROOT}' => $vhost_data['web_document_root_www']); + $vhost_data['apache_directives'] = strtr($vhost_data['apache_directives'], $trans); // Check if a SSL cert exists $ssl_dir = $data['new']['document_root'].'/ssl'; @@ -1256,6 +1258,7 @@ class apache2_plugin { $fcgi_tpl->setVar('php_fcgi_bin', escapeshellcmd($custom_fastcgi_php_executable)); } $fcgi_tpl->setVar('security_level', intval($web_config['security_level'])); + $fcgi_tpl->setVar('domain', escapeshellcmd($data['new']['domain'])); $php_open_basedir = ($data['new']['php_open_basedir'] == '')?$data['new']['document_root']:$data['new']['php_open_basedir']; $fcgi_tpl->setVar('open_basedir', escapeshellcmd($php_open_basedir)); @@ -2773,6 +2776,7 @@ class apache2_plugin { $tpl->setVar('pm_max_requests', $data['new']['pm_max_requests']); $tpl->setVar('document_root', $data['new']['document_root']); $tpl->setVar('security_level', $web_config['security_level']); + $tpl->setVar('domain', $data['new']['domain']); $php_open_basedir = ($data['new']['php_open_basedir'] == '')?escapeshellcmd($data['new']['document_root']):escapeshellcmd($data['new']['php_open_basedir']); $tpl->setVar('php_open_basedir', $php_open_basedir); if($php_open_basedir != ''){ diff --git a/server/plugins-available/bind_plugin.inc.php b/server/plugins-available/bind_plugin.inc.php index 4823cf3c2624c944044a0acfe0bed831c597c56d..0f2afaf479dbd38d6db0292730bf3518e4d430e7 100644 --- a/server/plugins-available/bind_plugin.inc.php +++ b/server/plugins-available/bind_plugin.inc.php @@ -156,8 +156,12 @@ class bind_plugin { if(is_file($filename.'.err')) unlink($filename.'.err'); } - //* Reload bind nameserver - $app->services->restartServiceDelayed('bind', 'reload'); + //* Restart bind nameserver if update_acl is not empty, otherwise reload it + if($data['new']['update_acl'] != '') { + $app->services->restartServiceDelayed('bind', 'restart'); + } else { + $app->services->restartServiceDelayed('bind', 'reload'); + } } diff --git a/server/plugins-available/maildeliver_plugin.inc.php b/server/plugins-available/maildeliver_plugin.inc.php index c5b531dfa121d91e4d2981d20b26be4c43595c32..f4d8194c525722641a6fc7297c4293596656455d 100644 --- a/server/plugins-available/maildeliver_plugin.inc.php +++ b/server/plugins-available/maildeliver_plugin.inc.php @@ -121,7 +121,14 @@ class maildeliver_plugin { $tpl->newTemplate($filter_file_template); // cc Field + $tmp_mails_arr = explode(',',$data["new"]["cc"]); + $tmp_addresses_arr = array(); + foreach($tmp_mails_arr as $address) { + if(trim($address) != '') $tmp_addresses_arr[] = array('address' => trim($address)); + } + $tpl->setVar('cc', $data["new"]["cc"]); + $tpl->setLoop('ccloop', $tmp_addresses_arr); // Custom filters $tpl->setVar('custom_mailfilter', $data["new"]["custom_mailfilter"]); diff --git a/server/plugins-available/maildrop_plugin.inc.php b/server/plugins-available/maildrop_plugin.inc.php index 73bace85fe340267b097b2f1147c485857dcdc3c..37b030608012cf01b3af88e0aed2c2577734c683 100644 --- a/server/plugins-available/maildrop_plugin.inc.php +++ b/server/plugins-available/maildrop_plugin.inc.php @@ -192,7 +192,11 @@ class maildrop_plugin { $mailfilter_content = ''; if($data["new"]["cc"] != '') { - $mailfilter_content .= "cc \"!".$data["new"]["cc"]."\"\n"; + $tmp_mails_arr = explode(',',$data["new"]["cc"]); + foreach($tmp_mails_arr as $address) { + if(trim($address) != '') $mailfilter_content .= "cc \"!".trim($address)."\"\n"; + } + //$mailfilter_content .= "cc \"!".$data["new"]["cc"]."\"\n"; $app->log("Added CC address ".$data["new"]["cc"].' to mailfilter file.', LOGLEVEL_DEBUG); } diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index 127161eb470bdcc64f2a20a63eacf53df819e129..878c114fbfb1c5090d708e92bb6dfadaf36e438b 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -2355,6 +2355,7 @@ class nginx_plugin { $tpl->setVar('pm_max_requests', $data['new']['pm_max_requests']); $tpl->setVar('document_root', $data['new']['document_root']); $tpl->setVar('security_level', $web_config['security_level']); + $tpl->setVar('domain', $data['new']['domain']); $php_open_basedir = ($data['new']['php_open_basedir'] == '')?escapeshellcmd($data['new']['document_root']):escapeshellcmd($data['new']['php_open_basedir']); $tpl->setVar('php_open_basedir', $php_open_basedir); if($php_open_basedir != ''){ diff --git a/server/scripts/create_jailkit_user.sh b/server/scripts/create_jailkit_user.sh index da01f9af928d4fd7bed244d9bb94de3fa7713e55..5e1060be2503bc713842d3ef83910e675cf8d2d7 100755 --- a/server/scripts/create_jailkit_user.sh +++ b/server/scripts/create_jailkit_user.sh @@ -21,12 +21,12 @@ CHROOT_SHELL=$4 CHROOT_P_USER=$5 CHROOT_P_USER_HOMEDIR=$6 -### Add the chroot user ### -jk_jailuser -n -s $CHROOT_SHELL -j $CHROOT_HOMEDIR $CHROOT_USERNAME - ### Reconfigure the chroot home directory for the user ### usermod --home=$CHROOT_HOMEDIR/.$CHROOT_USERHOMEDIR $CHROOT_USERNAME 2>/dev/null +### Add the chroot user ### +jk_jailuser -n -s $CHROOT_SHELL -j $CHROOT_HOMEDIR $CHROOT_USERNAME + ### We have to reconfigure the chroot home directory for the parent user ### if [ "$CHROOT_P_USER" != "" ]; then usermod --home=$CHROOT_HOMEDIR/.$CHROOT_P_USER_HOMEDIR $CHROOT_P_USER 2>/dev/null