Commit ebbe6374 authored by Marius Cramer's avatar Marius Cramer

Merge remote-tracking branch 'origin/stable-3.0.5'

Conflicts:
	install/tpl/debian_postfix.conf.master
	install/tpl/fedora_postfix.conf.master
	install/tpl/gentoo_postfix.conf.master
	install/tpl/opensuse_postfix.conf.master
	install/uninstall.php
	interface/lib/classes/remoting_lib.inc.php
	interface/lib/classes/tform.inc.php
	interface/web/mail/lib/lang/de_mail_user.lng
	interface/web/mailuser/lib/lang/de_mail_user_cc.lng
	interface/web/sites/aps_install_package.php
	interface/web/sites/lib/lang/en_web_vhost_subdomain.lng
	interface/web/sites/web_vhost_domain_edit.php
	interface/web/sites/web_vhost_subdomain_edit.php
	server/cron_daily.php
	server/lib/classes/monitor_tools.inc.php
parents 441afe55 ce1c6d84
......@@ -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");
}
......
......@@ -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");
}
......
......@@ -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");
}
}
......
......@@ -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 = '/\<VirtualHost.*\:(\d{1,})\>/';
}
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
*/
......
......@@ -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');
......
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
......@@ -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 ;
-- --------------------------------------------------------
......
......@@ -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 = </etc/postfix/smtpd.cert
ssl_key = </etc/postfix/smtpd.key
passdb {
......
......@@ -19,7 +19,7 @@ smtpd_tls_key_file = {config_dir}/smtpd.key
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf
relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re
smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf
smtpd_client_message_rate_limit = 100
......
......@@ -16,7 +16,7 @@ smtpd_tls_key_file = {config_dir}/smtpd.key
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf
relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re
smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf
smtpd_client_message_rate_limit = 100
......
......@@ -16,7 +16,7 @@ smtpd_tls_key_file = {config_dir}/smtpd.key
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf
relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re
smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf
smtpd_client_message_rate_limit = 100
......
......@@ -2,12 +2,12 @@
# this section probably needs adjustment on 64bit systems
# or non-Linux systems
comment = common files for all jails that need user/group information
libraries = /lib/libnsl.so.1, /lib64/libnsl.so.1, /lib/libnss*.so.2, /lib64/libnss*.so.2
libraries = /lib/libnsl.so.1, /lib64/libnsl.so.1, /lib/libnss*.so.2, /lib64/libnss*.so.2, /lib/x86_64-linux-gnu/libnss*.so.2
regularfiles = /etc/nsswitch.conf, /etc/ld.so.conf
[netbasics]
comment = common files for all jails that need any internet connectivity
libraries = /lib/libnss_dns.so.2, /lib64/libnss_dns.so.2
libraries = /lib/libnss_dns.so.2, /lib64/libnss_dns.so.2, /lib/x86_64-linux-gnu/libnss_dns.so.2
regularfiles = /etc/resolv.conf, /etc/host.conf, /etc/hosts, /etc/protocols
[logbasics]
......
......@@ -4,5 +4,6 @@ dbname = {mysql_server_database}
table = mail_forwarding
select_field = destination
where_field = source
additional_conditions = and active = 'y' and server_id = {server_id}
additional_conditions = and type != 'aliasdomain' and active = 'y' and server_id = {server_id}
# additional_conditions = and active = 'y' and server_id = {server_id}
hosts = {mysql_server_ip}
\ No newline at end of file
......@@ -16,7 +16,7 @@ smtpd_tls_key_file = {config_dir}/smtpd.key
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf
relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re
smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf
smtpd_client_message_rate_limit = 100
......
......@@ -43,7 +43,8 @@ MaxClientsNumber 10
# Fork in background
Daemonize yes
#Daemonize yes
Daemonize no
......
......@@ -95,7 +95,15 @@ if($do_uninstall == 'yes') {
// Delete the ispconfig files
exec('rm -rf /usr/local/ispconfig');
// echo "Please do not forget to delete the ispconfig user in the mysql.user table.\n\n";
// Delete various other files
@unlink("/usr/local/bin/ispconfig_update.sh");
@unlink("/usr/local/bin/ispconfig_update_from_svn.sh");
@unlink("/var/spool/mail/ispconfig");
@unlink("/var/www/ispconfig");
@unlink("/var/www/php-fcgi-scripts/ispconfig");
@unlink("/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter");
echo "Backups in /var/backup/ and log files in /var/log/ispconfig are not deleted.";
echo "Finished uninstalling.\n";
} else {
......
......@@ -288,11 +288,26 @@ class ApsCrawler extends ApsBase
$sxe = new SimpleXMLElement($xml);
$namespaces = $sxe->getDocNamespaces(true);
foreach($namespaces as $ns => $url) $sxe->registerXPathNamespace($ns, $url);
//Find highest version
$app_version = "0.0.0";
$entry_pos = 1;
for ($p = 1; ; $p++) {
$app_version_tmp = parent::getXPathValue($sxe, 'entry[position()=' . $p . ']/a:version');
if (strlen($app_version_tmp) < 1) break;
if (version_compare($app_version_tmp, $app_version) >= 0) {
$app_version = $app_version_tmp;
$entry_pos = $p;
}
}
// Fetching values of interest
$app_name = parent::getXPathValue($sxe, 'entry[position()=1]/a:name');
$app_version = parent::getXPathValue($sxe, 'entry[position()=1]/a:version');
$app_release = parent::getXPathValue($sxe, 'entry[position()=1]/a:release');
//$app_name = parent::getXPathValue($sxe, 'entry[position()=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)
......
......@@ -861,6 +861,9 @@ class db extends mysqli
case 'blob':
return 'blob';
break;
case 'date':
return 'date';
break;
}
}
......
......@@ -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){
......
......@@ -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 -----------------------------------------------------------------------------------
......
......@@ -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);
......
......@@ -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 != ''){
......
......@@ -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;
}
......
......@@ -415,7 +415,9 @@ class tools_monitor {
}
else {
$data = unserialize($record['data']);
$html .= nl2br($data['output']);
// improve view @Author <info@typoworx.de>
//-- $html .= nl2br($data['output']);
$html .= '<xmp>' . $data['output'] . '</xmp>';
}
$html .= '</div></div>';
......
......@@ -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']);
}
}
......
......@@ -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);
......
......@@ -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' => '',
......
......@@ -13,7 +13,7 @@
<div class="ctrlHolder">
<label for="remote_password">{tmpl_var name='password_txt'}</label>
<input name="remote_password" id="password" value="{tmpl_var name='remote_password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value);checkPassMatch('password','repeat_password');" />&nbsp;<a href="javascript:void(0);" onclick="generatePassword('password','repeat_password');">{tmpl_var name='generate_password_txt'}</a>
<input name="remote_password" id="password" value="{tmpl_var name='remote_password'}" size="30" maxlength="255" type="password" class="textInput" autocomplete="off" onkeyup="pass_check(this.value);checkPassMatch('password','repeat_password');" />&nbsp;<a href="javascript:void(0);" onclick="generatePassword('password','repeat_password');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='password_strength_txt'}</p>
......@@ -22,7 +22,7 @@
</div>
<div class="ctrlHolder">
<label for="repeat_password">{tmpl_var name='repeat_password_txt'}</label>
<input name="repeat_password" id="repeat_password" value="" size="15" maxlength="100" type="password" class="textInput" style="width:100px;" onkeyup="checkPassMatch('password','repeat_password');" />
<input name="repeat_password" id="repeat_password" value="" size="15" maxlength="100" type="password" class="textInput" style="width:100px;" autocomplete="off" onkeyup="checkPassMatch('password','repeat_password');" />
</div>
<div id="confirmpasswordError" style="display:none;" class="confirmpassworderror">{tmpl_var name='password_mismatch_txt'}</div>
<div id="confirmpasswordOK" style="display:none;" class="confirmpasswordok">{tmpl_var name='password_match_txt'}</div>
......
......@@ -11,7 +11,7 @@
</div>
<div class="ctrlHolder">
<label for="passwort">{tmpl_var name='passwort_txt'}</label>
<input name="passwort" id="passwort" value="{tmpl_var name='passwort'}" size="15" maxlength="100" type="password" class="textInput" onkeyup="pass_check(this.value);checkPassMatch('passwort','repeat_password');"/>&nbsp;<a href="javascript:void(0);" onclick="generatePassword('passwort','repeat_password');">{tmpl_var name='generate_password_txt'}</a>
<input name="passwort" id="passwort" value="{tmpl_var name='passwort'}" size="15" maxlength="100" type="password" class="textInput" autocomplete="off" onkeyup="pass_check(this.value);checkPassMatch('passwort','repeat_password');"/>&nbsp;<a href="javascript:void(0);" onclick="generatePassword('passwort','repeat_password');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='password_strength_txt'}</p>
......@@ -20,7 +20,7 @@
</div>
<div class="ctrlHolder">
<label for="repeat_password">{tmpl_var name='repeat_password_txt'}</label>
<input name="repeat_password" id="repeat_password" value="" size="15" maxlength="100" type="password" class="textInput" style="width:100px;" onkeyup="checkPassMatch('passwort','repeat_password');" />
<input name="repeat_password" id="repeat_password" value="" size="15" maxlength="100" type="password" class="textInput" style="width:100px;" autocomplete="off" onkeyup="checkPassMatch('passwort','repeat_password');" />
</div>
<div id="confirmpasswordError" style="display:none;" class="confirmpassworderror">{tmpl_var name='password_mismatch_txt'}</div>
<div id="confirmpasswordOK" style="display:none;" class="confirmpasswordok">{tmpl_var name='password_match_txt'}</div>
......
......@@ -30,7 +30,7 @@
</div>
<div class="ctrlHolder">
<label for="password">{tmpl_var name='password_txt'}</label>
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value);checkPassMatch('password','repeat_password');" />&nbsp;<a href="javascript:void(0);" onclick="generatePassword('password','repeat_password');">{tmpl_var name='generate_password_txt'}</a>
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" autocomplete="off" onkeyup="pass_check(this.value);checkPassMatch('password','repeat_password');" />&nbsp;<a href="javascript:void(0);" onclick="generatePassword('password','repeat_password');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='password_strength_txt'}</p>
......@@ -39,7 +39,7 @@
</div>
<div class="ctrlHolder">
<label for="repeat_password">{tmpl_var name='repeat_password_txt'}</label>
<input name="repeat_password" id="repeat_password" value="" size="15" maxlength="100" type="password" class="textInput" style="width:100px;" onkeyup="checkPassMatch('password','repeat_password');" />
<input name="repeat_password" id="repeat_password" value="" size="15" maxlength="100" type="password" class="textInput" style="width:100px;" autocomplete="off" onkeyup="checkPassMatch('password','repeat_password');" />
</div>
<div id="confirmpasswordError" style="display:none;" class="confirmpassworderror">{tmpl_var name='password_mismatch_txt'}</div>
<div id="confirmpasswordOK" style="display:none;" class="confirmpasswordok">{tmpl_var name='password_match_txt'}</div>
......
......@@ -30,7 +30,7 @@
</div>
<div class="ctrlHolder">
<label for="password">{tmpl_var name='password_txt'}</label>
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value);checkPassMatch('password','repeat_password');" />&nbsp;<a href="javascript:void(0);" onclick="generatePassword('password','repeat_password');">{tmpl_var name='generate_password_txt'}</a>
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" autocomplete="off" onkeyup="pass_check(this.value);checkPassMatch('password','repeat_password');" />&nbsp;<a href="javascript:void(0);" onclick="generatePassword('password','repeat_password');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='password_strength_txt'}</p>
......@@ -39,7 +39,7 @@
</div>
<div class="ctrlHolder">
<label for="repeat_password">{tmpl_var name='repeat_password_txt'}</label>
<input name="repeat_password" id="repeat_password" value="" size="15" maxlength="100" type="password" class="textInput" style="width:100px;" onkeyup="checkPassMatch('password','repeat_password');" />
<input name="repeat_password" id="repeat_password" value="" size="15" maxlength="100" type="password" class="textInput" style="width:100px;" autocomplete="off" onkeyup="checkPassMatch('password','repeat_password');" />
</div>
<div id="confirmpasswordError" style="display:none;" class="confirmpassworderror">{tmpl_var name='password_mismatch_txt'}</div>
<div id="confirmpasswordOK" style="display:none;" class="confirmpasswordok">{tmpl_var name='password_match_txt'}</div>
......
......@@ -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' => '',
......
......@@ -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' => '',
......
......@@ -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' => '',
......
......@@ -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' => '',
......
......@@ -88,7 +88,7 @@ $form["tabs"]['dns'] = array (
'validators' => array (