Merged revisions 3960-4065 from stable branch.
198 files modified
33 files added
| | |
| | | } |
| | | |
| | | // load files |
| | | $content = rf('tpl/mm_cfg.py.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/mm_cfg.py.master', 'tpl/mm_cfg.py.master'); |
| | | $old_file = rf($full_file_name); |
| | | |
| | | $old_options = array(); |
| | |
| | | copy($full_file_name, $config_dir.'virtual_to_transport.sh~'); |
| | | } |
| | | |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailman-virtual_to_transport.sh')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailman-virtual_to_transport.sh', $full_file_name); |
| | | } else { |
| | | copy('tpl/mailman-virtual_to_transport.sh',$full_file_name); |
| | | } |
| | | chgrp($full_file_name,'mailman'); |
| | | chmod($full_file_name,0750); |
| | | |
| | |
| | | $configfile = 'fedora_amavisd_conf'; |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf')) copy($conf["amavis"]["config_dir"].'/amavisd.conf',$conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf~')) exec('chmod 400 '.$conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | $content = rf("tpl/".$configfile.".master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/".$configfile.".master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | // Only add the content if we had not addded it before |
| | | if(!stristr($content,"127.0.0.1:10025")) { |
| | | unset($content); |
| | | $content = rf("tpl/master_cf_amavis.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', "tpl/master_cf_amavis.master"); |
| | | af($conf["postfix"]["config_dir"].'/master.cf',$content); |
| | | } |
| | | unset($content); |
| | |
| | | } |
| | | |
| | | // load files |
| | | $content = rf('tpl/mm_cfg.py.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/mm_cfg.py.master', 'tpl/mm_cfg.py.master'); |
| | | $old_file = rf($full_file_name); |
| | | |
| | | $old_options = array(); |
| | |
| | | copy($full_file_name, $config_dir.'virtual_to_transport.sh~'); |
| | | } |
| | | |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailman-virtual_to_transport.sh')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailman-virtual_to_transport.sh', $full_file_name); |
| | | } else { |
| | | copy('tpl/mailman-virtual_to_transport.sh',$full_file_name); |
| | | } |
| | | chgrp($full_file_name,'mailman'); |
| | | chmod($full_file_name,0750); |
| | | |
| | |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf')) copy($conf["amavis"]["config_dir"].'/amavisd.conf',$conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf~')) exec('chmod 400 '.$conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | if(!is_dir($conf["amavis"]["config_dir"])) mkdir($conf["amavis"]["config_dir"]); |
| | | $content = rf("tpl/".$configfile.".master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/".$configfile.".master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | // Only add the content if we had not addded it before |
| | | if(!stristr($content,"127.0.0.1:10025")) { |
| | | unset($content); |
| | | $content = rf("tpl/master_cf_amavis.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', "tpl/master_cf_amavis.master"); |
| | | af($conf["postfix"]["config_dir"].'/master.cf',$content); |
| | | } |
| | | unset($content); |
| | |
| | | |
| | | //* Copy dovecot configuration file |
| | | if($dovecot_version == 2) { |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot2.conf.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot2.conf.master', $config_dir.'/'.$configfile); |
| | | } else { |
| | | copy('tpl/debian6_dovecot2.conf.master',$config_dir.'/'.$configfile); |
| | | } |
| | | } 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); |
| | | } else { |
| | | copy('tpl/debian6_dovecot.conf.master',$config_dir.'/'.$configfile); |
| | | } |
| | | } |
| | | |
| | | //* dovecot-sql.conf |
| | |
| | | copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); |
| | | chmod($config_dir.'/'.$configfile.'~', 0400); |
| | | } |
| | | $content = rf('tpl/debian6_dovecot-sql.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot-sql.conf.master', 'tpl/debian6_dovecot-sql.conf.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | } |
| | | |
| | | // load files |
| | | $content = rf('tpl/mm_cfg.py.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/mm_cfg.py.master', 'tpl/mm_cfg.py.master'); |
| | | $old_file = rf($full_file_name); |
| | | |
| | | $old_options = array(); |
| | |
| | | } |
| | | |
| | | if(is_dir('/etc/mailman')) { |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailman-virtual_to_transport.sh')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailman-virtual_to_transport.sh', $full_file_name); |
| | | } else { |
| | | copy('tpl/mailman-virtual_to_transport.sh',$full_file_name); |
| | | } |
| | | chgrp($full_file_name,'mailman'); |
| | | chmod($full_file_name,0750); |
| | | } |
| | |
| | | if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | |
| | | //* These postconf commands will be executed on installation and update |
| | | $postconf_commands = array ( |
| | | 'virtual_alias_domains =', |
| | | 'virtual_alias_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_forwardings.cf, mysql:'.$config_dir.'/mysql-virtual_email2email.cf', |
| | | 'virtual_mailbox_domains = proxy:mysql:'.$config_dir.'/mysql-virtual_domains.cf', |
| | | 'virtual_mailbox_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_mailboxes.cf', |
| | | 'virtual_mailbox_base = '.$cf['vmail_mailbox_base'], |
| | | 'virtual_uid_maps = static:'.$cf['vmail_userid'], |
| | | 'virtual_gid_maps = static:'.$cf['vmail_groupid'], |
| | | 'smtpd_sasl_auth_enable = yes', |
| | | 'broken_sasl_auth_clients = yes', |
| | | 'smtpd_sasl_authenticated_header = yes', |
| | | 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:'.$config_dir.'/mysql-virtual_recipient.cf, reject_unauth_destination', |
| | | 'smtpd_use_tls = yes', |
| | | 'smtpd_tls_security_level = may', |
| | | 'smtpd_tls_cert_file = '.$config_dir.'/smtpd.cert', |
| | | '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', |
| | | 'smtpd_sender_restrictions = check_sender_access mysql:'.$config_dir.'/mysql-virtual_sender.cf', |
| | | 'smtpd_client_restrictions = check_client_access mysql:'.$config_dir.'/mysql-virtual_client.cf', |
| | | 'maildrop_destination_concurrency_limit = 1', |
| | | 'maildrop_destination_recipient_limit = 1', |
| | | 'virtual_transport = maildrop', |
| | | 'header_checks = regexp:'.$config_dir.'/header_checks', |
| | | 'mime_header_checks = regexp:'.$config_dir.'/mime_header_checks', |
| | | 'nested_header_checks = regexp:'.$config_dir.'/nested_header_checks', |
| | | 'body_checks = regexp:'.$config_dir.'/body_checks', |
| | | 'inet_interfaces = all' |
| | | ); |
| | | $postconf_placeholders = array('{config_dir}' => $config_dir, |
| | | '{vmail_mailbox_base}' => $cf['vmail_mailbox_base'], |
| | | '{vmail_userid}' => $cf['vmail_userid'], |
| | | '{vmail_groupid}' => $cf['vmail_groupid'], |
| | | '{rbl_list}' => $rbl_list); |
| | | |
| | | $postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_postfix.conf.master', 'tpl/fedora_postfix.conf.master'); |
| | | $postconf_tpl = strtr($postconf_tpl, $postconf_placeholders); |
| | | $postconf_commands = array_filter(explode("\n", $postconf_tpl)); // read and remove empty lines |
| | | |
| | | //* These postconf commands will be executed on installation only |
| | | if($this->is_update == false) { |
| | |
| | | if(is_file($cf['vmail_mailbox_base'].'/.'.$configfile)){ |
| | | copy($cf['vmail_mailbox_base'].'/.'.$configfile, $cf['vmail_mailbox_base'].'/.'.$configfile.'~'); |
| | | } |
| | | $content = rf("tpl/$configfile.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); |
| | | $content = str_replace('{dist_postfix_vmail_mailbox_base}', $cf['vmail_mailbox_base'], $content); |
| | | wf($cf['vmail_mailbox_base'].'/.'.$configfile, $content); |
| | | |
| | |
| | | global $conf; |
| | | |
| | | $configfile = 'tpl/fedora_saslauthd_smtpd_conf.master'; |
| | | $content = rf($configfile); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_saslauthd_smtpd_conf.master', $configfile); |
| | | wf('/usr/lib/sasl2/smtpd.conf',$content); |
| | | if(is_dir('/usr/lib64')) wf('/usr/lib64/sasl/smtpd.conf',$content); |
| | | if(is_dir('/usr/lib64')) wf('/usr/lib64/sasl2/smtpd.conf',$content); |
| | |
| | | if(is_file("$pam/smtp")) copy("$pam/smtp", "$pam/smtp~"); |
| | | if(is_file("$pam/smtp~")) exec("chmod 400 $pam/smtp~"); |
| | | |
| | | $content = rf("tpl/$configfile.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | |
| | | copy("$config_dir/$configfile", "$config_dir/$configfile~"); |
| | | } |
| | | exec("chmod 400 $config_dir/$configfile~"); |
| | | $content = rf("tpl/$configfile.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | |
| | | //* Copy dovecot configuration file |
| | | if($dovecot_version == 2) { |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_dovecot2.conf.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_dovecot2.conf.master', $config_dir.'/'.$configfile); |
| | | } else { |
| | | copy('tpl/fedora_dovecot2.conf.master',$config_dir.'/'.$configfile); |
| | | } |
| | | } else { |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_dovecot.conf.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_dovecot.conf.master', $config_dir.'/'.$configfile); |
| | | } else { |
| | | copy('tpl/fedora_dovecot.conf.master',$config_dir.'/'.$configfile); |
| | | } |
| | | } |
| | | |
| | | //* dovecot-sql.conf |
| | |
| | | exec("chmod 400 $config_dir/$configfile~"); |
| | | } |
| | | |
| | | $content = rf("tpl/fedora_dovecot-sql.conf.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_dovecot-sql.conf.master', "tpl/fedora_dovecot-sql.conf.master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | $configfile = 'fedora_amavisd_conf'; |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf')) copy($conf["amavis"]["config_dir"].'/amavisd.conf',$conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf~')) exec('chmod 400 '.$conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | $content = rf("tpl/".$configfile.".master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/".$configfile.".master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | // Only add the content if we had not addded it before |
| | | if(!stristr($content,"127.0.0.1:10025")) { |
| | | unset($content); |
| | | $content = rf("tpl/master_cf_amavis.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', "tpl/master_cf_amavis.master"); |
| | | af($conf["postfix"]["config_dir"].'/master.cf',$content); |
| | | } |
| | | unset($content); |
| | |
| | | if(is_file("$config_dir/$configfile~")){ |
| | | exec("chmod 400 $config_dir/$configfile~"); |
| | | } |
| | | $content = rf('tpl/pureftpd_mysql.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/pureftpd_mysql.conf.master', 'tpl/pureftpd_mysql.conf.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf["mysql"]["ispconfig_user"], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf["mysql"]["ispconfig_password"], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf["mysql"]["database"], $content); |
| | |
| | | exec("chown root:root $config_dir/$configfile"); |
| | | |
| | | // copy our customized copy of pureftpd.conf to the pure-ftpd config directory |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_pureftpd_conf.master')) { |
| | | exec("cp " . $conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_pureftpd_conf.master ' . "$config_dir/pure-ftpd.conf"); |
| | | }else { |
| | | exec("cp tpl/fedora_pureftpd_conf.master $config_dir/pure-ftpd.conf"); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | $configfile = 'mydns.conf'; |
| | | if(is_file($conf["mydns"]["config_dir"].'/'.$configfile)) copy($conf["mydns"]["config_dir"].'/'.$configfile,$conf["mydns"]["config_dir"].'/'.$configfile.'~'); |
| | | if(is_file($conf["mydns"]["config_dir"].'/'.$configfile.'~')) exec('chmod 400 '.$conf["mydns"]["config_dir"].'/'.$configfile.'~'); |
| | | $content = rf("tpl/".$configfile.".master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/".$configfile.".master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | $vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir']; |
| | | |
| | | // copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf'); |
| | | $content = rf('tpl/apache_ispconfig.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_ispconfig.conf.master', 'tpl/apache_ispconfig.conf.master'); |
| | | $records = $this->db->queryAllRecords('SELECT * FROM '.$conf['mysql']['master_database'].'.server_ip WHERE server_id = '.$conf['server_id']." AND virtualhost = 'y'"); |
| | | |
| | | if(is_array($records) && count($records) > 0) { |
| | |
| | | if(is_dir("/etc/Bastille")) caselog("mv -f /etc/Bastille /etc/Bastille.backup", __FILE__, __LINE__); |
| | | @mkdir("/etc/Bastille", octdec($directory_mode)); |
| | | if(is_dir("/etc/Bastille.backup/firewall.d")) caselog("cp -pfr /etc/Bastille.backup/firewall.d /etc/Bastille/", __FILE__, __LINE__); |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/bastille-firewall.cfg.master')) { |
| | | caselog("cp -f " . $conf['ispconfig_install_dir']."/server/conf-custom/install/bastille-firewall.cfg.master /etc/Bastille/bastille-firewall.cfg", __FILE__, __LINE__); |
| | | } else { |
| | | caselog("cp -f tpl/bastille-firewall.cfg.master /etc/Bastille/bastille-firewall.cfg", __FILE__, __LINE__); |
| | | } |
| | | caselog("chmod 644 /etc/Bastille/bastille-firewall.cfg", __FILE__, __LINE__); |
| | | $content = rf("/etc/Bastille/bastille-firewall.cfg"); |
| | | $content = str_replace("{DNS_SERVERS}", "", $content); |
| | |
| | | if(is_file($install_dir.'/interface/lib/'.$configfile)){ |
| | | copy("$install_dir/interface/lib/$configfile", "$install_dir/interface/lib/$configfile~"); |
| | | } |
| | | $content = rf("tpl/$configfile.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | |
| | | if(is_file($install_dir.'/server/lib/'.$configfile)){ |
| | | copy("$install_dir/server/lib/$configfile", "$install_dir/interface/lib/$configfile~"); |
| | | } |
| | | $content = rf("tpl/$configfile.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | |
| | | |
| | | |
| | | // Dont just copy over the virtualhost template but add some custom settings |
| | | $content = rf("tpl/apache_ispconfig.vhost.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_ispconfig.vhost.master', "tpl/apache_ispconfig.vhost.master"); |
| | | $content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content); |
| | | |
| | | // comment out the listen directive if port is 80 or 443 |
| | |
| | | replaceLine('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter','PHPRC=','PHPRC=/etc/',0,0); |
| | | */ |
| | | //if(!is_file('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) { |
| | | $content = rf('tpl/apache_ispconfig_fcgi_starter.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_ispconfig_fcgi_starter.master', 'tpl/apache_ispconfig_fcgi_starter.master'); |
| | | $content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content); |
| | | $content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content); |
| | | if(!is_dir('/var/www/php-fcgi-scripts/ispconfig')) exec('mkdir -p /var/www/php-fcgi-scripts/ispconfig'); |
| | |
| | | $vhost_conf_enabled_dir = $conf['nginx']['vhost_conf_enabled_dir']; |
| | | |
| | | // Dont just copy over the virtualhost template but add some custom settings |
| | | $content = rf('tpl/nginx_ispconfig.vhost.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/nginx_ispconfig.vhost.master', 'tpl/nginx_ispconfig.vhost.master'); |
| | | $content = str_replace('{vhost_port}', $conf['nginx']['vhost_port'], $content); |
| | | |
| | | if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) { |
| | |
| | | |
| | | // PHP-FPM |
| | | // Dont just copy over the php-fpm pool template but add some custom settings |
| | | $content = rf('tpl/php_fpm_pool.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/php_fpm_pool.conf.master', 'tpl/php_fpm_pool.conf.master'); |
| | | $content = str_replace('{fpm_pool}', 'ispconfig', $content); |
| | | //$content = str_replace('{fpm_port}', $conf['nginx']['php_fpm_start_port'], $content); |
| | | $content = str_replace('{fpm_socket}', $fpm_socket, $content); |
| | |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | $content = rf("tpl/mysql_clientdb.conf.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/mysql_clientdb.conf.master', "tpl/mysql_clientdb.conf.master"); |
| | | $content = str_replace('{hostname}',$conf['mysql']['host'],$content); |
| | | $content = str_replace('{username}',$conf['mysql']['admin_user'],$content); |
| | | $content = str_replace('{password}',$conf['mysql']['admin_password'], $content); |
| | |
| | | } |
| | | |
| | | //* These postconf commands will be executed on installation and update |
| | | $postconf_commands = array ( |
| | | 'virtual_alias_domains =', |
| | | 'virtual_alias_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_forwardings.cf, mysql:'.$config_dir.'/mysql-virtual_email2email.cf', |
| | | 'virtual_mailbox_domains = proxy:mysql:'.$config_dir.'/mysql-virtual_domains.cf', |
| | | 'virtual_mailbox_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_mailboxes.cf', |
| | | 'virtual_mailbox_base = '.$cf['vmail_mailbox_base'], |
| | | 'virtual_uid_maps = static:'.$cf['vmail_userid'], |
| | | 'virtual_gid_maps = static:'.$cf['vmail_groupid'], |
| | | 'smtpd_sasl_auth_enable = yes', |
| | | 'broken_sasl_auth_clients = yes', |
| | | 'smtpd_sasl_authenticated_header = yes', |
| | | 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:'.$config_dir.'/mysql-virtual_recipient.cf, reject_unauth_destination', |
| | | 'smtpd_use_tls = yes', |
| | | 'smtpd_tls_security_level = may', |
| | | 'smtpd_tls_cert_file = '.$config_dir.'/smtpd.cert', |
| | | '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', |
| | | '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', |
| | | 'smtpd_sender_restrictions = check_sender_access mysql:'.$config_dir.'/mysql-virtual_sender.cf', |
| | | 'smtpd_client_restrictions = check_client_access mysql:'.$config_dir.'/mysql-virtual_client.cf', |
| | | 'maildrop_destination_concurrency_limit = 1', |
| | | 'maildrop_destination_recipient_limit = 1', |
| | | 'virtual_transport = maildrop', |
| | | 'header_checks = regexp:'.$config_dir.'/header_checks', |
| | | 'mime_header_checks = regexp:'.$config_dir.'/mime_header_checks', |
| | | 'nested_header_checks = regexp:'.$config_dir.'/nested_header_checks', |
| | | 'body_checks = regexp:'.$config_dir.'/body_checks' |
| | | ); |
| | | $postconf_placeholders = array('{config_dir}' => $config_dir, |
| | | '{vmail_mailbox_base}' => $cf['vmail_mailbox_base'], |
| | | '{vmail_userid}' => $cf['vmail_userid'], |
| | | '{vmail_groupid}' => $cf['vmail_groupid'], |
| | | '{rbl_list}' => $rbl_list); |
| | | |
| | | $postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/gentoo_postfix.conf.master', 'tpl/gentoo_postfix.conf.master'); |
| | | $postconf_tpl = strtr($postconf_tpl, $postconf_placeholders); |
| | | $postconf_commands = array_filter(explode("\n", $postconf_tpl)); // read and remove empty lines |
| | | |
| | | //* These postconf commands will be executed on installation only |
| | | if($this->is_update == false) { |
| | |
| | | $this->write_config_file($configfile, $content); |
| | | |
| | | //* Writing the Maildrop mailfilter file |
| | | $content = rf('tpl/mailfilter.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailfilter.master', 'tpl/mailfilter.master'); |
| | | $content = str_replace('{dist_postfix_vmail_mailbox_base}', $cf['vmail_mailbox_base'], $content); |
| | | |
| | | $this->write_config_file($cf['vmail_mailbox_base'].'/.mailfilter', $content); |
| | |
| | | |
| | | //if ( !is_file($conf['web']['website_basedir'].'/php-fcgi-scripts/apps/.php-fcgi-starter') ) |
| | | //{ |
| | | $content = rf('tpl/apache_apps_fcgi_starter.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_apps_fcgi_starter.master', 'tpl/apache_apps_fcgi_starter.master'); |
| | | $content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content); |
| | | $content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content); |
| | | mkdir($conf['web']['website_basedir'].'/php-fcgi-scripts/apps', 0755, true); |
| | |
| | | $apps_vhost_servername = ($conf['web']['apps_vhost_servername'] == '')?'_':$conf['web']['apps_vhost_servername']; |
| | | |
| | | // Dont just copy over the virtualhost template but add some custom settings |
| | | $content = rf('tpl/nginx_apps.vhost.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/nginx_apps.vhost.master', 'tpl/nginx_apps.vhost.master'); |
| | | |
| | | if($conf['web']['apps_vhost_ip'] == '_default_'){ |
| | | $apps_vhost_ip = ''; |
| | |
| | | |
| | | // PHP-FPM |
| | | // Dont just copy over the php-fpm pool template but add some custom settings |
| | | $content = rf('tpl/apps_php_fpm_pool.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apps_php_fpm_pool.conf.master', 'tpl/apps_php_fpm_pool.conf.master'); |
| | | $content = str_replace('{fpm_pool}', 'apps', $content); |
| | | //$content = str_replace('{fpm_port}', ($conf['nginx']['php_fpm_start_port']+1), $content); |
| | | $content = str_replace('{fpm_socket}', $fpm_socket, $content); |
| | |
| | | $this->write_config_file($vhost_path, $content); |
| | | |
| | | if(!is_file('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) { |
| | | $content = rf('tpl/apache_ispconfig_fcgi_starter.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_ispconfig_fcgi_starter.master', 'tpl/apache_ispconfig_fcgi_starter.master'); |
| | | $content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content); |
| | | $content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content); |
| | | @mkdir('/var/www/php-fcgi-scripts/ispconfig', 0755, true); |
| | |
| | | $vhost_conf_enabled_dir = $conf['nginx']['vhost_conf_enabled_dir']; |
| | | |
| | | // Dont just copy over the virtualhost template but add some custom settings |
| | | $content = rf('tpl/nginx_ispconfig.vhost.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/nginx_ispconfig.vhost.master', 'tpl/nginx_ispconfig.vhost.master'); |
| | | $content = str_replace('{vhost_port}', $conf['nginx']['vhost_port'], $content); |
| | | |
| | | if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) { |
| | |
| | | |
| | | // PHP-FPM |
| | | // Dont just copy over the php-fpm pool template but add some custom settings |
| | | $content = rf('tpl/php_fpm_pool.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/php_fpm_pool.conf.master', 'tpl/php_fpm_pool.conf.master'); |
| | | $content = str_replace('{fpm_pool}', 'ispconfig', $content); |
| | | //$content = str_replace('{fpm_port}', $conf['nginx']['php_fpm_start_port'], $content); |
| | | $content = str_replace('{fpm_socket}', $fpm_socket, $content); |
| | |
| | | } |
| | | |
| | | // load files |
| | | $content = rf('tpl/mm_cfg.py.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/mm_cfg.py.master', 'tpl/mm_cfg.py.master'); |
| | | $old_file = rf($full_file_name); |
| | | |
| | | $old_options = array(); |
| | |
| | | } |
| | | |
| | | if(is_dir('/etc/mailman')) { |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailman-virtual_to_transport.sh')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailman-virtual_to_transport.sh', $full_file_name); |
| | | } else { |
| | | copy('tpl/mailman-virtual_to_transport.sh',$full_file_name); |
| | | } |
| | | chgrp($full_file_name,'mailman'); |
| | | chmod($full_file_name,0750); |
| | | } |
| | |
| | | if($cf['vmail_mailbox_base'] != '' && strlen($cf['vmail_mailbox_base']) >= 10 && $this->is_update === false) exec('chown -R '.$cf['vmail_username'].':'.$cf['vmail_groupname'].' '.$cf['vmail_mailbox_base']); |
| | | |
| | | //* These postconf commands will be executed on installation and update |
| | | $postconf_commands = array ( |
| | | 'virtual_alias_domains =', |
| | | 'virtual_alias_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_forwardings.cf, mysql:'.$config_dir.'/mysql-virtual_email2email.cf', |
| | | 'virtual_mailbox_domains = proxy:mysql:'.$config_dir.'/mysql-virtual_domains.cf', |
| | | 'virtual_mailbox_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_mailboxes.cf', |
| | | 'virtual_mailbox_base = '.$cf['vmail_mailbox_base'], |
| | | 'virtual_uid_maps = static:'.$cf['vmail_userid'], |
| | | 'virtual_gid_maps = static:'.$cf['vmail_groupid'], |
| | | 'smtpd_sasl_auth_enable = yes', |
| | | 'broken_sasl_auth_clients = yes', |
| | | 'smtpd_sasl_authenticated_header = yes', |
| | | 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:'.$config_dir.'/mysql-virtual_recipient.cf, reject_unauth_destination', |
| | | 'smtpd_use_tls = yes', |
| | | 'smtpd_tls_security_level = may', |
| | | 'smtpd_tls_cert_file = '.$config_dir.'/smtpd.cert', |
| | | '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', |
| | | 'smtpd_sender_restrictions = check_sender_access mysql:'.$config_dir.'/mysql-virtual_sender.cf', |
| | | 'smtpd_client_restrictions = check_client_access mysql:'.$config_dir.'/mysql-virtual_client.cf', |
| | | 'maildrop_destination_concurrency_limit = 1', |
| | | 'maildrop_destination_recipient_limit = 1', |
| | | 'virtual_transport = maildrop', |
| | | 'header_checks = regexp:'.$config_dir.'/header_checks', |
| | | 'mime_header_checks = regexp:'.$config_dir.'/mime_header_checks', |
| | | 'nested_header_checks = regexp:'.$config_dir.'/nested_header_checks', |
| | | 'body_checks = regexp:'.$config_dir.'/body_checks', |
| | | 'inet_interfaces = all' |
| | | ); |
| | | $postconf_placeholders = array('{config_dir}' => $config_dir, |
| | | '{vmail_mailbox_base}' => $cf['vmail_mailbox_base'], |
| | | '{vmail_userid}' => $cf['vmail_userid'], |
| | | '{vmail_groupid}' => $cf['vmail_groupid'], |
| | | '{rbl_list}' => $rbl_list); |
| | | |
| | | $postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/opensuse_postfix.conf.master', 'tpl/opensuse_postfix.conf.master'); |
| | | $postconf_tpl = strtr($postconf_tpl, $postconf_placeholders); |
| | | $postconf_commands = array_filter(explode("\n", $postconf_tpl)); // read and remove empty lines |
| | | |
| | | //* These postconf commands will be executed on installation only |
| | | if($this->is_update == false) { |
| | |
| | | if(is_file($cf['vmail_mailbox_base'].'/.'.$configfile)){ |
| | | copy($cf['vmail_mailbox_base'].'/.'.$configfile, $cf['vmail_mailbox_base'].'/.'.$configfile.'~'); |
| | | } |
| | | $content = rf("tpl/$configfile.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); |
| | | $content = str_replace('{dist_postfix_vmail_mailbox_base}', $cf['vmail_mailbox_base'], $content); |
| | | wf($cf['vmail_mailbox_base'].'/.'.$configfile, $content); |
| | | |
| | |
| | | if(is_file("$pam/smtp")) copy("$pam/smtp", "$pam/smtp~"); |
| | | if(is_file("$pam/smtp~")) exec("chmod 400 $pam/smtp~"); |
| | | |
| | | $content = rf("tpl/$configfile.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | |
| | | copy("$config_dir/$configfile", "$config_dir/$configfile~"); |
| | | } |
| | | exec("chmod 400 $config_dir/$configfile~"); |
| | | $content = rf("tpl/$configfile.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | |
| | | //* Copy dovecot configuration file |
| | | if($dovecot_version == 2) { |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/opensuse_dovecot2.conf.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/opensuse_dovecot2.conf.master', $config_dir.'/'.$configfile); |
| | | } else { |
| | | copy('tpl/opensuse_dovecot2.conf.master',$config_dir.'/'.$configfile); |
| | | } |
| | | } else { |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/opensuse_dovecot.conf.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/opensuse_dovecot.conf.master', $config_dir.'/'.$configfile); |
| | | } else { |
| | | copy('tpl/opensuse_dovecot.conf.master',$config_dir.'/'.$configfile); |
| | | } |
| | | } |
| | | |
| | | //* dovecot-sql.conf |
| | |
| | | exec("chmod 400 $config_dir/$configfile~"); |
| | | } |
| | | |
| | | $content = rf("tpl/opensuse_dovecot-sql.conf.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/opensuse_dovecot-sql.conf.master', "tpl/opensuse_dovecot-sql.conf.master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | $configfile = 'opensuse_amavisd_conf'; |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf')) @copy($conf["amavis"]["config_dir"].'/amavisd.conf',$conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf~')) exec('chmod 400 '.$conf["amavis"]["config_dir"].'/amavisd.conf~'); |
| | | $content = rf("tpl/".$configfile.".master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/".$configfile.".master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | // Only add the content if we had not addded it before |
| | | if(!stristr($content,"127.0.0.1:10025")) { |
| | | unset($content); |
| | | $content = rf("tpl/master_cf_amavis.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', "tpl/master_cf_amavis.master"); |
| | | af($conf["postfix"]["config_dir"].'/master.cf',$content); |
| | | } |
| | | unset($content); |
| | |
| | | if(is_file("$config_dir/$configfile~")){ |
| | | exec("chmod 400 $config_dir/$configfile~"); |
| | | } |
| | | $content = rf('tpl/pureftpd_mysql.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/pureftpd_mysql.conf.master', 'tpl/pureftpd_mysql.conf.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf["mysql"]["ispconfig_user"], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf["mysql"]["ispconfig_password"], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf["mysql"]["database"], $content); |
| | |
| | | exec("chown root:root $config_dir/$configfile"); |
| | | |
| | | // copy our customized copy of pureftpd.conf to the pure-ftpd config directory |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/opensuse_pureftpd_conf.master')) { |
| | | exec("cp " . $conf['ispconfig_install_dir']."/server/conf-custom/install/opensuse_pureftpd_conf.master $config_dir/pure-ftpd.conf"); |
| | | } else { |
| | | exec("cp tpl/opensuse_pureftpd_conf.master $config_dir/pure-ftpd.conf"); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | $configfile = 'mydns.conf'; |
| | | if(is_file($conf["mydns"]["config_dir"].'/'.$configfile)) copy($conf["mydns"]["config_dir"].'/'.$configfile,$conf["mydns"]["config_dir"].'/'.$configfile.'~'); |
| | | if(is_file($conf["mydns"]["config_dir"].'/'.$configfile.'~')) exec('chmod 400 '.$conf["mydns"]["config_dir"].'/'.$configfile.'~'); |
| | | $content = rf("tpl/".$configfile.".master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/".$configfile.".master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | $vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir']; |
| | | |
| | | //copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf'); |
| | | $content = rf('tpl/apache_ispconfig.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_ispconfig.conf.master', 'tpl/apache_ispconfig.conf.master'); |
| | | $records = $this->db->queryAllRecords('SELECT * FROM '.$conf['mysql']['master_database'].'.server_ip WHERE server_id = '.$conf['server_id']." AND virtualhost = 'y'"); |
| | | |
| | | if(is_array($records) && count($records) > 0) { |
| | |
| | | if(is_dir("/etc/Bastille")) caselog("mv -f /etc/Bastille /etc/Bastille.backup", __FILE__, __LINE__); |
| | | @mkdir("/etc/Bastille", octdec($directory_mode)); |
| | | if(is_dir("/etc/Bastille.backup/firewall.d")) caselog("cp -pfr /etc/Bastille.backup/firewall.d /etc/Bastille/", __FILE__, __LINE__); |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/bastille-firewall.cfg.master')) { |
| | | caselog("cp -f " . $conf['ispconfig_install_dir']."/server/conf-custom/install/bastille-firewall.cfg.master /etc/Bastille/bastille-firewall.cfg", __FILE__, __LINE__); |
| | | } else { |
| | | caselog("cp -f tpl/bastille-firewall.cfg.master /etc/Bastille/bastille-firewall.cfg", __FILE__, __LINE__); |
| | | } |
| | | caselog("chmod 644 /etc/Bastille/bastille-firewall.cfg", __FILE__, __LINE__); |
| | | $content = rf("/etc/Bastille/bastille-firewall.cfg"); |
| | | $content = str_replace("{DNS_SERVERS}", "", $content); |
| | |
| | | if(is_file($install_dir.'/interface/lib/'.$configfile)){ |
| | | copy("$install_dir/interface/lib/$configfile", "$install_dir/interface/lib/$configfile~"); |
| | | } |
| | | $content = rf("tpl/$configfile.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | |
| | | if(is_file($install_dir.'/server/lib/'.$configfile)){ |
| | | copy("$install_dir/server/lib/$configfile", "$install_dir/interface/lib/$configfile~"); |
| | | } |
| | | $content = rf("tpl/$configfile.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | |
| | | |
| | | // Dont just copy over the virtualhost template but add some custom settings |
| | | |
| | | $content = rf("tpl/apache_ispconfig.vhost.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_ispconfig.vhost.master', "tpl/apache_ispconfig.vhost.master"); |
| | | $content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content); |
| | | |
| | | // comment out the listen directive if port is 80 or 443 |
| | |
| | | wf("$vhost_conf_dir/ispconfig.vhost", $content); |
| | | |
| | | //if(!is_file('/srv/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) { |
| | | $content = rf('tpl/apache_ispconfig_fcgi_starter.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_ispconfig_fcgi_starter.master', 'tpl/apache_ispconfig_fcgi_starter.master'); |
| | | $content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content); |
| | | $content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content); |
| | | exec('mkdir -p /srv/www/php-fcgi-scripts/ispconfig'); |
| | |
| | | $vhost_conf_enabled_dir = $conf['nginx']['vhost_conf_enabled_dir']; |
| | | |
| | | // Dont just copy over the virtualhost template but add some custom settings |
| | | $content = rf('tpl/nginx_ispconfig.vhost.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/nginx_ispconfig.vhost.master', 'tpl/nginx_ispconfig.vhost.master'); |
| | | $content = str_replace('{vhost_port}', $conf['nginx']['vhost_port'], $content); |
| | | |
| | | if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) { |
| | |
| | | |
| | | // PHP-FPM |
| | | // Dont just copy over the php-fpm pool template but add some custom settings |
| | | $content = rf('tpl/php_fpm_pool.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/php_fpm_pool.conf.master', 'tpl/php_fpm_pool.conf.master'); |
| | | $content = str_replace('{fpm_pool}', 'ispconfig', $content); |
| | | //$content = str_replace('{fpm_port}', $conf['nginx']['php_fpm_start_port'], $content); |
| | | $content = str_replace('{fpm_socket}', $fpm_socket, $content); |
| | |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | $content = rf("tpl/mysql_clientdb.conf.master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/mysql_clientdb.conf.master', "tpl/mysql_clientdb.conf.master"); |
| | | $content = str_replace('{hostname}',$conf['mysql']['host'],$content); |
| | | $content = str_replace('{username}',$conf['mysql']['admin_user'],$content); |
| | | $content = str_replace('{password}',$conf['mysql']['admin_password'], $content); |
| | |
| | | $distid = 'debian60'; |
| | | $distbaseid = 'debian'; |
| | | swriteln("Operating System: Debian 6.0 (Squeeze/Sid) or compatible\n"); |
| | | } elseif(strstr(trim(file_get_contents('/etc/debian_version')),'6.0') || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') { |
| | | } elseif(strstr(trim(file_get_contents('/etc/debian_version')),'7.0') || strstr(trim(file_get_contents('/etc/debian_version')),'7.1') || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') { |
| | | $distname = 'Debian'; |
| | | $distver = 'Wheezy/Sid'; |
| | | $distid = 'debian60'; |
| | |
| | | return false; |
| | | } |
| | | |
| | | function rfsel($file, $file2) { |
| | | clearstatcache(); |
| | | if(is_file($file)) return rf($file); |
| | | else return rf($file2); |
| | | } |
| | | |
| | | function rf($file){ |
| | | clearstatcache(); |
| | | if(is_file($file)) { |
| | |
| | | if(is_file($full_file_name)) { |
| | | copy($full_file_name, $config_dir.$configfile.'~'); |
| | | } |
| | | $content = rf('tpl/'.$configfile.'.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | |
| | | if(is_file($config_dir.'/'.$jk_init)) copy($config_dir.'/'.$jk_init, $config_dir.'/'.$jk_init.'~'); |
| | | if(is_file($config_dir.'/'.$jk_chrootsh.'.master')) copy($config_dir.'/'.$jk_chrootsh.'.master', $config_dir.'/'.$jk_chrootsh.'~'); |
| | | |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$jk_init.'.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$jk_init.'.master', $config_dir.'/'.$jk_init); |
| | | } else { |
| | | copy('tpl/'.$jk_init.'.master', $config_dir.'/'.$jk_init); |
| | | } |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$jk_chrootsh.'.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$jk_chrootsh.'.master', $config_dir.'/'.$jk_chrootsh); |
| | | } else { |
| | | copy('tpl/'.$jk_chrootsh.'.master', $config_dir.'/'.$jk_chrootsh); |
| | | } |
| | | } |
| | | |
| | | //* help jailkit fo find its ini files |
| | |
| | | } |
| | | |
| | | // load files |
| | | $content = rf('tpl/mm_cfg.py.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/mm_cfg.py.master', 'tpl/mm_cfg.py.master'); |
| | | $old_file = rf($full_file_name); |
| | | |
| | | $old_options = array(); |
| | |
| | | } |
| | | |
| | | if(is_dir('/etc/mailman')) { |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailman-virtual_to_transport.sh')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailman-virtual_to_transport.sh', $full_file_name); |
| | | } else { |
| | | copy('tpl/mailman-virtual_to_transport.sh',$full_file_name); |
| | | } |
| | | chgrp($full_file_name,'list'); |
| | | chmod($full_file_name,0750); |
| | | } |
| | |
| | | unset($rbl_hosts); |
| | | unset($server_ini_array); |
| | | |
| | | $postconf_commands = array ( |
| | | 'alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases', |
| | | 'alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases', |
| | | 'virtual_alias_domains =', |
| | | 'virtual_alias_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_forwardings.cf, proxy:mysql:'.$config_dir.'/mysql-virtual_email2email.cf, hash:/var/lib/mailman/data/virtual-mailman', |
| | | 'virtual_mailbox_domains = proxy:mysql:'.$config_dir.'/mysql-virtual_domains.cf', |
| | | 'virtual_mailbox_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_mailboxes.cf', |
| | | 'virtual_mailbox_base = '.$cf['vmail_mailbox_base'], |
| | | 'virtual_uid_maps = static:'.$cf['vmail_userid'], |
| | | 'virtual_gid_maps = static:'.$cf['vmail_groupid'], |
| | | 'inet_protocols=all', |
| | | 'smtpd_sasl_auth_enable = yes', |
| | | 'broken_sasl_auth_clients = yes', |
| | | 'smtpd_sasl_authenticated_header = yes', |
| | | 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:'.$config_dir.'/mysql-virtual_recipient.cf, reject_unauth_destination'. $rbl_list, |
| | | 'smtpd_use_tls = yes', |
| | | 'smtpd_tls_security_level = may', |
| | | 'smtpd_tls_cert_file = '.$config_dir.'/smtpd.cert', |
| | | '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', |
| | | 'smtpd_sender_restrictions = check_sender_access mysql:'.$config_dir.'/mysql-virtual_sender.cf', |
| | | 'smtpd_client_restrictions = check_client_access mysql:'.$config_dir.'/mysql-virtual_client.cf', |
| | | 'smtpd_client_message_rate_limit = 100', |
| | | 'maildrop_destination_concurrency_limit = 1', |
| | | 'maildrop_destination_recipient_limit = 1', |
| | | 'virtual_transport = maildrop', |
| | | 'header_checks = regexp:'.$config_dir.'/header_checks', |
| | | 'mime_header_checks = regexp:'.$config_dir.'/mime_header_checks', |
| | | 'nested_header_checks = regexp:'.$config_dir.'/nested_header_checks', |
| | | 'body_checks = regexp:'.$config_dir.'/body_checks', |
| | | 'owner_request_special = no' |
| | | ); |
| | | $postconf_placeholders = array('{config_dir}' => $config_dir, |
| | | '{vmail_mailbox_base}' => $cf['vmail_mailbox_base'], |
| | | '{vmail_userid}' => $cf['vmail_userid'], |
| | | '{vmail_groupid}' => $cf['vmail_groupid'], |
| | | '{rbl_list}' => $rbl_list); |
| | | |
| | | $postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_postfix.conf.master', 'tpl/debian_postfix.conf.master'); |
| | | $postconf_tpl = strtr($postconf_tpl, $postconf_placeholders); |
| | | $postconf_commands = array_filter(explode("\n", $postconf_tpl)); // read and remove empty lines |
| | | |
| | | //* These postconf commands will be executed on installation only |
| | | if($this->is_update == false) { |
| | |
| | | if(is_file($cf['vmail_mailbox_base'].'/.'.$configfile)) { |
| | | copy($cf['vmail_mailbox_base'].'/.'.$configfile, $cf['vmail_mailbox_base'].'/.'.$configfile.'~'); |
| | | } |
| | | $content = rf('tpl/'.$configfile.'.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); |
| | | $content = str_replace('{dist_postfix_vmail_mailbox_base}', $cf['vmail_mailbox_base'], $content); |
| | | wf($cf['vmail_mailbox_base'].'/.'.$configfile, $content); |
| | | |
| | |
| | | |
| | | if(is_file($conf['postfix']['config_dir'].'/sasl/smtpd.conf')) copy($conf['postfix']['config_dir'].'/sasl/smtpd.conf',$conf['postfix']['config_dir'].'/sasl/smtpd.conf~'); |
| | | if(is_file($conf['postfix']['config_dir'].'/sasl/smtpd.conf~')) chmod($conf['postfix']['config_dir'].'/sasl/smtpd.conf~', 0400); |
| | | $content = rf('tpl/'.$configfile.'.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | if(is_file($pam.'/smtp')) copy($pam.'/smtp', $pam.'/smtp~'); |
| | | if(is_file($pam.'/smtp~')) chmod($pam.'/smtp~', 0400); |
| | | |
| | | $content = rf('tpl/'.$configfile.'.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | |
| | | copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); |
| | | } |
| | | chmod($config_dir.'/'.$configfile.'~', 0400); |
| | | $content = rf('tpl/'.$configfile.'.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | |
| | | //* Copy dovecot configuration file |
| | | if($dovecot_version == 2) { |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot2.conf.master')) { |
| | | copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot2.conf.master', $config_dir.'/'.$configfile); |
| | | } else { |
| | | copy('tpl/debian_dovecot2.conf.master',$config_dir.'/'.$configfile); |
| | | } |
| | | } 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); |
| | | } else { |
| | | copy('tpl/debian_dovecot.conf.master',$config_dir.'/'.$configfile); |
| | | } |
| | | } |
| | | |
| | | //* dovecot-sql.conf |
| | |
| | | copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); |
| | | } |
| | | if(is_file($config_dir.'/'.$configfile.'~')) chmod($config_dir.'/'.$configfile.'~', 0400); |
| | | $content = rf('tpl/debian_dovecot-sql.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot-sql.conf.master', 'tpl/debian_dovecot-sql.conf.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | $configfile = 'amavisd_user_config'; |
| | | if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user')) copy($conf['amavis']['config_dir'].'/conf.d/50-user',$conf['amavis']['config_dir'].'/50-user~'); |
| | | if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user~')) chmod($conf['amavis']['config_dir'].'/conf.d/50-user~', 0400); |
| | | $content = rf('tpl/'.$configfile.'.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | // Only add the content if we had not addded it before |
| | | if(!stristr($content,'127.0.0.1:10025')) { |
| | | unset($content); |
| | | $content = rf('tpl/master_cf_amavis.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', 'tpl/master_cf_amavis.master'); |
| | | af($conf['postfix']['config_dir'].'/master.cf',$content); |
| | | } |
| | | unset($content); |
| | |
| | | if(is_file($config_dir.'/'.$configfile.'~')) { |
| | | chmod($config_dir.'/'.$configfile.'~', 0400); |
| | | } |
| | | $content = rf('tpl/pureftpd_mysql.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/pureftpd_mysql.conf.master', 'tpl/pureftpd_mysql.conf.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | |
| | | $configfile = 'mydns.conf'; |
| | | if(is_file($conf['mydns']['config_dir'].'/'.$configfile)) copy($conf['mydns']['config_dir'].'/'.$configfile,$conf['mydns']['config_dir'].'/'.$configfile.'~'); |
| | | if(is_file($conf['mydns']['config_dir'].'/'.$configfile.'~')) chmod($conf['mydns']['config_dir'].'/'.$configfile.'~', 0400); |
| | | $content = rf('tpl/'.$configfile.'.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); |
| | |
| | | $configfile = 'pdns.local'; |
| | | if(is_file($conf['powerdns']['config_dir'].'/'.$configfile)) copy($conf['powerdns']['config_dir'].'/'.$configfile,$conf['powerdns']['config_dir'].'/'.$configfile.'~'); |
| | | if(is_file($conf['powerdns']['config_dir'].'/'.$configfile.'~')) chmod($conf['powerdns']['config_dir'].'/'.$configfile.'~', 0400); |
| | | $content = rf('tpl/'.$configfile.'.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{powerdns_database}',$conf['powerdns']['database'],$content); |
| | |
| | | |
| | | // copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf'); |
| | | |
| | | $content = rf('tpl/apache_ispconfig.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_ispconfig.conf.master', 'tpl/apache_ispconfig.conf.master'); |
| | | $records = $this->db->queryAllRecords('SELECT * FROM '.$conf['mysql']['master_database'].'.server_ip WHERE server_id = '.$conf['server_id']." AND virtualhost = 'y'"); |
| | | |
| | | if(is_array($records) && count($records) > 0) { |
| | |
| | | $configfile = 'squid.conf'; |
| | | if(is_file($conf["squid"]["config_dir"].'/'.$configfile)) copy($conf["squid"]["config_dir"].'/'.$configfile,$conf["squid"]["config_dir"].'/'.$configfile.'~'); |
| | | if(is_file($conf["squid"]["config_dir"].'/'.$configfile.'~')) exec('chmod 400 '.$conf["squid"]["config_dir"].'/'.$configfile.'~'); |
| | | $content = rf("tpl/".$configfile.".master"); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/".$configfile.".master"); |
| | | $content = str_replace('{server_name}',$server_name,$content); |
| | | $content = str_replace('{ip_address}',$ip_address, $content); |
| | | $content = str_replace('{config_dir}',$conf['squid']['config_dir'], $content); |
| | |
| | | if(is_dir('/etc/Bastille')) caselog('mv -f /etc/Bastille /etc/Bastille.backup', __FILE__, __LINE__); |
| | | @mkdir('/etc/Bastille', 0700); |
| | | if(is_dir('/etc/Bastille.backup/firewall.d')) caselog('cp -pfr /etc/Bastille.backup/firewall.d /etc/Bastille/', __FILE__, __LINE__); |
| | | if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/bastille-firewall.cfg.master')) { |
| | | caselog('cp -f ' . $conf['ispconfig_install_dir'].'/server/conf-custom/install/bastille-firewall.cfg.master /etc/Bastille/bastille-firewall.cfg', __FILE__, __LINE__); |
| | | } else { |
| | | caselog('cp -f tpl/bastille-firewall.cfg.master /etc/Bastille/bastille-firewall.cfg', __FILE__, __LINE__); |
| | | } |
| | | caselog('chmod 644 /etc/Bastille/bastille-firewall.cfg', __FILE__, __LINE__); |
| | | $content = rf('/etc/Bastille/bastille-firewall.cfg'); |
| | | $content = str_replace('{DNS_SERVERS}', '', $content); |
| | |
| | | $configfile = 'vlogger-dbi.conf'; |
| | | if(is_file($conf['vlogger']['config_dir'].'/'.$configfile)) copy($conf['vlogger']['config_dir'].'/'.$configfile,$conf['vlogger']['config_dir'].'/'.$configfile.'~'); |
| | | if(is_file($conf['vlogger']['config_dir'].'/'.$configfile.'~')) chmod($conf['vlogger']['config_dir'].'/'.$configfile.'~', 0400); |
| | | $content = rf('tpl/'.$configfile.'.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); |
| | | if($conf['mysql']['master_slave_setup'] == 'y') { |
| | | $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['master_ispconfig_user'],$content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['master_ispconfig_password'], $content); |
| | |
| | | $apps_vhost_servername = ($conf['web']['apps_vhost_servername'] == '')?'':'ServerName '.$conf['web']['apps_vhost_servername']; |
| | | |
| | | // Dont just copy over the virtualhost template but add some custom settings |
| | | $content = rf('tpl/apache_apps.vhost.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_apps.vhost.master', 'tpl/apache_apps.vhost.master'); |
| | | |
| | | $content = str_replace('{apps_vhost_ip}', $conf['web']['apps_vhost_ip'], $content); |
| | | $content = str_replace('{apps_vhost_port}', $conf['web']['apps_vhost_port'], $content); |
| | |
| | | } |
| | | |
| | | if(!is_file($conf['web']['website_basedir'].'/php-fcgi-scripts/apps/.php-fcgi-starter')) { |
| | | $content = rf('tpl/apache_apps_fcgi_starter.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_apps_fcgi_starter.master', 'tpl/apache_apps_fcgi_starter.master'); |
| | | $content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content); |
| | | $content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content); |
| | | mkdir($conf['web']['website_basedir'].'/php-fcgi-scripts/apps', 0755, true); |
| | |
| | | $apps_vhost_servername = ($conf['web']['apps_vhost_servername'] == '')?'_':$conf['web']['apps_vhost_servername']; |
| | | |
| | | // Dont just copy over the virtualhost template but add some custom settings |
| | | $content = rf('tpl/nginx_apps.vhost.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/nginx_apps.vhost.master', 'tpl/nginx_apps.vhost.master'); |
| | | |
| | | if($conf['web']['apps_vhost_ip'] == '_default_'){ |
| | | $apps_vhost_ip = ''; |
| | |
| | | |
| | | // PHP-FPM |
| | | // Dont just copy over the php-fpm pool template but add some custom settings |
| | | $content = rf('tpl/apps_php_fpm_pool.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apps_php_fpm_pool.conf.master', 'tpl/apps_php_fpm_pool.conf.master'); |
| | | $content = str_replace('{fpm_pool}', 'apps', $content); |
| | | //$content = str_replace('{fpm_port}', ($conf['nginx']['php_fpm_start_port']+1), $content); |
| | | $content = str_replace('{fpm_socket}', $fpm_socket, $content); |
| | |
| | | if(is_file($install_dir.'/interface/lib/'.$configfile)) { |
| | | copy($install_dir.'/interface/lib/'.$configfile, $install_dir.'/interface/lib/'.$configfile.'~'); |
| | | } |
| | | $content = rf('tpl/'.$configfile.'.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | |
| | | if(is_file($install_dir.'/server/lib/'.$configfile)) { |
| | | copy($install_dir.'/server/lib/'.$configfile, $install_dir.'/interface/lib/'.$configfile.'~'); |
| | | } |
| | | $content = rf('tpl/'.$configfile.'.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); |
| | | $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | |
| | | $vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir']; |
| | | |
| | | // Dont just copy over the virtualhost template but add some custom settings |
| | | $content = rf('tpl/apache_ispconfig.vhost.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_ispconfig.vhost.master', 'tpl/apache_ispconfig.vhost.master'); |
| | | $content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content); |
| | | |
| | | // comment out the listen directive if port is 80 or 443 |
| | |
| | | } |
| | | } |
| | | //if(!is_file('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) { |
| | | $content = rf('tpl/apache_ispconfig_fcgi_starter.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_ispconfig_fcgi_starter.master', 'tpl/apache_ispconfig_fcgi_starter.master'); |
| | | $content = str_replace('{fastcgi_bin}', $conf['fastcgi']['fastcgi_bin'], $content); |
| | | $content = str_replace('{fastcgi_phpini_path}', $conf['fastcgi']['fastcgi_phpini_path'], $content); |
| | | @mkdir('/var/www/php-fcgi-scripts/ispconfig', 0755, true); |
| | |
| | | $vhost_conf_enabled_dir = $conf['nginx']['vhost_conf_enabled_dir']; |
| | | |
| | | // Dont just copy over the virtualhost template but add some custom settings |
| | | $content = rf('tpl/nginx_ispconfig.vhost.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/nginx_ispconfig.vhost.master', 'tpl/nginx_ispconfig.vhost.master'); |
| | | $content = str_replace('{vhost_port}', $conf['nginx']['vhost_port'], $content); |
| | | |
| | | if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) { |
| | |
| | | |
| | | // PHP-FPM |
| | | // Dont just copy over the php-fpm pool template but add some custom settings |
| | | $content = rf('tpl/php_fpm_pool.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/php_fpm_pool.conf.master', 'tpl/php_fpm_pool.conf.master'); |
| | | $content = str_replace('{fpm_pool}', 'ispconfig', $content); |
| | | //$content = str_replace('{fpm_port}', $conf['nginx']['php_fpm_start_port'], $content); |
| | | $content = str_replace('{fpm_socket}', $fpm_socket, $content); |
| | |
| | | caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); |
| | | } |
| | | |
| | | $content = rf('tpl/mysql_clientdb.conf.master'); |
| | | $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/mysql_clientdb.conf.master', 'tpl/mysql_clientdb.conf.master'); |
| | | $content = str_replace('{hostname}',$conf['mysql']['host'],$content); |
| | | $content = str_replace('{username}',$conf['mysql']['admin_user'],$content); |
| | | $content = str_replace('{password}',$conf['mysql']['admin_password'], $content); |
| | |
| | | global $conf, $dist; |
| | | |
| | | $final_path = ''; |
| | | $dist_template = $conf['ispconfig_install_dir'] . '/server/conf-custom/install/' . $tLocal . '.master'; |
| | | if (file_exists($dist_template)) { |
| | | $final_path = $dist_template; |
| | | } else { |
| | | $dist_template = 'dist/tpl/'.strtolower($dist['name'])."/$tLocal.master"; |
| | | if (file_exists($dist_template)) { |
| | | $final_path = $dist_template; |
| | | } else { |
| | | $final_path = "tpl/$tLocal.master"; |
| | | } |
| | | } |
| | | |
| | | if (!$tRf) { |
| | | return $final_path; |
New file |
| | |
| | | UPDATE `country` SET `iso` = 'RS', `name` = 'SERBIA', `printable_name` = 'Serbia', `iso3` = 'SRB', `numcode` = 381 WHERE `iso` = 'CS'; |
| | | INSERT INTO `country` (`iso`, `name`, `printable_name`, `iso3`, `numcode`) VALUES ('ME', 'MONTENEGRO', 'Montenegro', 'MNE', 382); |
| | |
| | | ALTER TABLE `mail_domain` ADD `dkim_public` MEDIUMTEXT NOT NULL AFTER `domain`;
|
| | | ALTER TABLE `mail_domain` ADD `dkim_private` MEDIUMTEXT NOT NULL AFTER `domain`;
|
| | | ALTER TABLE `mail_domain` ADD `dkim` ENUM( 'n', 'y' ) NOT NULL AFTER `domain`;
|
| | | ALTER TABLE `client` ADD `default_slave_dnsserver` INT( 11 ) UNSIGNED NOT NULL DEFAULT '1' AFTER `limit_dns_zone`;
|
New file |
| | |
| | | ALTER TABLE `web_domain` ADD `last_quota_notification` DATE NULL DEFAULT NULL; |
| | | ALTER TABLE `mail_user` ADD `last_quota_notification` DATE NULL DEFAULT NULL; |
New file |
| | |
| | | ALTER TABLE `web_domain` ADD `rewrite_rules` MEDIUMTEXT NULL DEFAULT NULL; |
| | |
| | | `limit_aps` int(11) NOT NULL DEFAULT '-1', |
| | | `default_dnsserver` int(11) unsigned NOT NULL DEFAULT '1', |
| | | `limit_dns_zone` int(11) NOT NULL DEFAULT '-1', |
| | | `default_slave_dnsserver` int(11) unsigned NOT NULL DEFAULT '1', |
| | | `limit_dns_slave_zone` int(11) NOT NULL DEFAULT '-1', |
| | | `limit_dns_record` int(11) NOT NULL DEFAULT '-1', |
| | | `default_dbserver` int(11) NOT NULL DEFAULT '1', |
| | |
| | | `disablesieve` enum('n','y') NOT NULL default 'n', |
| | | `disablelda` enum('n','y') NOT NULL default 'n', |
| | | `disabledoveadm` enum('n','y') NOT NULL default 'n', |
| | | `last_quota_notification` date NULL default NULL, |
| | | PRIMARY KEY (`mailuser_id`), |
| | | KEY `server_id` (`server_id`,`email`), |
| | | KEY `email_access` (`email`,`access`) |
| | |
| | | `traffic_quota_lock` enum('n','y') NOT NULL default 'n', |
| | | `fastcgi_php_version` varchar(255) DEFAULT NULL, |
| | | `proxy_directives` mediumtext, |
| | | `last_quota_notification` date NULL default NULL, |
| | | `rewrite_rules` mediumtext, |
| | | PRIMARY KEY (`domain_id`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
| | | |
| | |
| | | ('ST', 'SAO TOME AND PRINCIPE', 'Sao Tome and Principe', 'STP', 678), |
| | | ('SA', 'SAUDI ARABIA', 'Saudi Arabia', 'SAU', 682), |
| | | ('SN', 'SENEGAL', 'Senegal', 'SEN', 686), |
| | | ('CS', 'SERBIA AND MONTENEGRO', 'Serbia and Montenegro', NULL, NULL), |
| | | ('RS', 'SERBIA', 'Serbia', 'SRB', 381), |
| | | ('SC', 'SEYCHELLES', 'Seychelles', 'SYC', 690), |
| | | ('SL', 'SIERRA LEONE', 'Sierra Leone', 'SLE', 694), |
| | | ('SG', 'SINGAPORE', 'Singapore', 'SGP', 702), |
| | |
| | | ('EH', 'WESTERN SAHARA', 'Western Sahara', 'ESH', 732), |
| | | ('YE', 'YEMEN', 'Yemen', 'YEM', 887), |
| | | ('ZM', 'ZAMBIA', 'Zambia', 'ZMB', 894), |
| | | ('ZW', 'ZIMBABWE', 'Zimbabwe', 'ZWE', 716); |
| | | ('ZW', 'ZIMBABWE', 'Zimbabwe', 'ZWE', 716), |
| | | ('ME', 'MONTENEGRO', 'Montenegro', 'MNE', 382); |
| | | |
| | | -- -------------------------------------------------------- |
| | | |
| | |
| | | DocumentRoot /var/www/ispconfig/ |
| | | SuexecUserGroup ispconfig ispconfig |
| | | <Directory /var/www/ispconfig/> |
| | | Options Indexes FollowSymLinks MultiViews +ExecCGI |
| | | Options -Indexes FollowSymLinks MultiViews +ExecCGI |
| | | AllowOverride AuthConfig Indexes Limit Options FileInfo |
| | | AddHandler fcgid-script .php |
| | | FCGIWrapper /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter .php |
| | |
| | | } |
| | | user = root |
| | | } |
| | | service imap-login { |
| | | client_limit = 1000 |
| | | process_limit = 500 |
| | | } |
| | | protocol imap { |
| | | mail_plugins = quota imap_quota |
| | | } |
| | |
| | | } |
| | | user = root |
| | | } |
| | | service imap-login { |
| | | client_limit = 1000 |
| | | process_limit = 500 |
| | | } |
| | | protocol imap { |
| | | mail_plugins = quota imap_quota |
| | | } |
New file |
| | |
| | | alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases |
| | | alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases |
| | | virtual_alias_domains = |
| | | virtual_alias_maps = proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, proxy:mysql:{config_dir}/mysql-virtual_email2email.cf, hash:/var/lib/mailman/data/virtual-mailman |
| | | virtual_mailbox_domains = proxy:mysql:{config_dir}/mysql-virtual_domains.cf |
| | | virtual_mailbox_maps = proxy:mysql:{config_dir}/mysql-virtual_mailboxes.cf |
| | | virtual_mailbox_base = {vmail_mailbox_base} |
| | | virtual_uid_maps = static:{vmail_userid} |
| | | virtual_gid_maps = static:{vmail_groupid} |
| | | inet_protocols=all |
| | | smtpd_sasl_auth_enable = yes |
| | | broken_sasl_auth_clients = yes |
| | | smtpd_sasl_authenticated_header = yes |
| | | smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf, reject_unauth_destination{rbl_list} |
| | | smtpd_use_tls = yes |
| | | smtpd_tls_security_level = may |
| | | smtpd_tls_cert_file = {config_dir}/smtpd.cert |
| | | 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 |
| | | smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf |
| | | smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf |
| | | smtpd_client_message_rate_limit = 100 |
| | | maildrop_destination_concurrency_limit = 1 |
| | | maildrop_destination_recipient_limit = 1 |
| | | virtual_transport = maildrop |
| | | header_checks = regexp:{config_dir}/header_checks |
| | | mime_header_checks = regexp:{config_dir}/mime_header_checks |
| | | nested_header_checks = regexp:{config_dir}/nested_header_checks |
| | | body_checks = regexp:{config_dir}/body_checks |
| | | owner_request_special = no |
| | |
| | | } |
| | | user = root |
| | | } |
| | | service imap-login { |
| | | client_limit = 1000 |
| | | process_limit = 500 |
| | | } |
| | | protocol imap { |
| | | mail_plugins = quota imap_quota |
| | | } |
New file |
| | |
| | | virtual_alias_domains = |
| | | virtual_alias_maps = proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, proxy:mysql:{config_dir}/mysql-virtual_email2email.cf |
| | | virtual_mailbox_domains = proxy:mysql:{config_dir}/mysql-virtual_domains.cf |
| | | virtual_mailbox_maps = proxy:mysql:{config_dir}/mysql-virtual_mailboxes.cf |
| | | virtual_mailbox_base = {vmail_mailbox_base} |
| | | virtual_uid_maps = static:{vmail_userid} |
| | | virtual_gid_maps = static:{vmail_groupid} |
| | | smtpd_sasl_auth_enable = yes |
| | | broken_sasl_auth_clients = yes |
| | | smtpd_sasl_authenticated_header = yes |
| | | smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf, reject_unauth_destination{rbl_list} |
| | | smtpd_use_tls = yes |
| | | smtpd_tls_security_level = may |
| | | smtpd_tls_cert_file = {config_dir}/smtpd.cert |
| | | 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 |
| | | smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf |
| | | smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf |
| | | smtpd_client_message_rate_limit = 100 |
| | | maildrop_destination_concurrency_limit = 1 |
| | | maildrop_destination_recipient_limit = 1 |
| | | virtual_transport = maildrop |
| | | header_checks = regexp:{config_dir}/header_checks |
| | | mime_header_checks = regexp:{config_dir}/mime_header_checks |
| | | nested_header_checks = regexp:{config_dir}/nested_header_checks |
| | | body_checks = regexp:{config_dir}/body_checks |
| | | inet_interfaces = all |
New file |
| | |
| | | virtual_alias_domains = |
| | | virtual_alias_maps = proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, proxy:mysql:{config_dir}/mysql-virtual_email2email.cf |
| | | virtual_mailbox_domains = proxy:mysql:{config_dir}/mysql-virtual_domains.cf |
| | | virtual_mailbox_maps = proxy:mysql:{config_dir}/mysql-virtual_mailboxes.cf |
| | | virtual_mailbox_base = {vmail_mailbox_base} |
| | | virtual_uid_maps = static:{vmail_userid} |
| | | virtual_gid_maps = static:{vmail_groupid} |
| | | smtpd_sasl_auth_enable = yes |
| | | broken_sasl_auth_clients = yes |
| | | smtpd_sasl_authenticated_header = yes |
| | | smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf, reject_unauth_destination{rbl_list} |
| | | smtpd_use_tls = yes |
| | | smtpd_tls_security_level = may |
| | | smtpd_tls_cert_file = {config_dir}/smtpd.cert |
| | | 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 |
| | | smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf |
| | | smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf |
| | | smtpd_client_message_rate_limit = 100 |
| | | maildrop_destination_concurrency_limit = 1 |
| | | maildrop_destination_recipient_limit = 1 |
| | | virtual_transport = maildrop |
| | | header_checks = regexp:{config_dir}/header_checks |
| | | mime_header_checks = regexp:{config_dir}/mime_header_checks |
| | | nested_header_checks = regexp:{config_dir}/nested_header_checks |
| | | body_checks = regexp:{config_dir}/body_checks |
| | | inet_interfaces = all |
| | |
| | | } |
| | | user = root |
| | | } |
| | | service imap-login { |
| | | client_limit = 1000 |
| | | process_limit = 500 |
| | | } |
| | | protocol imap { |
| | | mail_plugins = quota imap_quota |
| | | } |
New file |
| | |
| | | virtual_alias_domains = |
| | | virtual_alias_maps = proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, proxy:mysql:{config_dir}/mysql-virtual_email2email.cf |
| | | virtual_mailbox_domains = proxy:mysql:{config_dir}/mysql-virtual_domains.cf |
| | | virtual_mailbox_maps = proxy:mysql:{config_dir}/mysql-virtual_mailboxes.cf |
| | | virtual_mailbox_base = {vmail_mailbox_base} |
| | | virtual_uid_maps = static:{vmail_userid} |
| | | virtual_gid_maps = static:{vmail_groupid} |
| | | smtpd_sasl_auth_enable = yes |
| | | broken_sasl_auth_clients = yes |
| | | smtpd_sasl_authenticated_header = yes |
| | | smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf, reject_unauth_destination{rbl_list} |
| | | smtpd_use_tls = yes |
| | | smtpd_tls_security_level = may |
| | | smtpd_tls_cert_file = {config_dir}/smtpd.cert |
| | | 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 |
| | | smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf |
| | | smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf |
| | | smtpd_client_message_rate_limit = 100 |
| | | maildrop_destination_concurrency_limit = 1 |
| | | maildrop_destination_recipient_limit = 1 |
| | | virtual_transport = maildrop |
| | | header_checks = regexp:{config_dir}/header_checks |
| | | mime_header_checks = regexp:{config_dir}/mime_header_checks |
| | | nested_header_checks = regexp:{config_dir}/nested_header_checks |
| | | body_checks = regexp:{config_dir}/body_checks |
| | | inet_interfaces = all |
| | |
| | | nameservers=8.8.8.8,8.8.4.4 |
| | | firewall=bastille |
| | | loglevel=2 |
| | | admin_notify_events=1 |
| | | backup_dir=/var/backup |
| | | backup_mode=rootgz |
| | | monit_url= |
| | | monit_user= |
| | | monit_password= |
| | | munin_url= |
| | | munin_user= |
| | | munin_password= |
| | | |
| | | [mail] |
| | | module=postfix_mysql |
| | |
| | | message_size_limit=0 |
| | | mailbox_quota_stats=y |
| | | realtime_blackhole_list= |
| | | overquota_notify_admin=y |
| | | overquota_notify_client=y |
| | | overquota_notify_freq=7 |
| | | overquota_notify_onok=n |
| | | sendmail_path=/usr/sbin/sendmail |
| | | |
| | | [getmail] |
| | |
| | | apps_vhost_port=8081 |
| | | apps_vhost_ip=_default_ |
| | | apps_vhost_servername= |
| | | php_open_basedir=[website_path]/web:[website_path]/private:[website_path]/tmp:/var/www/[website_domain]/web:/srv/www/[website_domain]/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/usr/share/php |
| | | php_open_basedir=[website_path]/web:[website_path]/private:[website_path]/tmp:/var/www/[website_domain]/web:/srv/www/[website_domain]/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin |
| | | htaccess_allow_override=All |
| | | awstats_conf_dir=/etc/awstats |
| | | awstats_data_dir=/var/lib/awstats |
| | |
| | | connect_userid_to_webid=n |
| | | connect_userid_to_webid_start=10000 |
| | | web_folder_protection=y |
| | | php_ini_check_minutes=1 |
| | | |
| | | <<<<<<< .minephp_ini_check_minutes=1 |
| | | =======overquota_notify_admin=y |
| | | overquota_notify_client=y |
| | | overquota_notify_freq=7 |
| | | overquota_notify_onok=n |
| | | >>>>>>> .theirs |
| | | [dns] |
| | | bind_user=root |
| | | bind_group=bind |
| | |
| | | } |
| | | |
| | | public function get_ispconfig_url() { |
| | | global $app; |
| | | |
| | | $url = (stristr($_SERVER['SERVER_PROTOCOL'],'HTTPS') || stristr($_SERVER['HTTPS'],'on'))?'https':'http'; |
| | | if($_SERVER['SERVER_NAME'] != '_') { |
| | | $url .= '://'.$_SERVER['SERVER_NAME']; |
| | | if($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) { |
| | | $url .= ':'.$_SERVER['SERVER_PORT']; |
| | | } |
| | | } else { |
| | | $app->uses("getconf"); |
| | | $server_config = $app->getconf->get_server_config(1,'server'); |
| | | $url .= '://'.$server_config['hostname']; |
| | | if($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) { |
| | | $url .= ':'.$_SERVER['SERVER_PORT']; |
| | | } |
| | | } |
| | | return $url; |
| | | } |
| | | |
| | |
| | | $this->body = "This is a multi-part message in MIME format.\n\n"; |
| | | |
| | | if($text) { |
| | | $this->body .= "--{$this->mime_boundary}\n" . |
| | | /*$this->body .= "--{$this->mime_boundary}\n" . |
| | | "Content-Type:text/plain; charset=\"" . strtolower($this->mail_charset) . "\"\n" . |
| | | "Content-Transfer-Encoding: 7bit\n\n" . $this->text_part . "\n\n"; |
| | | "Content-Transfer-Encoding: 7bit\n\n" . $this->text_part . "\n\n";*/ |
| | | $this->body .= "--{$this->mime_boundary}\n" . |
| | | "Content-Type:text/plain; charset=\"UTF-8\"\n" . |
| | | "Content-Transfer-Encoding: 8bit\n\n" . $this->text_part . "\n\n"; |
| | | } |
| | | |
| | | if($html) { |
| | | $this->body .= "--{$this->mime_boundary}\n" . |
| | | /*$this->body .= "--{$this->mime_boundary}\n" . |
| | | "Content-Type:text/html; charset=\"" . strtolower($this->mail_charset) . "\"\n" . |
| | | "Content-Transfer-Encoding: 7bit\n\n" . $this->html_part . "\n\n"; |
| | | "Content-Transfer-Encoding: 7bit\n\n" . $this->html_part . "\n\n";*/ |
| | | $this->body .= "--{$this->mime_boundary}\n" . |
| | | "Content-Type:text/html; charset=\"UTF-8\"\n" . |
| | | "Content-Transfer-Encoding: 8bit\n\n" . $this->html_part . "\n\n"; |
| | | } |
| | | |
| | | if($attach) { |
| | |
| | | $this->_is_signed = true; |
| | | } |
| | | |
| | | private function _char_to_hex($matches) { |
| | | return '=' . strtoupper(dechex(ord($matches[1]))); |
| | | } |
| | | |
| | | /** |
| | | * Function to encode a header if necessary |
| | | * according to RFC2047 |
| | |
| | | private function _encodeHeader($input, $charset = 'ISO-8859-1') { |
| | | preg_match_all('/(\s?\w*[\x80-\xFF]+\w*\s?)/', $input, $matches); |
| | | foreach ($matches[1] as $value) { |
| | | $replacement = preg_replace_callback('/([\x20\x80-\xFF])/', array($this, '_char_to_hex'), $value); |
| | | $input = str_replace($value, '=?' . $charset . '?Q?' . $replacement . '?=', $input); |
| | | } |
| | | |
| | | return $input; |
| | | } |
| | | |
| | | /** |
| | | * Function to encode the subject if necessary |
| | | * according to RFC2047 |
| | | * @access private |
| | | */ |
| | | private function _encodeSubject($input, $charset = 'ISO-8859-1') { |
| | | /* |
| | | if($charset == 'UTF-8' && function_exists('imap_8bit')) { |
| | | $input = "=?utf-8?Q?" . imap_8bit($input) . "?="; |
| | | } else { |
| | | preg_match_all('/(\s?\w*[\x80-\xFF]+\w*\s?)/', $input, $matches); |
| | | foreach ($matches[1] as $value) { |
| | | $replacement = preg_replace('/([\x20\x80-\xFF])/e', '"=" . strtoupper(dechex(ord("\1")))', $value); |
| | | $input = str_replace($value, '=?' . $charset . '?Q?' . $replacement . '?=', $input); |
| | | } |
| | | }*/ |
| | | $input='=?UTF-8?B?'.base64_encode($input).'?='; |
| | | |
| | | return $input; |
| | | } |
| | |
| | | //$subject = $this->_encodeHeader($this->headers['Subject'], $this->mail_charset); |
| | | $subject = $this->headers['Subject']; |
| | | |
| | | $enc_subject = $this->_encodeHeader($subject, $this->mail_charset); |
| | | //$enc_subject = $this->_encodeHeader($subject, $this->mail_charset); |
| | | $enc_subject = $this->_encodeSubject($subject, $this->mail_charset); |
| | | unset($this->headers['Subject']); |
| | | } |
| | | |
| | |
| | | if(@is_array($this->listDef['item'])) { |
| | | foreach($this->listDef['item'] as $i) { |
| | | $field = $i['field']; |
| | | $table = $i['table']; |
| | | // if($_REQUEST[$search_prefix.$field] != '') $sql_where .= " $field ".$i["op"]." '".$i["prefix"].$_REQUEST[$search_prefix.$field].$i["suffix"]."' and"; |
| | | if(isset($_SESSION['search'][$list_name][$search_prefix.$field]) && $_SESSION['search'][$list_name][$search_prefix.$field] != ''){ |
| | | $sql_where .= " $field ".$i['op']." '".$app->db->quote($i['prefix'].$_SESSION['search'][$list_name][$search_prefix.$field].$i['suffix'])."' and"; |
| | | $sql_where .= " ".($table != ''? $table.'.' : $this->listDef['table'].'.')."$field ".$i['op']." '".$app->db->quote($i['prefix'].$_SESSION['search'][$list_name][$search_prefix.$field].$i['suffix'])."' and"; |
| | | } |
| | | } |
| | | } |
| | |
| | | if($this->searchChanged == 1) $_SESSION['search'][$list_name]['page'] = 0; |
| | | |
| | | $sql_von = $app->functions->intval($_SESSION['search'][$list_name]['page'] * $records_per_page); |
| | | $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM $table WHERE $sql_where"); |
| | | $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM $table".($app->listform->listDef['additional_tables'] != ''? ','.$app->listform->listDef['additional_tables'] : '')." WHERE $sql_where"); |
| | | $pages = $app->functions->intval(($record_count['anzahl'] - 1) / $records_per_page); |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | break; |
| | | case 'DATETIMETSTAMP': |
| | | if ($record[$key] > 0) { |
| | | // is value int? |
| | | if (preg_match("/^[0-9]+[\.]?[0-9]*$/", $record[$key], $p)) { |
| | | $record[$key] = date($this->lng('conf_format_datetime'), $record[$key]); |
| | | } else { |
| | | $record[$key] = date($this->lng('conf_format_datetime'), strtotime($record[$key])); |
| | | } |
| | | } |
| | | break; |
| | | case 'DATE': |
| | | if ($record[$key] > 0) { |
| | | // is value int? |
| | |
| | | } |
| | | break; |
| | | |
| | | case 'DATETIMETSTAMP': |
| | | if($record[$key] > 0) { |
| | | $record[$key] = date('Y-m-d H:i:s',strtotime($record[$key])); |
| | | } |
| | | break; |
| | | |
| | | case 'DATE': |
| | | if($record[$key] != '' && $record[$key] != '0000-00-00') { |
| | | $record[$key] = $record[$key]; |
| | |
| | | public $SQLExtWhere = ''; |
| | | public $SQLOrderBy = ''; |
| | | public $SQLExtSelect = ''; |
| | | private $sortKeys; |
| | | |
| | | private function _sort($aOne, $aTwo) { |
| | | if(!is_array($aOne) || !is_array($aTwo)) return 0; |
| | | |
| | | if(!is_array($this->sortKeys)) $this->sortKeys = array($this->sortKeys); |
| | | foreach($this->sortKeys as $sKey => $sDir) { |
| | | if(is_numeric($sKey)) { |
| | | $sKey = $sDir; |
| | | $sDir = 'ASC'; |
| | | } |
| | | $a = $aOne[$sKey]; |
| | | $b = $aTwo[$sKey]; |
| | | if(is_string($a)) $a = strtolower($a); |
| | | if(is_string($b)) $b = strtolower($b); |
| | | if($a < $b) return ($sDir == 'DESC' ? 1 : -1); |
| | | elseif($a > $b) return ($sDir == 'DESC' ? -1 : 1); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public function onLoad() |
| | | { |
| | |
| | | |
| | | //* Manipulate order by for sorting / Every list has a stored value |
| | | //* Against notice error |
| | | if(!isset($_SESSION['search'][$app->listform->listDef["name"].$app->listform->listDef['table']]['order'])){ |
| | | $_SESSION['search'][$app->listform->listDef["name"].$app->listform->listDef['table']]['order'] = ''; |
| | | if(!isset($_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'])){ |
| | | $_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'] = ''; |
| | | } |
| | | |
| | | $php_sort = false; |
| | | |
| | | if(!empty($_GET['orderby'])){ |
| | | $order = str_replace('tbl_col_','',$_GET['orderby']); |
| | | |
| | | //* Check the css class submited value |
| | | if (preg_match("/^[a-z\_]{1,}$/",$order)) { |
| | | if($_SESSION['search'][$app->listform->listDef["name"].$app->listform->listDef['table']]['order'] == $order){ |
| | | $_SESSION['search'][$app->listform->listDef["name"].$app->listform->listDef['table']]['order'] = $order.' DESC'; |
| | | |
| | | if(isset($app->listform->listDef['phpsort']) && is_array($app->listform->listDef['phpsort']) && in_array($order, $app->listform->listDef['phpsort'])) { |
| | | $php_sort = true; |
| | | } else { |
| | | $_SESSION['search'][$app->listform->listDef["name"].$app->listform->listDef['table']]['order'] = $order; |
| | | // prepend correct table |
| | | $prepend_table = $app->listform->listDef['table']; |
| | | if(trim($app->listform->listDef['additional_tables']) != '' && is_array($app->listform->listDef['item']) && count($app->listform->listDef['item']) > 0) { |
| | | foreach($app->listform->listDef['item'] as $field) { |
| | | if($field['field'] == $order && $field['table'] != ''){ |
| | | $prepend_table = $field['table']; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | $order = $prepend_table.'.'.$order; |
| | | } |
| | | |
| | | if($_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'] == $order){ |
| | | $_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'] = $order.' DESC'; |
| | | } else { |
| | | $_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'] = $order; |
| | | } |
| | | $_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order_in_php'] = $php_sort; |
| | | } |
| | | } |
| | | |
| | | // If a manuel oder by like customers isset the sorting will be infront |
| | | if(!empty($_SESSION['search'][$app->listform->listDef["name"].$app->listform->listDef['table']]['order'])){ |
| | | if(!empty($_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order']) && !$_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order_in_php']){ |
| | | if(empty($this->SQLOrderBy)){ |
| | | $this->SQLOrderBy = "ORDER BY ".$_SESSION['search'][$app->listform->listDef["name"].$app->listform->listDef['table']]['order']; |
| | | $this->SQLOrderBy = "ORDER BY ".$_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order']; |
| | | } else { |
| | | $this->SQLOrderBy = str_replace("ORDER BY ","ORDER BY ".$_SESSION['search'][$app->listform->listDef["name"].$app->listform->listDef['table']]['order'].', ',$this->SQLOrderBy); |
| | | $this->SQLOrderBy = str_replace("ORDER BY ","ORDER BY ".$_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'].', ',$this->SQLOrderBy); |
| | | } |
| | | } |
| | | |
| | |
| | | foreach($records as $rec) { |
| | | $records_new[] = $this->prepareDataRow($rec); |
| | | } |
| | | } |
| | | |
| | | if(!empty($_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order']) && $_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order_in_php']) { |
| | | $order_by = $_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order']; |
| | | $order_dir = 'ASC'; |
| | | if(substr($order_by, -5) === ' DESC') { |
| | | $order_by = substr($order_by, 0, -5); |
| | | $order_dir = 'DESC'; |
| | | } |
| | | $this->sortKeys = array($order_by => $order_dir); |
| | | uasort($records_new, array($this, '_sort')); |
| | | } |
| | | |
| | | $app->tpl->setLoop('records',$records_new); |
| | |
| | | return $rec; |
| | | } |
| | | |
| | | private function getQueryString() { |
| | | public function getQueryString() { |
| | | global $app; |
| | | $sql_where = ''; |
| | | |
| | |
| | | } |
| | | |
| | | $sql_where = $app->listform->getSearchSQL($sql_where); |
| | | if($app->listform->listDef['join_sql']) $sql_where .= ' AND '.$app->listform->listDef['join_sql']; |
| | | $app->tpl->setVar($app->listform->searchValues); |
| | | |
| | | $order_by_sql = $this->SQLOrderBy; |
| | |
| | | |
| | | $extselect = ''; |
| | | $join = ''; |
| | | if(!empty($_SESSION['search'][$app->listform->listDef["name"].$app->listform->listDef['table']]['order'])){ |
| | | $order = str_replace(' DESC','',$_SESSION['search'][$app->listform->listDef["name"].$app->listform->listDef['table']]['order']); |
| | | if($order == 'server_id' && $app->listform->listDef['table'] != 'server'){ |
| | | $join .= ' LEFT JOIN server as s ON '.$app->listform->listDef['table'].'.server_id = s.server_id '; |
| | | $order_by_sql = str_replace('server_id','s.server_name',$order_by_sql); |
| | | } elseif($order == 'client_id' && $app->listform->listDef['table'] != 'client'){ |
| | | $join .= ' LEFT JOIN client as c ON '.$app->listform->listDef['table'].'.client_id = c.client_id '; |
| | | $order_by_sql = str_replace('client_id','c.contact_name',$order_by_sql); |
| | | } elseif($order == 'parent_domain_id'){ |
| | | $join .= ' LEFT JOIN web_domain as wd ON '.$app->listform->listDef['table'].'.parent_domain_id = wd.domain_id '; |
| | | //$order_by_sql = str_replace(' domain', ' '.$app->listform->listDef['table'].'.domain',$order_by_sql); |
| | | //$order_by_sql = str_replace('parent_domain_id','wd.domain',$order_by_sql); |
| | | $order_by_sql = preg_replace('@( |,|^)(domain)( |,|$)@', '$1'.$app->listform->listDef['table'].'.$2$3', $order_by_sql); |
| | | $order_by_sql = preg_replace('@( |,|^)(parent_domain_id)( |,|$)@', '$1wd.domain$3', $order_by_sql); |
| | | |
| | | //$sql_where = str_replace('type',$app->listform->listDef['table'].'.type',$sql_where); |
| | | //$sql_where = str_replace(' domain',' '.$app->listform->listDef['table'].'.domain',$sql_where); |
| | | $sql_where = preg_replace('@( |,|^)(type)( |,|$)@', '$1'.$app->listform->listDef['table'].'.$2$3', $sql_where); |
| | | $sql_where = preg_replace('@( |,|^)(domain)( |,|$)@', '$1'.$app->listform->listDef['table'].'.$2$3', $sql_where); |
| | | } elseif($order == 'sys_groupid'){ |
| | | $join .= ' LEFT JOIN sys_group as sg ON '.$app->listform->listDef['table'].'.sys_groupid = sg.groupid '; |
| | | $order_by_sql = str_replace('sys_groupid','sg.name',$order_by_sql); |
| | | } elseif($order == 'rid'){ |
| | | $join .= ' LEFT JOIN spamfilter_users as su ON '.$app->listform->listDef['table'].'.rid = su.id '; |
| | | $order_by_sql = str_replace('rid','su.email',$order_by_sql); |
| | | } elseif($order == 'policy_id'){ |
| | | $join .= ' LEFT JOIN spamfilter_policy as sp ON '.$app->listform->listDef['table'].'.policy_id = sp.id '; |
| | | $order_by_sql = str_replace('policy_id','sp.policy_name',$order_by_sql); |
| | | } elseif($order == 'web_folder_id'){ |
| | | $join .= ' LEFT JOIN web_folder as wf ON '.$app->listform->listDef['table'].'.web_folder_id = wf.web_folder_id '; |
| | | $order_by_sql = str_replace('web_folder_id','wf.path',$order_by_sql); |
| | | } elseif($order == 'ostemplate_id' && $app->listform->listDef['table'] != 'openvz_ostemplate'){ |
| | | $join .= ' LEFT JOIN openvz_ostemplate as oo ON '.$app->listform->listDef['table'].'.ostemplate_id = oo.ostemplate_id '; |
| | | $order_by_sql = str_replace('ostemplate_id','oo.template_name',$order_by_sql); |
| | | } elseif($order == 'template_id' && $app->listform->listDef['table'] != 'openvz_template'){ |
| | | $join .= ' LEFT JOIN openvz_template as ot ON '.$app->listform->listDef['table'].'.template_id = ot.template_id '; |
| | | $order_by_sql = str_replace('template_id','ot.template_name',$order_by_sql); |
| | | } elseif($order == 'sender_id' && $app->listform->listDef['table'] != 'sys_user'){ |
| | | $join .= ' LEFT JOIN sys_user as su ON '.$app->listform->listDef['table'].'.sender_id = su.userid '; |
| | | $order_by_sql = str_replace('sender_id','su.username',$order_by_sql); |
| | | } elseif($order == 'web_traffic_last_month'){ |
| | | $tmp_year = date('Y',mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | $tmp_month = date('m',mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | $extselect .= ', SUM(wt.traffic_bytes) as calctraffic'; |
| | | $join .= ' INNER JOIN web_traffic as wt ON '.$app->listform->listDef['table'].'.domain = wt.hostname '; |
| | | $sql_where .= " AND YEAR(wt.traffic_date) = '$tmp_year' AND MONTH(wt.traffic_date) = '$tmp_month'"; |
| | | $order_by_sql = str_replace('web_traffic_last_month','calctraffic',$order_by_sql); |
| | | $order_by_sql = "GROUP BY domain ".$order_by_sql; |
| | | } elseif($order == 'web_traffic_this_month'){ |
| | | $tmp_year = date('Y'); |
| | | $tmp_month = date('m'); |
| | | $extselect .= ', SUM(wt.traffic_bytes) as calctraffic'; |
| | | $join .= ' INNER JOIN web_traffic as wt ON '.$app->listform->listDef['table'].'.domain = wt.hostname '; |
| | | $sql_where .= " AND YEAR(wt.traffic_date) = '$tmp_year' AND MONTH(wt.traffic_date) = '$tmp_month'"; |
| | | $order_by_sql = str_replace('web_traffic_this_month','calctraffic',$order_by_sql); |
| | | $order_by_sql = "GROUP BY domain ".$order_by_sql; |
| | | } elseif($order == 'web_traffic_last_year'){ |
| | | $tmp_year = date('Y',mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | $extselect .= ', SUM(wt.traffic_bytes) as calctraffic'; |
| | | $join .= ' INNER JOIN web_traffic as wt ON '.$app->listform->listDef['table'].'.domain = wt.hostname '; |
| | | $sql_where .= " AND YEAR(wt.traffic_date) = '$tmp_year'"; |
| | | $order_by_sql = str_replace('web_traffic_last_year','calctraffic',$order_by_sql); |
| | | $order_by_sql = "GROUP BY domain ".$order_by_sql; |
| | | } elseif($order == 'web_traffic_this_year'){ |
| | | $tmp_year = date('Y'); |
| | | $extselect .= ', SUM(wt.traffic_bytes) as calctraffic'; |
| | | $join .= ' INNER JOIN web_traffic as wt ON '.$app->listform->listDef['table'].'.domain = wt.hostname '; |
| | | $sql_where .= " AND YEAR(wt.traffic_date) = '$tmp_year'"; |
| | | $order_by_sql = str_replace('web_traffic_this_year','calctraffic',$order_by_sql); |
| | | $order_by_sql = "GROUP BY domain ".$order_by_sql; |
| | | } elseif($order == 'mail_traffic_last_month'){ |
| | | $tmp_date = date('Y-m',mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | $join .= ' INNER JOIN mail_traffic as mt ON '.$app->listform->listDef['table'].'.mailuser_id = mt.mailuser_id '; |
| | | $sql_where .= " AND mt.month like '$tmp_date%'"; |
| | | $order_by_sql = str_replace('mail_traffic_last_month','traffic',$order_by_sql); |
| | | } elseif($order == 'mail_traffic_this_month'){ |
| | | $tmp_date = date('Y-m'); |
| | | $join .= ' INNER JOIN mail_traffic as mt ON '.$app->listform->listDef['table'].'.mailuser_id = mt.mailuser_id '; |
| | | $sql_where .= " AND mt.month like '$tmp_date%'"; |
| | | $order_by_sql = str_replace('mail_traffic_this_month','traffic',$order_by_sql); |
| | | } elseif($order == 'mail_traffic_last_year'){ |
| | | $tmp_date = date('Y',mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | $extselect .= ', SUM(mt.traffic) as calctraffic'; |
| | | $join .= ' INNER JOIN mail_traffic as mt ON '.$app->listform->listDef['table'].'.mailuser_id = mt.mailuser_id '; |
| | | $sql_where .= " AND mt.month like '$tmp_date%'";; |
| | | $order_by_sql = str_replace('mail_traffic_last_year','calctraffic',$order_by_sql); |
| | | $order_by_sql = "GROUP BY mailuser_id ".$order_by_sql; |
| | | } elseif($order == 'mail_traffic_this_year'){ |
| | | $tmp_date = date('Y'); |
| | | $extselect .= ', SUM(mt.traffic) as calctraffic'; |
| | | $join .= ' INNER JOIN mail_traffic as mt ON '.$app->listform->listDef['table'].'.mailuser_id = mt.mailuser_id '; |
| | | $sql_where .= " AND mt.month like '$tmp_date%'"; |
| | | $order_by_sql = str_replace('mail_traffic_this_year','calctraffic',$order_by_sql); |
| | | $order_by_sql = "GROUP BY mailuser_id ".$order_by_sql; |
| | | } |
| | | } |
| | | |
| | | if($this->SQLExtSelect != '') { |
| | | if(substr($this->SQLExtSelect,0,1) != ',') $this->SQLExtSelect = ','.$this->SQLExtSelect; |
| | | $extselect .= $this->SQLExtSelect; |
| | | } |
| | | |
| | | return 'SELECT '.$app->listform->listDef['table'].'.*'.$extselect.' FROM '.$app->listform->listDef['table']."$join WHERE $sql_where $order_by_sql $limit_sql"; |
| | | $table_selects = array(); |
| | | $table_selects[] = trim($app->listform->listDef['table']).'.*'; |
| | | $app->listform->listDef['additional_tables'] = trim($app->listform->listDef['additional_tables']); |
| | | if($app->listform->listDef['additional_tables'] != ''){ |
| | | $additional_tables = explode(',', $app->listform->listDef['additional_tables']); |
| | | foreach($additional_tables as $additional_table){ |
| | | $table_selects[] = trim($additional_table).'.*'; |
| | | } |
| | | } |
| | | $select = implode(', ', $table_selects); |
| | | |
| | | $sql = 'SELECT '.$select.$extselect.' FROM '.$app->listform->listDef['table'].($app->listform->listDef['additional_tables'] != ''? ','.$app->listform->listDef['additional_tables'] : '')."$join WHERE $sql_where $order_by_sql $limit_sql"; |
| | | //echo $sql; |
| | | return $sql; |
| | | } |
| | | |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (preg_match('/^[a-z0-9][a-z0-9\-]+[a-z0-9](\.[a-z]{2,4})+$/i', $origin)) { |
| | | if(!preg_match('/^[a-z0-9][a-z0-9\-]+[a-z0-9](\.[a-z]{2,4})+$/i', $origin)){ |
| | | $this->server->fault('no_domain_found', 'Invalid domain name.'); |
| | | return false; |
| | | } |
| | | |
| | | $rec = $app->db->queryOneRecord("SELECT id FROM dns_soa WHERE origin like '".$origin.'%'); |
| | | $rec = $app->db->queryOneRecord("SELECT id FROM dns_soa WHERE origin like '".$origin."%'"); |
| | | if(isset($rec['id'])) { |
| | | return $app->functions->intval($rec['id']); |
| | | } else { |
| | |
| | | if(@is_numeric($primary_id)) { |
| | | $sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id; |
| | | return $app->db->queryOneRecord($sql); |
| | | } elseif (@is_array($primary_id)) { |
| | | } elseif (@is_array($primary_id) || @is_object($primary_id)) { |
| | | if(@is_object($primary_id)) $primary_id = get_object_vars($primary_id); // do not use cast (array)xxx because it returns private and protected properties! |
| | | $sql_offset = 0; |
| | | $sql_limit = 0; |
| | | $sql_where = ''; |
| | |
| | | public function processDatabaseInsert($form_page) { |
| | | global $app; |
| | | |
| | | if($form_page->dataRecord["parent_domain_id"] > 0) { |
| | | /*if($form_page->dataRecord["parent_domain_id"] > 0) { |
| | | $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($form_page->dataRecord["parent_domain_id"])); |
| | | |
| | | //* The Database user shall be owned by the same group then the website |
| | |
| | | |
| | | if($form_page->dataRecord['database_user_id']) { |
| | | // check if there has already been a database on this server with that user |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "') AND `sys_groupid` = '" . $app->functions->intval($sys_groupid) . "'"); |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "')"); |
| | | |
| | | if($check && $check['cnt'] < 1) { |
| | | // we need to make a datalog insert for the database users that are connected to this database |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "' AND `sys_groupid` = '" . $app->functions->intval($sys_groupid) . "'"); |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "'"); |
| | | if($db_user) { |
| | | $db_user['server_id'] = $form_page->dataRecord['server_id']; |
| | | $app->db->datalogSave('web_database_user', 'INSERT', 'database_user_id', $db_user['database_user_id'], array(), $db_user); |
| | |
| | | |
| | | if($form_page->dataRecord['database_ro_user_id']) { |
| | | // check if there has already been a database on this server with that user |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "') AND `sys_groupid` = '" . $app->functions->intval($sys_groupid) . "'"); |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "')"); |
| | | |
| | | if($check && $check['cnt'] < 1) { |
| | | // we need to make a datalog insert for the database users that are connected to this database |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "' AND `sys_groupid` = '" . $app->functions->intval($sys_groupid) . "'"); |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "'"); |
| | | if($db_user) { |
| | | $db_user['server_id'] = $form_page->dataRecord['server_id']; |
| | | $app->db->datalogSave('web_database_user', 'INSERT', 'database_user_id', $db_user['database_user_id'], array(), $db_user); |
| | | } |
| | | } |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | public function processDatabaseUpdate($form_page) { |
| | | global $app; |
| | | |
| | | $old_record = $app->db->queryOneRecord('SELECT * FROM `web_database` WHERE `database_id` = ' . $app->functions->intval($form_page->id)); |
| | | /*$old_record = $app->db->queryOneRecord('SELECT * FROM `web_database` WHERE `database_id` = ' . $app->functions->intval($form_page->id)); |
| | | |
| | | if($form_page->dataRecord["parent_domain_id"] > 0) { |
| | | $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($form_page->dataRecord["parent_domain_id"])); |
| | |
| | | // check if database user has changed |
| | | if($old_record['database_user_id'] && $old_record['database_user_id'] != $form_page->dataRecord['database_user_id'] && $old_record['database_user_id'] != $form_page->dataRecord['database_ro_user_id']) { |
| | | // check if any database on the server still uses this one |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "') AND `sys_groupid` = '" . $app->functions->intval($sys_groupid) . "' AND `database_id` != '" . $app->functions->intval($form_page->id) . "'"); |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "') AND `database_id` != '" . $app->functions->intval($form_page->id) . "'"); |
| | | if($check['cnt'] < 1) { |
| | | // send a datalog delete |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "' AND `sys_groupid` = '" . $app->functions->intval($sys_groupid) . "'"); |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "'"); |
| | | if($db_user) { |
| | | $db_user['server_id'] = $form_page->dataRecord['server_id']; |
| | | $app->db->datalogSave('web_database_user', 'DELETE', 'database_user_id', $db_user['database_user_id'], $db_user, array()); |
| | |
| | | // check if readonly database user has changed |
| | | if($old_record['database_ro_user_id'] && $old_record['database_ro_user_id'] != $form_page->dataRecord['database_ro_user_id'] && $old_record['database_ro_user_id'] != $form_page->dataRecord['database_user_id']) { |
| | | // check if any database on the server still uses this one |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($old_record['database_ro_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($old_record['database_ro_user_id']) . "') AND `sys_groupid` = '" . $app->functions->intval($sys_groupid) . "' AND `database_id` != '" . $app->functions->intval($form_page->id) . "'"); |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($old_record['database_ro_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($old_record['database_ro_user_id']) . "') AND `database_id` != '" . $app->functions->intval($form_page->id) . "'"); |
| | | if($check['cnt'] < 1) { |
| | | // send a datalog delete |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($old_record['database_ro_user_id']) . "' AND `sys_groupid` = '" . $app->functions->intval($sys_groupid) . "'"); |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($old_record['database_ro_user_id']) . "'"); |
| | | if($db_user) { |
| | | $db_user['server_id'] = $form_page->dataRecord['server_id']; |
| | | $app->db->datalogSave('web_database_user', 'DELETE', 'database_user_id', $db_user['database_user_id'], $db_user, array()); |
| | | } |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | if($form_page->dataRecord['database_user_id']) { |
| | | /*if($form_page->dataRecord['database_user_id']) { |
| | | // check if there has already been a database on this server with that user |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "') AND `sys_groupid` = '" . $app->functions->intval($sys_groupid) . "'"); |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "')"); |
| | | |
| | | if($check && $check['cnt'] < 1) { |
| | | // we need to make a datalog insert for the database users that are connected to this database |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "' AND `sys_groupid` = '" . $app->functions->intval($sys_groupid) . "'"); |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_user_id']) . "'"); |
| | | if($db_user) { |
| | | $db_user['server_id'] = $form_page->dataRecord['server_id']; |
| | | $app->db->datalogSave('web_database_user', 'INSERT', 'database_user_id', $db_user['database_user_id'], array(), $db_user); |
| | |
| | | |
| | | if($form_page->dataRecord['database_ro_user_id']) { |
| | | // check if there has already been a database on this server with that user |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "') AND `sys_groupid` = '" . $app->functions->intval($sys_groupid) . "'"); |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($form_page->dataRecord['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "')"); |
| | | |
| | | if($check && $check['cnt'] < 1) { |
| | | // we need to make a datalog insert for the database users that are connected to this database |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "' AND `sys_groupid` = '" . $app->functions->intval($sys_groupid) . "'"); |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($form_page->dataRecord['database_ro_user_id']) . "'"); |
| | | if($db_user) { |
| | | $db_user['server_id'] = $form_page->dataRecord['server_id']; |
| | | $app->db->datalogSave('web_database_user', 'INSERT', 'database_user_id', $db_user['database_user_id'], array(), $db_user); |
| | | } |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | } |
| | | |
| | | public function processDatabaseDelete($primary_id) { |
| | | global $app; |
| | | |
| | | $old_record = $app->db->queryOneRecord('SELECT * FROM `web_database` WHERE `database_id` = ' . $app->functions->intval($primary_id)); |
| | | /*$old_record = $app->db->queryOneRecord('SELECT * FROM `web_database` WHERE `database_id` = ' . $app->functions->intval($primary_id)); |
| | | if($old_record['database_user_id']) { |
| | | // check if any database on the server still uses this one |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($old_record['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "') AND `sys_groupid` = '" . $app->functions->intval($old_record['sys_groupid']) . "' AND `database_id` != '" . $app->functions->intval($primary_id) . "'"); |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($old_record['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "') AND `database_id` != '" . $app->functions->intval($primary_id) . "'"); |
| | | if($check['cnt'] < 1) { |
| | | // send a datalog delete |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "' AND `sys_groupid` = '" . $app->functions->intval($old_record['sys_groupid']) . "'"); |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($old_record['database_user_id']) . "'"); |
| | | if($db_user) { |
| | | $db_user['server_id'] = $old_record['server_id']; |
| | | $app->db->datalogSave('web_database_user', 'DELETE', 'database_user_id', $db_user['database_user_id'], $db_user, array()); |
| | |
| | | } |
| | | if($old_record['database_ro_user_id']) { |
| | | // check if any database on the server still uses this one |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($old_record['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($old_record['database_ro_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($old_record['database_ro_user_id']) . "') AND `sys_groupid` = '" . $app->functions->intval($old_record['sys_groupid']) . "' AND `database_id` != '" . $app->functions->intval($primary_id) . "'"); |
| | | $check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . $app->functions->intval($old_record['server_id']) . "' AND (`database_user_id` = '" . $app->functions->intval($old_record['database_ro_user_id']) . "' OR `database_ro_user_id` = '" . $app->functions->intval($old_record['database_ro_user_id']) . "') AND `database_id` != '" . $app->functions->intval($primary_id) . "'"); |
| | | if($check['cnt'] < 1) { |
| | | // send a datalog delete |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($old_record['database_ro_user_id']) . "' AND `sys_groupid` = '" . $app->functions->intval($old_record['sys_groupid']) . "'"); |
| | | $db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . $app->functions->intval($old_record['database_ro_user_id']) . "'"); |
| | | if($db_user) { |
| | | $db_user['server_id'] = $old_record['server_id']; |
| | | $app->db->datalogSave('web_database_user', 'DELETE', 'database_user_id', $db_user['database_user_id'], $db_user, array()); |
| | | } |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | } |
| | | } |
| | |
| | | $field_value_array[] = $field_value; |
| | | } |
| | | foreach($field_value_array as $field_value) { |
| | | $field_value = trim($field_value); |
| | | if(function_exists('filter_var')) { |
| | | if(!filter_var($field_value,FILTER_VALIDATE_IP)) { |
| | | $errmsg = $validator['errmsg']; |
| | |
| | | if (is_array($k)) { |
| | | foreach($k as $key => $value){ |
| | | $key = ($this->OPTIONS['CASELESS']) ? strtolower(trim($key)) : trim($key); |
| | | if (preg_match('/^[A-Za-z_]+[A-Za-z0-9_]*$/', $key) && $value !== null ) { |
| | | if (preg_match('/^[A-Za-z]+[A-Za-z0-9_]*$/', $key) && $value !== null ) { |
| | | $this->_vars[$key] = $value; |
| | | } |
| | | } |
| | | } else { |
| | | if (preg_match('/^[A-Za-z_]+[A-Za-z0-9_]*$/', $k) && $v !== null) { |
| | | if (preg_match('/^[A-Za-z]+[A-Za-z0-9_]*$/', $k) && $v !== null) { |
| | | if ($this->OPTIONS['CASELESS']) $k = strtolower($k); |
| | | $this->_vars[trim($k)] = $v; |
| | | } else { |
| | |
| | | for ($i = 0; $i < $num_args; $i++) { |
| | | $var = func_get_arg($i); |
| | | if ($this->OPTIONS['CASELESS']) $var = strtolower($var); |
| | | if (!preg_match('/^[A-Za-z_]+[A-Za-z0-9_]*$/', $var)) continue; |
| | | if (!preg_match('/^[A-Za-z]+[A-Za-z0-9_]*$/', $var)) continue; |
| | | unset($this->_vars[$var]); |
| | | } |
| | | return true; |
| | |
| | | */ |
| | | public function setLoop($k, $v) |
| | | { |
| | | if (is_array($v) && preg_match('/^[A-Za-z_]+[A-Za-z0-9_]*$/', $k)) { |
| | | if (is_array($v) && preg_match('/^[A-Za-z]+[A-Za-z0-9_]*$/', $k)) { |
| | | $k = ($this->OPTIONS['CASELESS']) ? strtolower(trim($k)) : trim($k); |
| | | $this->_arrvars[$k] = array(); |
| | | if ($this->OPTIONS['SET_LOOP_VAR'] && !empty($v)) $this->setvar($k, 1); |
| | | if (($this->_arrvars[$k] = $this->_arrayBuild($v)) == false) { |
| | | vlibTemplateError::raiseError('VT_WARNING_INVALID_ARR', WARNING, $k); |
| | | } else { |
| | | $this->vars['_'.$k.'_num'] = count($v); |
| | | } |
| | | } |
| | | return true; |
| | |
| | | $regex.= '[\"\']?'; |
| | | $regex.= ')?\s*'; |
| | | $regex.= '(?:>|\/>|}|-->){1}'; |
| | | $regex.= '([\r\n|\n|\r])?/ie'; |
| | | $data = preg_replace($regex,"\$this->_parseTag(array('\\0','\\1','\\2','\\3','\\4','\\5','\\6','\\7','\\8','\\9'));",$data); |
| | | $regex.= '([\r\n|\n|\r])?/i'; |
| | | $data = preg_replace_callback($regex, array($this, _parseTag), $data); |
| | | |
| | | if ($this->_cache) { // add cache if need be |
| | | $this->_createCache($data); |
| | |
| | | |
| | | |
| | | $ftp_data = $app->db->queryOneRecord("SELECT parent_domain_id FROM ftp_user WHERE ftp_user_id = '".$app->db->quote($app->tform->primary_id)."'"); |
| | | if(!$ftp_data["parent_domain_id"]) { |
| | | if(!is_array($ftp_data) || $ftp_data["parent_domain_id"] < 1) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($app->tform->wordbook[$errmsg])) { |
| | | return $app->tform->wordbook[$errmsg]."<br>\r\n"; |
| | |
| | | } |
| | | |
| | | $domain_data = $app->db->queryOneRecord("SELECT domain_id, document_root FROM web_domain WHERE domain_id = '".$app->db->quote($ftp_data["parent_domain_id"])."'"); |
| | | if(!$domain_data["domain_id"]) { |
| | | if(!is_array($domain_data) || $domain_data["domain_id"] < 1) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($app->tform->wordbook[$errmsg])) { |
| | | return $app->tform->wordbook[$errmsg]."<br>\r\n"; |
| | |
| | | |
| | | if(stristr($field_value,'..') or stristr($field_value,'./') or stristr($field_value,'/.')) $is_ok = false; |
| | | |
| | | //* Final check if docroot path of website is >= 5 chars |
| | | if(strlen($doc_root) < 5) $is_ok = false; |
| | | |
| | | if($is_ok == false) { |
| | | $errmsg = $validator['errmsg']; |
| | | if(isset($app->tform->wordbook[$errmsg])) { |
| | |
| | | global $app, $conf; |
| | | |
| | | // make sure that the record belongs to the clinet group and not the admin group when a dmin inserts it |
| | | // also make sure that the user can not delete domain created by a admin |
| | | // also make sure that the user can not delete entry created by an admin |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($page_form->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $app->db->query("UPDATE web_database_user SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE database_user_id = ".$page_form->id); |
| | |
| | | $client_group_id = $app->functions->intval($page_form->dataRecord["client_group_id"]); |
| | | $app->db->query("UPDATE web_database_user SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE database_user_id = ".$page_form->id); |
| | | } |
| | | $app->db->query("UPDATE web_database_user SET server_id = '" . $app->functions->intval($conf['server_id']) . "' WHERE database_user_id = ".$page_form->id); |
| | | //$app->db->query("UPDATE web_database_user SET server_id = '" . $app->functions->intval($conf['server_id']) . "' WHERE database_user_id = ".$page_form->id); |
| | | } |
| | | } |
| | |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'admin_notify_events' => array( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '1', |
| | | 'value' => array('3' => 'no_notifications_txt', '0' => 'Debug', '1' => 'Warnings', '2' => 'Errors'), |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'backup_dir' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | |
| | | 'formtype' => 'SELECT', |
| | | 'default' => 'userzip', |
| | | 'value' => array('userzip' => 'backup_mode_userzip', 'rootgz' => 'backup_mode_rootgz'), |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'monit_url' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '', |
| | | 'validators' => array ( 0 => array ( 'type' => 'REGEX', |
| | | 'regex' => '/^[0-9a-zA-Z\:\/\-\.\[\]]{0,255}$/', |
| | | 'errmsg'=> 'monit_url_error_regex'), |
| | | ), |
| | | 'value' => '', |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'monit_user' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '', |
| | | 'value' => '', |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'monit_password' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '', |
| | | 'value' => '', |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'munin_url' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '', |
| | | 'validators' => array ( 0 => array ( 'type' => 'REGEX', |
| | | 'regex' => '/^[0-9a-zA-Z\:\/\-\.\[\]]{0,255}$/', |
| | | 'errmsg'=> 'munin_url_error_regex'), |
| | | ), |
| | | 'value' => '', |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'munin_user' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '', |
| | | 'value' => '', |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'munin_password' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '', |
| | | 'value' => '', |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '', |
| | | 'validators' => array ( 0 => array ( 'type' => 'REGEX', |
| | | 'regex' => '/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])(,\s*(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]))*$/', |
| | | 'regex' => '/^((([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])(,\s*(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]))*)?$/', |
| | | 'errmsg'=> 'rbl_error_regex'), |
| | | ), |
| | | 'value' => '', |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'sendmail_path' => array( |
| | | 'overquota_notify_admin' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '/usr/sbin/sendmail', |
| | | 'validators' => array(0 => array('type' => 'NOTEMPTY', |
| | | 'errmsg' => 'sendmail_path_error_empty'), |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'y', |
| | | 'value' => array(0 => 'n', 1 => 'y') |
| | | ), |
| | | 'overquota_notify_client' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'y', |
| | | 'value' => array(0 => 'n', 1 => 'y') |
| | | ), |
| | | 'overquota_notify_freq' => array( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '7', |
| | | 'value' => '', |
| | | 'width' => '40', |
| | | 'width' => '20', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'overquota_notify_onok' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'n', |
| | | 'value' => array(0 => 'n', 1 => 'y') |
| | | ), |
| | | ################################## |
| | | # ENDE Datatable fields |
| | |
| | | 'default' => 'y', |
| | | 'value' => array(0 => 'n', 1 => 'y') |
| | | ), |
| | | 'overquota_notify_admin' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'y', |
| | | 'value' => array(0 => 'n', 1 => 'y') |
| | | ), |
| | | 'overquota_notify_client' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'y', |
| | | 'value' => array(0 => 'n', 1 => 'y') |
| | | ), |
| | | 'overquota_notify_freq' => array( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '7', |
| | | 'value' => '', |
| | | 'width' => '20', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'overquota_notify_onok' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | | 'default' => 'n', |
| | | 'value' => array(0 => 'n', 1 => 'y') |
| | | ), |
| | | 'user' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => "SELECT client_id,CONCAT(contact_name,' :: ',username) as name FROM client WHERE {AUTHSQL} ORDER BY contact_name", |
| | | 'querystring' => "SELECT client_id,CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as name FROM client WHERE {AUTHSQL} ORDER BY contact_name", |
| | | 'keyfield'=> 'client_id', |
| | | 'valuefield'=> 'name' |
| | | ), |
| | |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => "SELECT client_id,CONCAT(contact_name,' :: ',username) as name FROM client WHERE {AUTHSQL} ORDER BY contact_name", |
| | | 'querystring' => "SELECT client_id,CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as name FROM client WHERE {AUTHSQL} ORDER BY contact_name", |
| | | 'keyfield'=> 'client_id', |
| | | 'valuefield'=> 'name' |
| | | ), |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | Copyright (c) 2008, Till Brehm, projektfarm Gmbh |
| | | All rights reserved. |
| | | |
| | | Redistribution and use in source and binary forms, with or without modification, |
| | | are permitted provided that the following conditions are met: |
| | | |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright notice, |
| | | this list of conditions and the following disclaimer in the documentation |
| | | and/or other materials provided with the distribution. |
| | | * Neither the name of ISPConfig nor the names of its contributors |
| | | may be used to endorse or promote products derived from this software without |
| | | specific prior written permission. |
| | | |
| | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| | | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| | | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| | | IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
| | | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| | | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| | | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| | | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| | | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| | | */ |
| | | |
| | | /* |
| | | Form Definition |
| | | |
| | | Tabellendefinition |
| | | |
| | | Datentypen: |
| | | - INTEGER (Wandelt Ausdrücke in Int um) |
| | | - DOUBLE |
| | | - CURRENCY (Formatiert Zahlen nach Währungsnotation) |
| | | - VARCHAR (kein weiterer Format Check) |
| | | - TEXT (kein weiterer Format Check) |
| | | - DATE (Datumsformat, Timestamp Umwandlung) |
| | | |
| | | Formtype: |
| | | - TEXT (normales Textfeld) |
| | | - TEXTAREA (normales Textfeld) |
| | | - PASSWORD (Feldinhalt wird nicht angezeigt) |
| | | - SELECT (Gibt Werte als option Feld aus) |
| | | - RADIO |
| | | - CHECKBOX |
| | | - FILE |
| | | |
| | | VALUE: |
| | | - Wert oder Array |
| | | |
| | | Hinweis: |
| | | Das ID-Feld ist nicht bei den Table Values einzufügen. |
| | | |
| | | |
| | | */ |
| | | |
| | | $form["title"] = "Software Package"; |
| | | $form["description"] = "Modify software package details"; |
| | | $form["name"] = "software_package"; |
| | | $form["action"] = "software_package_edit.php"; |
| | | $form["db_table"] = "software_package"; |
| | | $form["db_table_idx"] = "package_id"; |
| | | $form["db_history"] = "no"; |
| | | $form["tab_default"] = "software_package"; |
| | | $form["list_default"] = "software_package_list.php"; |
| | | $form["auth"] = 'yes'; |
| | | |
| | | $form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user |
| | | $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user |
| | | $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete |
| | | $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete |
| | | $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete |
| | | |
| | | $form["tabs"]['software_package'] = array ( |
| | | 'title' => "Software Package", |
| | | 'width' => 80, |
| | | 'template' => "templates/software_package_edit.htm", |
| | | 'fields' => array ( |
| | | ################################## |
| | | # Beginn Datenbankfelder |
| | | ################################## |
| | | 'package_title' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'validators' => '', |
| | | 'default' => '', |
| | | 'value' => '', |
| | | 'separator' => '', |
| | | 'width' => '40', |
| | | 'maxlength' => '40', |
| | | 'rows' => '', |
| | | 'cols' => '' |
| | | ), |
| | | 'package_key' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'validators' => '', |
| | | 'default' => '', |
| | | 'value' => '', |
| | | 'separator' => '', |
| | | 'width' => '40', |
| | | 'maxlength' => '40', |
| | | 'rows' => '', |
| | | 'cols' => '' |
| | | ), |
| | | ################################## |
| | | # ENDE Datenbankfelder |
| | | ################################## |
| | | ) |
| | | ); |
| | | ?> |
| | |
| | | */ |
| | | |
| | | $form["title"] = "Software Repository"; |
| | | $form["description"] = "Software Repositoy which may contain addons or updates"; |
| | | $form["description"] = "Software Repository which may contain addons or updates"; |
| | | $form["name"] = "software_repo"; |
| | | $form["action"] = "software_repo_edit.php"; |
| | | $form["db_table"] = "software_repo"; |
| | |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'validators' => array ( 0 => array ( 'type' => 'REGEX', |
| | | 'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}(\?.+)?$/', |
| | | /*'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}(\?.+)?$/',*/ |
| | | 'regex' => '/^[0-9a-zA-Z\:\/\-\.\[\]]{0,255}$/', |
| | | 'errmsg'=> 'webmail_url_error_regex'), |
| | | ), |
| | | 'default' => '', |
| | |
| | | $wb['Domains'] = 'Domains'; |
| | | $wb['Misc'] = 'Diverses'; |
| | | $wb['Software'] = 'Apps & Add-Ons'; |
| | | $wb['Repositories'] = 'Bibliotheken'; |
| | | $wb['Repositories'] = 'Repositories'; |
| | | $wb['Packages'] = 'Pakete'; |
| | | $wb['Updates'] = 'Updates'; |
| | | $wb['Language Editor'] = 'Sprachen Editor'; |
| | |
| | | $wb['overtraffic_notify_admin_txt'] = 'Ãœberschreiten des Transfer Limits an den Administrator senden'; |
| | | $wb['overtraffic_notify_client_txt'] = 'Ãœberschreiten des Transfer Limits an den Kunden senden'; |
| | | $wb['rbl_error_regex'] = 'Bitte geben Sie gültige RBL-Hostnamen an.'; |
| | | $wb['php_ini_check_minutes_txt'] = 'Prüfe System php.ini Dateien auf Änderungen alle'; |
| | | $wb['php_ini_check_minutes_info_txt'] = 'Minute(n) (0 deaktiviert diese Funktion)'; |
| | | $wb['php_ini_check_minutes_error_empty'] = 'Der Wert für die Einstellung der php.ini Prüfung ist ungültig.'; |
| | | $wb["rbl_error_regex"] = 'Bitte geben Sie gültige RBL-Hostnamen an.'; |
| | | $wb["sendmail_path_txt"] = 'Pfad zu Sendmail'; |
| | | $wb["sendmail_path_error_empty"] = 'Sendmail Pfad ist leer.'; |
| | | $wb['overquota_notify_admin_txt'] = 'Quota-Warnungen an den Administrator senden'; |
| | | $wb['overquota_notify_client_txt'] = 'Quota-Warnungen an den Kunden senden'; |
| | | $wb['overquota_notify_onok_txt'] = 'Meldung an den Kunden senden, wenn Belegung wieder ok'; |
| | | $wb['overquota_notify_freq_txt'] = 'Quota-Warnung alle X Tage versenden'; |
| | | $wb['overquota_notify_freq_note_txt'] = '0 = Meldung nur einmalig versenden, keine Wiederholung'; |
| | | $wb['admin_notify_events_txt'] = 'Sende E-Mail an Administrator ab folgendem Level'; |
| | | $wb['no_notifications_txt'] = 'Keine Benachrichtigungen'; |
| | | $wb['monit_url_txt'] = 'Monit-URL'; |
| | | $wb['monit_user_txt'] = 'Monit-Benutzer'; |
| | | $wb['monit_password_txt'] = 'Monit-Passwort'; |
| | | $wb['monit_url_error_regex'] = 'Ungültige Monit-URL'; |
| | | $wb['monit_url_note_txt'] = 'Platzhalter:'; |
| | | $wb['munin_url_txt'] = 'Munin-URL'; |
| | | $wb['munin_user_txt'] = 'Munin-Benutzer'; |
| | | $wb['munin_password_txt'] = 'Munin-Passwort'; |
| | | $wb['munin_url_error_regex'] = 'Ungültige Munin-URL'; |
| | | $wb['munin_url_note_txt'] = 'Platzhalter:'; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb['package_title_txt'] = 'Paket-Titel'; |
| | | $wb['package_key_txt'] = 'Paket-Key'; |
| | | $wb['Software Package'] = 'Software-Paket'; |
| | | $wb['Modify software package details'] = 'Software-Paket-Einstellungen bearbeiten'; |
| | | ?> |
| | |
| | | <?php |
| | | $wb['head_txt'] = 'Softwarepaket installieren'; |
| | | $wb['install_key_txt'] = 'Installations Key eingeben'; |
| | | $wb['install_key_txt'] = 'Installationskey eingeben'; |
| | | $wb['btn_save_txt'] = 'Installation starten'; |
| | | $wb['btn_cancel_txt'] = 'Abbrechen'; |
| | | ?> |
| | |
| | | $wb['toolsarea_head_txt'] = 'Pakete'; |
| | | $wb['repoupdate_txt'] = 'Softwarepakete Liste updaten'; |
| | | $wb['package_id_txt'] = 'Lokale App ID'; |
| | | $wb['no_packages_txt'] = 'No packages available'; |
| | | $wb['no_packages_txt'] = 'Keine Pakete verfügbar'; |
| | | $wb['edit_txt'] = 'Bearbeiten'; |
| | | $wb['delete_txt'] = 'Löschen'; |
| | | ?> |
| | |
| | | <?php |
| | | $wb['repo_name_txt'] = 'Bibliothek'; |
| | | $wb['repo_name_txt'] = 'Repository'; |
| | | $wb['repo_url_txt'] = 'URL'; |
| | | $wb['repo_username_txt'] = 'Benutzername (optional)'; |
| | | $wb['repo_password_txt'] = 'Passwort (optional)'; |
| | | $wb['active_txt'] = 'Aktiv'; |
| | | $wb['Software Repository which may contain addons or updates'] = 'Software-Repository, das Add-Ons oder Updates enthalten kann'; |
| | | ?> |
| | |
| | | <?php |
| | | $wb['list_head_txt'] = 'Bibliothek'; |
| | | $wb['list_head_txt'] = 'Repository'; |
| | | $wb['active_txt'] = 'Aktiv'; |
| | | $wb['repo_name_txt'] = 'Bibliothek'; |
| | | $wb['repo_name_txt'] = 'Repository'; |
| | | $wb['repo_url_txt'] = 'URL'; |
| | | ?> |
| | |
| | | $wb['update_title_txt'] = 'Update'; |
| | | $wb['version_txt'] = 'Version'; |
| | | $wb['action_txt'] = 'Aktion'; |
| | | $wb['no_updates_txt'] = 'No updates available'; |
| | | $wb['no_updates_txt'] = 'Keine Updates verfügbar'; |
| | | ?> |
| | |
| | | $wb['mailbox_show_mail_filter_tab_txt'] = 'Zeige E-Mail Filter Reiter in E-Mail Kontodetails'; |
| | | $wb['mailbox_show_custom_rules_tab_txt'] = 'Zeige Benutzerregel Reiter in E-Mail Kontodetails';$wb['webmail_url_error_regex'] = 'Falsche Webmail URL'; |
| | | $wb['reseller_can_use_options_txt'] = 'Reseller können den Optionen Reiter bei Webseiten verwenden'; |
| | | $wb['phpmyadmin_url_note_txt'] = 'Platzhalter:'; |
| | | $wb['webmail_url_note_txt'] = 'Platzhalter:'; |
| | | ?> |
| | |
| | | $wb["web_folder_protection_txt"] = 'Make web folders immutable (extended attributes)'; |
| | | $wb["overtraffic_notify_admin_txt"] = 'Send overtraffic notification to admin'; |
| | | $wb["overtraffic_notify_client_txt"] = 'Send overtraffic notification to client'; |
| | | $wb["v6_prefix_txt"] = 'IPv6 Prefix'; |
| | | $wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror'; |
| | | $wb["v6_prefix_wrong"] = 'Invalid v6 Netmask format.'; |
| | | $wb["php_ini_check_minutes_txt"] = 'Check system php.ini files for changes each'; |
| | | $wb["php_ini_check_minutes_info_txt"] = 'minutes (0 disables checking)'; |
| | | $wb['php_ini_check_minutes_error_empty'] = 'Invalid value for php.ini checking.'; |
| | | $wb["rbl_error_regex"] = 'Please specify valid RBL hostnames.'; |
| | | $wb["sendmail_path_txt"] = 'Sendmail Path'; |
| | | $wb["sendmail_path_error_empty"] = 'Sendmail Path is empty.'; |
| | | $wb["overquota_notify_admin_txt"] = 'Send quota warnings to admin'; |
| | | $wb["overquota_notify_client_txt"] = 'Send quota warnings to client'; |
| | | $wb["overquota_notify_onok_txt"] = 'Send quota ok message to client'; |
| | | $wb['overquota_notify_freq_txt'] = 'Send quota warning each X days'; |
| | | $wb['overquota_notify_freq_note_txt'] = '0 = send message just once, no repeated messages'; |
| | | $wb['admin_notify_events_txt'] = 'Send email to admin starting with the following level'; |
| | | $wb['no_notifications_txt'] = 'No Notifications'; |
| | | $wb['monit_url_txt'] = 'Monit URL'; |
| | | $wb['monit_user_txt'] = 'Monit User'; |
| | | $wb['monit_password_txt'] = 'Monit Password'; |
| | | $wb['monit_url_error_regex'] = 'Invalid Monit URL'; |
| | | $wb['monit_url_note_txt'] = 'Placeholder:'; |
| | | $wb['munin_url_txt'] = 'Munin URL'; |
| | | $wb['munin_user_txt'] = 'Munin User'; |
| | | $wb['munin_password_txt'] = 'Munin Password'; |
| | | $wb['munin_url_error_regex'] = 'Invalid Munin URL'; |
| | | $wb['munin_url_note_txt'] = 'Placeholder:'; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["package_title_txt"] = 'Package Title'; |
| | | $wb["package_key_txt"] = 'Package Key'; |
| | | $wb["Software Package"] = 'Software Package'; |
| | | $wb['Modify software package details'] = 'Modify software package details'; |
| | | ?> |
| | |
| | | $wb['repoupdate_txt'] = 'Update package list'; |
| | | $wb['package_id_txt'] = 'local App-ID'; |
| | | $wb['no_packages_txt'] = 'No packages available'; |
| | | $wb['edit_txt'] = 'Edit'; |
| | | $wb['delete_txt'] = 'Delete'; |
| | | ?> |
| | |
| | | $wb["repo_username_txt"] = 'User (optional)'; |
| | | $wb["repo_password_txt"] = 'Password (optional)'; |
| | | $wb["active_txt"] = 'Active'; |
| | | $wb['Software Repository which may contain addons or updates'] = 'Software Repository which may contain addons or updates'; |
| | | ?> |
| | |
| | | $wb['mailbox_show_mail_filter_tab_txt'] = 'Show mail filter tab in mail account details'; |
| | | $wb['mailbox_show_custom_rules_tab_txt'] = 'Show custom mailfilter tab in mail account details'; |
| | | $wb['webmail_url_error_regex'] = 'Invalid webmail URL'; |
| | | $wb['reseller_can_use_options_txt'] = 'Reseller can use options tab in web sites config'; |
| | | $wb['phpmyadmin_url_note_txt'] = 'Placeholder:'; |
| | | $wb['webmail_url_note_txt'] = 'Placeholder:'; |
| | | ?> |
| | |
| | | |
| | | $app->uses('listform_actions'); |
| | | |
| | | $app->listform_actions->SQLOrderBy = "ORDER BY server_id, ip_address"; |
| | | $app->listform_actions->SQLOrderBy = "ORDER BY server_ip.server_id, server_ip.ip_address"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | |
| | | $app->uses('listform_actions'); |
| | | |
| | | $app->listform_actions->SQLOrderBy = "ORDER BY server_id, name"; |
| | | $app->listform_actions->SQLOrderBy = "ORDER BY server_php.server_id, server_php.name"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
New file |
| | |
| | | <?php |
| | | /* |
| | | Copyright (c) 2008, Till Brehm, projektfarm Gmbh |
| | | All rights reserved. |
| | | |
| | | Redistribution and use in source and binary forms, with or without modification, |
| | | are permitted provided that the following conditions are met: |
| | | |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright notice, |
| | | this list of conditions and the following disclaimer in the documentation |
| | | and/or other materials provided with the distribution. |
| | | * Neither the name of ISPConfig nor the names of its contributors |
| | | may be used to endorse or promote products derived from this software without |
| | | specific prior written permission. |
| | | |
| | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| | | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| | | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| | | IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
| | | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| | | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| | | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| | | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| | | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| | | */ |
| | | |
| | | |
| | | /****************************************** |
| | | * Begin Form configuration |
| | | ******************************************/ |
| | | |
| | | $tform_def_file = "form/software_package.tform.php"; |
| | | |
| | | /****************************************** |
| | | * End Form configuration |
| | | ******************************************/ |
| | | |
| | | require_once('../../lib/config.inc.php'); |
| | | require_once('../../lib/app.inc.php'); |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('admin'); |
| | | if($conf['demo_mode'] == true) $app->error('This function is disabled in demo mode.'); |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions'); |
| | | $app->load('tform_actions'); |
| | | |
| | | class page_action extends tform_actions { |
| | | |
| | | } |
| | | |
| | | $page = new page_action; |
| | | $page->onLoad(); |
| | | |
| | | ?> |
| | |
| | | |
| | | $app->tpl->setLoop('records',$packages); |
| | | |
| | | include_once('lib/lang/en_software_package_list.lng'); |
| | | $language = (isset($_SESSION['s']['language']))?$_SESSION['s']['language']:$conf['language']; |
| | | include_once('lib/lang/'.$language.'_software_package_list.lng'); |
| | | $app->tpl->setVar($wb); |
| | | |
| | | |
| | |
| | | |
| | | $app->tpl->setLoop('records',$records_out); |
| | | |
| | | include_once('lib/lang/en_software_update_list.lng'); |
| | | $language = (isset($_SESSION['s']['language']))?$_SESSION['s']['language']:$conf['language']; |
| | | include_once('lib/lang/'.$language.'_software_update_list.lng'); |
| | | $app->tpl->setVar($wb); |
| | | |
| | | |
| | |
| | | <table class="list"> |
| | | <thead> |
| | | <tr class="caption"> |
| | | <th class="tbl_col_remote_user_pid" scope="col"><tmpl_var name="parent_remote_userid_txt"></th> |
| | | <th class="tbl_col_remote_userid" scope="col"><tmpl_var name="parent_remote_userid_txt"></th> |
| | | <th class="tbl_col_remote_username" scope="col"><tmpl_var name="username_txt"></th> |
| | | <th class="tbl_col_limit" scope="col">{tmpl_var name='search_limit'}</th> |
| | | </tr> |
| | | <tr class="filter"> |
| | | <td class="tbl_col_remote_user_pid"> </td> |
| | | <td class="tbl_col_remote_userid"> </td> |
| | | <td class="tbl_col_remote_username"><input type="text" name="search_username" value="{tmpl_var name='search_username'}" /></td> |
| | | <td class="tbl_col_buttons"> |
| | | <button type="button" class="button icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onclick="submitForm('pageForm','admin/remote_user_list.php');"><span>{tmpl_var name="filter_txt"}</span></button> |
| | |
| | | <tbody> |
| | | <tmpl_loop name="records"> |
| | | <tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>"> |
| | | <td class="tbl_col_remote_user_pid"><a href="#" onclick="loadContent('admin/remote_user_edit.php?id={tmpl_var name='remote_userid'}');">{tmpl_var name="remote_userid"}</a></td> |
| | | <td class="tbl_col_remote_userid"><a href="#" onclick="loadContent('admin/remote_user_edit.php?id={tmpl_var name='remote_userid'}');">{tmpl_var name="remote_userid"}</a></td> |
| | | <td class="tbl_col_remote_username"><a href="#" onclick="loadContent('admin/remote_user_edit.php?id={tmpl_var name='remote_userid'}');">{tmpl_var name="remote_username"}</a></td> |
| | | <td class="tbl_col_buttons"> |
| | | <a class="button icons16 icoDelete" href="javascript: del_record('admin/remote_user_del.php?id={tmpl_var name='remote_userid'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span>{tmpl_var name='delete_txt'}</span></a> |
| | |
| | | <input name="realtime_blackhole_list" id="realtime_blackhole_list" value="{tmpl_var name='realtime_blackhole_list'}" size="40" maxlength="255" type="text" class="textInput" /> {tmpl_var name='realtime_blackhole_list_note_txt'} |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="sendmail_path">{tmpl_var name='sendmail_path_txt'}</label> |
| | | <input name="sendmail_path" id="sendmail_path" value="{tmpl_var name='sendmail_path'}" size="40" maxlength="255" type="text" class="textInput" /> |
| | | <p class="label">{tmpl_var name='overquota_notify_admin_txt'}</p> |
| | | <div class="multiField"> |
| | | {tmpl_var name='overquota_notify_admin'} |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name='overquota_notify_client_txt'}</p> |
| | | <div class="multiField"> |
| | | {tmpl_var name='overquota_notify_client'} |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="overquota_notify_freq">{tmpl_var name='overquota_notify_freq_txt'}</label> |
| | | <input name="overquota_notify_freq" id="overquota_notify_freq" value="{tmpl_var name='overquota_notify_freq'}" size="40" maxlength="255" type="text" class="textInput" /> {tmpl_var name='overquota_notify_freq_note_txt'} |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name='overquota_notify_onok_txt'}</p> |
| | | <div class="multiField"> |
| | | {tmpl_var name='overquota_notify_onok'} |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | |
| | |
| | | </select> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="admin_notify_events">{tmpl_var name='admin_notify_events_txt'}</label> |
| | | <select name="admin_notify_events" id="admin_notify_events" class="selectInput"> |
| | | {tmpl_var name='admin_notify_events'} |
| | | </select> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="backup_dir">{tmpl_var name='backup_dir_txt'}</label> |
| | | <input name="backup_dir" id="backup_dir" value="{tmpl_var name='backup_dir'}" size="40" maxlength="255" type="text" class="textInput" /> |
| | | </div> |
| | |
| | | {tmpl_var name='backup_mode'} |
| | | </select> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="monit_url">{tmpl_var name='monit_url_txt'}</label> |
| | | <input name="monit_url" id="monit_url" value="{tmpl_var name='monit_url'}" size="40" maxlength="255" type="text" class="textInput" /> {tmpl_var name='monit_url_note_txt'} <a href="javascript:void(0);" class="addPlaceholder">[SERVERNAME]</a> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="monit_user">{tmpl_var name='monit_user_txt'}</label> |
| | | <input name="monit_user" id="monit_user" value="{tmpl_var name='monit_user'}" size="40" maxlength="255" type="text" class="textInput" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="monit_password">{tmpl_var name='monit_password_txt'}</label> |
| | | <input name="monit_password" id="monit_password" value="{tmpl_var name='monit_password'}" size="40" maxlength="255" type="text" class="textInput" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="munin_url">{tmpl_var name='munin_url_txt'}</label> |
| | | <input name="munin_url" id="munin_url" value="{tmpl_var name='munin_url'}" size="40" maxlength="255" type="text" class="textInput" /> {tmpl_var name='munin_url_note_txt'} <a href="javascript:void(0);" class="addPlaceholder">[SERVERNAME]</a> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="munin_user">{tmpl_var name='munin_user_txt'}</label> |
| | | <input name="munin_user" id="munin_user" value="{tmpl_var name='munin_user'}" size="40" maxlength="255" type="text" class="textInput" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="munin_password">{tmpl_var name='munin_password_txt'}</label> |
| | | <input name="munin_password" id="munin_password" value="{tmpl_var name='munin_password'}" size="40" maxlength="255" type="text" class="textInput" /> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <input type="hidden" name="id" value="{tmpl_var name='id'}"> |
| | |
| | | {tmpl_var name='overtraffic_notify_client'} |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name='overquota_notify_admin_txt'}</p> |
| | | <div class="multiField"> |
| | | {tmpl_var name='overquota_notify_admin'} |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name='overquota_notify_client_txt'}</p> |
| | | <div class="multiField"> |
| | | {tmpl_var name='overquota_notify_client'} |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="overquota_notify_freq">{tmpl_var name='overquota_notify_freq_txt'}</label> |
| | | <input name="overquota_notify_freq" id="overquota_notify_freq" value="{tmpl_var name='overquota_notify_freq'}" size="40" maxlength="255" type="text" class="textInput" /> {tmpl_var name='overquota_notify_freq_note_txt'} |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name='overquota_notify_onok_txt'}</p> |
| | | <div class="multiField"> |
| | | {tmpl_var name='overquota_notify_onok'} |
| | | </div> |
| | | </div> |
| | | <div class="subsectiontoggle"><span></span>{tmpl_var name='ssl_settings_txt'}<em></em></div> |
| | | <div style="display:none;"> |
| | | <div class="ctrlHolder"> |
New file |
| | |
| | | <h2><tmpl_var name="list_head_txt"></h2> |
| | | <p><tmpl_var name="list_desc_txt"></p> |
| | | |
| | | <div class="panel panel_software_package"> |
| | | |
| | | <div class="pnl_formsarea"> |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <label for="package_title">{tmpl_var name='package_title_txt'}</label> |
| | | {tmpl_var name='package_title'}<input name="package_title" id="package_title" value="{tmpl_var name='package_title'}" size="40" maxlength="40" type="hidden" class="textInput" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="package_key">{tmpl_var name='package_key_txt'}</label> |
| | | <input name="package_key" id="package_key" value="{tmpl_var name='package_key'}" size="40" maxlength="40" type="text" class="textInput" /> |
| | | </div> |
| | | |
| | | |
| | | <input type="hidden" name="id" value="{tmpl_var name='id'}"> |
| | | |
| | | <div class="buttonHolder buttons"> |
| | | <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onclick="submitForm('pageForm','admin/software_package_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button> |
| | | <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onclick="loadContent('admin/software_package_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | <th class="tbl_col_installed" scope="col"><tmpl_var name="installed_txt"></th> |
| | | <th class="tbl_col_package_title" scope="col"><tmpl_var name="package_title_txt"></th> |
| | | <th class="tbl_col_package_description" scope="col"><tmpl_var name="package_description_txt"></th> |
| | | <th class="tbl_col_package_description" scope="col"><tmpl_var name="package_id_txt"></th> |
| | | <th class="tbl_col_package_id" scope="col"><tmpl_var name="package_id_txt"></th> |
| | | <th class="tbl_col_limit" scope="col">{tmpl_var name='search_limit'}</th> |
| | | </tr> |
| | | </thead> |
| | |
| | | <td class="tbl_col_installed">{tmpl_var name="installed"}</td> |
| | | <td class="tbl_col_package_title">{tmpl_var name="package_title"}</td> |
| | | <td class="tbl_col_package_description">{tmpl_var name="package_description"}</td> |
| | | <td class="tbl_col_package_description">ispapp{tmpl_var name="package_id"}</td> |
| | | <td class="tbl_col_package_id">ispapp{tmpl_var name="package_id"}</td> |
| | | <td class="tbl_col_buttons"> |
| | | <a class="button icons16 icoEdit" href="javascript: loadContent('admin/software_package_edit.php?id={tmpl_var name='package_id'}');"><span>{tmpl_var name='edit_txt'}</span></a> |
| | | <a class="button icons16 icoDelete" href="javascript: del_record('admin/software_package_del.php?software_update_inst_id={tmpl_var name='software_update_inst_id'}','{tmpl_var name='delete_confirmation'}');"><span>{tmpl_var name='delete_txt'}</span></a> |
| | | </td> |
| | | </tr> |
| | |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="webmail_url">{tmpl_var name='webmail_url_txt'}</label> |
| | | <input name="webmail_url" id="webmail_url" value="{tmpl_var name='webmail_url'}" size="30" maxlength="255" type="text" class="textInput" /> |
| | | <input name="webmail_url" id="webmail_url" value="{tmpl_var name='webmail_url'}" size="30" maxlength="255" type="text" class="textInput" /> {tmpl_var name='webmail_url_note_txt'} <a href="javascript:void(0);" class="addPlaceholder">[SERVERNAME]</a> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name='mailmailinglist_link_txt'}</p> |
| | |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="phpmyadmin_url">{tmpl_var name='phpmyadmin_url_txt'}</label> |
| | | <input name="phpmyadmin_url" id="phpmyadmin_url" value="{tmpl_var name='phpmyadmin_url'}" size="30" maxlength="255" type="text" class="textInput" /> |
| | | <input name="phpmyadmin_url" id="phpmyadmin_url" value="{tmpl_var name='phpmyadmin_url'}" size="30" maxlength="255" type="text" class="textInput" /> {tmpl_var name='phpmyadmin_url_note_txt'} <a href="javascript:void(0);" class="addPlaceholder">[SERVERNAME]</a>, <a href="javascript:void(0);" class="addPlaceholder">[DATABASENAME]</a> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="webftp_url">{tmpl_var name='webftp_url_txt'}</label> |
| | |
| | | $app->auth->check_module_permissions('admin'); |
| | | |
| | | $app->uses('listform_actions'); |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY username'; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY sys_user.username'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | |
| | |
| | | |
| | | $app->uses('listform_actions'); |
| | | |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY circle_name, circle_id'; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY client_circle.circle_name, client_circle.circle_id'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | $app->tpl->setVar('id',$this->id); |
| | | $app->tpl->setVar('number_records',$number); |
| | | $app->tpl->setLoop('records', $table_list); |
| | | |
| | | //* load language file |
| | |
| | | $tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE db_server = 1 AND mirror_server_id = 0 LIMIT 0,1'); |
| | | $default_dbserver = $app->functions->intval($tmp['server_id']); |
| | | |
| | | $sql = "UPDATE client SET default_mailserver = $default_mailserver, default_webserver = $default_webserver, default_dnsserver = $default_dnsserver, default_dbserver = $default_dbserver WHERE client_id = ".$this->id; |
| | | $sql = "UPDATE client SET default_mailserver = $default_mailserver, default_webserver = $default_webserver, default_dnsserver = $default_dnsserver, default_slave_dnsserver = $default_dnsserver, default_dbserver = $default_dbserver WHERE client_id = ".$this->id; |
| | | $app->db->query($sql); |
| | | |
| | | |
| | |
| | | |
| | | $app->uses('listform_actions'); |
| | | |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY company_name, contact_name, client_id'; |
| | | $app->listform_actions->SQLExtWhere = "limit_client = 0"; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY client.company_name, client.contact_name, client.client_id'; |
| | | $app->listform_actions->SQLExtWhere = "client.limit_client = 0"; |
| | | $app->listform_actions->SQLExtSelect = ', client.country as countryiso'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | if ($this->dataRecord["template_type"] == 'm'){ |
| | | $sql = "SELECT client_id FROM client WHERE template_master = " . $this->id; |
| | | } else { |
| | | $sql = "SELECT client_id FROM client WHERE template_additional LIKE '%/" . $this->id . "/%'"; |
| | | $sql = "SELECT client_id FROM client WHERE template_additional LIKE '%/" . $this->id . "/%' OR template_additional LIKE '" . $this->id . "/%' OR template_additional LIKE '%/" . $this->id . "'";
|
| | | } |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | if (is_array($clients)){ |
| | |
| | | if(!$_SESSION["s"]["user"]["typ"] == 'admin') die('Client-Templates are only for Admins.'); |
| | | |
| | | $app->uses('listform_actions'); |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY template_name'; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY client_template.template_name'; |
| | | $app->listform_actions->onLoad(); |
| | | ?> |
| | |
| | | |
| | | $app->uses('listform_actions'); |
| | | |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY domain'; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY domain.domain'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | ?> |
| | |
| | | 'rows' => '', |
| | | 'cols' => '' |
| | | ), |
| | | 'default_slave_dnsserver' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '1', |
| | | 'datasource' => array ( 'type' => 'CUSTOM', |
| | | 'class'=> 'custom_datasource', |
| | | 'function'=> 'client_servers' |
| | | ), |
| | | 'value' => '', |
| | | 'name' => 'default_slave_dnsserver' |
| | | ), |
| | | 'limit_dns_slave_zone' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'TEXT', |
| | |
| | | 'rows' => '', |
| | | 'cols' => '' |
| | | ), |
| | | 'default_slave_dnsserver' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '1', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE dns_server = 1 AND {AUTHSQL} ORDER BY server_name', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | | 'value' => '' |
| | | ), |
| | | 'limit_dns_slave_zone' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'TEXT', |
| | |
| | | $wb['limit_web_quota_txt'] = 'Webbeschränkung'; |
| | | $wb['limit_traffic_quota_txt'] = 'Trafficbeschränkung'; |
| | | $wb['limit_trafficquota_error_notint'] = 'Trafficbeschränkung muss eine Zahl sein.'; |
| | | $wb['limit_dns_slave_zone_txt'] = 'Max. Anzahl an Zweiter DNS Zonen'; |
| | | $wb['limit_dns_slave_zone_txt'] = 'Max. Anzahl an Secondary DNS Zonen'; |
| | | $wb['limit_webdav_user_txt'] = 'Max. Anzahl an WebDAV Benutzern'; |
| | | $wb['limit_webdav_user_error_notint'] = 'Das WebDAV Benutzer Limit muss eine Zahl sein.'; |
| | | $wb['limit_dns_slave_zone_error_notint'] = 'Das Zweiter DNS Zonen Limit muss eine Zahl sein.'; |
| | | $wb['limit_dns_slave_zone_error_notint'] = 'Das Secondary DNS Zonen Limit muss eine Zahl sein.'; |
| | | $wb['customer_no_txt'] = 'Kundennummer'; |
| | | $wb['vat_id_txt'] = 'USt-ID'; |
| | | $wb['required_fields_txt'] = '* Benötigte Felder'; |
| | |
| | | $wb['aps_limits_txt'] = 'APS Installationsassistent Limits'; |
| | | $wb['limit_aps_txt'] = 'Max. Anzahl an APS-Instanzen'; |
| | | $wb['limit_aps_error_notint'] = 'Das APS Instanzen Limit muss eine Zahl sein.'; |
| | | $wb['default_slave_dnsserver_txt'] = 'Standard Secondary DNS Server'; |
| | | ?> |
| | |
| | | $wb['delete_explanation'] = 'Diese Aktion wird folgende Anzahl an Datensätzen des Kunden löschen'; |
| | | $wb['btn_save_txt'] = 'Kunden löschen'; |
| | | $wb['btn_cancel_txt'] = 'Abbrechen, ohne den Kunden zu löschen'; |
| | | $wb['confirm_client_delete_txt'] = 'Sind Sie sicher, daß Sie den Kunden löschen möchten?'; |
| | | ?> |
| | |
| | | $wb['list_head_txt'] = 'Kundenvorlagen'; |
| | | $wb['template_type_txt'] = 'Typ'; |
| | | $wb['template_name_txt'] = 'Vorlagenname'; |
| | | $wb['template_id_txt'] = 'Template ID'; |
| | | ?> |
| | |
| | | $wb['limit_web_quota_txt'] = 'Speicherplatzbeschränkung'; |
| | | $wb['limit_traffic_quota_txt'] = 'Transfervolumenbeschränkung'; |
| | | $wb['limit_trafficquota_error_notint'] = 'Transfervolumenbeschränkung muss eine Zahl sein.'; |
| | | $wb['limit_dns_slave_zone_txt'] = 'Max. Anzahl an Zweiter DNS Zonen'; |
| | | $wb['limit_dns_slave_zone_error_notint'] = 'Das Zweiter DNS Zonen Limit muss eine Zahl sein.'; |
| | | $wb['limit_dns_slave_zone_txt'] = 'Max. Anzahl an Secondary DNS Zonen'; |
| | | $wb['limit_dns_slave_zone_error_notint'] = 'Das Secondary DNS Zonen Limit muss eine Zahl sein.'; |
| | | $wb['limit_dns_record_error_notint'] = 'Das DNS Eintrag Limit muss eine Zahl sein.'; |
| | | $wb['customer_no_txt'] = 'Kundennummer'; |
| | | $wb['vat_id_txt'] = 'USt-ID'; |
| | |
| | | $wb['aps_limits_txt'] = 'APS Installationsassistent Limits'; |
| | | $wb['limit_aps_txt'] = 'Max. Anzahl an APS-Instanzen'; |
| | | $wb['limit_aps_error_notint'] = 'Das APS Instanzen Limit muss eine Zahl sein.'; |
| | | $wb['default_slave_dnsserver_txt'] = 'Standard Secondary DNS Server'; |
| | | ?> |
| | |
| | | $wb["limit_database_error_notint"] = 'The database limit must be a number.'; |
| | | $wb["limit_cron_error_notint"] = 'The cron limit must be a number.'; |
| | | $wb["limit_cron_error_frequency"] = 'The cron frequency limit must be a number.'; |
| | | $wb["username_error_regex"] = 'The Username contains invalid chracaters.'; |
| | | $wb["username_error_regex"] = 'The Username contains invalid characters.'; |
| | | $wb["template_master_txt"] = 'Master template'; |
| | | $wb["template_additional_txt"] = 'Addon template'; |
| | | $wb["active_template_additional_txt"] = 'Active Addons'; |
| | |
| | | $wb['aps_limits_txt'] = 'APS Installer Limits'; |
| | | $wb['limit_aps_txt'] = 'Max. number of APS instances'; |
| | | $wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; |
| | | $wb["default_slave_dnsserver_txt"] = 'Default Secondary DNS Server'; |
| | | ?> |
| | |
| | | $wb["delete_explanation"] = 'This action will delete the following number of records associated with this client'; |
| | | $wb["btn_save_txt"] = 'Delete the client'; |
| | | $wb["btn_cancel_txt"] = 'Cancel without deleting the client'; |
| | | $wb["confirm_client_delete_txt"] = 'Are you sure you want to delete this client?'; |
| | | ?> |
| | |
| | | $wb["list_head_txt"] = 'Client-Templates'; |
| | | $wb["template_type_txt"] = 'Type'; |
| | | $wb["template_name_txt"] = 'Template name'; |
| | | $wb['template_id_txt'] = 'Template ID'; |
| | | ?> |
| | |
| | | $wb["limit_database_error_notint"] = 'The database limit must be a number.'; |
| | | $wb["limit_cron_error_notint"] = 'The cron limit must be a number.'; |
| | | $wb["limit_cron_error_frequency"] = 'The cron frequency limit must be a number.'; |
| | | $wb["username_error_regex"] = 'The Username contains invalid chracaters.'; |
| | | $wb["username_error_regex"] = 'The Username contains invalid characters.'; |
| | | $wb["template_master_txt"] = 'Master template'; |
| | | $wb["template_additional_txt"] = 'Addon template'; |
| | | $wb["add_additional_template_txt"] = 'Add additional template'; |
| | |
| | | $wb['aps_limits_txt'] = 'APS Installer Limits'; |
| | | $wb['limit_aps_txt'] = 'Max. number of APS instances'; |
| | | $wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; |
| | | $wb["default_slave_dnsserver_txt"] = 'Default Secondary DNS Server'; |
| | | ?> |
| | |
| | | $tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE db_server = 1 LIMIT 0,1'); |
| | | $default_dbserver = $app->functions->intval($tmp['server_id']); |
| | | |
| | | $sql = "UPDATE client SET default_mailserver = $default_mailserver, default_webserver = $default_webserver, default_dnsserver = $default_dnsserver, default_dbserver = $default_dbserver WHERE client_id = ".$this->id; |
| | | $sql = "UPDATE client SET default_mailserver = $default_mailserver, default_webserver = $default_webserver, default_dnsserver = $default_dnsserver, default_slave_dnsserver = $default_dnsserver, default_dbserver = $default_dbserver WHERE client_id = ".$this->id; |
| | | $app->db->query($sql); |
| | | |
| | | parent::onAfterInsert(); |
| | |
| | | |
| | | $app->uses('listform_actions'); |
| | | |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY company_name, contact_name, client_id'; |
| | | $app->listform_actions->SQLExtWhere = "(limit_client > 0 or limit_client = -1)"; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY client.company_name, client.contact_name, client.client_id'; |
| | | $app->listform_actions->SQLExtWhere = "(client.limit_client > 0 or client.limit_client = -1)"; |
| | | $app->listform_actions->SQLExtSelect = ', client.country as countryiso'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | <div class="pnl_formsarea"> |
| | | |
| | | <div id="OKMsg"> |
| | | <tmpl_if name='number_records'> |
| | | <tmpl_var name="delete_explanation">:<br /><br /> |
| | | <tmpl_loop name="records"> |
| | | <tmpl_var name="table">, |
| | | </tmpl_loop> |
| | | </tmpl_else> |
| | | <tmpl_var name="confirm_client_delete_txt"> |
| | | </tmpl_if> |
| | | </div> |
| | | |
| | | <input type="checkbox" name="confirm" value="yes" /> <b><tmpl_var name="confirm_action_txt"></b> |
| | |
| | | <input name="limit_dns_zone" id="limit_dns_zone" value="{tmpl_var name='limit_dns_zone'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="default_slave_dnsserver">{tmpl_var name='default_slave_dnsserver_txt'}</label> |
| | | <select name="default_slave_dnsserver" id="default_slave_dnsserver" class="selectInput"> |
| | | {tmpl_var name='default_slave_dnsserver'} |
| | | </select> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="limit_dns_slave_zone">{tmpl_var name='limit_dns_slave_zone_txt'}</label> |
| | | <input name="limit_dns_slave_zone" id="limit_dns_slave_zone" value="{tmpl_var name='limit_dns_slave_zone'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" /> |
| | | </div> |
| | |
| | | .find('div.pnl_formsarea') |
| | | .find('fieldset') |
| | | .find('input,select,button') |
| | | .not('#template_master,#template_additional') |
| | | .not('#template_master,#template_additional,#default_mailserver,#default_webserver,#default_dbserver,#default_dnsserver,#default_slave_dnsserver') |
| | | .click(function(e) { |
| | | if(custom_template_selected()) return true; |
| | | e.preventDefault(); |
| | |
| | | <thead> |
| | | <tr> |
| | | <th class="tbl_col_domain" scope="col"><tmpl_var name="domain_txt"></th> |
| | | <th class="tbl_col_sys_groupid" scope="col"><tmpl_var name="user_txt">A</th> |
| | | <th class="tbl_col_sys_groupid" scope="col"><tmpl_var name="user_txt"></th> |
| | | <th class="tbl_col_limit" scope="col">{tmpl_var name='search_limit'}</th> |
| | | </tr> |
| | | <tr> |
| | |
| | | <label for="limit_dns_zone">{tmpl_var name='limit_dns_zone_txt'}</label> |
| | | <input name="limit_dns_zone" id="limit_dns_zone" value="{tmpl_var name='limit_dns_zone'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="default_slave_dnsserver">{tmpl_var name='default_slave_dnsserver_txt'}</label> |
| | | <select name="default_slave_dnsserver" id="default_slave_dnsserver" class="selectInput"> |
| | | {tmpl_var name='default_slave_dnsserver'} |
| | | </select> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="limit_dns_slave_zone">{tmpl_var name='limit_dns_slave_zone_txt'}</label> |
| | | <input name="limit_dns_slave_zone" id="limit_dns_slave_zone" value="{tmpl_var name='limit_dns_slave_zone'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" /> |
| | |
| | | |
| | | /* Which dashlets in which column */ |
| | | /******************************************************************************/ |
| | | $leftcol_dashlets = array('modules','invoices'); |
| | | $leftcol_dashlets = array('modules','invoices','quota','mailquota'); |
| | | $rightcol_dashlets = array('limits'); |
| | | /******************************************************************************/ |
| | | |
New file |
| | |
| | | <?php
|
| | |
|
| | | class dashlet_mailquota {
|
| | | |
| | | function show() {
|
| | | global $app, $conf;
|
| | | |
| | | //* Loading Template
|
| | | $app->uses('tpl');
|
| | | |
| | | $tpl = new tpl;
|
| | | $tpl->newTemplate("dashlets/templates/mailquota.htm");
|
| | | |
| | | $wb = array();
|
| | | $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_mailquota.lng';
|
| | | if(is_file($lng_file)) include($lng_file);
|
| | | $tpl->setVar($wb);
|
| | | |
| | | $tmp_rec = $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'email_quota' ORDER BY created DESC");
|
| | | $monitor_data = array();
|
| | | if(is_array($tmp_rec)) {
|
| | | foreach ($tmp_rec as $tmp_mon) {
|
| | | //$monitor_data = array_merge_recursive($monitor_data,unserialize($app->db->unquote($tmp_mon['data'])));
|
| | | $tmp_array = unserialize($app->db->unquote($tmp_mon['data']));
|
| | | if(is_array($tmp_array)) {
|
| | | foreach($tmp_array as $username => $data) {
|
| | | if(!$monitor_data[$username]['used']) $monitor_data[$username]['used'] = $data['used'];
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | //print_r($monitor_data);
|
| | | if($_SESSION["s"]["user"]["typ"] != 'admin'){
|
| | | $sql_where = " AND sys_groupid = ".$_SESSION['s']['user']['default_group'];
|
| | | }
|
| | | |
| | | $has_mailquota = false;
|
| | | // select email accounts belonging to client
|
| | | $emails = $app->db->queryAllRecords("SELECT * FROM mail_user WHERE 1".$sql_where);
|
| | | //print_r($emails);
|
| | | if(is_array($emails) && !empty($emails)){
|
| | | for($i=0;$i<sizeof($emails);$i++){
|
| | | $email = $emails[$i]['email'];
|
| | | |
| | | $emails[$i]['used'] = isset($monitor_data[$email]['used']) ? $monitor_data[$email]['used'] : array(1 => 0);
|
| | | |
| | | if (!is_numeric($emails[$i]['used'])) $emails[$i]['used']=$emails[$i]['used'][1];
|
| | | |
| | | // colours
|
| | | $emails[$i]['display_colour'] = '#000000';
|
| | | if($emails[$i]['quota'] > 0){
|
| | | $used_ratio = $emails[$i]['used']/$emails[$i]['quota'];
|
| | | } else {
|
| | | $used_ratio = 0;
|
| | | }
|
| | | if($used_ratio >= 0.8) $emails[$i]['display_colour'] = '#fd934f';
|
| | | if($used_ratio >= 1) $emails[$i]['display_colour'] = '#cc0000';
|
| | |
|
| | | if($emails[$i]['quota'] == 0){
|
| | | $emails[$i]['quota'] = $app->lng('unlimited');
|
| | | } else {
|
| | | $emails[$i]['quota'] = round($emails[$i]['quota'] / 1048576,4).' MB';
|
| | | }
|
| | |
|
| | |
|
| | | if($emails[$i]['used'] < 1544000) {
|
| | | $emails[$i]['used'] = round($emails[$i]['used'] / 1024,4).' KB';
|
| | | } else {
|
| | | $emails[$i]['used'] = round($emails[$i]['used'] / 1048576,4).' MB';
|
| | | } |
| | | |
| | | }
|
| | | $has_mailquota = true;
|
| | | $tpl->setloop('mailquota', $emails);
|
| | | }
|
| | | //print_r($sites);
|
| | | |
| | | $tpl->setVar('has_mailquota',$has_mailquota);
|
| | | |
| | | return $tpl->grab();
|
| | | |
| | | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | ?> |
New file |
| | |
| | | <?php
|
| | |
|
| | | class dashlet_quota {
|
| | | |
| | | function show() {
|
| | | global $app, $conf;
|
| | | |
| | | //* Loading Template
|
| | | $app->uses('tpl');
|
| | | |
| | | $tpl = new tpl;
|
| | | $tpl->newTemplate("dashlets/templates/quota.htm");
|
| | | |
| | | $wb = array();
|
| | | $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_quota.lng';
|
| | | if(is_file($lng_file)) include($lng_file);
|
| | | $tpl->setVar($wb);
|
| | | |
| | | $tmp_rec = $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'harddisk_quota' ORDER BY created DESC");
|
| | | $monitor_data = array();
|
| | | if(is_array($tmp_rec)) {
|
| | | foreach ($tmp_rec as $tmp_mon) {
|
| | | $monitor_data = array_merge_recursive($monitor_data,unserialize($app->db->unquote($tmp_mon['data'])));
|
| | | }
|
| | | }
|
| | | //print_r($monitor_data);
|
| | | if($_SESSION["s"]["user"]["typ"] != 'admin'){
|
| | | $sql_where = " AND sys_groupid = ".$_SESSION['s']['user']['default_group'];
|
| | | }
|
| | | |
| | | $has_quota = false;
|
| | | // select websites belonging to client
|
| | | $sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y'".$sql_where);
|
| | | //print_r($sites);
|
| | | if(is_array($sites) && !empty($sites)){
|
| | | for($i=0;$i<sizeof($sites);$i++){
|
| | | $username = $sites[$i]['system_user'];
|
| | | $sites[$i]['used'] = $monitor_data['user'][$username]['used'];
|
| | | $sites[$i]['soft'] = $monitor_data['user'][$username]['soft'];
|
| | | $sites[$i]['hard'] = $monitor_data['user'][$username]['hard'];
|
| | | $sites[$i]['files'] = $monitor_data['user'][$username]['files'];
|
| | | |
| | | if (!is_numeric($sites[$i]['used'])){
|
| | | if ($sites[$i]['used'][0] > $sites[$i]['used'][1]){
|
| | | $sites[$i]['used'] = $sites[$i]['used'][0];
|
| | | } else {
|
| | | $sites[$i]['used'] = $sites[$i]['used'][1];
|
| | | }
|
| | | }
|
| | | if (!is_numeric($sites[$i]['soft'])) $sites[$i]['soft']=$sites[$i]['soft'][1];
|
| | | if (!is_numeric($sites[$i]['hard'])) $sites[$i]['hard']=$sites[$i]['hard'][1];
|
| | | if (!is_numeric($sites[$i]['files'])) $sites[$i]['files']=$sites[$i]['files'][1];
|
| | | |
| | | // colours
|
| | | $sites[$i]['display_colour'] = '#000000';
|
| | | if($sites[$i]['soft'] > 0){
|
| | | $used_ratio = $sites[$i]['used']/$sites[$i]['soft'];
|
| | | } else {
|
| | | $used_ratio = 0;
|
| | | }
|
| | | if($used_ratio >= 0.8) $sites[$i]['display_colour'] = '#fd934f';
|
| | | if($used_ratio >= 1) $sites[$i]['display_colour'] = '#cc0000';
|
| | | |
| | | if($sites[$i]['used'] > 1024) {
|
| | | $sites[$i]['used'] = round($sites[$i]['used'] / 1024,2).' MB';
|
| | | } else {
|
| | | if ($sites[$i]['used'] != '') $sites[$i]['used'] .= ' KB';
|
| | | }
|
| | | |
| | | if($sites[$i]['soft'] > 1024) {
|
| | | $sites[$i]['soft'] = round($sites[$i]['soft'] / 1024,2).' MB';
|
| | | } else {
|
| | | $sites[$i]['soft'] .= ' KB';
|
| | | }
|
| | | |
| | | if($sites[$i]['hard'] > 1024) {
|
| | | $sites[$i]['hard'] = round($sites[$i]['hard'] / 1024,2).' MB';
|
| | | } else {
|
| | | $sites[$i]['hard'] .= ' KB';
|
| | | }
|
| | | |
| | | if($sites[$i]['soft'] == " KB") $sites[$i]['soft'] = $app->lng('unlimited');
|
| | | if($sites[$i]['hard'] == " KB") $sites[$i]['hard'] = $app->lng('unlimited');
|
| | | |
| | | |
| | | /*
|
| | | if(!strstr($sites[$i]['used'],'M') && !strstr($sites[$i]['used'],'K')) $sites[$i]['used'].= ' B';
|
| | | if(!strstr($sites[$i]['soft'],'M') && !strstr($sites[$i]['soft'],'K')) $sites[$i]['soft'].= ' B';
|
| | | if(!strstr($sites[$i]['hard'],'M') && !strstr($sites[$i]['hard'],'K')) $sites[$i]['hard'].= ' B';
|
| | | */
|
| | | |
| | | if($sites[$i]['soft'] == '0 B' || $sites[$i]['soft'] == '0 KB' || $sites[$i]['soft'] == '0') $sites[$i]['soft'] = $app->lng('unlimited');
|
| | | if($sites[$i]['hard'] == '0 B' || $sites[$i]['hard'] == '0 KB' || $sites[$i]['hard'] == '0') $sites[$i]['hard'] = $app->lng('unlimited');
|
| | | |
| | | }
|
| | | $has_quota = true;
|
| | | $tpl->setloop('quota', $sites);
|
| | | }
|
| | | //print_r($sites);
|
| | | |
| | | $tpl->setVar('has_quota',$has_quota);
|
| | | |
| | | return $tpl->grab();
|
| | | |
| | | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | ?> |
New file |
| | |
| | | <div style="float: left;"> |
| | | <h2>{tmpl_var name='mailquota_txt'}</h2> |
| | | <div style="width:320px;"> |
| | | <table class="list"> |
| | | <thead> |
| | | <tr> |
| | | <td>{tmpl_var name='email_txt'}</td> |
| | | <td>{tmpl_var name='name_txt'}</td> |
| | | <td>{tmpl_var name='used_txt'}</td> |
| | | <td>{tmpl_var name='quota_txt'}</td> |
| | | </tr> |
| | | </thead> |
| | | <tmpl_if name="has_mailquota"> |
| | | <tmpl_loop name='mailquota'> |
| | | <tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>"> |
| | | <td style="color:{tmpl_var name='display_colour'}">{tmpl_var name='email'}</td> |
| | | <td style="color:{tmpl_var name='display_colour'}">{tmpl_var name='name'}</td> |
| | | <td style="color:{tmpl_var name='display_colour'}">{tmpl_var name='used'}</td> |
| | | <td style="color:{tmpl_var name='display_colour'}">{tmpl_var name='quota'}</td> |
| | | </tr> |
| | | </tmpl_loop> |
| | | <tmpl_else> |
| | | <tr> |
| | | <td colspan="4" style="text-align:center;">{tmpl_var name='no_email_accounts_txt'}</td> |
| | | </tr> |
| | | </tmpl_if> |
| | | </table> |
| | | </div> |
| | | </div> |
New file |
| | |
| | | <div style="float: left;"> |
| | | <h2>{tmpl_var name='quota_txt'}</h2> |
| | | <div style="width:320px;"> |
| | | <table class="list"> |
| | | <thead> |
| | | <tr> |
| | | <td>{tmpl_var name='domain_txt'}</td> |
| | | <td>{tmpl_var name='used_txt'}</td> |
| | | <td>{tmpl_var name='soft_txt'}</td> |
| | | <td>{tmpl_var name='hard_txt'}</td> |
| | | </tr> |
| | | </thead> |
| | | <tmpl_if name="has_quota"> |
| | | <tmpl_loop name='quota'> |
| | | <tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>"> |
| | | <td style="color:{tmpl_var name='display_colour'}">{tmpl_var name='domain'}</td> |
| | | <td style="color:{tmpl_var name='display_colour'}">{tmpl_var name='used'}</td> |
| | | <td style="color:{tmpl_var name='display_colour'}">{tmpl_var name='soft'}</td> |
| | | <td style="color:{tmpl_var name='display_colour'}">{tmpl_var name='hard'}</td> |
| | | </tr> |
| | | </tmpl_loop> |
| | | <tmpl_else> |
| | | <tr> |
| | | <td colspan="4" style="text-align:center;">{tmpl_var name='no_sites_txt'}</td> |
| | | </tr> |
| | | </tmpl_if> |
| | | </table> |
| | | </div> |
| | | </div> |
New file |
| | |
| | | <?php |
| | | $wb["mailquota_txt"] = 'Mailbox-Speicherplatz'; |
| | | $wb["email_txt"] = 'E-Mail-Adresse'; |
| | | $wb["name_txt"] = 'Name'; |
| | | $wb["used_txt"] = 'Verwendet'; |
| | | $wb["quota_txt"] = 'Verfügbar'; |
| | | $wb["no_email_accounts_txt"] = 'Kein E-Mail-Konto gefunden.'; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["quota_txt"] = 'Webseiten-Speicherplatz'; |
| | | $wb["domain_txt"] = 'Domain / Webseite'; |
| | | $wb["used_txt"] = 'Verwendet'; |
| | | $wb["hard_txt"] = 'Hard Limit'; |
| | | $wb["soft_txt"] = 'Soft Limit'; |
| | | $wb["no_sites_txt"] = 'Keine Webseite gefunden.'; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["mailquota_txt"] = 'Mailbox Quota'; |
| | | $wb["email_txt"] = 'Email Address'; |
| | | $wb["name_txt"] = 'Name'; |
| | | $wb["used_txt"] = 'Used Space'; |
| | | $wb["quota_txt"] = 'Quota'; |
| | | $wb["no_email_accounts_txt"] = 'No email accounts found.'; |
| | | ?> |
New file |
| | |
| | | <?php |
| | | $wb["quota_txt"] = 'Website Harddisk Quota'; |
| | | $wb["domain_txt"] = 'Domain / Website'; |
| | | $wb["used_txt"] = 'Used space'; |
| | | $wb["hard_txt"] = 'Hard limit'; |
| | | $wb["soft_txt"] = 'Soft limit'; |
| | | $wb["no_sites_txt"] = 'No web sites found.'; |
| | | ?> |
| | |
| | | <div style="float:left; width:350px;"> |
| | | <tmpl_loop name='leftcol'> |
| | | {tmpl_var name='content'} |
| | | <p> </p> |
| | | <tmpl_if name='content'> |
| | | <p style="clear:left"> </p> |
| | | </tmpl_if> |
| | | </tmpl_loop> |
| | | </div> |
| | | <div style="float:left; width:350px;"> |
| | | <tmpl_loop name='rightcol'> |
| | | {tmpl_var name='content'} |
| | | <tmpl_if name='content'> |
| | | <p> </p> |
| | | </tmpl_if> |
| | | </tmpl_loop> |
| | | </div> |
| | | </div> |
| | |
| | | $app->auth->check_module_permissions('dns'); |
| | | |
| | | $app->uses('listform_actions'); |
| | | $app->listform_actions->SQLExtWhere = "type = 'A'"; |
| | | $app->listform_actions->SQLExtWhere = "dns_rr.type = 'A'"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | $app->tpl->setVar("server_id",$server_id_option); |
| | | |
| | | // load the list of clients |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = ''; |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>"; |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = ($client["groupid"] == $sys_groupid)?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | |
| | | |
| | | // load the list of clients |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>'; |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = ($client["groupid"] == $sys_groupid)?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | |
| | |
| | | // If user is admin, we will allow him to select to whom this record belongs |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') { |
| | | // Getting Domains of the user |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = ''; |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>"; |
| | |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, sys_group.name, client.contact_name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, sys_group.name, client.contact_name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>'; |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin') { |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_slave_zone, default_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT limit_dns_slave_zone, default_slave_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | |
| | | // When the record is updated |
| | | if($this->id > 0) { |
| | |
| | | // When the record is inserted |
| | | } else { |
| | | // set the server ID to the default dnsserver of the client |
| | | $this->dataRecord["server_id"] = $client["default_dnsserver"]; |
| | | $this->dataRecord["server_id"] = $client["default_slave_dnsserver"]; |
| | | |
| | | // Check if the user may add anoter secondary domain. |
| | | if(!$app->tform->checkClientLimit('limit_dns_slave_zone')) { |
| | |
| | | $app->auth->check_module_permissions('dns'); |
| | | |
| | | $app->uses('listform_actions'); |
| | | // $app->listform_actions->SQLExtWhere = "access = 'REJECT'"; |
| | | // $app->listform_actions->SQLExtWhere = "dns_slave.access = 'REJECT'"; |
| | | |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY origin'; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY dns_slave.origin'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | |
| | |
| | | // If user is admin, we will allow him to select to whom this record belongs |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') { |
| | | // Getting Domains of the user |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = ''; |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>"; |
| | |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>'; |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | $this->dataRecord["mbox"] = str_replace('@','.',$this->dataRecord["mbox"]); |
| | | } |
| | | |
| | | $this->dataRecord["xfer"] = preg_replace('/\s+/', '', $this->dataRecord["xfer"]); |
| | | $this->dataRecord["also_notify"] = preg_replace('/\s+/', '', $this->dataRecord["also_notify"]); |
| | | |
| | | //* Check if a secondary zone with the same name already exists |
| | | $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_slave WHERE origin = \"".$this->dataRecord["origin"]."\" AND server_id = \"".$this->dataRecord["server_id"]."\""); |
| | | if($tmp["number"] > 0) { |
| | |
| | | $app->auth->check_module_permissions('dns'); |
| | | |
| | | $app->uses('listform_actions'); |
| | | // $app->listform_actions->SQLExtWhere = "access = 'REJECT'"; |
| | | // $app->listform_actions->SQLExtWhere = "dns_soa.access = 'REJECT'"; |
| | | |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY origin'; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY dns_soa.origin'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | |
| | |
| | | // Split the 3 parts of the SRV Record apart |
| | | $split = explode(' ', $this->dataRecord['data']); |
| | | |
| | | // Weight |
| | | $this->dataRecord['weight'] = $split[0]; |
| | | |
| | | // Port |
| | | $this->dataRecord['port'] = $split[1]; |
| | | |
| | | // Target |
| | | $this->dataRecord['target'] = $split[2]; |
| | | |
| | | // Bind the new datarecord to the template |
| | | $app->tpl->setVar($this->dataRecord); |
| | | $app->tpl->setVar('weight', $split[0]); |
| | | $app->tpl->setVar('port', $split[1]); |
| | | $app->tpl->setVar('target', $split[2]); |
| | | |
| | | parent::onShowEnd(); |
| | | } |
| | |
| | | $app->auth->check_module_permissions('dns'); |
| | | |
| | | $app->uses('listform_actions'); |
| | | // $app->listform_actions->SQLExtWhere = "access = 'REJECT'"; |
| | | // $app->listform_actions->SQLExtWhere = "dns_template.access = 'REJECT'"; |
| | | |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY name'; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY dns_template.name'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | |
| | |
| | | $app->tpl->setVar("server_id",$server_id_option); |
| | | |
| | | // load the list of clients |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = ''; |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>"; |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = ($client["groupid"] == $sys_groupid)?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | |
| | | |
| | | // load the list of clients |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>'; |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = ($client["groupid"] == $sys_groupid)?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | |
| | |
| | | $res = $app->db->queryOneRecord("SELECT MIN(hfs_id) AS min_id FROM help_faq_sections"); |
| | | $hf_section = $res['min_id']; |
| | | } |
| | | $app->listform_actions->SQLExtWhere = "hf_section = $hf_section"; |
| | | $app->listform_actions->SQLExtWhere = "help_faq.hf_section = $hf_section"; |
| | | |
| | | |
| | | if($hf_section) $res = $app->db->queryOneRecord("SELECT hfs_name FROM help_faq_sections WHERE hfs_id=$hf_section"); |
| | |
| | | 'formtype' => 'SELECT', |
| | | 'default' => $sm_default_recipient_id, |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => "SELECT sys_user.userid, CONCAT(sys_user.username,' :: ',client.company_name,' :: ',client.contact_name) as contactname FROM sys_user, client WHERE sys_user.userid != 1 AND sys_user.client_id = client.client_id AND $authsql ORDER BY sys_user.username", |
| | | 'querystring' => "SELECT sys_user.userid, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_user, client WHERE sys_user.userid != 1 AND sys_user.client_id = client.client_id AND $authsql ORDER BY sys_user.username", |
| | | 'keyfield' => 'userid', |
| | | 'valuefield' => 'contactname' |
| | | ), |
| | |
| | | $wb['message_txt'] = 'Nachricht'; |
| | | $wb['tstamp_txt'] = 'Zeitpunkt'; |
| | | $wb['reply_txt'] = 'Antworten'; |
| | | $wb['date_txt'] = 'Datum'; |
| | | $wb['support_request_subject_txt'] = 'Supportanfrage'; |
| | | $wb['support_request_txt'] = 'Sie haben eine Supportanfrage erhalten. Bitte antworten Sie nicht auf diese Email, sondern bearbeiten Sie die Supportanfrage in ISPConfig.'; |
| | | $wb['answer_to_support_request_txt'] = 'Sie haben eine Antwort auf Ihre Supportanfrage erhalten. Bitte antworten Sie nicht auf diese Email, sondern bearbeiten Sie die Nachricht in ISPConfig.'; |
| | | $wb['answer_to_support_request_sent_txt'] = 'Ihre Antwort auf die Supportanfrage ist verschickt worden. Bitte antworten Sie nicht auf diese Email.'; |
| | | $wb['support_request_sent_txt'] = 'Ihre Supportanfrage ist verschickt worden. Bitte antworten Sie nicht auf diese Email.'; |
| | | $wb['recipient_or_sender_email_address_not_valid_txt'] = 'Die Nachricht konnte nicht verschickt werden, da die Empfänger- und/oder die Sender-Email-Adresse nicht gültig ist.'; |
| | | ?> |
| | |
| | | $wb['sender_id_txt'] = 'Absender'; |
| | | $wb['subject_txt'] = 'Betreff'; |
| | | $wb['add_new_record_txt'] = 'Neue Supportnachricht erstellen'; |
| | | $wb['date_txt'] = 'Datum'; |
| | | ?> |
| | |
| | | $wb['message_txt'] = 'Message'; |
| | | $wb['tstamp_txt'] = 'Timestamp'; |
| | | $wb['reply_txt'] = 'Reply'; |
| | | $wb['date_txt'] = 'Date'; |
| | | $wb['support_request_subject_txt'] = 'Support Request'; |
| | | $wb['support_request_txt'] = 'You have got a support request. Please don\'t reply to this email, but process the support request inside ISPConfig.'; |
| | | $wb['answer_to_support_request_txt'] = 'You have got a reply to your support request. Please don\'t reply to this email, but process the message inside ISPConfig.'; |
| | | $wb['answer_to_support_request_sent_txt'] = 'Your reply to the support request has been sent. Please don\'t reply to this email.'; |
| | | $wb['support_request_sent_txt'] = 'Your support request has been sent. Please don\'t reply to this email.'; |
| | | $wb['recipient_or_sender_email_address_not_valid_txt'] = 'The message could not be sent because the recipient and/or the sender email address is not valid.'; |
| | | ?> |
| | |
| | | $wb['sender_id_txt'] = 'Sender'; |
| | | $wb['subject_txt'] = 'Subject'; |
| | | $wb["add_new_record_txt"] = 'Create new support message'; |
| | | $wb['date_txt'] = 'Date'; |
| | | ?> |
| | |
| | | 'suffix' => '%', |
| | | 'width' => '', |
| | | 'value' => ''); |
| | | |
| | | $liste['item'][] = array( 'field' => 'tstamp', |
| | | 'datatype' => 'DATETIMETSTAMP', |
| | | 'formtype' => 'TEXT', |
| | | 'op' => '=', |
| | | 'prefix' => '', |
| | | 'suffix' => '', |
| | | 'width' => '', |
| | | 'value' => ''); |
| | | |
| | | |
| | | ?> |
| | |
| | | //* Set the sender_id field to the ID of the current user |
| | | $this->dataRecord['sender_id'] = $_SESSION['s']['user']['userid']; |
| | | |
| | | //* Get recipient email address |
| | | if($this->dataRecord['recipient_id'] > 1){ |
| | | $sql = "SELECT client.email FROM sys_user, client WHERE sys_user.userid = ".$this->dataRecord['recipient_id']." AND sys_user.client_id = client.client_id"; |
| | | $client = $app->db->queryOneRecord($sql); |
| | | $recipient_email = $client['email']; |
| | | } else { |
| | | $app->uses('ini_parser,getconf'); |
| | | $system_config_mail_settings = $app->getconf->get_global_config('mail'); |
| | | $recipient_email = $system_config_mail_settings['admin_mail']; |
| | | } |
| | | |
| | | //* Get sender email address |
| | | if($this->dataRecord['sender_id'] > 1){ |
| | | $sql = "SELECT client.email FROM sys_user, client WHERE sys_user.userid = ".$this->dataRecord['sender_id']." AND sys_user.client_id = client.client_id"; |
| | | $client = $app->db->queryOneRecord($sql); |
| | | $sender_email = $client['email']; |
| | | } else { |
| | | $app->uses('ini_parser,getconf'); |
| | | $system_config_mail_settings = $app->getconf->get_global_config('mail'); |
| | | $sender_email = $system_config_mail_settings['admin_mail']; |
| | | } |
| | | |
| | | $email_regex = '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i'; |
| | | if(preg_match($email_regex, $sender_email, $match) && preg_match($email_regex, $recipient_email, $match)){ |
| | | $subject = $app->tform->lng('support_request_subject_txt').': '.$this->dataRecord['subject']; |
| | | if($this->dataRecord['recipient_id'] == 1){ |
| | | $message = $app->tform->lng('support_request_txt'); |
| | | } else { |
| | | $message = $app->tform->lng('answer_to_support_request_txt'); |
| | | } |
| | | $message .= "\n\n".$app->tform->lng('message_txt').": \"".$this->dataRecord['message']."\""; |
| | | $message .= "\n\nISPConfig: ".($_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://').$_SERVER['HTTP_HOST']; |
| | | $app->functions->mail($recipient_email, $subject, $message, $sender_email); |
| | | |
| | | //* Send confirmation email to sender |
| | | if($this->dataRecord['sender_id'] == 1){ |
| | | $confirmation_message = $app->tform->lng('answer_to_support_request_sent_txt'); |
| | | } else { |
| | | $confirmation_message = $app->tform->lng('support_request_sent_txt'); |
| | | } |
| | | $confirmation_message .= "\n\n".$app->tform->lng('message_txt').": \"".$this->dataRecord['message']."\""; |
| | | $confirmation_message .= "\n\nISPConfig: ".($_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://').$_SERVER['HTTP_HOST']; |
| | | $app->functions->mail($sender_email, $subject, $confirmation_message, $recipient_email); |
| | | } else { |
| | | $app->tform->errorMessage .= $app->tform->lng("recipient_or_sender_email_address_not_valid_txt")."<br />"; |
| | | } |
| | | |
| | | //* call the onSubmit function of the parent class |
| | | parent::onSubmit(); |
| | | } |
| | |
| | | //* read only template if a existing message is loaded |
| | | if($this->id > 0) { |
| | | $app->tform->formDef['tabs']['message']['template'] = 'templates/support_message_view.htm'; |
| | | $record = $app->db->queryOneRecord("SELECT * FROM support_message WHERE support_message_id = ".$this->id); |
| | | if ($record['tstamp'] > 0) { |
| | | // is value int? |
| | | if (preg_match("/^[0-9]+[\.]?[0-9]*$/", $record['tstamp'], $p)) { |
| | | $record['tstamp'] = date($app->lng('conf_format_datetime'), $record['tstamp']); |
| | | } else { |
| | | $record['tstamp'] = date($app->lng('conf_format_datetime'), strtotime($record['tstamp'])); |
| | | } |
| | | } |
| | | $app->tpl->setVar("date", $record['tstamp']); |
| | | //die(print_r($this->dataRecord)); |
| | | } |
| | | |
| | | //* call the onShow function of the parent class |
| | |
| | | $app->uses('listform_actions'); |
| | | |
| | | //* Optional limit |
| | | $app->listform_actions->SQLExtWhere = "recipient_id = ".$_SESSION['s']['user']['userid']; |
| | | $app->listform_actions->SQLExtWhere = "support_message.recipient_id = ".$_SESSION['s']['user']['userid']; |
| | | |
| | | //* Start the form rendering and action ahndling |
| | | $app->listform_actions->onLoad(); |
| | |
| | | <tr class="caption"> |
| | | <th class="tbl_col_sender_id" scope="col"><tmpl_var name="sender_id_txt"></th> |
| | | <th class="tbl_col_subject" scope="col"><tmpl_var name="subject_txt"></th> |
| | | <th class="tbl_col_tstamp" scope="col"><tmpl_var name="date_txt"></th> |
| | | <th class="tbl_col_limit" scope="col">{tmpl_var name='search_limit'}</th> |
| | | </tr> |
| | | <tr class="filter"> |
| | | <td class="tbl_col_sender_id"><select name="search_sender_id">{tmpl_var name='search_sender_id'}</select></td> |
| | | <td class="tbl_col_subject"><input type="text" name="search_subject" value="{tmpl_var name='search_subject'}" /></td> |
| | | <td class="tbl_col_tstamp"> </td> |
| | | <td class="tbl_col_buttons"> |
| | | <button type="button" class="button icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onclick="submitForm('pageForm','help/support_message_list.php');"><span>{tmpl_var name="filter_txt"}</span></button> |
| | | </td> |
| | |
| | | <tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>"> |
| | | <td class="tbl_col_sender_id"><a href="#" onclick="loadContent('help/support_message_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="sender_id"}</a></td> |
| | | <td class="tbl_col_subject"><a href="#" onclick="loadContent('help/support_message_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="subject"}</a></td> |
| | | <td class="tbl_col_tstamp"><a href="#" onclick="loadContent('help/support_message_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="tstamp"}</a></td> |
| | | <td class="tbl_col_buttons"> |
| | | <a class="button icons16 icoDelete" href="javascript: del_record('help/support_message_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span>{tmpl_var name='delete_txt'}</span></a> |
| | | </td> |
| | |
| | | </tmpl_loop> |
| | | <tmpl_unless name="records"> |
| | | <tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>"> |
| | | <td colspan="3">{tmpl_var name='globalsearch_noresults_text_txt'}</td> |
| | | <td colspan="4">{tmpl_var name='globalsearch_noresults_text_txt'}</td> |
| | | </tr> |
| | | </tmpl_unless> |
| | | </tbody> |
| | | <tfoot> |
| | | <tr> |
| | | <td class="tbl_footer tbl_paging" colspan="3"><tmpl_var name="paging"></td> |
| | | <td class="tbl_footer tbl_paging" colspan="4"><tmpl_var name="paging"></td> |
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | |
| | | <label for="message">{tmpl_var name='message_txt'}</label> |
| | | <p>{tmpl_var name='message'}</p> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="message">{tmpl_var name='date_txt'}</label> |
| | | <p>{tmpl_var name='date'}</p> |
| | | </div> |
| | | </fieldset> |
| | | <div class="buttonHolder buttons"> |
| | | <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='reply_txt'}" onclick="loadContent('help/support_message_edit.php?reply={tmpl_var name='id'}');"><span>{tmpl_var name='reply_txt'}</span></button> |
| | |
| | | internal = false; |
| | | return; |
| | | } |
| | | var matcher = new RegExp( "" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "", "i" ), |
| | | matchtext = $(this).val(); |
| | | var matchtext = $(this).val().toLowerCase(); |
| | | valid = false, |
| | | selected = false; |
| | | selected = false, |
| | | selected_val = ""; |
| | | select.children( "option" ).each(function() { |
| | | if( (($(this).val() == "" && matchtext == "") || $( this ).text().match( matcher )) && $(this).css('display') != 'none' ) { |
| | | 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($(this).val()).autocomplete('option','select').call(input, (e ? e : {target: select}), { item: { option: selected.get(0), internal: true } }); |
| | | input.val(selected_val).autocomplete('option','select').call(input, (e ? e : {target: select}), { item: { option: selected.get(0), internal: true } }); |
| | | }); |
| | | |
| | | $( "<a>" ) |
| | |
| | | <?php |
| | | session_start(); |
| | | include('../../lib/config.inc.php'); |
| | | header('Content-Type: text/javascript; charset=utf-8'); // the config file sets the content type header so we have to override it here! |
| | | require_once('../../lib/app.inc.php'); |
| | | $lang = (isset($_SESSION['s']['language']) && $_SESSION['s']['language'] != '')?$_SESSION['s']['language']:'en'; |
| | | include_once(ISPC_ROOT_PATH.'/web/strengthmeter/lib/lang/'.$lang.'_strengthmeter.lng'); |
| | |
| | | $wb['email_txt'] = 'E-Mail'; |
| | | $wb['error_maintenance_mode'] = 'Diese ISPConfig Installation wird gerade gewartet. Wir sind in Kürze wieder für Sie da. Vielen Dank für Ihre Geduld.'; |
| | | $wb['theme_not_compatible'] = 'Das gewählte Design ist mit dieser ISPConfig Version nicht kompatibel. Bitte prüfen Sie, ob ein Update des Themes verfügbar ist.<br />Es wurde nun automatisch das Standard Design aktiviert.'; |
| | | $wb['back_txt'] = 'Zurück'; |
| | | ?> |
| | |
| | | $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.'; |
| | | |
| | |
| | | <input type="hidden" name="s_pg" value="index" /> |
| | | |
| | | <div class="buttonHolder buttons"> |
| | | <button class="positive iconstxt icoKey" type="button" value="{tmpl_var name="add_new_record_txt"}" onclick="submitLoginForm('pageForm');"><span>{tmpl_var name='login_button_txt'}</span></button> |
| | | <button class="positive iconstxt icoKey" type="button" value="{tmpl_var name='add_new_record_txt'}" onclick="submitLoginForm('pageForm');"><span>{tmpl_var name='login_button_txt'}</span></button> |
| | | <button class="negative iconstxt icoKey" type="button" value="{tmpl_var name='pw_lost_txt'}" onclick="loadContent('login/password_reset.php');"><span>{tmpl_var name='pw_lost_txt'}</span></button> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <input type="hidden" name="s_pg" value="index" /> |
| | | |
| | | <div class="buttonHolder buttons"> |
| | | <button class="positive" type="button" value="{tmpl_var name="add_new_record_txt"}" onclick="submitForm('pageForm','login/password_reset.php');"><span>{tmpl_var name='pw_button_txt'}</span></button> |
| | | <button class="positive" type="button" value="{tmpl_var name='pw_button_txt'}" onclick="submitForm('pageForm','login/password_reset.php');"><span>{tmpl_var name='pw_button_txt'}</span></button> |
| | | <button class="negative" type="button" value="{tmpl_var name='back_txt'}" onclick="loadInitContent();"><span>{tmpl_var name='back_txt'}</span></button> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | $wb['spam_tag_level_txt'] = 'SPAM Markierungslevel'; |
| | | $wb['spam_tag2_level_txt'] = 'SPAM Markierungslevel 2'; |
| | | $wb['spam_kill_level_txt'] = 'SPAM Markierungslevel Kill'; |
| | | $wb['spam_dsn_cutoff_level_txt'] = 'SPAM Markierungslevel DNS Cutoff'; |
| | | $wb['spam_dsn_cutoff_level_txt'] = 'SPAM Markierungslevel DSN Cutoff'; |
| | | $wb['spam_quarantine_cutoff_level_txt'] = 'SPAM Markierungslevel Quarantine Cutoff'; |
| | | $wb['spam_modifies_subj_txt'] = 'SPAM ändert Betreff'; |
| | | $wb['spam_subject_tag_txt'] = 'SPAM Betreff Markierung'; |
| | |
| | | $wb['email_txt'] = 'E-Mail (Zeichenkette)'; |
| | | $wb['fullname_txt'] = 'Name'; |
| | | $wb['local_txt'] = 'Lokal'; |
| | | $wb['email_error_notempty'] = 'Die E-Mail-Adresse darf nicht leer sein.'; |
| | | $wb['fullname_error_notempty'] = 'Der Name darf nicht leer sein.'; |
| | | ?> |
| | |
| | | $wb['name_txt'] = 'Name'; |
| | | $wb['email_txt'] = 'E-Mail Adresse'; |
| | | $wb['used_txt'] = 'Verbrauchter Speicherplatz'; |
| | | $wb['percentage_txt'] = 'Verbraucht in %'; |
| | | ?> |
| | |
| | | $wb["email_txt"] = 'Email (Pattern)'; |
| | | $wb["fullname_txt"] = 'Name'; |
| | | $wb["local_txt"] = 'Local'; |
| | | $wb['email_error_notempty'] = 'The email address must not be empty.'; |
| | | $wb['fullname_error_notempty'] = 'The name must not be empty.'; |
| | | ?> |
| | |
| | | $wb["name_txt"] = 'Name'; |
| | | $wb["email_txt"] = 'Email Address'; |
| | | $wb["used_txt"] = 'Used space'; |
| | | $wb["percentage_txt"] = 'Used %'; |
| | | ?> |
| | |
| | | // Enable auth |
| | | $liste["auth"] = "yes"; |
| | | |
| | | // mark columns for php sorting (no real mySQL columns) |
| | | $liste["phpsort"] = array('used_sort', 'percentage_sort'); |
| | | |
| | | /***************************************************** |
| | | * Suchfelder |
| | |
| | | $app->uses('listform_actions'); |
| | | |
| | | // Limit the results to alias domains |
| | | $app->listform_actions->SQLExtWhere = "type = 'alias'"; |
| | | $app->listform_actions->SQLExtWhere = "mail_forwarding.type = 'alias'"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | $app->uses('listform_actions'); |
| | | |
| | | // Limit the results to alias domains |
| | | $app->listform_actions->SQLExtWhere = "type = 'aliasdomain'"; |
| | | $app->listform_actions->SQLExtWhere = "mail_forwarding.type = 'aliasdomain'"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | $app->auth->check_module_permissions('mail'); |
| | | |
| | | $app->uses('listform_actions'); |
| | | $app->listform_actions->SQLExtWhere = "access = 'REJECT'"; |
| | | $app->listform_actions->SQLExtWhere = "mail_access.access = 'REJECT'"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | $app->uses('listform_actions'); |
| | | |
| | | // Limit the results to alias domains |
| | | $app->listform_actions->SQLExtWhere = "type = 'catchall'"; |
| | | $app->listform_actions->SQLExtWhere = "mail_forwarding.type = 'catchall'"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') { |
| | | // Getting Clients of the user |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = ''; |
| | |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, client.default_mailserver, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id order by client.contact_name"); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, client.default_mailserver, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id order by client.contact_name"); |
| | | |
| | | // Set the mailserver to the default server of the client |
| | | $tmp = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = $client[default_mailserver]"); |
| | |
| | | unset($tmp); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>'; |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | // Limit the results to alias domains |
| | | // $app->listform_actions->SQLExtWhere = "type = 'local'"; |
| | | |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY domain'; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY mail_domain.domain'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | |
| | |
| | | $app->uses('listform_actions'); |
| | | |
| | | // Limit the results to alias domains |
| | | $app->listform_actions->SQLExtWhere = "type = 'forward'"; |
| | | $app->listform_actions->SQLExtWhere = "mail_forwarding.type = 'forward'"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') { |
| | | // Getting Clients of the user |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = ''; |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>"; |
| | |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = ($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, client.default_mailserver, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id order by contact_name"); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, client.default_mailserver, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id order by contact_name"); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>'; |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | $tmp_data_record = $app->tform->getDataRecord($this->id); |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | } |
| | | |
| | | $list = new list_action; |
| | | $list->SQLOrderBy = 'ORDER BY email'; |
| | | $list->SQLOrderBy = 'ORDER BY mail_user.email'; |
| | | $list->onLoad(); |
| | | |
| | | |
| | |
| | | $rec['id'] = $rec[$this->idx_key]; |
| | | return $rec; |
| | | } |
| | | |
| | | function getQueryString() { |
| | | global $app; |
| | | $sql_where = ''; |
| | | |
| | | //* Generate the search sql |
| | | if($app->listform->listDef['auth'] != 'no') { |
| | | if($_SESSION['s']['user']['typ'] == "admin") { |
| | | $sql_where = ''; |
| | | } else { |
| | | $sql_where = $app->tform->getAuthSQL('r', $app->listform->listDef['table']).' and'; |
| | | //$sql_where = $app->tform->getAuthSQL('r').' and'; |
| | | } |
| | | } |
| | | if($this->SQLExtWhere != '') { |
| | | $sql_where .= ' '.$this->SQLExtWhere.' and'; |
| | | } |
| | | |
| | | $sql_where = $app->listform->getSearchSQL($sql_where); |
| | | if($app->listform->listDef['join_sql']) $sql_where .= ' AND '.$app->listform->listDef['join_sql']; |
| | | $app->tpl->setVar($app->listform->searchValues); |
| | | |
| | | $order_by_sql = $this->SQLOrderBy; |
| | | |
| | | //* Generate SQL for paging |
| | | $limit_sql = $app->listform->getPagingSQL($sql_where); |
| | | $app->tpl->setVar('paging',$app->listform->pagingHTML); |
| | | |
| | | $extselect = ''; |
| | | $join = ''; |
| | | |
| | | if(!empty($_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'])){ |
| | | $order = str_replace(' DESC','',$_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order']); |
| | | list($tmp_table, $order) = explode('.', $order); |
| | | if($order == 'mail_traffic_last_month'){ |
| | | $tmp_date = date('Y-m',mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | $join .= ' INNER JOIN mail_traffic as mt ON '.$app->listform->listDef['table'].'.mailuser_id = mt.mailuser_id '; |
| | | $sql_where .= " AND mt.month like '$tmp_date%'"; |
| | | $order_by_sql = str_replace($app->listform->listDef['table'].'.mail_traffic_last_month','traffic',$order_by_sql); |
| | | } elseif($order == 'mail_traffic_this_month'){ |
| | | $tmp_date = date('Y-m'); |
| | | $join .= ' INNER JOIN mail_traffic as mt ON '.$app->listform->listDef['table'].'.mailuser_id = mt.mailuser_id '; |
| | | $sql_where .= " AND mt.month like '$tmp_date%'"; |
| | | $order_by_sql = str_replace($app->listform->listDef['table'].'.mail_traffic_this_month','traffic',$order_by_sql); |
| | | } elseif($order == 'mail_traffic_last_year'){ |
| | | $tmp_date = date('Y',mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | $extselect .= ', SUM(mt.traffic) as calctraffic'; |
| | | $join .= ' INNER JOIN mail_traffic as mt ON '.$app->listform->listDef['table'].'.mailuser_id = mt.mailuser_id '; |
| | | $sql_where .= " AND mt.month like '$tmp_date%'";; |
| | | $order_by_sql = str_replace($app->listform->listDef['table'].'.mail_traffic_last_year','calctraffic',$order_by_sql); |
| | | $order_by_sql = "GROUP BY mailuser_id ".$order_by_sql; |
| | | } elseif($order == 'mail_traffic_this_year'){ |
| | | $tmp_date = date('Y'); |
| | | $extselect .= ', SUM(mt.traffic) as calctraffic'; |
| | | $join .= ' INNER JOIN mail_traffic as mt ON '.$app->listform->listDef['table'].'.mailuser_id = mt.mailuser_id '; |
| | | $sql_where .= " AND mt.month like '$tmp_date%'"; |
| | | $order_by_sql = str_replace($app->listform->listDef['table'].'.mail_traffic_this_year','calctraffic',$order_by_sql); |
| | | $order_by_sql = "GROUP BY mailuser_id ".$order_by_sql; |
| | | } |
| | | } |
| | | |
| | | if($this->SQLExtSelect != '') { |
| | | if(substr($this->SQLExtSelect,0,1) != ',') $this->SQLExtSelect = ','.$this->SQLExtSelect; |
| | | $extselect .= $this->SQLExtSelect; |
| | | } |
| | | |
| | | $table_selects = array(); |
| | | $table_selects[] = trim($app->listform->listDef['table']).'.*'; |
| | | $app->listform->listDef['additional_tables'] = trim($app->listform->listDef['additional_tables']); |
| | | if($app->listform->listDef['additional_tables'] != ''){ |
| | | $additional_tables = explode(',', $app->listform->listDef['additional_tables']); |
| | | foreach($additional_tables as $additional_table){ |
| | | $table_selects[] = trim($additional_table).'.*'; |
| | | } |
| | | } |
| | | $select = implode(', ', $table_selects); |
| | | |
| | | $sql = 'SELECT '.$select.$extselect.' FROM '.$app->listform->listDef['table'].($app->listform->listDef['additional_tables'] != ''? ','.$app->listform->listDef['additional_tables'] : '')."$join WHERE $sql_where $order_by_sql $limit_sql"; |
| | | return $sql; |
| | | } |
| | | } |
| | | |
| | | $list = new list_action; |
| | |
| | | $app->auth->check_module_permissions('mail'); |
| | | |
| | | $app->uses('listform_actions'); |
| | | $app->listform_actions->SQLExtWhere = "access = 'OK'"; |
| | | $app->listform_actions->SQLExtWhere = "mail_access.access = 'OK'"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | $app->auth->check_module_permissions('mail'); |
| | | |
| | | $app->uses('listform_actions'); |
| | | $app->listform_actions->SQLExtWhere = "wb = 'B'"; |
| | | $app->listform_actions->SQLExtWhere = "spamfilter_wblist.wb = 'B'"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | $app->auth->check_module_permissions('mail'); |
| | | |
| | | $app->uses('listform_actions'); |
| | | $app->listform_actions->SQLExtWhere = "wb = 'W'"; |
| | | $app->listform_actions->SQLExtWhere = "spamfilter_wblist.wb = 'W'"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | <tr class="caption"> |
| | | <th class="tbl_col_email" scope="col"><tmpl_var name="email_txt"></th> |
| | | <th class="tbl_col_name" scope="col"><tmpl_var name="name_txt"></th> |
| | | <th class="tbl_col_used tbl_col_nosort" scope="col"><tmpl_var name="used_txt"></th> |
| | | <th class="tbl_col_used_sort" scope="col"><tmpl_var name="used_txt"></th>
|
| | | <th class="tbl_col_quota" scope="col"><tmpl_var name="quota_txt"></th> |
| | | <th class="tbl_col_percentage_sort" scope="col"><tmpl_var name="percentage_txt"></th>
|
| | | <th class="tbl_col_limit" scope="col">{tmpl_var name='search_limit'}</th> |
| | | </tr> |
| | | <tr class="filter"> |
| | |
| | | <td class="tbl_col_name"><input type="text" name="search_system_user" value="{tmpl_var name='search_name'}" /></td> |
| | | <td class="tbl_col_used"> </td> |
| | | <td class="tbl_col_quota"> </td> |
| | | <td class="tbl_col_percentage"> </td>
|
| | | <td class="tbl_col_buttons"> |
| | | <button type="button" class="button icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onclick="submitForm('pageForm','mail/user_quota_stats.php');"><span>{tmpl_var name="filter_txt"}</span></button> |
| | | </td> |
| | |
| | | <td class="tbl_col_name"><a href="#" onclick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="name"}</a></td> |
| | | <td class="tbl_col_used"><a href="#" onclick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="used"}</a></td> |
| | | <td class="tbl_col_quota"><a href="#" onclick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="quota"}</a></td> |
| | | <td class="tbl_col_percentage"><a href="#" onclick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="percentage"}</a></td>
|
| | | <td class="tbl_col_buttons"></td> |
| | | </tr> |
| | | </tmpl_loop> |
| | | <tmpl_unless name="records"> |
| | | <tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>"> |
| | | <td colspan="5">{tmpl_var name='globalsearch_noresults_text_txt'}</td> |
| | | <td colspan="6">{tmpl_var name='globalsearch_noresults_text_txt'}</td>
|
| | | </tr> |
| | | </tmpl_unless> |
| | | </tbody> |
| | | <tfoot> |
| | | <tr> |
| | | <td class="tbl_footer tbl_paging" colspan="5"><tmpl_var name="paging"></td> |
| | | <td class="tbl_footer tbl_paging" colspan="6"><tmpl_var name="paging"></td>
|
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | |
| | | |
| | | if (!is_numeric($rec['used'])) $rec['used']=$rec['used'][1]; |
| | | |
| | | $rec['quota'] = round($rec['quota'] / 1048576,2).' MB'; |
| | | if($rec['quota'] == "0 MB") $rec['quota'] = $app->lng('unlimited'); |
| | | |
| | | |
| | | if($rec['used'] < 1544000) { |
| | | $rec['used'] = round($rec['used'] / 1024,2).' KB'; |
| | | if($rec['quota'] == 0){ |
| | | $rec['quota'] = $app->lng('unlimited'); |
| | | $rec['percentage'] = ''; |
| | | $rec['percentage_sort'] = 0; |
| | | } else { |
| | | $rec['used'] = round($rec['used'] / 1048576,2).' MB'; |
| | | $rec['percentage'] = round(100 * $rec['used'] / $rec['quota']) . '%'; |
| | | $rec['percentage_sort'] = round(100 * $rec['used'] / $rec['quota']); |
| | | $rec['quota'] = round($rec['quota'] / 1048576,4).' MB'; |
| | | } |
| | | |
| | | |
| | | $rec['used_sort'] = $rec['used']; |
| | | if($rec['used'] < 1544000) { |
| | | $rec['used'] = round($rec['used'] / 1024,4).' KB'; |
| | | } else { |
| | | $rec['used'] = round($rec['used'] / 1048576,4).' MB'; |
| | | } |
| | | |
| | | //* The variable "id" contains always the index variable |
| | |
| | | $global_config = $app->getconf->get_global_config('mail'); |
| | | |
| | | if($global_config['webmail_url'] != '') { |
| | | header('Location:' . $global_config['webmail_url']); |
| | | $webmail_url = $global_config['webmail_url']; |
| | | $webmail_url = str_replace('[SERVERNAME]', $serverData['server_name'], $webmail_url); |
| | | header('Location:' . $webmail_url); |
| | | } else { |
| | | |
| | | /* |
| | | * We only redirect to the login-form, so there is no need, to check any rights |
| | | */ |
| | | isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http'; |
| | | if($web_config['server_type'] == 'nginx') { |
| | | header('Location: http://' . $serverData['server_name'] . ':8081/webmail'); |
| | | } else { |
| | | header('Location:' . $http . '://' . $serverData['server_name'] . '/webmail'); |
| | | } |
| | | isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http'; |
| | | } |
| | | exit; |
| | | ?> |
| | |
| | | $app->tpl->setVar("ar_active", ''); |
| | | } |
| | | |
| | | if($this->dataRecord['autoresponder_subject'] == '') { |
| | | $app->tpl->setVar('autoresponder_subject', $app->tform->lng('autoresponder_subject')); |
| | | } else { |
| | | $app->tpl->setVar('autoresponder_subject', $this->dataRecord['autoresponder_subject']); |
| | | } |
| | | |
| | | parent::onShowEnd(); |
| | | } |
| | | |
| | |
| | | |
| | | $list = new list_action; |
| | | |
| | | $list->SQLExtWhere = "mailuser_id = ".$_SESSION['s']['user']['mailuser_id']; |
| | | $list->SQLExtWhere = "mail_user_filter.mailuser_id = ".$_SESSION['s']['user']['mailuser_id']; |
| | | |
| | | $list->onLoad(); |
| | | |
| | |
| | | |
| | | $sql = '('; |
| | | foreach($servers as $sv) { |
| | | $sql .= " (datalog_id > ".$sv['updated']." AND sys_datalog.server_id = ".$sv['server_id'].") OR "; |
| | | $sql .= " (sys_datalog.datalog_id > ".$sv['updated']." AND sys_datalog.server_id = ".$sv['server_id'].") OR "; |
| | | } |
| | | $sql = substr($sql,0,-4); |
| | | $sql .= ')'; |
| | | |
| | | $app->listform_actions->SQLExtWhere = $sql; |
| | | $app->listform_actions->SQLOrderBy = "ORDER BY tstamp DESC, datalog_id DESC"; |
| | | $app->listform_actions->SQLOrderBy = "ORDER BY sys_datalog.tstamp DESC, sys_datalog.datalog_id DESC"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
| | |
| | | $wb['Show fail2ban-Log'] = 'Fail2ban Protokoll anzeigen'; |
| | | $wb['Show IPTables'] = 'IPTables anzeigen'; |
| | | $wb['Show OpenVz VE BeanCounter'] = 'OpenVz VE BeanCounter anzeigen'; |
| | | $wb['Show Monit'] = 'Monit anzeigen'; |
| | | $wb['no_monit_url_defined_txt'] = 'Keine Monit-URL definiert.'; |
| | | $wb['no_permissions_to_view_monit_txt'] = 'Sie haben nicht die Berechtigung, auf Monit zuzugreifen.'; |
| | | $wb['Show Munin'] = 'Munin anzeigen'; |
| | | $wb['no_munin_url_defined_txt'] = 'Keine Munin-URL definiert.'; |
| | | $wb['no_permissions_to_view_munin_txt'] = 'Sie haben nicht die Berechtigung, auf Munin zuzugreifen.'; |
| | | ?> |
| | |
| | | $wb['monitor_title_beancounter_txt'] = 'OpenVz VE BeanCounter'; |
| | | $wb['monitor_updates_nosupport_txt'] = 'Your distribution is not supported for this monitoring'; |
| | | $wb['monitor_beancounter_nosupport_txt'] = 'This server is not a OpenVz VE and has no beancounter information'; |
| | | $wb['Show Monit'] = 'Show Monit'; |
| | | $wb['no_monit_url_defined_txt'] = 'No Monit URL defined.'; |
| | | $wb['no_permissions_to_view_monit_txt'] = 'You are not allowed to access Monit.'; |
| | | $wb['Show Munin'] = 'Show Munin'; |
| | | $wb['no_munin_url_defined_txt'] = 'No Munin URL defined.'; |
| | | $wb['no_permissions_to_view_munin_txt'] = 'You are not allowed to access Munin.'; |
| | | ?> |
| | |
| | | 'link' => 'monitor/show_data.php?type=services', |
| | | 'html_id' => 'services'); |
| | | |
| | | $items[] = array( 'title' => "Show Monit", |
| | | 'target' => 'content', |
| | | 'link' => 'monitor/show_monit.php', |
| | | 'html_id' => 'monit'); |
| | | |
| | | $items[] = array( 'title' => "Show OpenVz VE BeanCounter", |
| | | 'target' => 'content', |
| | | 'link' => 'monitor/show_data.php?type=openvz_beancounter', |
| | | 'html_id' => 'openvz_beancounter'); |
| | | |
| | | $items[] = array( 'title' => "Show Munin", |
| | | 'target' => 'content', |
| | | 'link' => 'monitor/show_munin.php', |
| | | 'html_id' => 'monit'); |
| | | |
| | | $module["nav"][] = array( 'title' => 'Server State', |
| | | 'open' => 1, |
| | | 'items' => $items); |
| | |
| | | $app->uses('listform_actions'); |
| | | //$app->listform_actions->SQLExtWhere = "wb = 'W'"; |
| | | |
| | | $app->listform_actions->SQLOrderBy = "ORDER BY tstamp DESC, syslog_id DESC"; |
| | | $app->listform_actions->SQLOrderBy = "ORDER BY sys_log.tstamp DESC, sys_log.syslog_id DESC"; |
| | | |
| | | $app->listform_actions->onLoad(); |
| | | |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | Copyright (c) 2007-2008, Till Brehm, projektfarm Gmbh and Oliver Vogel www.muv.com |
| | | All rights reserved. |
| | | |
| | | Redistribution and use in source and binary forms, with or without modification, |
| | | are permitted provided that the following conditions are met: |
| | | |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright notice, |
| | | this list of conditions and the following disclaimer in the documentation |
| | | and/or other materials provided with the distribution. |
| | | * Neither the name of ISPConfig nor the names of its contributors |
| | | may be used to endorse or promote products derived from this software without |
| | | specific prior written permission. |
| | | |
| | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| | | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| | | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| | | IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
| | | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| | | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| | | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| | | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| | | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| | | */ |
| | | |
| | | require_once('../../lib/config.inc.php'); |
| | | require_once('../../lib/app.inc.php'); |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('monitor'); |
| | | |
| | | $app->uses('tools_monitor'); |
| | | |
| | | // Loading the template |
| | | $app->uses('tpl'); |
| | | $app->tpl->newTemplate("form.tpl.htm"); |
| | | $app->tpl->setInclude('content_tpl', 'templates/show_monit.htm'); |
| | | |
| | | $monTransSrv = $app->lng("monitor_settings_server_txt"); |
| | | $title = 'Monit ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')'; |
| | | |
| | | $app->tpl->setVar("list_head_txt", $title); |
| | | |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin'){ |
| | | |
| | | $app->uses('getconf'); |
| | | $server_config = $app->getconf->get_server_config($_SESSION['monitor']['server_id'],'server'); |
| | | |
| | | $monit_url = trim($server_config['monit_url']); |
| | | if($monit_url != ''){ |
| | | $monit_url = str_replace('[SERVERNAME]', $_SESSION['monitor']['server_name'], $monit_url); |
| | | $monit_user = trim($server_config['monit_user']); |
| | | $monit_password = trim($server_config['monit_password']); |
| | | $auth_string = ''; |
| | | if($monit_user != ''){ |
| | | $auth_string = $monit_user; |
| | | } |
| | | if($monit_user != '' && $monit_password != ''){ |
| | | $auth_string .= ':'.$monit_password; |
| | | } |
| | | if($auth_string != '') $auth_string .= '@'; |
| | | |
| | | $monit_url_parts = parse_url($monit_url); |
| | | |
| | | $monit_url = $monit_url_parts['scheme'].'://'.$auth_string.$monit_url_parts['host'].(isset($monit_url_parts['port']) ? ':' . $monit_url_parts['port'] : '').(isset($monit_url_parts['path']) ? $monit_url_parts['path'] : '').(isset($monit_url_parts['query']) ? '?' . $monit_url_parts['query'] : '').(isset($monit_url_parts['fragment']) ? '#' . $monit_url_parts['fragment'] : ''); |
| | | |
| | | $app->tpl->setVar("monit_url", $monit_url); |
| | | } else { |
| | | $app->tpl->setVar("no_monit_url_defined_txt", $app->lng("no_monit_url_defined_txt")); |
| | | } |
| | | } else { |
| | | $app->tpl->setVar("no_permissions_to_view_monit_txt", $app->lng("no_permissions_to_view_monit_txt")); |
| | | } |
| | | |
| | | $app->tpl_defaults(); |
| | | $app->tpl->pparse(); |
| | | ?> |
New file |
| | |
| | | <?php |
| | | |
| | | /* |
| | | Copyright (c) 2007-2008, Till Brehm, projektfarm Gmbh and Oliver Vogel www.muv.com |
| | | All rights reserved. |
| | | |
| | | Redistribution and use in source and binary forms, with or without modification, |
| | | are permitted provided that the following conditions are met: |
| | | |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright notice, |
| | | this list of conditions and the following disclaimer in the documentation |
| | | and/or other materials provided with the distribution. |
| | | * Neither the name of ISPConfig nor the names of its contributors |
| | | may be used to endorse or promote products derived from this software without |
| | | specific prior written permission. |
| | | |
| | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| | | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| | | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| | | IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
| | | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| | | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| | | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| | | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| | | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| | | */ |
| | | |
| | | require_once('../../lib/config.inc.php'); |
| | | require_once('../../lib/app.inc.php'); |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('monitor'); |
| | | |
| | | $app->uses('tools_monitor'); |
| | | |
| | | // Loading the template |
| | | $app->uses('tpl'); |
| | | $app->tpl->newTemplate("form.tpl.htm"); |
| | | $app->tpl->setInclude('content_tpl', 'templates/show_munin.htm'); |
| | | |
| | | $monTransSrv = $app->lng("monitor_settings_server_txt"); |
| | | $title = 'Munin ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')'; |
| | | |
| | | $app->tpl->setVar("list_head_txt", $title); |
| | | |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin'){ |
| | | |
| | | $app->uses('getconf'); |
| | | $server_config = $app->getconf->get_server_config($_SESSION['monitor']['server_id'],'server'); |
| | | |
| | | $munin_url = trim($server_config['munin_url']); |
| | | if($munin_url != ''){ |
| | | $munin_url = str_replace('[SERVERNAME]', $_SESSION['monitor']['server_name'], $munin_url); |
| | | $munin_user = trim($server_config['munin_user']); |
| | | $munin_password = trim($server_config['munin_password']); |
| | | $auth_string = ''; |
| | | if($munin_user != ''){ |
| | | $auth_string = $munin_user; |
| | | } |
| | | if($munin_user != '' && $munin_password != ''){ |
| | | $auth_string .= ':'.$munin_password; |
| | | } |
| | | if($auth_string != '') $auth_string .= '@'; |
| | | |
| | | $munin_url_parts = parse_url($munin_url); |
| | | |
| | | $munin_url = $munin_url_parts['scheme'].'://'.$auth_string.$munin_url_parts['host'].(isset($munin_url_parts['port']) ? ':' . $munin_url_parts['port'] : '').(isset($munin_url_parts['path']) ? $munin_url_parts['path'] : '').(isset($munin_url_parts['query']) ? '?' . $munin_url_parts['query'] : '').(isset($munin_url_parts['fragment']) ? '#' . $munin_url_parts['fragment'] : ''); |
| | | |
| | | $app->tpl->setVar("munin_url", $munin_url); |
| | | } else { |
| | | $app->tpl->setVar("no_munin_url_defined_txt", $app->lng("no_munin_url_defined_txt")); |
| | | } |
| | | } else { |
| | | $app->tpl->setVar("no_permissions_to_view_munin_txt", $app->lng("no_permissions_to_view_munin_txt")); |
| | | } |
| | | |
| | | $app->tpl_defaults(); |
| | | $app->tpl->pparse(); |
| | | ?> |
New file |
| | |
| | | <h2><tmpl_var name="list_head_txt"></h2> |
| | | <p><tmpl_var name="list_desc_txt"></p> |
| | | |
| | | <div class="panel panel_system"> |
| | | <tmpl_if name='monit_url'> |
| | | <iframe src="{tmpl_var name='monit_url'}" width="100%" height="1000" frameborder="0" style="overflow:visible;"></iframe> |
| | | <tmpl_else> |
| | | <div id="errorMsg"><h3>ERROR</h3><ol><li>{tmpl_var name="no_monit_url_defined_txt"} {tmpl_var name="no_permissions_to_view_monit_txt"}<br></li></ol></div> |
| | | </tmpl_if> |
| | | </div> |
New file |
| | |
| | | <h2><tmpl_var name="list_head_txt"></h2> |
| | | <p><tmpl_var name="list_desc_txt"></p> |
| | | |
| | | <div class="panel panel_system"> |
| | | <tmpl_if name='munin_url'> |
| | | <iframe src="{tmpl_var name='munin_url'}" width="100%" height="1000" frameborder="0" style="overflow:visible;"></iframe> |
| | | <tmpl_else> |
| | | <div id="errorMsg"><h3>ERROR</h3><ol><li>{tmpl_var name="no_munin_url_defined_txt"} {tmpl_var name="no_permissions_to_view_munin_txt"}<br></li></ol></div> |
| | | </tmpl_if> |
| | | </div> |
| | |
| | | $web_config = $app->getconf->get_server_config($server_id, 'web'); |
| | | if(!empty($web_config['server_type'])) $server_type = $web_config['server_type']; |
| | | if($server_type == 'nginx' && $php_type == 'fast-cgi') $php_type = 'php-fpm'; |
| | | // get client id |
| | | $sql_where = ''; |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin'){ |
| | | $sql_where = " AND client_id = ".$_SESSION["s"]["user"]["client_id"]; |
| | | } |
| | | |
| | | if($php_type == 'php-fpm'){ |
| | | $php_records = $app->db->queryAllRecords("SELECT * FROM server_php WHERE php_fpm_init_script != '' AND php_fpm_ini_dir != '' AND php_fpm_pool_dir != '' AND server_id = $server_id"); |
| | | $php_records = $app->db->queryAllRecords("SELECT * FROM server_php WHERE php_fpm_init_script != '' AND php_fpm_ini_dir != '' AND php_fpm_pool_dir != '' AND server_id = $server_id".$sql_where); |
| | | } |
| | | if($php_type == 'fast-cgi'){ |
| | | $php_records = $app->db->queryAllRecords("SELECT * FROM server_php WHERE php_fastcgi_binary != '' AND php_fastcgi_ini_dir != '' AND server_id = $server_id"); |
| | | $php_records = $app->db->queryAllRecords("SELECT * FROM server_php WHERE php_fastcgi_binary != '' AND php_fastcgi_ini_dir != '' AND server_id = $server_id".$sql_where); |
| | | } |
| | | $php_select = ""; |
| | | if(is_array($php_records) && !empty($php_records)) { |
| | |
| | | // Load needed classes |
| | | $app->uses('tpl,listform_actions'); |
| | | |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY name, version'; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY aps_packages.name, aps_packages.version'; |
| | | // Show only unlocked packages to clients and (un-)lockable packages to admins |
| | | if($_SESSION['s']['user']['typ'] != 'admin') $app->listform_actions->SQLExtWhere = 'package_status = '.PACKAGE_ENABLED; |
| | | else $app->listform_actions->SQLExtWhere = '(package_status = '.PACKAGE_ENABLED.' OR package_status = '.PACKAGE_LOCKED.')'; |
| | | if($_SESSION['s']['user']['typ'] != 'admin') $app->listform_actions->SQLExtWhere = 'aps_packages.package_status = '.PACKAGE_ENABLED; |
| | | else $app->listform_actions->SQLExtWhere = '(aps_packages.package_status = '.PACKAGE_ENABLED.' OR aps_packages.package_status = '.PACKAGE_LOCKED.')'; |
| | | |
| | | // Get package amount |
| | | $pkg_count = $app->db->queryOneRecord("SELECT COUNT(*) FROM aps_packages"); |
| | |
| | | $this->dataRecord["type"] = 'url'; |
| | | } else { |
| | | $domain_owner = $app->db->queryOneRecord("SELECT limit_cron_type FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ".$app->functions->intval($parent_domain["sys_groupid"])); |
| | | if($domain_owner["limit_cron_type"] == 'full') $this->dataRecord["type"] = 'full'; |
| | | else $this->dataRecord["type"] = 'chrooted'; |
| | | //* True when the site is assigned to a client |
| | | if(isset($domain_owner["limit_cron_type"])) { |
| | | if($domain_owner["limit_cron_type"] == 'full') { |
| | | $this->dataRecord["type"] = 'full'; |
| | | } else { |
| | | $this->dataRecord["type"] = 'chrooted'; |
| | | } |
| | | } else { |
| | | //* True when the site is assigned to the admin |
| | | $this->dataRecord["type"] = 'full'; |
| | | } |
| | | } |
| | | |
| | | parent::onSubmit(); |
| | |
| | | if($app->tform->checkPerm($this->id,'d') == false) $app->error($app->lng('error_no_delete_permission')); |
| | | |
| | | $app->uses('sites_database_plugin'); |
| | | $app->sites_database_plugin->processDatabaseDelete($this->id); |
| | | //$app->sites_database_plugin->processDatabaseDelete($this->id); |
| | | } |
| | | } |
| | | |
| | |
| | | if(preg_match('/(^|,)' . preg_quote($server_config['ip_address'], '/') . '(,|$)/', $this->dataRecord['remote_ips']) == false) { |
| | | $this->dataRecord['remote_ips'] .= ',' . $server_config['ip_address']; |
| | | } |
| | | $tmp = preg_split('/\s*,\s*/', $this->dataRecord['remote_ips']); |
| | | $tmp = array_unique($tmp); |
| | | $this->dataRecord['remote_ips'] = implode(',', $tmp); |
| | | unset($tmp); |
| | | } |
| | | } |
| | | } |
| | |
| | | if(preg_match('/(^|,)' . preg_quote($server_config['ip_address'], '/') . '(,|$)/', $this->dataRecord['remote_ips']) == false) { |
| | | $this->dataRecord['remote_ips'] .= ',' . $server_config['ip_address']; |
| | | } |
| | | $tmp = preg_split('/\s*,\s*/', $this->dataRecord['remote_ips']); |
| | | $tmp = array_unique($tmp); |
| | | $this->dataRecord['remote_ips'] = implode(',', $tmp); |
| | | unset($tmp); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | $app->uses('sites_database_plugin'); |
| | | |
| | | $app->sites_database_plugin->processDatabaseInsert($this); |
| | | //$app->sites_database_plugin->processDatabaseInsert($this); |
| | | |
| | | $app->db->query($sql); |
| | | if($app->db->errorMessage != '') die($app->db->errorMessage); |
| | |
| | | if(!empty($sql) && !$app->tform->isReadonlyTab($app->tform->getCurrentTab(),$this->id)) { |
| | | |
| | | $app->uses('sites_database_plugin'); |
| | | $app->sites_database_plugin->processDatabaseUpdate($this); |
| | | //$app->sites_database_plugin->processDatabaseUpdate($this); |
| | | |
| | | $app->db->query($sql); |
| | | if($app->db->errorMessage != '') die($app->db->errorMessage); |
| | |
| | | } |
| | | |
| | | $list = new list_action; |
| | | $list->SQLOrderBy = 'ORDER BY database_name'; |
| | | $list->SQLOrderBy = 'ORDER BY web_database.database_name'; |
| | | $list->onLoad(); |
| | | |
| | | |
| | |
| | | } else { |
| | | isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http'; |
| | | if($web_config['server_type'] == 'nginx') { |
| | | header('location:' . $http . '://' . $serverData['server_name'] . ':8081/phpmyadmin'); |
| | | header('Location: http://' . $serverData['server_name'] . ':8081/phpmyadmin'); |
| | | } else { |
| | | header('location:' . $http . '://' . $serverData['server_name'] . '/phpmyadmin'); |
| | | header('Location: ' . $http . '://' . $serverData['server_name'] . '/phpmyadmin'); |
| | | } |
| | | } |
| | | exit; |
| | |
| | | if($app->tform->checkPerm($this->id,'d') == false) $app->error($app->lng('error_no_delete_permission')); |
| | | |
| | | $old_record = $app->tform->getDataRecord($this->id); |
| | | $app->db->datalogDelete('web_database_user', 'database_user_id', $this->id); |
| | | |
| | | /* we cannot use datalogDelete here, as we need to set server_id to 0 */ |
| | | $app->db->query("DELETE FROM `web_database_user` WHERE $index_field = '$index_value'"); |
| | | $new_rec = array(); |
| | | $old_record['server_id'] = 0; |
| | | $app->db->datalogSave('web_database_user', 'DELETE', 'database_user_id', $this->id, $old_record, $new_rec); |
| | | } |
| | | |
| | | function onAfterDelete() { // this has to be done on AFTER delete, because we need the db user still in the database when the server plugin processes the datalog |
| | |
| | | $client = $app->db->queryOneRecord("SELECT client.company_name, client.contact_name, client.client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['company_name'].' :: '.$client['contact_name'].'</option>'; |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contact_name'].'</option>'; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | | if(is_array($records)) { |
| | | foreach( $records as $rec) { |
| | | $selected = @(is_array($this->dataRecord) && ($rec["groupid"] == $this->dataRecord['client_group_id'] || $rec["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':''; |
| | | $client_select .= "<option value='$rec[groupid]' $selected>$rec[name] :: $rec[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$rec[groupid]' $selected>$rec[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | | } elseif($_SESSION["s"]["user"]["typ"] == 'admin') { |
| | | // Fill the client select field |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = "<option value='0'></option>"; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | |
| | | foreach( $clients as $client) { |
| | | //$selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; |
| | | $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | $this->dataRecord['database_user'] = substr($dbuser_prefix . $this->dataRecord['database_user'], 0, 16); |
| | | } |
| | | |
| | | $this->dataRecord['server_id'] = $conf['server_id']; |
| | | $this->dataRecord['server_id'] = 0; // we need this on all servers |
| | | |
| | | parent::onBeforeUpdate(); |
| | | } |
| | |
| | | $this->dataRecord['database_user'] = substr($dbuser_prefix . $this->dataRecord['database_user'], 0, 16); |
| | | } |
| | | |
| | | $this->dataRecord['server_id'] = $conf['server_id']; |
| | | $this->dataRecord['server_id'] = 0; // we need this on all servers |
| | | |
| | | parent::onBeforeInsert(); |
| | | } |
| | |
| | | $app->db->query("UPDATE web_database_user SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE database_user_id = ".$this->id); |
| | | } |
| | | |
| | | $password = $app->db->queryOneRecord("SELECT database_password FROM web_database_user WHERE database_user_id = ".$this->id); |
| | | /*$password = $app->db->queryOneRecord("SELECT database_password FROM web_database_user WHERE database_user_id = ".$this->id); |
| | | |
| | | $records = $app->db->queryAllRecords("SELECT DISTINCT server_id FROM web_database WHERE database_user_id = '".$app->functions->intval($this->id)."' UNION SELECT DISTINCT server_id FROM web_database WHERE database_ro_user_id = '".$app->functions->intval($this->id)."'"); |
| | | foreach($records as $rec) { |
| | |
| | | $new_rec['database_password'] = $password['database_password']; |
| | | $app->db->datalogSave('web_database_user', 'UPDATE', 'database_user_id', $this->id, $this->oldDataRecord, $new_rec); |
| | | } |
| | | unset($new_rec); |
| | | unset($new_rec);*/ |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | $list = new list_action; |
| | | $list->SQLOrderBy = 'ORDER BY database_user'; |
| | | $list->SQLOrderBy = 'ORDER BY web_database_user.database_user'; |
| | | $list->onLoad(); |
| | | |
| | | |
| | |
| | | $form["action"] = "database_user_edit.php"; |
| | | $form["db_table"] = "web_database_user"; |
| | | $form["db_table_idx"] = "database_user_id"; |
| | | $form["db_history"] = "no"; |
| | | $form["db_history"] = "yes"; |
| | | $form["tab_default"] = "database_user"; |
| | | $form["list_default"] = "database_user_list.php"; |
| | | $form["auth"] = 'yes'; // yes / no |
| | |
| | | 'validators' => array ( 0 => array ( 'type' => 'UNIQUE', |
| | | 'errmsg'=> 'username_error_unique'), |
| | | 1 => array ( 'type' => 'REGEX', |
| | | 'regex' => '/^[\w\.\-]{0,64}$/', |
| | | 'regex' => '/^[\w\.\-]{0,32}$/', |
| | | 'errmsg'=> 'username_error_regex'), |
| | | ), |
| | | 'default' => '', |
| | |
| | | 'default' => '', |
| | | 'value' => array('' => 'no_redirect_txt', 'non_www_to_www' => 'domain.tld => www.domain.tld', 'www_to_non_www' => 'www.domain.tld => domain.tld', '*_domain_tld_to_domain_tld' => '*.doman.tld => domain.tld', '*_domain_tld_to_www_domain_tld' => '*.domain.tld => www.domain.tld', '*_to_domain_tld' => '* => domain.tld', '*_to_www_domain_tld' => '* => www.domain.tld') |
| | | ), |
| | | 'rewrite_rules' => array ( |
| | | 'datatype' => 'TEXT', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '', |
| | | 'value' => '', |
| | | 'width' => '30', |
| | | 'maxlength' => '255' |
| | | ), |
| | | ################################## |
| | | # ENDE Datatable fields |
| | | ################################## |
| | |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'value' => array('none' => 'No backup', 'daily' => 'Daily', 'weekly' => 'Weekly', 'monthly' => 'Monthly') |
| | | 'value' => array('none' => 'no_backup_txt', 'daily' => 'daily_backup_txt', 'weekly' => 'weekly_backup_txt', 'monthly' => 'monthly_backup_txt') |
| | | ), |
| | | 'backup_copies' => array ( |
| | | 'datatype' => 'INTEGER', |
| | |
| | | $app->db->query($sql); |
| | | } |
| | | |
| | | //* 2. check to ensure that the FTP user path is not changed to a path outside of the docroot by a normal user |
| | | if(isset($this->dataRecord['dir']) && $this->dataRecord['dir'] != $this->oldDataRecord['dir'] && !$app->auth->is_admin()) { |
| | | $vd = new validate_ftpuser; |
| | | $error_message = $vd->ftp_dir('dir', $this->dataRecord['dir'], ''); |
| | | //* This check should normally never be triggered |
| | | //* Set the path to a safe path (web doc root). |
| | | if($error_message != '') { |
| | | $ftp_data = $app->db->queryOneRecord("SELECT parent_domain_id FROM ftp_user WHERE ftp_user_id = '".$app->db->quote($app->tform->primary_id)."'"); |
| | | $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($ftp_data["parent_domain_id"])); |
| | | $dir = $web["document_root"]; |
| | | $sql = "UPDATE ftp_user SET dir = '$dir' WHERE ftp_user_id = ".$this->id; |
| | | $app->db->query($sql); |
| | | $app->log("Error in FTP path settings of FTP user ".$this->dataRecord['username'], 1); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | $list = new list_action; |
| | | $list->SQLOrderBy = 'ORDER BY username'; |
| | | $list->SQLOrderBy = 'ORDER BY ftp_user.username'; |
| | | $list->onLoad(); |
| | | |
| | | |
| | |
| | | $wb['repeat_password_txt'] = 'Passwort wiederholen'; |
| | | $wb['password_mismatch_txt'] = 'Die Passwörter stimmen nicht überein.'; |
| | | $wb['password_match_txt'] = 'Die Passwörter stimmen überein.'; |
| | | $wb['username_must_not_exceed_32_chars_txt'] = 'Der Benutzername darf 32 Zeichen nicht überschreiten.'; |
| | | $wb['username_not_allowed_txt'] = 'Der Benutzername ist nicht erlaubt.'; |
| | | ?> |
| | |
| | | $wb['available_nginx_directive_snippets_txt'] = 'Verfügbare nginx Direktiven Schnipsel:'; |
| | | $wb['proxy_directives_txt'] = 'Proxy Direktiven'; |
| | | $wb['available_proxy_directive_snippets_txt'] = 'Verfügbare Proxy Direktiven Schnipsel:'; |
| | | $wb['no_server_error'] = 'No server selected.'; |
| | | $wb['no_server_error'] = 'Kein server ausgewählt.'; |
| | | $wb['no_backup_txt'] = 'Kein Backup'; |
| | | $wb['daily_backup_txt'] = 'Täglich'; |
| | | $wb['weekly_backup_txt'] = 'Wöchentlich'; |
| | | $wb['monthly_backup_txt'] = 'Monatlich'; |
| | | $wb['rewrite_rules_txt'] = 'Rewrite Rules'; |
| | | $wb['invalid_rewrite_rules_txt'] = 'Unzulässige Rewrite Rules'; |
| | | $wb['allowed_rewrite_rule_directives_txt'] = 'Erlaubte Direktiven:'; |
| | | ?> |
| | |
| | | $wb['repeat_password_txt'] = 'Repeat Password'; |
| | | $wb['password_mismatch_txt'] = 'The passwords do not match.'; |
| | | $wb['password_match_txt'] = 'The passwords do match.'; |
| | | $wb['username_must_not_exceed_32_chars_txt'] = 'The username must not exceed 32 characters.'; |
| | | $wb['username_not_allowed_txt'] = 'The username is not allowed.'; |
| | | ?> |
| | |
| | | $wb['proxy_directives_txt'] = 'Proxy Directives'; |
| | | $wb['available_proxy_directive_snippets_txt'] = 'Available Proxy Directive Snippets:'; |
| | | $wb['no_server_error'] = 'No server selected.'; |
| | | $wb['no_backup_txt'] = 'No backup'; |
| | | $wb['daily_backup_txt'] = 'Daily'; |
| | | $wb['weekly_backup_txt'] = 'Weekly'; |
| | | $wb['monthly_backup_txt'] = 'Monthly'; |
| | | $wb['rewrite_rules_txt'] = 'Rewrite Rules'; |
| | | $wb['invalid_rewrite_rules_txt'] = 'Invalid Rewrite Rules'; |
| | | $wb['allowed_rewrite_rule_directives_txt'] = 'Allowed Directives:'; |
| | | ?> |
| | |
| | | */ |
| | | |
| | | $liste['name'] = 'aps_instances'; // Name of the list |
| | | $liste['table'] = 'aps_instances,aps_packages'; // Database table |
| | | $liste['table'] = 'aps_instances'; // Database table
|
| | | $liste['table_idx'] = 'id'; // Table index |
| | |
|
| | | // if multiple tables are involved, list the additional tables here (comma separated)
|
| | | $liste["additional_tables"] = "aps_packages";
|
| | |
|
| | | // if multiple tables are involved, specify sql to join these tables
|
| | | $liste["join_sql"] = " aps_instances.package_id = aps_packages.id";
|
| | |
|
| | | $liste["search_prefix"] = 'search_'; // Search field prefix |
| | | $liste['records_per_page'] = 15; // Records per page |
| | | $liste['file'] = 'aps_installedpackages_list.php'; // Script file for this list |
| | |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'width' => '', |
| | | 'value' => ''); |
| | | 'value' => '',
|
| | | 'table' => 'aps_packages');
|
| | | |
| | | $liste["item"][] = array('field' => 'version', |
| | | 'datatype' => 'VARCHAR', |
| | |
| | | 'prefix' => '%', |
| | | 'suffix' => '%', |
| | | 'width' => '', |
| | | 'value' => ''); |
| | | 'value' => '',
|
| | | 'table' => 'aps_packages');
|
| | | |
| | | /* |
| | | $liste["item"][] = array('field' => 'customer_id', |
| | |
| | | 'value' => array(INSTANCE_INSTALL => $app->lng('Installation_task'), |
| | | INSTANCE_ERROR => $app->lng('Installation_error'), |
| | | INSTANCE_SUCCESS => $app->lng('Installation_success'), |
| | | INSTANCE_REMOVE => $app->lng('Installation_remove'))); |
| | | INSTANCE_REMOVE => $app->lng('Installation_remove')),
|
| | | 'table' => 'aps_instances'); |
| | | ?> |
| | |
| | | // Enable auth |
| | | $liste["auth"] = "yes"; |
| | | |
| | | // mark columns for php sorting (no real mySQL columns) |
| | | $liste["phpsort"] = array('used_sort', 'files'); |
| | | |
| | | |
| | | /***************************************************** |
| | | * Suchfelder |
| | |
| | | $blacklist = file(ISPC_LIB_PATH.'/shelluser_blacklist'); |
| | | foreach($blacklist as $line) { |
| | | if(strtolower(trim($line)) == strtolower(trim($this->dataRecord['username']))){ |
| | | $app->tform->errorMessage .= 'The username is not allowed.'; |
| | | $app->tform->errorMessage .= $app->tform->lng('username_not_allowed_txt'); |
| | | } |
| | | } |
| | | unset($blacklist); |
| | |
| | | $this->dataRecord['username_prefix'] = $shelluser_prefix; |
| | | /* restrict the names */ |
| | | $this->dataRecord['username'] = $shelluser_prefix . $this->dataRecord['username']; |
| | | |
| | | if(strlen($this->dataRecord['username']) > 32) $app->tform->errorMessage .= $app->tform->lng("username_must_not_exceed_32_chars_txt"); |
| | | } |
| | | parent::onBeforeInsert(); |
| | | } |
| | |
| | | $blacklist = file(ISPC_LIB_PATH.'/shelluser_blacklist'); |
| | | foreach($blacklist as $line) { |
| | | if(strtolower(trim($line)) == strtolower(trim($this->dataRecord['username']))){ |
| | | $app->tform->errorMessage .= 'The username is not allowed.'; |
| | | $app->tform->errorMessage .= $app->tform->lng('username_not_allowed_txt'); |
| | | } |
| | | } |
| | | unset($blacklist); |
| | |
| | | |
| | | /* restrict the names */ |
| | | $this->dataRecord['username'] = $shelluser_prefix . $this->dataRecord['username']; |
| | | |
| | | if(strlen($this->dataRecord['username']) > 32) $app->tform->errorMessage .= $app->tform->lng("username_must_not_exceed_32_chars_txt"); |
| | | } |
| | | } |
| | | |
| | |
| | | // Limit the results to alias domains |
| | | //$app->listform_actions->SQLExtWhere = "type = 'subdomain'"; |
| | | |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY username'; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY shell_user.username'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | |
| | |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="remote_ips">{tmpl_var name='remote_ips_txt'}</label> |
| | | <input name="remote_ips" id="remote_ips" value="{tmpl_var name='remote_ips'}" size="60" type="text" class="textInput formLengthHalf" /> |
| | | <input name="remote_ips" id="remote_ips" value="{tmpl_var name='remote_ips'}" size="30" type="text" class="textInput" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name='active_txt'}</p> |
| | |
| | | <tr class="caption"> |
| | | <th class="tbl_col_domain" scope="col"><tmpl_var name="domain_txt"></th> |
| | | <th class="tbl_col_system_user" scope="col"><tmpl_var name="system_user_txt"></th> |
| | | <th class="tbl_col_used tbl_col_nosort" scope="col"><tmpl_var name="used_txt"></th> |
| | | <th class="tbl_col_used_sort" scope="col"><tmpl_var name="used_txt"></th> |
| | | <th class="tbl_col_soft tbl_col_nosort" scope="col"><tmpl_var name="soft_txt"></th> |
| | | <th class="tbl_col_hard tbl_col_nosort" scope="col"><tmpl_var name="hard_txt"></th> |
| | | <th class="tbl_col_files tbl_col_nosort" scope="col"><tmpl_var name="files_txt"></th> |
| | | <th class="tbl_col_files" scope="col"><tmpl_var name="files_txt"></th> |
| | | <th class="tbl_col_limit" scope="col">{tmpl_var name='search_limit'}</th> |
| | | </tr> |
| | | <tr class="filter"> |
| | |
| | | <input name="pm_max_requests" id="pm_max_requests" value="{tmpl_var name='pm_max_requests'}" size="3" maxlength="6" type="text" class="textInput formLengthLimit" /> |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <div class="ctrlHolder php"> |
| | | <label for="php_open_basedir">{tmpl_var name='php_open_basedir_txt'}</label> |
| | | <input name="php_open_basedir" id="php_open_basedir" value="{tmpl_var name='php_open_basedir'}" size="30" type="text" class="textInput" style="width:400px;" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <div class="ctrlHolder php"> |
| | | <label for="custom_php_ini">{tmpl_var name='custom_php_ini_txt'}</label> |
| | | <textarea name="custom_php_ini" id="custom_php_ini" rows='10' cols='50' style="width:400px;">{tmpl_var name='custom_php_ini'}</textarea> <b>{tmpl_var name="available_php_directive_snippets_txt"}</b><br><br> {tmpl_var name="php_directive_snippets_txt"} |
| | | </div> |
| | |
| | | } else { |
| | | jQuery('.phpfpm').hide(); |
| | | } |
| | | if(data.phptype == "no"){ |
| | | jQuery('.php').hide(); |
| | | } else { |
| | | jQuery('.php').show(); |
| | | } |
| | | }); |
| | | jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {web_id : webId, type : "getredirecttype"}, function(data) { |
| | | if(data.redirecttype == "proxy"){ |
| | |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="ipv6_address">{tmpl_var name='ipv6_address_txt'}</label> |
| | | <select name="ipv6_address" id="ipv6_address" class="selectInput formLengthIPv4"> |
| | | <select name="ipv6_address" id="ipv6_address" class="selectInput formLengthIPv6"> |
| | | {tmpl_var name='ipv6_address'} |
| | | </select> |
| | | </div> |
| | |
| | | {tmpl_var name='seo_redirect'} |
| | | </select> |
| | | </div> |
| | | <div class="ctrlHolder nginx"> |
| | | <label for="rewrite_rules">{tmpl_var name='rewrite_rules_txt'}</label> |
| | | <textarea name="rewrite_rules" id="rewrite_rules" rows='10' cols='50' style="width:400px;">{tmpl_var name='rewrite_rules'}</textarea> <b>{tmpl_var name="allowed_rewrite_rule_directives_txt"}</b><br><br> break<br> if<br> return<br> rewrite<br> set |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <input type="hidden" name="id" value="{tmpl_var name='id'}"> |
| | |
| | | jQuery('#redirect_type option[value="R,L"]').hide(); |
| | | jQuery('#redirect_type option[value="R=301,L"]').hide(); |
| | | if(selected != "no" && selected != "" && selected != "last" && selected != "break" && selected != "redirect" && selected != "permanent" && selected != "proxy") jQuery('#redirect_type option[value="no"]').attr('selected', 'selected'); |
| | | jQuery('.nginx').show(); |
| | | } else { |
| | | jQuery('#redirect_type option[value="last"]').attr('disabled','disabled'); |
| | | jQuery('#redirect_type option[value="break"]').attr('disabled','disabled'); |
| | |
| | | jQuery('#redirect_type option[value="permanent"]').hide(); |
| | | jQuery('#redirect_type option[value="proxy"]').hide(); |
| | | if(selected != "no" && selected != "" && selected != "R" && selected != "L" && selected != "R,L" && selected != "R=301,L") jQuery('#redirect_type option[value="no"]').attr('selected', 'selected'); |
| | | jQuery('.nginx').hide(); |
| | | } |
| | | }); |
| | | } |
| | |
| | | $username = $rec['system_user']; |
| | | |
| | | $rec['used'] = $monitor_data['user'][$username]['used']; |
| | | $rec['used_sort'] = $rec['used']; |
| | | $rec['soft'] = $monitor_data['user'][$username]['soft']; |
| | | $rec['hard'] = $monitor_data['user'][$username]['hard']; |
| | | $rec['files'] = $monitor_data['user'][$username]['files']; |
| | |
| | | } |
| | | |
| | | $list = new list_action; |
| | | $list->SQLExtWhere = "type = 'vhost'"; |
| | | $list->SQLOrderBy = 'ORDER BY domain'; |
| | | $list->SQLExtWhere = "web_domain.type = 'vhost'"; |
| | | $list->SQLOrderBy = 'ORDER BY web_domain.domain'; |
| | | $list->onLoad(); |
| | | |
| | | |
| | |
| | | $app->uses('listform_actions'); |
| | | |
| | | // Limit the results to alias domains |
| | | $app->listform_actions->SQLExtWhere = "type = 'alias'"; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY domain'; |
| | | $app->listform_actions->SQLExtWhere = "web_domain.type = 'alias'"; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY web_domain.domain'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.limit_web_domain, client.default_webserver, client.contact_name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name, client." . implode(", client.", $read_limits) . " FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.limit_web_domain, client.default_webserver, client.contact_name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name, client." . implode(", client.", $read_limits) . " FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | |
| | | //* Get global web config |
| | | $web_config = $app->getconf->get_server_config($client['default_webserver'], 'web'); |
| | |
| | | unset($tmp); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>'; |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | | if(is_array($records)) { |
| | | foreach( $records as $rec) { |
| | | $selected = @(is_array($this->dataRecord) && ($rec["groupid"] == $this->dataRecord['client_group_id'] || $rec["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':''; |
| | | $client_select .= "<option value='$rec[groupid]' $selected>$rec[name] :: $rec[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$rec[groupid]' $selected>$rec[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | unset($php_records); |
| | | |
| | | // Fill the client select field |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = "<option value='0'></option>"; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | |
| | | foreach( $clients as $client) { |
| | | //$selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; |
| | | $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | |
| | | //* get the server config for this server |
| | | $app->uses("getconf"); |
| | | $web_config = $app->getconf->get_server_config($app->functions->intval(isset($this->dataRecord["server_id"]) ? $this->dataRecord["server_id"] : 0),'web'); |
| | | if($this->id > 0){ |
| | | $web_rec = $app->tform->getDataRecord($this->id); |
| | | $server_id = $web_rec["server_id"]; |
| | | } else { |
| | | // Get the first server ID |
| | | $tmp = $app->db->queryOneRecord("SELECT server_id FROM server WHERE web_server = 1 ORDER BY server_name LIMIT 0,1"); |
| | | $server_id = intval($tmp['server_id']); |
| | | } |
| | | $web_config = $app->getconf->get_server_config($app->functions->intval(isset($this->dataRecord["server_id"]) ? $this->dataRecord["server_id"] : $server_id),'web'); |
| | | //* Check for duplicate ssl certs per IP if SNI is disabled |
| | | if(isset($this->dataRecord['ssl']) && $this->dataRecord['ssl'] == 'y' && $web_config['enable_sni'] != 'y') { |
| | | $sql = "SELECT count(domain_id) as number FROM web_domain WHERE `ssl` = 'y' AND ip_address = '".$app->db->quote($this->dataRecord['ip_address'])."' and domain_id != ".$this->id; |
| | |
| | | } |
| | | } |
| | | |
| | | // Check rewrite rules |
| | | $server_type = $web_config['server_type']; |
| | | |
| | | if($server_type == 'nginx' && isset($this->dataRecord['rewrite_rules']) && trim($this->dataRecord['rewrite_rules']) != '') { |
| | | $rewrite_rules = trim($this->dataRecord['rewrite_rules']); |
| | | $rewrites_are_valid = true; |
| | | // use this counter to make sure all curly brackets are properly closed |
| | | $if_level = 0; |
| | | // Make sure we only have Unix linebreaks |
| | | $rewrite_rules = str_replace("\r\n", "\n", $rewrite_rules); |
| | | $rewrite_rules = str_replace("\r", "\n", $rewrite_rules); |
| | | $rewrite_rule_lines = explode("\n", $rewrite_rules); |
| | | if(is_array($rewrite_rule_lines) && !empty($rewrite_rule_lines)){ |
| | | foreach($rewrite_rule_lines as $rewrite_rule_line){ |
| | | // rewrite |
| | | if(preg_match('@^\s*rewrite\s+(^/)?\S+(\$)?\s+\S+(\s+(last|break|redirect|permanent|))?\s*;\s*$@', $rewrite_rule_line)) continue; |
| | | // if |
| | | if(preg_match('@^\s*if\s+\(\s*\$\S+(\s+(\!?(=|~|~\*))\s+(\S+|\".+\"))?\s*\)\s*\{\s*$@', $rewrite_rule_line)){ |
| | | $if_level += 1; |
| | | continue; |
| | | } |
| | | // if - check for files, directories, etc. |
| | | if(preg_match('@^\s*if\s+\(\s*\!?-(f|d|e|x)\s+\S+\s*\)\s*\{\s*$@', $rewrite_rule_line)){ |
| | | $if_level += 1; |
| | | continue; |
| | | } |
| | | // break |
| | | if(preg_match('@^\s*break\s*;\s*$@', $rewrite_rule_line)){ |
| | | $if_level += 1; |
| | | continue; |
| | | } |
| | | // return code [ text ] |
| | | if(preg_match('@^\s*return\s+\d\d\d.*;\s*$@', $rewrite_rule_line)) continue; |
| | | // return code URL |
| | | // return URL |
| | | if(preg_match('@^\s*return(\s+\d\d\d)?\s+(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&%\$\-]+)*\@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\?\'\\\+&%\$#\=~_\-]+))*\s*;\s*$@', $rewrite_rule_line)) continue; |
| | | // set |
| | | if(preg_match('@^\s*set\s+\$\S+\s+\S+\s*;\s*$@', $rewrite_rule_line)) continue; |
| | | // closing curly bracket |
| | | if(trim($rewrite_rule_line) == '}'){ |
| | | $if_level -= 1; |
| | | continue; |
| | | } |
| | | $rewrites_are_valid = false; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if(!$rewrites_are_valid || $if_level != 0){ |
| | | $app->tform->errorMessage .= $app->tform->lng("invalid_rewrite_rules_txt").'<br>'; |
| | | } |
| | | } |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | $list = new list_action; |
| | | $list->SQLExtWhere = "type = 'vhost' AND parent_domain_id = '0'"; |
| | | $list->SQLOrderBy = 'ORDER BY domain'; |
| | | $list->SQLExtWhere = "web_domain.type = 'vhost' AND web_domain.parent_domain_id = '0'"; |
| | | $list->SQLOrderBy = 'ORDER BY web_domain.domain'; |
| | | $list->onLoad(); |
| | | |
| | | ?> |
| | |
| | | $app->tpl_defaults(); |
| | | $app->tpl->pparse(); |
| | | } |
| | | |
| | | function getQueryString() { |
| | | global $app; |
| | | $sql_where = ''; |
| | | |
| | | //* Generate the search sql |
| | | if($app->listform->listDef['auth'] != 'no') { |
| | | if($_SESSION['s']['user']['typ'] == "admin") { |
| | | $sql_where = ''; |
| | | } else { |
| | | $sql_where = $app->tform->getAuthSQL('r', $app->listform->listDef['table']).' and'; |
| | | //$sql_where = $app->tform->getAuthSQL('r').' and'; |
| | | } |
| | | } |
| | | if($this->SQLExtWhere != '') { |
| | | $sql_where .= ' '.$this->SQLExtWhere.' and'; |
| | | } |
| | | |
| | | $sql_where = $app->listform->getSearchSQL($sql_where); |
| | | if($app->listform->listDef['join_sql']) $sql_where .= ' AND '.$app->listform->listDef['join_sql']; |
| | | $app->tpl->setVar($app->listform->searchValues); |
| | | |
| | | $order_by_sql = $this->SQLOrderBy; |
| | | |
| | | //* Generate SQL for paging |
| | | $limit_sql = $app->listform->getPagingSQL($sql_where); |
| | | $app->tpl->setVar('paging',$app->listform->pagingHTML); |
| | | |
| | | $extselect = ''; |
| | | $join = ''; |
| | | |
| | | if(!empty($_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'])){ |
| | | $order = str_replace(' DESC','',$_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order']); |
| | | list($tmp_table, $order) = explode('.', $order); |
| | | if($order == 'web_traffic_last_month'){ |
| | | $tmp_year = date('Y',mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | $tmp_month = date('m',mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | $extselect .= ', SUM(wt.traffic_bytes) as calctraffic'; |
| | | $join .= ' INNER JOIN web_traffic as wt ON '.$app->listform->listDef['table'].'.domain = wt.hostname '; |
| | | $sql_where .= " AND YEAR(wt.traffic_date) = '$tmp_year' AND MONTH(wt.traffic_date) = '$tmp_month'"; |
| | | $order_by_sql = str_replace($app->listform->listDef['table'].'.web_traffic_last_month','calctraffic',$order_by_sql); |
| | | $order_by_sql = "GROUP BY domain ".$order_by_sql; |
| | | } elseif($order == 'web_traffic_this_month'){ |
| | | $tmp_year = date('Y'); |
| | | $tmp_month = date('m'); |
| | | $extselect .= ', SUM(wt.traffic_bytes) as calctraffic'; |
| | | $join .= ' INNER JOIN web_traffic as wt ON '.$app->listform->listDef['table'].'.domain = wt.hostname '; |
| | | $sql_where .= " AND YEAR(wt.traffic_date) = '$tmp_year' AND MONTH(wt.traffic_date) = '$tmp_month'"; |
| | | $order_by_sql = str_replace($app->listform->listDef['table'].'.web_traffic_this_month','calctraffic',$order_by_sql); |
| | | $order_by_sql = "GROUP BY domain ".$order_by_sql; |
| | | } elseif($order == 'web_traffic_last_year'){ |
| | | $tmp_year = date('Y',mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); |
| | | $extselect .= ', SUM(wt.traffic_bytes) as calctraffic'; |
| | | $join .= ' INNER JOIN web_traffic as wt ON '.$app->listform->listDef['table'].'.domain = wt.hostname '; |
| | | $sql_where .= " AND YEAR(wt.traffic_date) = '$tmp_year'"; |
| | | $order_by_sql = str_replace($app->listform->listDef['table'].'.web_traffic_last_year','calctraffic',$order_by_sql); |
| | | $order_by_sql = "GROUP BY domain ".$order_by_sql; |
| | | } elseif($order == 'web_traffic_this_year'){ |
| | | $tmp_year = date('Y'); |
| | | $extselect .= ', SUM(wt.traffic_bytes) as calctraffic'; |
| | | $join .= ' INNER JOIN web_traffic as wt ON '.$app->listform->listDef['table'].'.domain = wt.hostname '; |
| | | $sql_where .= " AND YEAR(wt.traffic_date) = '$tmp_year'"; |
| | | $order_by_sql = str_replace($app->listform->listDef['table'].'.web_traffic_this_year','calctraffic',$order_by_sql); |
| | | $order_by_sql = "GROUP BY domain ".$order_by_sql; |
| | | } |
| | | } |
| | | |
| | | if($this->SQLExtSelect != '') { |
| | | if(substr($this->SQLExtSelect,0,1) != ',') $this->SQLExtSelect = ','.$this->SQLExtSelect; |
| | | $extselect .= $this->SQLExtSelect; |
| | | } |
| | | |
| | | $table_selects = array(); |
| | | $table_selects[] = trim($app->listform->listDef['table']).'.*'; |
| | | $app->listform->listDef['additional_tables'] = trim($app->listform->listDef['additional_tables']); |
| | | if($app->listform->listDef['additional_tables'] != ''){ |
| | | $additional_tables = explode(',', $app->listform->listDef['additional_tables']); |
| | | foreach($additional_tables as $additional_table){ |
| | | $table_selects[] = trim($additional_table).'.*'; |
| | | } |
| | | } |
| | | $select = implode(', ', $table_selects); |
| | | |
| | | $sql = 'SELECT '.$select.$extselect.' FROM '.$app->listform->listDef['table'].($app->listform->listDef['additional_tables'] != ''? ','.$app->listform->listDef['additional_tables'] : '')."$join WHERE $sql_where $order_by_sql $limit_sql"; |
| | | return $sql; |
| | | } |
| | | } |
| | | |
| | | $list = new list_action; |
| | | $list->SQLExtWhere = "(type = 'vhost' or type = 'vhostsubdomain')"; |
| | | $list->SQLOrderBy = 'ORDER BY domain'; |
| | | $list->SQLExtWhere = "(web_domain.type = 'vhost' or web_domain.type = 'vhostsubdomain')"; |
| | | $list->SQLOrderBy = 'ORDER BY web_domain.domain'; |
| | | $list->onLoad(); |
| | | |
| | | |
| | |
| | | $app->uses('listform_actions'); |
| | | |
| | | // Limit the results to alias domains |
| | | $app->listform_actions->SQLExtWhere = "type = 'subdomain'"; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY domain'; |
| | | $app->listform_actions->SQLExtWhere = "web_domain.type = 'subdomain'"; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY web_domain.domain'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.limit_web_subdomain, client.default_webserver, client.contact_name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name, client." . implode(", client.", $read_limits) . " FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.limit_web_subdomain, client.default_webserver, client.contact_name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name, client." . implode(", client.", $read_limits) . " FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | |
| | | //* Get global web config |
| | | $web_config = $app->getconf->get_server_config($parent_domain['server_id'], 'web'); |
| | |
| | | $app->uses('listform_actions'); |
| | | |
| | | // Limit the results to alias domains |
| | | $app->listform_actions->SQLExtWhere = "type = 'vhostsubdomain'"; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY domain'; |
| | | $app->listform_actions->SQLExtWhere = "web_domain.type = 'vhostsubdomain'"; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY web_domain.domain'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | |
| | |
| | | $app->auth->check_module_permissions('sites'); |
| | | |
| | | $app->uses('listform_actions'); |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY username'; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY webdav_user.username'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | |
| | |
| | | |
| | | #topNav a { |
| | | background: url("../icons/x32_sprite.png") no-repeat #D3D3D3; |
| | | border-top-left-radius:5px;
|
| | | border-top-right-radius:5px;
|
| | | color:black; |
| | | display:inline-block; |
| | | height:20px; |
| | |
| | | font-family: Consolas, "Lucida Console", "Courier New", monospace; |
| | | font-size: 0.9em; |
| | | } |
| | | .codeview .logerror { background: rgb(255,0,0); } |
| | | .codeview .logwarn { background: rgb(255,204,0); } |
| | | .codeview .loginfo { background: rgb(153,204,255); } |
| | | /* Lists */ |
| | | table.list { |
| | | width: 100%; |
| | |
| | | width:60px; |
| | | height: 60px; |
| | | border:1px dotted #888888; |
| | | border-radius:5px;
|
| | | background-color: #cccccc; |
| | | margin:10px; |
| | | background-position: center 5px; |
| | |
| | | .selectInput.formLengthLimit { width: 85px !important; } |
| | | .formLengthDate { width: 75px !important; } |
| | | .formLengthIPv4 { width: 125px !important; } |
| | | .formLengthIPv6 { width: 100% !important; } |
| | | .formLengthIPv6 { }
|
| | | .formLengthEmailUser { width: 30% !important; } |
| | | .formLengthEmailDomain { width: 30% !important; } |
| | | .formLengthHalf { width: 15% !important; } |
| | |
| | | background-color: #DFDFDF; |
| | | font-weight: bold; |
| | | } |
| | |
|
| | | .command {
|
| | | padding: 1em;
|
| | | border: 1px dashed #2f6fab;
|
| | | color: black;
|
| | | background-color: #f9f9f9;
|
| | | line-height: 1.1em;
|
| | | font-family: Courier New, Courier, mono;
|
| | | font-size: 12px;
|
| | | font-style: italic;
|
| | | }
|
| | | .system {
|
| | | color: black;
|
| | | font-family: Courier New, Courier, mono;
|
| | | font-size: 12px;
|
| | | font-style: italic;
|
| | | }
|
| | | .highlight {
|
| | | color: #FF0000;
|
| | | font-family: Georgia, "Times New Roman", Times, serif;
|
| | | font-size: 12px;
|
| | | text-decoration: underline;
|
| | | } |
| | |
| | | |
| | | // Store password in browser; works in Firefox, but not Chrome |
| | | $('#username').live("blur", function(){ |
| | | if($('#username').val() == '') { |
| | | return true; |
| | | } |
| | | if($('#dummy_username').val() == '' || $('#dummy_username').val() != $(this).val()){ |
| | | $('#dummy_login').show(); |
| | | $('#dummy_username').attr('value', $(this).val()).trigger('focus').trigger('blur'); |
| | |
| | | $app->uses('listform_actions'); |
| | | |
| | | // $app->listform_actions->SQLExtWhere = "limit_client = 0"; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY server_id,ip_address'; |
| | | $app->listform_actions->SQLOrderBy = 'ORDER BY openvz_ip.server_id, openvz_ip.ip_address'; |
| | | $app->listform_actions->onLoad(); |
| | | |
| | | |
| | |
| | | |
| | | //* Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, client.limit_openvz_vm_template_id, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, client.limit_openvz_vm_template_id, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | |
| | | |
| | | //* Fill the client select field |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name"; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>'; |
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>'; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | | if(is_array($records)) { |
| | | foreach( $records as $rec) { |
| | | $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':''; |
| | | $client_select .= "<option value='$rec[groupid]' $selected>$rec[name] :: $rec[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$rec[groupid]' $selected>$rec[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | } else { |
| | | |
| | | //* Fill the client select field |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name"; |
| | | $clients = $app->db->queryAllRecords($sql); |
| | | $client_select = "<option value='0'></option>"; |
| | | //$tmp_data_record = $app->tform->getDataRecord($this->id); |
| | | if(is_array($clients)) { |
| | | foreach( $clients as $client) { |
| | | $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':''; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n"; |
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; |
| | | } |
| | | } |
| | | $app->tpl->setVar("client_group_id",$client_select); |
| | |
| | | [options] |
| | | # message_log = /var/log/getmail.log |
| | | message_log_syslog = 1 |
| | | message_log_syslog = true |
| | | delete = {DELETE} |
| | | read_all = {READ_ALL} |
| | | |
New file |
| | |
| | | MIME-Version: 1.0 |
| | | Content-type: text/plain; charset=utf-8 |
| | | Content-Transfer-Encoding: 8bit |
| | | From: {admin_mail} |
| | | Reply-To: {admin_mail} |
| | | Subject: E-Mail Kontobelegungshinweis |
| | | |
| | | Ihr E-Mail Konto {email} hat den verfügbaren Speicherplatz (nahezu) ausgeschöpft. |
| | | |
| | | E-Mail Konto: {email} |
| | | Name: {name} |
| | | Belegter Speicher: {used} |
| | | Verfügbarer Speicher: {quota} |
| | | Belegt: {ratio} |
New file |
| | |
| | | MIME-Version: 1.0 |
| | | Content-type: text/plain; charset=utf-8 |
| | | Content-Transfer-Encoding: 8bit |
| | | From: {admin_mail} |
| | | Reply-To: {admin_mail} |
| | | Subject: Mailbox quota notification |
| | | |
| | | The mailbox {email} is near or over quota. |
| | | |
| | | Mailbox: {email} |
| | | Name: {name} |
| | | Used space: {used} |
| | | Quota: {quota} |
| | | Usage ratio: {ratio} |
New file |
| | |
| | | MIME-Version: 1.0 |
| | | Content-type: text/plain; charset=utf-8 |
| | | Content-Transfer-Encoding: 8bit |
| | | From: {admin_mail} |
| | | Reply-To: {admin_mail} |
| | | Subject: E-Mail Kontobelegungshinweis |
| | | |
| | | Der belegte Speicherplatz Ihres E-Mail Kontos {email} ist wieder ok. |
| | | |
| | | E-Mail Konto: {email} |
| | | Name: {name} |
| | | Belegter Speicher: {used} |
| | | Verfügbarer Speicher: {quota} |
| | | Belegt: {ratio} |
New file |
| | |
| | | MIME-Version: 1.0 |
| | | Content-type: text/plain; charset=utf-8 |
| | | Content-Transfer-Encoding: 8bit |
| | | From: {admin_mail} |
| | | Reply-To: {admin_mail} |
| | | Subject: Mailbox quota ok |
| | | |
| | | The mailbox {email} is no longer near or over quota. |
| | | |
| | | Mailbox: {email} |
| | | Name: {name} |
| | | Used space: {used} |
| | | Quota: {quota} |
| | | Usage ratio: {ratio} |
New file |
| | |
| | | MIME-Version: 1.0 |
| | | Content-type: text/plain; charset=utf-8 |
| | | Content-Transfer-Encoding: 8bit |
| | | From: {admin_mail} |
| | | Reply-To: {admin_mail} |
| | | Subject: Webseiten-Speicherhinweis |
| | | |
| | | Ihre Webseite {domain} hat den verfügbaren Speicherplatz (nahezu) ausgeschöpft. |
| | | |
| | | Webseite: {domain} |
| | | Belegter Speicherplatz: {used} |
| | | Verfügbarer Speicherplatz: {soft} |
| | | Verfügbarer Speicherplatz (hard quota): {hard} |
| | | Belegter Speicher in %: {ratio} |
New file |
| | |
| | | MIME-Version: 1.0 |
| | | Content-type: text/plain; charset=utf-8 |
| | | Content-Transfer-Encoding: 8bit |
| | | From: {admin_mail} |
| | | Reply-To: {admin_mail} |
| | | Subject: Website quota notification |
| | | |
| | | The website {domain} is near or over quota. |
| | | |
| | | Domain: {domain} |
| | | Used space: {used} |
| | | Soft limit: {soft} |
| | | Hard limit: {hard} |
| | | Usage ratio: {ratio} |
New file |
| | |
| | | MIME-Version: 1.0 |
| | | Content-type: text/plain; charset=utf-8 |
| | | Content-Transfer-Encoding: 8bit |
| | | From: {admin_mail} |
| | | Reply-To: {admin_mail} |
| | | Subject: Webseiten-Speicherhinweis |
| | | |
| | | Der belegte Speicherplatz Ihrer Webseite {domain} ist wieder ok. |
| | | |
| | | Webseite: {domain} |
| | | Belegter Speicherplatz: {used} |
| | | Verfügbarer Speicherplatz: {soft} |
| | | Verfügbarer Speicherplatz (hard quota): {hard} |
| | | Belegter Speicher in %: {ratio} |
New file |
| | |
| | | MIME-Version: 1.0 |
| | | Content-type: text/plain; charset=utf-8 |
| | | Content-Transfer-Encoding: 8bit |
| | | From: {admin_mail} |
| | | Reply-To: {admin_mail} |
| | | Subject: Website quota ok |
| | | |
| | | The website {domain} is no longer near or over quota. |
| | | |
| | | Domain: {domain} |
| | | Used space: {used} |
| | | Soft limit: {soft} |
| | | Hard limit: {hard} |
| | | Usage ratio: {ratio} |
New file |
| | |
| | | MIME-Version: 1.0 |
| | | Content-type: text/plain; charset=utf-8 |
| | | Content-Transfer-Encoding: 8bit |
| | | From: {admin_mail} |
| | | Reply-To: {admin_mail} |
| | | Subject: Traffic-Warnung |
| | | |
| | | Ihre Webseite {domain} hat den verfügbaren Traffic ausgeschöpft und wurde vorrübergehend deaktiviert. |
| | |
| | | MIME-Version: 1.0 |
| | | Content-type: text/plain; charset=utf-8 |
| | | Content-Transfer-Encoding: 8bit |
| | | From: {admin_mail} |
| | | Reply-To: {admin_mail} |
| | | Subject:Website traffic notification |
| | | |
| | | The website {domain} is over traffic and has been disabled. |
| | |
| | | } |
| | | </tmpl_if> |
| | | |
| | | <tmpl_loop name="rewrite_rules"> |
| | | <tmpl_var name='rewrite_rule'> |
| | | </tmpl_loop> |
| | | |
| | | <tmpl_loop name="nginx_directives"> |
| | | <tmpl_var name='nginx_directive'> |
| | | </tmpl_loop> |
| | |
| | | // Create webalizer statistics |
| | | ####################################################################################################### |
| | | |
| | | function setConfigVar( $filename, $varName, $varValue ) { |
| | | function setConfigVar( $filename, $varName, $varValue, $append = 0 ) { |
| | | if($lines = @file($filename)) { |
| | | $out = ''; |
| | | $found = 0; |
| | |
| | | } |
| | | } |
| | | |
| | | ######### |
| | | // function for sending notification emails |
| | | ######### |
| | | function send_notification_email($template, $placeholders, $recipients) { |
| | | global $conf; |
| | | |
| | | if(!is_array($recipients) || count($recipients) < 1) return false; |
| | | if(!is_array($placeholders)) $placeholders = array(); |
| | | |
| | | if(file_exists($conf['rootpath'].'/conf-custom/mail/' . $template . '_'.$conf['language'].'.txt')) { |
| | | $lines = file($conf['rootpath'].'/conf-custom/mail/' . $template . '_'.$conf['language'].'.txt'); |
| | | } elseif(file_exists($conf['rootpath'].'/conf-custom/mail/' . $template . '_en.txt')) { |
| | | $lines = file($conf['rootpath'].'/conf-custom/mail/' . $template . '_en.txt'); |
| | | } elseif(file_exists($conf['rootpath'].'/conf/mail/' . $template . '_'.$conf['language'].'.txt')) { |
| | | $lines = file($conf['rootpath'].'/conf/mail/' . $template . '_'.$conf['language'].'.txt'); |
| | | } else { |
| | | $lines = file($conf['rootpath'].'/conf/mail/' . $template . '_en.txt'); |
| | | } |
| | | |
| | | //* get mail headers, subject and body |
| | | $mailHeaders = ''; |
| | | $mailBody = ''; |
| | | $mailSubject = ''; |
| | | $inHeader = true; |
| | | for($l = 0; $l < count($lines); $l++) { |
| | | if($lines[$l] == '') { |
| | | $inHeader = false; |
| | | continue; |
| | | } |
| | | if($inHeader == true) { |
| | | $parts = explode(':', $lines[$l], 2); |
| | | if(strtolower($parts[0]) == 'subject') $mailSubject = trim($parts[1]); |
| | | unset($parts); |
| | | $mailHeaders .= trim($lines[$l]) . "\n"; |
| | | } else { |
| | | $mailBody .= trim($lines[$l]) . "\n"; |
| | | } |
| | | } |
| | | $mailBody = trim($mailBody); |
| | | |
| | | //* Replace placeholders |
| | | $mailHeaders = strtr($mailHeaders, $placeholders); |
| | | $mailSubject = strtr($mailSubject, $placeholders); |
| | | $mailBody = strtr($mailBody, $placeholders); |
| | | |
| | | for($r = 0; $r < count($recipients); $r++) { |
| | | mail($recipients[$r], $mailSubject, $mailBody, $mailHeaders); |
| | | } |
| | | |
| | | unset($mailSubject); |
| | | unset($mailHeaders); |
| | | unset($mailBody); |
| | | unset($lines); |
| | | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | ####################################################################################################### |
| | | // enforce traffic quota (run only on the "master-server") |
| | | ####################################################################################################### |
| | |
| | | $app->log('Traffic quota for '.$rec['domain'].' exceeded. Disabling website.',LOGLEVEL_DEBUG); |
| | | |
| | | //* Send traffic notifications |
| | | if($web_config['overtraffic_notify_admin'] == 'y' || $web_config['overtraffic_notify_client'] == 'y') { |
| | | if($rec['traffic_quota_lock'] != 'y' && ($web_config['overtraffic_notify_admin'] == 'y' || $web_config['overtraffic_notify_client'] == 'y')) { |
| | | |
| | | if(file_exists($conf['rootpath'].'/conf-custom/mail/web_traffic_notification_'.$conf['language'].'.txt')) { |
| | | $lines = file($conf['rootpath'].'/conf-custom/mail/web_traffic_notification_'.$conf['language'].'.txt'); |
| | | } elseif(file_exists($conf['rootpath'].'/conf-custom/mail/web_traffic_notification_en.txt')) { |
| | | $lines = file($conf['rootpath'].'/conf-custom/mail/web_traffic_notification_en.txt'); |
| | | } elseif(file_exists($conf['rootpath'].'/conf/mail/web_traffic_notification_'.$conf['language'].'.txt')) { |
| | | $lines = file($conf['rootpath'].'/conf/mail/web_traffic_notification_'.$conf['language'].'.txt'); |
| | | } else { |
| | | $lines = file($conf['rootpath'].'/conf/mail/web_traffic_notification_en.txt'); |
| | | } |
| | | $placeholders = array('{domain}' => $rec['domain'], |
| | | '{admin_mail}' => $global_config['admin_mail']); |
| | | |
| | | //* Get subject |
| | | $parts = explode(':',trim($lines[0])); |
| | | unset($parts[0]); |
| | | $traffic_mail_subject = implode(':',$parts); |
| | | unset($lines[0]); |
| | | |
| | | //* Get message |
| | | $traffic_mail_message = trim(implode($lines)); |
| | | unset($tmp); |
| | | |
| | | //* Replace placeholders |
| | | $traffic_mail_message = str_replace('{domain}',$rec['domain'],$traffic_mail_message); |
| | | |
| | | $mailHeaders = "MIME-Version: 1.0" . "\n"; |
| | | $mailHeaders .= "Content-type: text/plain; charset=utf-8" . "\n"; |
| | | $mailHeaders .= "Content-Transfer-Encoding: 8bit" . "\n"; |
| | | $mailHeaders .= "From: ". $global_config['admin_mail'] . "\n"; |
| | | $mailHeaders .= "Reply-To: ". $global_config['admin_mail'] . "\n"; |
| | | $mailSubject = "=?utf-8?B?".base64_encode($traffic_mail_subject)."?="; |
| | | |
| | | $recipients = array(); |
| | | //* send email to admin |
| | | if($global_config['admin_mail'] != '' && $web_config['overtraffic_notify_admin'] == 'y') { |
| | | mail($global_config['admin_mail'], $mailSubject, $traffic_mail_message, $mailHeaders); |
| | | $recipients[] = $global_config['admin_mail']; |
| | | } |
| | | |
| | | //* Send email to client |
| | |
| | | $client_group_id = $rec["sys_groupid"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.email FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | if($client['email'] != '') { |
| | | mail($client['email'], $mailSubject, $traffic_mail_message, $mailHeaders); |
| | | $recipients[] = $client['email']; |
| | | } |
| | | } |
| | | |
| | | send_notification_email('web_traffic_notification', $placeholders, $recipients); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | ####################################################################################################### |
| | | // send website quota warnings by email |
| | | ####################################################################################################### |
| | | |
| | | if ($app->dbmaster == $app->db) { |
| | | |
| | | $global_config = $app->getconf->get_global_config('mail'); |
| | | |
| | | //* Check website disk quota |
| | | $sql = "SELECT domain_id,sys_groupid,domain,system_user,last_quota_notification,DATEDIFF(CURDATE(), last_quota_notification) as `notified_before` FROM web_domain WHERE (type = 'vhost' OR type = 'vhostsubdomain')"; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | if(is_array($records) && !empty($records)) { |
| | | |
| | | $tmp_rec = $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'harddisk_quota' ORDER BY created DESC"); |
| | | $monitor_data = array(); |
| | | if(is_array($tmp_rec)) { |
| | | foreach ($tmp_rec as $tmp_mon) { |
| | | $monitor_data = array_merge_recursive($monitor_data,unserialize($app->db->unquote($tmp_mon['data']))); |
| | | } |
| | | } |
| | | |
| | | foreach($records as $rec) { |
| | | |
| | | //$web_hd_quota = $rec['hd_quota']; |
| | | $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']; |
| | | |
| | | if (!is_numeric($rec['used'])){ |
| | | if ($rec['used'][0] > $rec['used'][1]){ |
| | | $rec['used'] = $rec['used'][0]; |
| | | } else { |
| | | $rec['used'] = $rec['used'][1]; |
| | | } |
| | | } |
| | | if (!is_numeric($rec['soft'])) $rec['soft']=$rec['soft'][1]; |
| | | if (!is_numeric($rec['hard'])) $rec['hard']=$rec['hard'][1]; |
| | | if (!is_numeric($rec['files'])) $rec['files']=$rec['files'][1]; |
| | | |
| | | // used space ratio |
| | | if($rec['soft'] > 0){ |
| | | $used_ratio = $rec['used']/$rec['soft']; |
| | | } else { |
| | | $used_ratio = 0; |
| | | } |
| | | |
| | | $rec['ratio'] = number_format($used_ratio * 100, 2, '.', '').'%'; |
| | | |
| | | if($rec['used'] > 1024) { |
| | | $rec['used'] = round($rec['used'] / 1024,2).' MB'; |
| | | } else { |
| | | if ($rec['used'] != '') $rec['used'] .= ' KB'; |
| | | } |
| | | |
| | | if($rec['soft'] > 1024) { |
| | | $rec['soft'] = round($rec['soft'] / 1024,2).' MB'; |
| | | } elseif($rec['soft'] == 0){ |
| | | $rec['soft'] = '----'; |
| | | } else { |
| | | $rec['soft'] .= ' KB'; |
| | | } |
| | | |
| | | if($rec['hard'] > 1024) { |
| | | $rec['hard'] = round($rec['hard'] / 1024,2).' MB'; |
| | | } elseif($rec['hard'] == 0){ |
| | | $rec['hard'] = '----'; |
| | | } else { |
| | | $rec['hard'] .= ' KB'; |
| | | } |
| | | |
| | | // send notifications only if 90% or more of the quota are used |
| | | if($used_ratio < 0.9) { |
| | | // reset notification date |
| | | if($rec['last_quota_notification']) $app->dbmaster->datalogUpdate('web_domain', "last_quota_notification = NULL", 'domain_id', $rec['domain_id']); |
| | | |
| | | // send notification - everything ok again |
| | | if($rec['last_quota_notification'] && $web_config['overquota_notify_onok'] == 'y' && ($web_config['overquota_notify_admin'] == 'y' || $web_config['overquota_notify_client'] == 'y')) { |
| | | $placeholders = array('{domain}' => $rec['domain'], |
| | | '{admin_mail}' => $global_config['admin_mail'], |
| | | '{used}' => $rec['used'], |
| | | '{soft}' => $rec['soft'], |
| | | '{hard}' => $rec['hard'], |
| | | '{ratio}' => $rec['ratio']); |
| | | |
| | | $recipients = array(); |
| | | |
| | | //* send email to admin |
| | | if($global_config['admin_mail'] != '' && $web_config['overquota_notify_admin'] == 'y') { |
| | | $recipients[] = $global_config['admin_mail']; |
| | | } |
| | | |
| | | //* Send email to client |
| | | if($web_config['overquota_notify_client'] == 'y') { |
| | | $client_group_id = $rec["sys_groupid"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.email FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | if($client['email'] != '') { |
| | | $recipients[] = $client['email']; |
| | | } |
| | | } |
| | | send_notification_email('web_quota_ok_notification', $placeholders, $recipients); |
| | | } |
| | | |
| | | continue; |
| | | } |
| | | |
| | | // could a notification be sent? |
| | | $send_notification = false; |
| | | if(!$rec['last_quota_notification']) $send_notification = true; // not yet notified |
| | | elseif($web_config['overquota_notify_freq'] > 0 && $rec['notified_before'] >= $web_config['overquota_notify_freq']) $send_notification = true; |
| | | |
| | | //* Send quota notifications |
| | | if(($web_config['overquota_notify_admin'] == 'y' || $web_config['overquota_notify_client'] == 'y') && $send_notification == true) { |
| | | $app->dbmaster->datalogUpdate('web_domain', "last_quota_notification = CURDATE()", 'domain_id', $rec['domain_id']); |
| | | |
| | | $placeholders = array('{domain}' => $rec['domain'], |
| | | '{admin_mail}' => $global_config['admin_mail'], |
| | | '{used}' => $rec['used'], |
| | | '{soft}' => $rec['soft'], |
| | | '{hard}' => $rec['hard'], |
| | | '{ratio}' => $rec['ratio']); |
| | | |
| | | $recipients = array(); |
| | | |
| | | //* send email to admin |
| | | if($global_config['admin_mail'] != '' && $web_config['overquota_notify_admin'] == 'y') { |
| | | $recipients[] = $global_config['admin_mail']; |
| | | } |
| | | |
| | | //* Send email to client |
| | | if($web_config['overquota_notify_client'] == 'y') { |
| | | $client_group_id = $rec["sys_groupid"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.email FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | if($client['email'] != '') { |
| | | $recipients[] = $client['email']; |
| | | } |
| | | } |
| | | send_notification_email('web_quota_notification', $placeholders, $recipients); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | ####################################################################################################### |
| | | // send mail quota warnings by email |
| | | ####################################################################################################### |
| | | |
| | | if ($app->dbmaster == $app->db) { |
| | | |
| | | $global_config = $app->getconf->get_global_config('mail'); |
| | | $mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail'); |
| | | |
| | | //* Check email quota |
| | | $sql = "SELECT mailuser_id,sys_groupid,email,name,quota,last_quota_notification,DATEDIFF(CURDATE(), last_quota_notification) as `notified_before` FROM mail_user"; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | if(is_array($records) && !empty($records)) { |
| | | |
| | | $tmp_rec = $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'email_quota' ORDER BY created DESC"); |
| | | $monitor_data = array(); |
| | | if(is_array($tmp_rec)) { |
| | | foreach ($tmp_rec as $tmp_mon) { |
| | | //$monitor_data = array_merge_recursive($monitor_data,unserialize($app->db->unquote($tmp_mon['data']))); |
| | | $tmp_array = unserialize($app->db->unquote($tmp_mon['data'])); |
| | | if(is_array($tmp_array)) { |
| | | foreach($tmp_array as $username => $data) { |
| | | if(@!$monitor_data[$username]['used']) $monitor_data[$username]['used'] = $data['used']; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | foreach($records as $rec) { |
| | | |
| | | $email = $rec['email']; |
| | | |
| | | $rec['used'] = isset($monitor_data[$email]['used']) ? $monitor_data[$email]['used'] : array(1 => 0); |
| | | |
| | | if (!is_numeric($rec['used'])) $rec['used']=$rec['used'][1]; |
| | | |
| | | // used space ratio |
| | | if($rec['quota'] > 0){ |
| | | $used_ratio = $rec['used']/$rec['quota']; |
| | | } else { |
| | | $used_ratio = 0; |
| | | } |
| | | |
| | | $rec['ratio'] = number_format($used_ratio * 100, 2, '.', '').'%'; |
| | | |
| | | if($rec['quota'] > 0){ |
| | | $rec['quota'] = round($rec['quota'] / 1048576,4).' MB'; |
| | | } else { |
| | | $rec['quota'] = '----'; |
| | | } |
| | | |
| | | if($rec['used'] < 1544000) { |
| | | $rec['used'] = round($rec['used'] / 1024,4).' KB'; |
| | | } else { |
| | | $rec['used'] = round($rec['used'] / 1048576,4).' MB'; |
| | | } |
| | | |
| | | // send notifications only if 90% or more of the quota are used |
| | | if($used_ratio < 0.9) { |
| | | // reset notification date |
| | | if($rec['last_quota_notification']) $app->dbmaster->datalogUpdate('mail_user', "last_quota_notification = NULL", 'mailuser_id', $rec['mailuser_id']); |
| | | |
| | | // send notification - everything ok again |
| | | if($rec['last_quota_notification'] && $mail_config['overquota_notify_onok'] == 'y' && ($mail_config['overquota_notify_admin'] == 'y' || $mail_config['overquota_notify_client'] == 'y')) { |
| | | $placeholders = array('{email}' => $rec['email'], |
| | | '{admin_mail}' => $global_config['admin_mail'], |
| | | '{used}' => $rec['used'], |
| | | '{name}' => $rec['name'], |
| | | '{quota}' => $rec['quota'], |
| | | '{ratio}' => $rec['ratio']); |
| | | |
| | | $recipients = array(); |
| | | //* send email to admin |
| | | if($global_config['admin_mail'] != '' && $mail_config['overquota_notify_admin'] == 'y') { |
| | | $recipients[] = $global_config['admin_mail']; |
| | | } |
| | | |
| | | //* Send email to client |
| | | if($mail_config['overquota_notify_client'] == 'y') { |
| | | $client_group_id = $rec["sys_groupid"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.email FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | if($client['email'] != '') { |
| | | $recipients[] = $client['email']; |
| | | } |
| | | } |
| | | |
| | | send_notification_email('mail_quota_ok_notification', $placeholders, $recipients); |
| | | } |
| | | |
| | | continue; |
| | | } |
| | | |
| | | //* Send quota notifications |
| | | // could a notification be sent? |
| | | $send_notification = false; |
| | | if(!$rec['last_quota_notification']) $send_notification = true; // not yet notified |
| | | elseif($mail_config['overquota_notify_freq'] > 0 && $rec['notified_before'] >= $mail_config['overquota_notify_freq']) $send_notification = true; |
| | | |
| | | if(($mail_config['overquota_notify_admin'] == 'y' || $mail_config['overquota_notify_client'] == 'y') && $send_notification == true) { |
| | | $app->dbmaster->datalogUpdate('mail_user', "last_quota_notification = CURDATE()", 'mailuser_id', $rec['mailuser_id']); |
| | | |
| | | $placeholders = array('{email}' => $rec['email'], |
| | | '{admin_mail}' => $global_config['admin_mail'], |
| | | '{used}' => $rec['used'], |
| | | '{name}' => $rec['name'], |
| | | '{quota}' => $rec['quota'], |
| | | '{ratio}' => $rec['ratio']); |
| | | |
| | | $recipients = array(); |
| | | //* send email to admin |
| | | if($global_config['admin_mail'] != '' && $mail_config['overquota_notify_admin'] == 'y') { |
| | | $recipients[] = $global_config['admin_mail']; |
| | | } |
| | | |
| | | //* Send email to client |
| | | if($mail_config['overquota_notify_client'] == 'y') { |
| | | $client_group_id = $rec["sys_groupid"]; |
| | | $client = $app->db->queryOneRecord("SELECT client.email FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | if($client['email'] != '') { |
| | | $recipients[] = $client['email']; |
| | | } |
| | | } |
| | | |
| | | send_notification_email('mail_quota_notification', $placeholders, $recipients); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | if($backup_mode == 'userzip') { |
| | | //* Create a .zip backup as web user and include also files owned by apache / nginx user |
| | | $web_backup_file = 'web'.$web_id.'_'.date('Y-m-d_H-i').'.zip'; |
| | | exec('cd '.escapeshellarg($web_path).' && sudo -u '.escapeshellarg($web_user).' find . -group '.escapeshellarg($web_group).' -print 2> /dev/null | zip -b /tmp --exclude=backup\* --symlinks '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' -@'); |
| | | exec('cd '.escapeshellarg($web_path).' && sudo -u '.escapeshellarg($web_user).' find . -user '.escapeshellarg($http_server_user).' -print 2> /dev/null | zip -b /tmp --exclude=backup\* --update --symlinks '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' -@'); |
| | | exec('cd '.escapeshellarg($web_path).' && sudo -u '.escapeshellarg($web_user).' find . -group '.escapeshellarg($web_group).' -print 2> /dev/null | zip -b /tmp --exclude=backup\* --symlinks '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' -@', $tmp_output, $retval); |
| | | if($retval == 0) exec('cd '.escapeshellarg($web_path).' && sudo -u '.escapeshellarg($web_user).' find . -user '.escapeshellarg($http_server_user).' -print 2> /dev/null | zip -b /tmp --exclude=backup\* --update --symlinks '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' -@', $tmp_output, $retval); |
| | | } else { |
| | | //* Create a tar.gz backup as root user |
| | | $web_backup_file = 'web'.$web_id.'_'.date('Y-m-d_H-i').'.tar.gz'; |
| | | exec('tar pczf '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' --exclude=backup\* --directory '.escapeshellarg($web_path).' .'); |
| | | exec('tar pczf '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' --exclude=backup\* --directory '.escapeshellarg($web_path).' .', $tmp_output, $retval); |
| | | } |
| | | if($retval == 0){ |
| | | chown($web_backup_dir.'/'.$web_backup_file, 'root'); |
| | | chgrp($web_backup_dir.'/'.$web_backup_file, 'root'); |
| | | chmod($web_backup_dir.'/'.$web_backup_file, 0750); |
| | |
| | | //* Insert web backup record in database
|
| | | //$insert_data = "(server_id,parent_domain_id,backup_type,backup_mode,tstamp,filename) VALUES (".$conf['server_id'].",".$web_id.",'web','".$backup_mode."',".time().",'".$app->db->quote($web_backup_file)."')";
|
| | | //$app->dbmaster->datalogInsert('web_backup', $insert_data, 'backup_id');
|
| | |
|
| | | $sql = "INSERT INTO web_backup (server_id,parent_domain_id,backup_type,backup_mode,tstamp,filename,filesize) VALUES (".$conf['server_id'].",".$web_id.",'web','".$backup_mode."',".time().",'".$app->db->quote($web_backup_file)."','".formatBytes(filesize($web_backup_dir.'/'.$web_backup_file))."')";
|
| | | $sql = "INSERT INTO web_backup (server_id,parent_domain_id,backup_type,backup_mode,tstamp,filename) VALUES (".$conf['server_id'].",".$web_id.",'web','".$backup_mode."',".time().",'".$app->db->quote($web_backup_file)."')"; |
| | | $app->db->query($sql);
|
| | | if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql);
|
| | | } else { |
| | | if(is_file($web_backup_dir.'/'.$web_backup_file)) unlink($web_backup_dir.'/'.$web_backup_file); |
| | | } |
| | |
|
| | | //* Remove old backups |
| | | $backup_copies = intval($rec['backup_copies']); |
| | |
| | | $db_name = $rec['database_name']; |
| | | $db_backup_file = 'db_'.$db_name.'_'.date('Y-m-d_H-i').'.sql'; |
| | | $command = "mysqldump -h '".escapeshellcmd($clientdb_host)."' -u '".escapeshellcmd($clientdb_user)."' -p'".escapeshellcmd($clientdb_password)."' -c --add-drop-table --create-options --quick --result-file='".$db_backup_dir.'/'.$db_backup_file."' '".$db_name."'"; |
| | | exec($command); |
| | | exec($command, $tmp_output, $retval); |
| | | |
| | | //* Compress the backup with gzip |
| | | exec("gzip -c '".escapeshellcmd($db_backup_dir.'/'.$db_backup_file)."' > '".escapeshellcmd($db_backup_dir.'/'.$db_backup_file).".gz'"); |
| | | if($retval == 0) exec("gzip -c '".escapeshellcmd($db_backup_dir.'/'.$db_backup_file)."' > '".escapeshellcmd($db_backup_dir.'/'.$db_backup_file).".gz'", $tmp_output, $retval); |
| | | |
| | | if($retval == 0){ |
| | | chmod($db_backup_dir.'/'.$db_backup_file.'.gz', 0750); |
| | | chown($db_backup_dir.'/'.$db_backup_file.'.gz', fileowner($db_backup_dir)); |
| | | chgrp($db_backup_dir.'/'.$db_backup_file.'.gz', filegroup($db_backup_dir)); |
| | |
| | | $app->db->query($sql); |
| | | if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql); |
| | | |
| | | } else { |
| | | if(is_file($db_backup_dir.'/'.$db_backup_file.'.gz')) unlink($db_backup_dir.'/'.$db_backup_file.'.gz'); |
| | | } |
| | | //* Remove the uncompressed file |
| | | unlink($db_backup_dir.'/'.$db_backup_file); |
| | | if(is_file($db_backup_dir.'/'.$db_backup_file)) unlink($db_backup_dir.'/'.$db_backup_file); |
| | | |
| | | //* Remove old backups |
| | | $backup_copies = intval($rec['backup_copies']); |
| | |
| | | |
| | | global $conf; |
| | | |
| | | if($priority >= $conf['log_priority']) { |
| | | //if (is_writable($conf["log_file"])) { |
| | | if (!$fp = fopen ($conf['log_file'], 'a')) { |
| | | die('Unable to open logfile.'); |
| | | } |
| | | switch ($priority) { |
| | | case 0: |
| | | $priority_txt = 'DEBUG'; |
| | |
| | | $priority_txt = 'ERROR'; |
| | | break; |
| | | } |
| | | $log_msg = @date('d.m.Y-H:i').' - '.$priority_txt.' - '. $msg; |
| | | |
| | | if (!fwrite($fp, @date('d.m.Y-H:i').' - '.$priority_txt.' - '. $msg."\r\n")) { |
| | | if($priority >= $conf['log_priority']) { |
| | | //if (is_writable($conf["log_file"])) { |
| | | if (!$fp = fopen ($conf['log_file'], 'a')) { |
| | | die('Unable to open logfile.'); |
| | | } |
| | | |
| | | if (!fwrite($fp, $log_msg."\r\n")) { |
| | | die('Unable to write to logfile.'); |
| | | } |
| | | echo @date('d.m.Y-H:i').' - '.$priority_txt.' - '. $msg."\n"; |
| | | |
| | | echo $log_msg."\n"; |
| | | fclose($fp); |
| | | |
| | | // Log to database |
| | |
| | | //} else { |
| | | // die("Unable to write to logfile."); |
| | | //} |
| | | |
| | | |
| | | } // if |
| | | |
| | | if($priority >= $conf['admin_notify_priority'] && $conf['admin_mail'] != '') { |
| | | // send notification to admin |
| | | $mailBody = $log_msg; |
| | | $mailSubject = substr($log_msg,0,50).'...'; |
| | | $mailHeaders = "MIME-Version: 1.0" . "\n"; |
| | | $mailHeaders .= "Content-type: text/plain; charset=utf-8" . "\n"; |
| | | $mailHeaders .= "Content-Transfer-Encoding: 8bit" . "\n"; |
| | | $mailHeaders .= "From: ". $conf['admin_mail'] . "\n"; |
| | | $mailHeaders .= "Reply-To: ". $conf['admin_mail'] . "\n"; |
| | | |
| | | mail($conf['admin_mail'], $mailSubject, $mailBody, $mailHeaders); |
| | | } |
| | | } // func |
| | | |
| | | |
| | | /* |
| | | 0 = DEBUG |
| | | 1 = WARNING |
| | |
| | | $distver = 'Squeeze/Sid'; |
| | | $distid = 'debian60'; |
| | | $distbaseid = 'debian'; |
| | | } elseif (strstr(trim(file_get_contents('/etc/debian_version')), '7.0') || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') { |
| | | } elseif (strstr(trim(file_get_contents('/etc/debian_version')), '7.0') || strstr(trim(file_get_contents('/etc/debian_version')), '7.1') || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') { |
| | | $distname = 'Debian'; |
| | | $distver = 'Wheezy/Sid'; |
| | | $distid = 'debian60'; |
| | |
| | | } |
| | | |
| | | public function monitorDiskUsage() { |
| | | global $conf; |
| | | global $app,$conf; |
| | | |
| | | /* the id of the server as int */ |
| | | $server_id = intval($conf['server_id']); |
| | |
| | | $state = 'ok'; |
| | | |
| | | /** Fetch the data of ALL devices into a array (needed for monitoring!) */ |
| | | $dfData = shell_exec('df -hT 2>/dev/null'); |
| | | //$dfData = shell_exec('df -hT 2>/dev/null'); |
| | | $app->uses('getconf'); |
| | | $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); |
| | | $dfData = shell_exec('df -hT|grep -v "'.$web_config['website_basedir'].'/" 2>/dev/null'); |
| | | |
| | | // split into array |
| | | $df = explode("\n", $dfData); |
| | |
| | | $function_name = $this->registered_services[$service_name]['function']; |
| | | $app->log("Calling function '$function_name' from module '$module_name'.",LOGLEVEL_DEBUG); |
| | | // call_user_method($function_name,$app->loaded_modules[$module_name],$action); |
| | | call_user_func(array($app->loaded_modules[$module_name],$function_name),$action); |
| | | return call_user_func(array($app->loaded_modules[$module_name],$function_name),$action); |
| | | } else { |
| | | $app->log("Unable to restart $service_name. Service not registered.",LOGLEVEL_WARNING); |
| | | return array('output' => '', 'retval' => 0); |
| | | } |
| | | |
| | | } |
| | |
| | | if(substr($path,0,1) != '/') return false; |
| | | |
| | | //* We allow only some characters in the path |
| | | if(!preg_match('/[a-zA-Z0-9_\.\-]{1,}/',$path)) return false; |
| | | if(!preg_match('/^\/[a-zA-Z0-9_\/\.\-]{1,}$/',$path)) return false; |
| | | |
| | | //* Check path for symlinks |
| | | $path_parts = explode('/',$path); |
| | |
| | | $regex.= '[\"\']?'; |
| | | $regex.= ')?\s*'; |
| | | $regex.= '(?:>|\/>|}|-->){1}'; |
| | | $regex.= '/ie'; |
| | | $regex.= '/i'; |
| | | //$regex.= '([\r\n|\n|\r])?/ie'; |
| | | $data = preg_replace($regex,"\$this->_parseTag(array('\\0','\\1','\\2','\\3','\\4','\\5','\\6','\\7','\\8','\\9'));",$data); |
| | | $data = preg_replace_callback($regex, array($this, '_parseTag'), $data); |
| | | |
| | | if ($this->_cache) { // add cache if need be |
| | | $this->_createCache($data); |
| | |
| | | $daemon = 'named'; |
| | | } |
| | | |
| | | $retval = array('output' => '', 'retval' => 0); |
| | | if($action == 'restart') { |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' restart'); |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' restart', $retval['output'], $retval['retval']); |
| | | } else { |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' reload'); |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' reload', $retval['output'], $retval['retval']); |
| | | } |
| | | |
| | | return $retval; |
| | | } |
| | | |
| | | function restartPowerDNS($action = 'restart') { |
| | |
| | | $daemon = 'pdns'; |
| | | } |
| | | |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' restart'); |
| | | $retval = array('output' => '', 'retval' => 0); |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' restart', $retval['output'], $retval['retval']); |
| | | |
| | | // unset $tmps; |
| | | return $retval; |
| | | |
| | | } |
| | | |
| | |
| | | var $actions_available = array(); |
| | | /** The Tools */ |
| | | private $_tools = null; |
| | | //** time the script was called |
| | | private $_run_time = null; |
| | | |
| | | /** |
| | | * This function is called during ispconfig installation to determine |
| | |
| | | public function onLoad() { |
| | | global $app; |
| | | |
| | | //* store the running time |
| | | $this->_run_time = time(); |
| | | |
| | | /* |
| | | * Do the monitor every n minutes and write the result to the db |
| | | */ |
| | | $min = @date('i'); |
| | | $min = @date('i', $this->_run_time); |
| | | if (($min % $this->interval) == 0) { |
| | | $this->_doMonitor(); |
| | | } |
| | |
| | | /* |
| | | * This monitoring is expensive, so do it only every 15 minutes |
| | | */ |
| | | $min = @date('i'); |
| | | $min = @date('i', $this->_run_time); |
| | | if ($min % 15 != 0) return; |
| | | |
| | | $app->uses('getconf'); |
| | |
| | | /* |
| | | * This monitoring is expensive, so do it only once an hour |
| | | */ |
| | | $min = @date('i'); |
| | | $min = @date('i', $this->_run_time); |
| | | if ($min != 0) |
| | | return; |
| | | |
| | |
| | | $res = $this->_tools->monitorSystemUpdate(); |
| | | |
| | | //* Ensure that output is encoded so that it does not break the serialize |
| | | $res['data']['output'] = htmlentities($res['data']['output']); |
| | | //$res['data']['output'] = htmlentities($res['data']['output']); |
| | | $res['data']['output'] = htmlentities($res['data']['output'],ENT_QUOTES,'UTF-8'); |
| | | |
| | | /* |
| | | * Insert the data into the database |
| | |
| | | /* |
| | | * This monitoring is expensive, so do it only once a day |
| | | */ |
| | | $min = @date('i'); |
| | | $hour = @date('H'); |
| | | $min = @date('i', $this->_run_time); |
| | | $hour = @date('H', $this->_run_time); |
| | | if (!($min == 0 && $hour == 23)) |
| | | return; |
| | | /* |
| | |
| | | } |
| | | } |
| | | |
| | | $retval = array('output' => '', 'retval' => 0); |
| | | if($action == 'restart') { |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' restart'); |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' restart', $retval['output'], $retval['retval']); |
| | | } else { |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' reload'); |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' reload', $retval['output'], $retval['retval']); |
| | | } |
| | | |
| | | return $retval; |
| | | } |
| | | |
| | | function restartPHP_FPM($action = 'restart') { |
| | |
| | | |
| | | if(!$init_script) $init_script = $conf['init_scripts'].'/'.$web_config['php_fpm_init_script']; |
| | | |
| | | exec($init_script.' '.$action); |
| | | $retval = array('output' => '', 'retval' => 0); |
| | | exec($init_script.' '.$action, $retval['output'], $retval['retval']); |
| | | return $retval; |
| | | } |
| | | |
| | | } // end class |
| | |
| | | $app->uses('getconf'); |
| | | $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); |
| | | if ($web_config['CA_path']!='' && !file_exists($web_config['CA_path'].'/openssl.cnf')) |
| | | $app->log("CA path error, file does not exist:".$web_config['CA_path'].'/openssl.conf',LOGLEVEL_ERROR); |
| | | $app->log("CA path error, file does not exist:".$web_config['CA_path'].'/openssl.cnf',LOGLEVEL_ERROR); |
| | | |
| | | //* Only vhosts can have a ssl cert |
| | | if($data["new"]["type"] != "vhost" && $data["new"]["type"] != "vhostsubdomain") return; |
| | |
| | | //* Write the key file, if field is empty then import the key into the db |
| | | if(trim($data["new"]["ssl_key"]) != '') { |
| | | $app->system->file_put_contents($key_file2,$data["new"]["ssl_key"]); |
| | | $app->system->chmod($key_file2,0400); |
| | | } else { |
| | | $ssl_key2 = $app->db->quote($app->system->file_get_contents($key_file2)); |
| | | /* Update the DB of the (local) Server */ |
| | |
| | | } |
| | | } |
| | | |
| | | //* add the Apache user to the client group if this is a vhost and security level is set to high, no matter if this is an insert or update and regardless of set_folder_permissions_on_update |
| | | if($data['new']['type'] == 'vhost' && $web_config['security_level'] == 20) $app->system->add_user_to_group($groupname, escapeshellcmd($web_config['user'])); |
| | | |
| | | //* If the security level is set to high |
| | | if(($this->action == 'insert' && $data['new']['type'] == 'vhost') or ($web_config['set_folder_permissions_on_update'] == 'y' && $data['new']['type'] == 'vhost')) { |
| | | |
| | |
| | | $app->system->server_conf['group_datei'] = $tmp_groupfile; |
| | | unset($tmp_groupfile); |
| | | } |
| | | |
| | | //* add the Apache user to the client group |
| | | $app->system->add_user_to_group($groupname, escapeshellcmd($web_config['user'])); |
| | | |
| | | //* Chown all default directories |
| | | $app->system->chown($data['new']['document_root'],'root'); |
| | |
| | | |
| | | // Rewriting |
| | | if($alias['redirect_type'] != '' && $alias['redirect_path'] != '') { |
| | | if(substr($alias['redirect_path'],-1) != '/' && !preg_match('/^(https?|\[scheme\]):\/\//', $data['new']['redirect_path'])) $alias['redirect_path'] .= '/'; |
| | | if(substr($alias['redirect_path'],-1) != '/' && !preg_match('/^(https?|\[scheme\]):\/\//', $alias['redirect_path'])) $alias['redirect_path'] .= '/'; |
| | | if(substr($alias['redirect_path'],0,8) == '[scheme]'){ |
| | | $rewrite_target = 'http'.substr($alias['redirect_path'],8); |
| | | $rewrite_target_ssl = 'https'.substr($alias['redirect_path'],8); |
| | |
| | | |
| | | if (!is_dir($cgi_starter_path)) { |
| | | $app->system->mkdirpath($cgi_starter_path); |
| | | $app->system->chmod($cgi_starter_script,0755); |
| | | $app->system->chown($cgi_starter_script,$data['new']['system_user']); |
| | | $app->system->chgrp($cgi_starter_script,$data['new']['system_group']); |
| | | $app->system->chown($cgi_starter_path,$data['new']['system_user']); |
| | | $app->system->chgrp($cgi_starter_path,$data['new']['system_group']); |
| | | $app->system->chmod($cgi_starter_path,0755); |
| | | |
| | | $app->log('Creating cgi starter script directory: '.$cgi_starter_path,LOGLEVEL_DEBUG); |
| | | } |
| | |
| | | $apache_online_status_before_restart = $this->_checkTcp('localhost',80); |
| | | $app->log('Apache status is: '.$apache_online_status_before_restart,LOGLEVEL_DEBUG); |
| | | |
| | | $app->services->restartService('httpd','restart'); |
| | | $retval = $app->services->restartService('httpd','restart'); // $retval['retval'] is 0 on success and > 0 on failure |
| | | $app->log('Apache restart return value is: '.$retval['retval'],LOGLEVEL_DEBUG); |
| | | |
| | | // wait a few seconds, before we test the apache status again |
| | | $apache_online_status_after_restart = false; |
| | |
| | | } |
| | | //* Check if apache restarted successfully if it was online before |
| | | $app->log('Apache online status after restart is: '.$apache_online_status_after_restart,LOGLEVEL_DEBUG); |
| | | if($apache_online_status_before_restart && !$apache_online_status_after_restart) { |
| | | $app->log('Apache did not restart after the configuration change for website '.$data['new']['domain'].' Reverting the configuration. Saved non-working config as '.$vhost_file.'.err',LOGLEVEL_WARN); |
| | | if($apache_online_status_before_restart && !$apache_online_status_after_restart || $retval['retval'] > 0) { |
| | | $app->log('Apache did not restart after the configuration change for website '.$data['new']['domain'].'. Reverting the configuration. Saved non-working config as '.$vhost_file.'.err',LOGLEVEL_WARN); |
| | | if(is_array($retval['output']) && !empty($retval['output'])){ |
| | | $app->log('Reason for Apache restart failure: '.implode("\n", $retval['output']),LOGLEVEL_WARN); |
| | | } else { |
| | | // if no output is given, check again |
| | | $webserver_binary = ''; |
| | | exec('which apache2', $webserver_check_output, $webserver_check_retval); |
| | | if($webserver_check_retval == 0){ |
| | | $webserver_binary = 'apache2'; |
| | | } else { |
| | | unset($webserver_check_output, $webserver_check_retval); |
| | | exec('which httpd2', $webserver_check_output, $webserver_check_retval); |
| | | if($webserver_check_retval == 0){ |
| | | $webserver_binary = 'httpd2'; |
| | | } else { |
| | | unset($webserver_check_output, $webserver_check_retval); |
| | | exec('which httpd', $webserver_check_output, $webserver_check_retval); |
| | | if($webserver_check_retval == 0){ |
| | | $webserver_binary = 'httpd'; |
| | | } else { |
| | | unset($webserver_check_output, $webserver_check_retval); |
| | | exec('which apache', $webserver_check_output, $webserver_check_retval); |
| | | if($webserver_check_retval == 0){ |
| | | $webserver_binary = 'apache'; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if($webserver_binary != ''){ |
| | | exec($webserver_binary.' -t 2>&1', $tmp_output, $tmp_retval); |
| | | if($tmp_retval > 0 && is_array($tmp_output) && !empty($tmp_output)) $app->log('Reason for Apache restart failure: '.implode("\n", $tmp_output),LOGLEVEL_WARN); |
| | | unset($tmp_output, $tmp_retval); |
| | | } |
| | | } |
| | | $app->system->copy($vhost_file,$vhost_file.'.err'); |
| | | if(is_file($vhost_file.'~')) { |
| | | //* Copy back the last backup file |
| | |
| | | $app->log('Removed client directory: '.$client_dir,LOGLEVEL_DEBUG); |
| | | } |
| | | |
| | | if($app->system->is_group('client'.$client_id)){ |
| | | $this->_exec('groupdel client'.$client_id); |
| | | $app->log('Removed group client'.$client_id,LOGLEVEL_DEBUG); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | $tpl->setVar($zone); |
| | | |
| | | $records = $app->db->queryAllRecords("SELECT * FROM dns_rr WHERE zone = ".$zone['id']." AND active = 'Y'"); |
| | | if(is_array($records) && !empty($records)){ |
| | | for($i=0;$i<sizeof($records);$i++){ |
| | | if($records[$i]['ttl'] == 0) $records[$i]['ttl'] = ''; |
| | | } |
| | | } |
| | | $tpl->setLoop('zones',$records); |
| | | |
| | | //TODO : change this when distribution information has been integrated into server record |
| | |
| | | } |
| | | |
| | | $command .= "\t"; |
| | | if(substr($job['command'], 0, 1) != "/") $command .= $this->parent_domain['document_root'].'/'; |
| | | if($job['type'] == 'chrooted' && substr($job['command'], 0, 1) != "/") $command .= $this->parent_domain['document_root'].'/'; |
| | | $command .= $job['command']; |
| | | } |
| | | |
| | |
| | | function insert($event_name,$data) { |
| | | global $app, $conf; |
| | | |
| | | $app->uses('system'); |
| | | |
| | | if(!is_dir($data['new']['dir'])) { |
| | | $app->log("FTP User directory '".$data['new']['dir']."' does not exist. Creating it now.",LOGLEVEL_DEBUG); |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | $app->system->web_folder_protection($web['document_root'],false); |
| | | exec('mkdir -p '.escapeshellcmd($data['new']['dir'])); |
| | | exec('chown '.escapeshellcmd($web["system_user"]).':'.escapeshellcmd($web['system_group']).' '.$data['new']['dir']); |
| | | $app->system->web_folder_protection($web['document_root'],true); |
| | | |
| | | $app->log("Added ftpuser_dir: ".$data['new']['dir'],LOGLEVEL_DEBUG); |
| | | } |
| | |
| | | function update($event_name,$data) { |
| | | global $app, $conf; |
| | | |
| | | $app->uses('system'); |
| | | |
| | | if(!is_dir($data['new']['dir'])) { |
| | | $app->log("FTP User directory '".$data['new']['dir']."' does not exist. Creating it now.",LOGLEVEL_DEBUG); |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | $app->system->web_folder_protection($web['document_root'],false); |
| | | exec('mkdir -p '.escapeshellcmd($data['new']['dir'])); |
| | | exec('chown '.escapeshellcmd($web["system_user"]).':'.escapeshellcmd($web['system_group']).' '.$data['new']['dir']); |
| | | $app->system->web_folder_protection($web['document_root'],true); |
| | | |
| | | $app->log("Added ftpuser_dir: ".$data['new']['dir'],LOGLEVEL_DEBUG); |
| | | } |
| | |
| | | |
| | | // Shall emails be deleted after retrieval |
| | | if($data["new"]["source_delete"] == 'y') { |
| | | $tpl = str_replace('{DELETE}','1',$tpl); |
| | | $tpl = str_replace('{DELETE}','true',$tpl); |
| | | } else { |
| | | $tpl = str_replace('{DELETE}','0',$tpl); |
| | | $tpl = str_replace('{DELETE}','false',$tpl); |
| | | } |
| | | |
| | | if($data["new"]["read_all"] == 'y') { |
| | | $tpl = str_replace('{READ_ALL}', '1', $tpl); |
| | | $tpl = str_replace('{READ_ALL}', 'true', $tpl); |
| | | } else { |
| | | $tpl = str_replace('{READ_ALL}', '0', $tpl); |
| | | $tpl = str_replace('{READ_ALL}', 'false', $tpl); |
| | | } |
| | | |
| | | // Set the data retriever |
| | |
| | | |
| | | // get the users for this database |
| | | $db_user = $app->db->queryOneRecord("SELECT `database_user`, `database_password` FROM `web_database_user` WHERE `database_user_id` = '" . intval($data['new']['database_user_id']) . "'"); |
| | | $old_db_user = $app->db->queryOneRecord("SELECT `database_user`, `database_password` FROM `web_database_user` WHERE `database_user_id` = '" . intval($data['old']['database_user_id']) . "'"); |
| | | |
| | | $db_ro_user = $app->db->queryOneRecord("SELECT `database_user`, `database_password` FROM `web_database_user` WHERE `database_user_id` = '" . intval($data['new']['database_ro_user_id']) . "'"); |
| | | $old_db_ro_user = $app->db->queryOneRecord("SELECT `database_user`, `database_password` FROM `web_database_user` WHERE `database_user_id` = '" . intval($data['old']['database_ro_user_id']) . "'"); |
| | | |
| | | $host_list = ''; |
| | | if($data['new']['remote_access'] == 'y') { |
| | |
| | | else $this->process_host_list('GRANT', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $host_list, $link, '', true); |
| | | } |
| | | } else if($data['new']['active'] == 'n' && $data['old']['active'] == 'y') { // revoke database user, if inactive |
| | | if($db_user) { |
| | | if($db_user['database_user'] == 'root'){ |
| | | if($old_db_user) { |
| | | if($old_db_user['database_user'] == 'root'){ |
| | | $app->log('User root not allowed for Client databases',LOGLEVEL_WARNING); |
| | | } else { |
| | | // Find out users to drop and users to revoke |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['new']['database_id'], $data['new']['database_user_id'], $old_host_list); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $old_host_list); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['old']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['old']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | |
| | | |
| | | //$this->process_host_list('DROP', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $old_host_list, $link); |
| | | //$this->process_host_list('REVOKE', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $old_host_list, $link); |
| | | } |
| | | } |
| | | if($db_ro_user && $data['new']['database_user_id'] != $data['new']['database_ro_user_id']) { |
| | | if($db_ro_user['database_user'] == 'root'){ |
| | | if($old_db_ro_user && $data['old']['database_user_id'] != $data['old']['database_ro_user_id']) { |
| | | if($old_db_ro_user['database_user'] == 'root'){ |
| | | $app->log('User root not allowed for Client databases',LOGLEVEL_WARNING); |
| | | } else { |
| | | // Find out users to drop and users to revoke |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['new']['database_id'], $data['new']['database_ro_user_id'], $old_host_list); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_ro_user_id'], $old_host_list); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['old']['database_name'], $old_db_ro_user['database_user'], $old_db_ro_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['old']['database_name'], $old_db_ro_user['database_user'], $old_db_ro_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | |
| | | //$this->process_host_list('DROP', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $old_host_list, $link); |
| | | //$this->process_host_list('REVOKE', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $old_host_list, $link); |
| | |
| | | //* selected Users have changed |
| | | if($data['new']['database_user_id'] != $data['old']['database_user_id']) { |
| | | if($data['old']['database_user_id'] && $data['old']['database_user_id'] != $data['new']['database_ro_user_id']) { |
| | | $old_db_user = $app->db->queryOneRecord("SELECT `database_user`, `database_password` FROM `web_database_user` WHERE `database_user_id` = '" . intval($data['old']['database_user_id']) . "'"); |
| | | if($old_db_user) { |
| | | if($old_db_user['database_user'] == 'root'){ |
| | | $app->log('User root not allowed for Client databases',LOGLEVEL_WARNING); |
| | | } else { |
| | | // Find out users to drop and users to revoke |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['new']['database_id'], $data['old']['database_user_id'], $old_host_list); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['new']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['new']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $old_host_list); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['old']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['old']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | |
| | | //$this->process_host_list('DROP', $data['new']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $old_host_list, $link); |
| | | //$this->process_host_list('REVOKE', $data['new']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $old_host_list, $link); |
| | |
| | | } |
| | | if($data['new']['database_ro_user_id'] != $data['old']['database_ro_user_id']) { |
| | | if($data['old']['database_ro_user_id'] && $data['old']['database_ro_user_id'] != $data['new']['database_user_id']) { |
| | | $old_db_user = $app->db->queryOneRecord("SELECT `database_user`, `database_password` FROM `web_database_user` WHERE `database_user_id` = '" . intval($data['old']['database_ro_user_id']) . "'"); |
| | | if($old_db_user) { |
| | | if($old_db_user['database_user'] == 'root'){ |
| | | if($old_db_ro_user) { |
| | | if($old_db_ro_user['database_user'] == 'root'){ |
| | | $app->log('User root not allowed for Client databases',LOGLEVEL_WARNING); |
| | | } else { |
| | | // Find out users to drop and users to revoke |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['new']['database_id'], $data['old']['database_user_id'], $old_host_list); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['new']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['new']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $old_host_list); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['old']['database_name'], $old_db_ro_user['database_user'], $old_db_ro_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['old']['database_name'], $old_db_ro_user['database_user'], $old_db_ro_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | |
| | | //$this->process_host_list('DROP', $data['new']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $old_host_list, $link); |
| | | //$this->process_host_list('REVOKE', $data['new']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $old_host_list, $link); |
| | |
| | | else $this->process_host_list('GRANT', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $data['new']['remote_ips'], $link, '', true); |
| | | } |
| | | } else { |
| | | if($db_user) { |
| | | if($db_user['database_user'] == 'root'){ |
| | | if($old_db_user) { |
| | | if($old_db_user['database_user'] == 'root'){ |
| | | $app->log('User root not allowed for Client databases',LOGLEVEL_WARNING); |
| | | } else { |
| | | // Find out users to drop and users to revoke |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['new']['database_id'], $data['new']['database_user_id'], $data['old']['remote_ips']); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $data['old']['remote_ips']); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['old']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['old']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | |
| | | //$this->process_host_list('DROP', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $data['old']['remote_ips'], $link); |
| | | //$this->process_host_list('REVOKE', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $data['old']['remote_ips'], $link); |
| | | } |
| | | } |
| | | if($db_ro_user && $data['new']['database_user_id'] != $data['new']['database_ro_user_id']) { |
| | | if($db_ro_user['database_user'] == 'root'){ |
| | | if($old_db_ro_user && $data['old']['database_user_id'] != $data['old']['database_ro_user_id']) { |
| | | if($old_db_ro_user['database_user'] == 'root'){ |
| | | $app->log('User root not allowed for Client databases',LOGLEVEL_WARNING); |
| | | } else { |
| | | // Find out users to drop and users to revoke |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['new']['database_id'], $data['new']['database_ro_user_id'], $data['old']['remote_ips']); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_ro_user_id'], $data['old']['remote_ips']); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['old']['database_name'], $old_db_ro_user['database_user'], $old_db_ro_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['old']['database_name'], $old_db_ro_user['database_user'], $old_db_ro_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | |
| | | //$this->process_host_list('DROP', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $data['old']['remote_ips'], $link); |
| | | //$this->process_host_list('REVOKE', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $data['old']['remote_ips'], $link); |
| | |
| | | $app->log('Changing MySQL remote access privileges for database: '.$data['new']['database_name'],LOGLEVEL_DEBUG); |
| | | } elseif($data['new']['remote_access'] == 'y' && $data['new']['remote_ips'] != $data['old']['remote_ips']) { |
| | | //* Change remote access list |
| | | if($old_db_user) { |
| | | if($old_db_user['database_user'] == 'root'){ |
| | | $app->log('User root not allowed for Client databases',LOGLEVEL_WARNING); |
| | | } else { |
| | | // Find out users to drop and users to revoke |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $data['old']['remote_ips']); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['old']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['old']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | } |
| | | } |
| | | if($db_user) { |
| | | if($db_user['database_user'] == 'root'){ |
| | | $app->log('User root not allowed for Client databases',LOGLEVEL_WARNING); |
| | | } else { |
| | | // Find out users to drop and users to revoke |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['new']['database_id'], $data['new']['database_user_id'], $data['old']['remote_ips']); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | |
| | | //$this->process_host_list('DROP', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $data['old']['remote_ips'], $link); |
| | | //$this->process_host_list('REVOKE', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $data['old']['remote_ips'], $link); |
| | | $this->process_host_list('GRANT', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $data['new']['remote_ips'], $link); |
| | | } |
| | | } |
| | | |
| | | if($old_db_ro_user && $data['old']['database_user_id'] != $data['old']['database_ro_user_id']) { |
| | | if($old_db_ro_user['database_user'] == 'root'){ |
| | | $app->log('User root not allowed for Client databases',LOGLEVEL_WARNING); |
| | | } else { |
| | | // Find out users to drop and users to revoke |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $data['old']['remote_ips']); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['old']['database_name'], $old_db_ro_user['database_user'], $old_db_ro_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['old']['database_name'], $old_db_ro_user['database_user'], $old_db_ro_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | } |
| | | } |
| | | |
| | | if($db_ro_user && $data['new']['database_user_id'] != $data['new']['database_ro_user_id']) { |
| | | if($db_ro_user['database_user'] == 'root'){ |
| | | $app->log('User root not allowed for Client databases',LOGLEVEL_WARNING); |
| | | } else { |
| | | // Find out users to drop and users to revoke |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['new']['database_id'], $data['new']['database_user_id'], $data['old']['remote_ips']); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | |
| | | //$this->process_host_list('DROP', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $data['old']['remote_ips'], $link); |
| | | //$this->process_host_list('REVOKE', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $data['old']['remote_ips'], $link); |
| | | $this->process_host_list('GRANT', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $data['new']['remote_ips'], $link, '', true); |
| | | } |
| | | } |
| | |
| | | $app->log('Unable to connect to mysql: '.$link->connect_error,LOGLEVEL_ERROR); |
| | | return; |
| | | } |
| | | |
| | | $old_host_list = ''; |
| | | if($data['old']['remote_access'] == 'y') { |
| | | $old_host_list = $data['old']['remote_ips']; |
| | | if($old_host_list == '') $old_host_list = '%'; |
| | | } |
| | | if($old_host_list != '') $old_host_list .= ','; |
| | | $old_host_list .= 'localhost'; |
| | | |
| | | if($data['old']['database_user_id']) { |
| | | $old_db_user = $app->db->queryOneRecord("SELECT `database_user`, `database_password` FROM `web_database_user` WHERE `database_user_id` = '" . intval($data['old']['database_user_id']) . "'"); |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $old_host_list); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['old']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['old']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | } |
| | | if($data['old']['database_ro_user_id']) { |
| | | $old_db_user = $app->db->queryOneRecord("SELECT `database_user`, `database_password` FROM `web_database_user` WHERE `database_user_id` = '" . intval($data['old']['database_ro_user_id']) . "'"); |
| | | $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_ro_user_id'], $old_host_list); |
| | | if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['old']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); |
| | | if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['old']['database_name'], $old_db_user['database_user'], $old_db_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); |
| | | } |
| | | |
| | | |
| | | if($link->query('DROP DATABASE '.$link->escape_string($data['old']['database_name']))) { |
| | | $app->log('Dropping MySQL database: '.$data['old']['database_name'],LOGLEVEL_DEBUG); |
| | |
| | | $host_list = array('localhost'); |
| | | // get all databases this user was active for |
| | | $db_list = $app->db->queryAllRecords("SELECT `remote_access`, `remote_ips` FROM `web_database` WHERE `database_user_id` = '" . intval($data['old']['database_user_id']) . "'"); |
| | | if(count($db_list) < 1) return; // nothing to do on this server for this db user |
| | | |
| | | foreach($db_list as $database) { |
| | | if($database['remote_access'] != 'y') continue; |
| | | |
| | |
| | | $app->uses('getconf'); |
| | | $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); |
| | | if ($web_config['CA_path']!='' && !file_exists($web_config['CA_path'].'/openssl.cnf')) |
| | | $app->log("CA path error, file does not exist:".$web_config['CA_path'].'/openssl.conf',LOGLEVEL_ERROR); |
| | | $app->log("CA path error, file does not exist:".$web_config['CA_path'].'/openssl.cnf',LOGLEVEL_ERROR); |
| | | |
| | | //* Only vhosts can have a ssl cert |
| | | if($data["new"]["type"] != "vhost" && $data["new"]["type"] != "vhostsubdomain") return; |
| | |
| | | if(trim($data["new"]["ssl_cert"]) != '') $app->system->file_put_contents($crt_file,$data["new"]["ssl_cert"]); |
| | | //if(trim($data["new"]["ssl_bundle"]) != '') $app->system->file_put_contents($bundle_file,$data["new"]["ssl_bundle"]); |
| | | if(trim($data["new"]["ssl_key"]) != '') $app->system->file_put_contents($key_file2,$data["new"]["ssl_key"]); |
| | | $app->system->chmod($key_file2,0400); |
| | | |
| | | // for nginx, bundle files have to be appended to the certificate file |
| | | if(trim($data["new"]["ssl_bundle"]) != ''){ |
| | |
| | | } |
| | | } |
| | | |
| | | //* add the nginx user to the client group if this is a vhost and security level is set to high, no matter if this is an insert or update and regardless of set_folder_permissions_on_update |
| | | if($data['new']['type'] == 'vhost' && $web_config['security_level'] == 20) $app->system->add_user_to_group($groupname, escapeshellcmd($web_config['nginx_user'])); |
| | | |
| | | //* If the security level is set to high |
| | | if(($this->action == 'insert' && $data['new']['type'] == 'vhost') or ($web_config['set_folder_permissions_on_update'] == 'y' && $data['new']['type'] == 'vhost')) { |
| | | |
| | |
| | | //* add the nginx user to the client group in the chroot environment |
| | | $tmp_groupfile = $app->system->server_conf['group_datei']; |
| | | $app->system->server_conf['group_datei'] = $web_config['website_basedir'].'/etc/group'; |
| | | $app->system->add_user_to_group($groupname, escapeshellcmd($web_config['user'])); |
| | | $app->system->add_user_to_group($groupname, escapeshellcmd($web_config['nginx_user'])); |
| | | $app->system->server_conf['group_datei'] = $tmp_groupfile; |
| | | unset($tmp_groupfile); |
| | | } |
| | | |
| | | //* add the nginx user to the client group |
| | | $app->system->add_user_to_group($groupname, escapeshellcmd($web_config['nginx_user'])); |
| | | |
| | | //* Chown all default directories |
| | | $app->system->chown($data['new']['document_root'],'root'); |
| | |
| | | |
| | | // backwards compatibility; since ISPConfig 3.0.5, the PHP mode for nginx is called 'php-fpm' instead of 'fast-cgi'. The following line makes sure that old web sites that have 'fast-cgi' in the database still get PHP-FPM support. |
| | | if($vhost_data['php'] == 'fast-cgi') $vhost_data['php'] = 'php-fpm'; |
| | | |
| | | // Custom rewrite rules |
| | | $final_rewrite_rules = array(); |
| | | $custom_rewrite_rules = $data['new']['rewrite_rules']; |
| | | // Make sure we only have Unix linebreaks |
| | | $custom_rewrite_rules = str_replace("\r\n", "\n", $custom_rewrite_rules); |
| | | $custom_rewrite_rules = str_replace("\r", "\n", $custom_rewrite_rules); |
| | | $custom_rewrite_rule_lines = explode("\n", $custom_rewrite_rules); |
| | | if(is_array($custom_rewrite_rule_lines) && !empty($custom_rewrite_rule_lines)){ |
| | | foreach($custom_rewrite_rule_lines as $custom_rewrite_rule_line){ |
| | | $final_rewrite_rules[] = array('rewrite_rule' => $custom_rewrite_rule_line); |
| | | } |
| | | } |
| | | $tpl->setLoop('rewrite_rules', $final_rewrite_rules); |
| | | |
| | | // Custom nginx directives |
| | | $final_nginx_directives = array(); |
| | |
| | | $nginx_online_status_before_restart = $this->_checkTcp('localhost',80); |
| | | $app->log('nginx status is: '.$nginx_online_status_before_restart,LOGLEVEL_DEBUG); |
| | | |
| | | $app->services->restartService('httpd','restart'); |
| | | $retval = $app->services->restartService('httpd','restart'); // $retval['retval'] is 0 on success and > 0 on failure |
| | | $app->log('nginx restart return value is: '.$retval['retval'],LOGLEVEL_DEBUG); |
| | | |
| | | // wait a few seconds, before we test the apache status again |
| | | sleep(2); |
| | |
| | | //* Check if nginx restarted successfully if it was online before |
| | | $nginx_online_status_after_restart = $this->_checkTcp('localhost',80); |
| | | $app->log('nginx online status after restart is: '.$nginx_online_status_after_restart,LOGLEVEL_DEBUG); |
| | | if($nginx_online_status_before_restart && !$nginx_online_status_after_restart) { |
| | | $app->log('nginx did not restart after the configuration change for website '.$data['new']['domain'].' Reverting the configuration. Saved non-working config as '.$vhost_file.'.err',LOGLEVEL_WARN); |
| | | if($nginx_online_status_before_restart && !$nginx_online_status_after_restart || $retval['retval'] > 0) { |
| | | $app->log('nginx did not restart after the configuration change for website '.$data['new']['domain'].'. Reverting the configuration. Saved non-working config as '.$vhost_file.'.err',LOGLEVEL_WARN); |
| | | if(is_array($retval['output']) && !empty($retval['output'])){ |
| | | $app->log('Reason for nginx restart failure: '.implode("\n", $retval['output']),LOGLEVEL_WARN); |
| | | } else { |
| | | // if no output is given, check again |
| | | exec('nginx -t 2>&1', $tmp_output, $tmp_retval); |
| | | if($tmp_retval > 0 && is_array($tmp_output) && !empty($tmp_output)) $app->log('Reason for nginx restart failure: '.implode("\n", $tmp_output),LOGLEVEL_WARN); |
| | | unset($tmp_output, $tmp_retval); |
| | | } |
| | | $app->system->copy($vhost_file,$vhost_file.'.err'); |
| | | |
| | | if(is_file($vhost_file.'~')) { |
| | | //* Copy back the last backup file |
| | | $app->system->copy($vhost_file.'~',$vhost_file); |
| | |
| | | } |
| | | } else { |
| | | //* We do not check the nginx config after changes (is faster) |
| | | if($nginx_chrooted) { |
| | | $app->services->restartServiceDelayed('httpd','reload'); |
| | | } else { |
| | | // request a httpd reload when all records have been processed |
| | | $app->services->restartServiceDelayed('httpd','reload'); |
| | | } |
| | | } |
| | | |
| | | //* The vhost is written and apache has been restarted, so we |
| | |
| | | if(is_array($lines) && !empty($lines)){ |
| | | $linecount = sizeof($lines); |
| | | for($h=0;$h<$linecount;$h++){ |
| | | // remove comments |
| | | if(substr(trim($lines[$h]),0,1) == '#'){ |
| | | unset($lines[$h]); |
| | | continue; |
| | | } |
| | | |
| | | $lines[$h] = rtrim($lines[$h]); |
| | | /* |
| | | if(substr(ltrim($lines[$h]), 0, 8) == 'location' && strpos($lines[$h], '{') !== false && strpos($lines[$h], ';') !== false){ |
| | |
| | | $app->log('Removed client directory: '.$client_dir,LOGLEVEL_DEBUG); |
| | | } |
| | | |
| | | if($app->system->is_group('client'.$client_id)){ |
| | | $this->_exec('groupdel client'.$client_id); |
| | | $app->log('Removed group client'.$client_id,LOGLEVEL_DEBUG); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | else |
| | | touch /tmp/.getmail_lock |
| | | if [ "$rcfiles" != "" ]; then |
| | | /usr/bin/getmail -v -g /etc/getmail $rcfiles |
| | | /usr/bin/getmail -v -g /etc/getmail $rcfiles || true |
| | | fi |
| | | rm -f /tmp/.getmail_lock |
| | | fi |
| | |
| | | // Set the loglevel |
| | | $conf['log_priority'] = intval($conf['serverconfig']['server']['loglevel']); |
| | | |
| | | // Set level from which admin should be notified by email |
| | | if(!isset($conf['serverconfig']['server']['admin_notify_events']) || $conf['serverconfig']['server']['admin_notify_events'] == '') $conf['serverconfig']['server']['admin_notify_events'] = 3; |
| | | $conf['admin_notify_priority'] = intval($conf['serverconfig']['server']['admin_notify_events']); |
| | | |
| | | // we do not need this variable anymore |
| | | unset($server_db_record); |
| | | |
| | | // retrieve admin email address for notifications |
| | | $sys_ini = $app->dbmaster->queryOneRecord("SELECT * FROM sys_ini WHERE sysini_id = 1"); |
| | | $conf['sys_ini'] = $app->ini_parser->parse_ini_string(stripslashes($sys_ini['config'])); |
| | | $conf['admin_mail'] = $conf['sys_ini']['mail']['admin_mail']; |
| | | unset($sys_ini); |
| | | |
| | | /* |
| | | * Save the rescue-config, maybe we need it (because the database is down) |
| | | */ |