Skip to content
......@@ -47,4 +47,5 @@ $wb['Relay Recipients'] = 'Relay Recipients';
$wb['Mailbox quota'] = 'Mailbox quota';
$wb['add_header_txt'] = 'Header (adds \"X-Spam: Yes\")';
$wb['rewrite_subject_txt'] = 'Subject (adds \"***SPAM***\" at the beginning)';
$wb['inactive'] = 'inactive';
?>
......@@ -48,4 +48,5 @@ $wb['Global Filters'] = 'Genel Süzgeçler';
$wb['Domain Alias'] = 'Takma Etki Alanı';
$wb['Relay Recipients'] = 'Aktarılan Alıcılar';
$wb['Mailbox quota'] = 'E-posta Kutusu Kotası';
$wb['inactive'] = 'inactive';
?>
......@@ -91,14 +91,15 @@ class page_action extends tform_actions {
// Getting Domains of the user
// $sql = "SELECT domain, server_id FROM mail_domain WHERE ".$app->tform->getAuthSQL('r').' ORDER BY domain';
$sql = "SELECT domain, server_id FROM mail_domain WHERE (".$app->tform->getAuthSQL('r').") AND domain NOT IN (SELECT SUBSTR(source,2) FROM mail_forwarding WHERE type = 'aliasdomain') ORDER BY domain";
$sql = "SELECT domain, server_id, active FROM mail_domain WHERE (".$app->tform->getAuthSQL('r').") AND domain NOT IN (SELECT SUBSTR(source,2) FROM mail_forwarding WHERE type = 'aliasdomain') ORDER BY domain";
$domains = $app->db->queryAllRecords($sql);
$domain_select = '';
if(is_array($domains)) {
foreach( $domains as $domain) {
$domain['domain'] = $app->functions->idn_decode($domain['domain']);
$selected = ($domain["domain"] == @$email_parts[1])?'SELECTED':'';
$domain_select .= "<option value='" . $app->functions->htmlentities($domain['domain']) . "' $selected>" . $app->functions->htmlentities($domain['domain']) . "</option>\r\n";
$domain_select .= "<option value='" . $app->functions->htmlentities($domain['domain']) . "' $selected>" . $app->functions->htmlentities($domain['domain']) .
($domain['active'] == 'n' ? ' (' . $app->lng('inactive') . ')': '') . "</option>\r\n";
}
}
$app->tpl->setVar("email_domain", $domain_select);
......
......@@ -12,7 +12,7 @@
<select name="email_domain" id="email_domain" class="form-control" style="height:50px;min-width:170px;">{tmpl_var name='email_domain'}</select>
</div>
<div class="input-group-field">
<a class="btn btn-default formbutton-narrow" href="javascript: navigator.clipboard.writeText(document.getElementById('email_local_part').value + '@' + document.getElementById('email_domain').value);" title="">i
<a class="btn btn-default formbutton-narrow" href="javascript: navigator.clipboard.writeText(document.getElementById('email_local_part').value + '@' + document.getElementById('email_domain').value);" title="">
<span class="fa fa-clone"></span>
</a>
</div>
......
......@@ -369,7 +369,7 @@ class page_action extends tform_actions {
} else {
$remote_ips = explode(",", $global_config['default_remote_dbserver']);
}
if (!in_array($server_config['ip_address'], $default_remote_db)) { $remote_ips[] = $server_config['ip_address']; }
if (!in_array($server_config['ip_address'], $remote_ips)) { $remote_ips[] = $server_config['ip_address']; }
if($server_config['ip_address']!='') {
if($this->dataRecord['remote_access'] != 'y'){
......@@ -459,7 +459,7 @@ class page_action extends tform_actions {
$remote_ips = explode(",", $global_config['default_remote_dbserver']);
}
if (!in_array($server_config['ip_address'], $default_remote_db)) { $remote_ips[] = $server_config['ip_address']; }
if (!in_array($server_config['ip_address'], $remote_ips)) { $remote_ips[] = $server_config['ip_address']; }
if($server_config['ip_address']!='') {
if($this->dataRecord['remote_access'] != 'y'){
......
......@@ -168,7 +168,7 @@ if($childdomain_type == 'aliasdomain') {
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'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')
'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' => '*.domain.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')
);
}
......
......@@ -417,7 +417,7 @@ $form["tabs"]['redirect'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'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')
'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' => '*.domain.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',
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><title>ISPCOnfig 3 remote API documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="definitionen.css">
<style type="text/css">
</style></head>
<body>
<div style="padding:40px">
<h1>monitor_jobqueue_count(<span class="var">$session_id</span>, <span class="var">$server_id = 0</span>);</h1>
<br>
<p class="headgrp">Description: </p>
<p class="margin"> Get the number of pending jobs from jobqueue.</p><br>
<p class="headgrp">Input Variables: </p>
<p class="margin"> <span class="var">$session_id</span>, <span class="var">$server_id</span></p>
<p class="headgrp">Parameters (in <span class="var">$params</span>): </p>
<p class="margin"> None</p>
<p class="headgrp">Output: </p>
<p class="margin"> Returns the number of pending jobs from jobqueue.</p>
</div>
</body></html>
......@@ -384,7 +384,7 @@ class ApsInstaller extends ApsBase
if(is_dir($this->document_root)){
$files = array_diff(scandir($this->document_root), array('.', '..', 'error', 'stats'));
foreach($files as $file){
if(is_dir($this->document_root.'/'.$file)){
if(is_dir($this->document_root.'/'.$file) and !is_link($this->document_root.'/'.$file)){
$app->file->removeDirectory($this->document_root.'/'.$file);
} else {
@unlink($this->document_root.'/'.$file);
......
......@@ -1076,11 +1076,10 @@ class backup
{
global $app;
if ( ! is_dir($repos_path)) {
$dbt = debug_backtrace();
$dbt_info = $dbt[1]['file'] . ':' . $dbt[1]['line'];
$app->log("Unknown path " . var_export($repos_path, TRUE)
. ' called from ' . (function() {
$dbt = debug_backtrace();
return $dbt[1]['file'] . ':' . $dbt[1]['line'];
})(), LOGLEVEL_ERROR);
. ' called from ' . $dbt_info, LOGLEVEL_ERROR);
return FALSE;
}
switch ($backup_mode) {
......
......@@ -118,16 +118,15 @@ class file{
$content = $input;
}
$lines = explode("\n", $content);
$new_lines = array();
if(!empty($lines)){
foreach($lines as $line){
if(trim($line) != '') $new_lines[] = $line;
}
}
if(is_array($new_lines)){
$content = implode("\n", $new_lines);
} else {
$content = '';
}
$content = implode("\n", $new_lines);
if($file){
$this->wf($input, $content);
} else {
......
......@@ -304,6 +304,7 @@ class letsencrypt {
'domain' => $domain,
'key' => $ssl_dir.'/'.$domain.'-le.key',
'key2' => $ssl_dir.'/'.$domain.'-le.key.org',
'csr' => '', # Not used for LE.
'crt' => $ssl_dir.'/'.$domain.'-le.crt',
'bundle' => $ssl_dir.'/'.$domain.'-le.bundle'
);
......
......@@ -266,7 +266,7 @@ class apache2_plugin {
// load the server configuration options
$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'))
if (isset($web_config['CA_path']) && $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.cnf', LOGLEVEL_ERROR);
//* Only vhosts can have a ssl cert
......@@ -1169,7 +1169,7 @@ class apache2_plugin {
if(!is_dir($web_config['website_basedir'].'/conf')) $app->system->mkdir($web_config['website_basedir'].'/conf');
//* add open_basedir restriction to custom php.ini content, required for suphp only
if(!stristr($data['new']['custom_php_ini'], 'open_basedir') && $data['new']['php'] == 'suphp') {
if(isset($data['new']['custom_php_ini']) && !stristr($data['new']['custom_php_ini'], 'open_basedir') && $data['new']['php'] == 'suphp') {
$data['new']['custom_php_ini'] .= "\nopen_basedir = '".$data['new']['php_open_basedir']."'\n";
}
......@@ -1194,7 +1194,7 @@ class apache2_plugin {
//* Create custom php.ini
# Because of custom default PHP directives from snippet
# php.ini custom values order os: 1. general settings 2. Directive Snippets settings 3. custom php.ini settings defined in domain settings
if(trim($data['new']['custom_php_ini']) != '' || $data['new']['directive_snippets_id'] > "0") {
if((isset($data['new']['custom_php_ini']) && trim($data['new']['custom_php_ini']) != '') || $data['new']['directive_snippets_id'] > "0") {
$has_custom_php_ini = true;
$custom_sendmail_path = false;
if(!is_dir($custom_php_ini_dir)) $app->system->mkdirpath($custom_php_ini_dir);
......@@ -1400,14 +1400,12 @@ class apache2_plugin {
$server_alias = array();
// get autoalias
$auto_alias = $web_config['website_autoalias'];
if($auto_alias != '') {
if(isset($web_config['website_autoalias']) && $web_config['website_autoalias'] != '') {
// get the client username
$client = $app->db->queryOneRecord("SELECT `username` FROM `client` WHERE `client_id` = ?", $client_id);
$aa_search = array('[client_id]', '[website_id]', '[client_username]', '[website_domain]');
$aa_replace = array($client_id, $data['new']['domain_id'], $client['username'], $data['new']['domain']);
$auto_alias = str_replace($aa_search, $aa_replace, $auto_alias);
$auto_alias = str_replace($aa_search, $aa_replace, $web_config['website_autoalias']);
unset($client);
unset($aa_search);
unset($aa_replace);
......@@ -1793,7 +1791,7 @@ class apache2_plugin {
//if proxy protocol is enabled we need to add a new port to lsiten to
if($web_config['vhost_proxy_protocol_enabled'] == 'y' && $data['new']['proxy_protocol'] == 'y'){
if((int)$web_config['vhost_proxy_protocol_http_port'] > 0) {
if(isset($web_config['vhost_proxy_protocol_http_port']) && (int)$web_config['vhost_proxy_protocol_http_port'] > 0) {
$tmp_vhost_arr['port'] = (int)$web_config['vhost_proxy_protocol_http_port'];
$tmp_vhost_arr['use_proxy_protocol'] = $data['new']['proxy_protocol'];
$vhosts[] = $tmp_vhost_arr;
......@@ -1942,7 +1940,7 @@ class apache2_plugin {
unset($ht_file);
if(!is_file($data['new']['document_root'].'/web/stats/.htpasswd_stats') || $data['new']['stats_password'] != $data['old']['stats_password']) {
if(trim($data['new']['stats_password']) != '') {
if(isset($data['new']['stats_password']) && trim($data['new']['stats_password']) != '') {
$htp_file = 'admin:'.trim($data['new']['stats_password']);
$app->system->web_folder_protection($data['new']['document_root'], false);
$app->system->file_put_contents($data['new']['document_root'].'/web/stats/.htpasswd_stats', $htp_file);
......
......@@ -429,7 +429,7 @@ class mail_plugin {
$maildir_path_deleted = false;
$old_maildir_path = $data['old']['maildir'];
if($old_maildir_path != $mail_config['homedir_path'] && strlen($old_maildir_path) > strlen($mail_config['homedir_path']) && !stristr($old_maildir_path, '//') && !stristr($old_maildir_path, '..') && !stristr($old_maildir_path, '*') && strlen($old_maildir_path) >= 10) {
if ($mail_config['mailbox_soft_delete'] == 'y') {
if ($mail_config['mailbox_soft_delete'] == 'y' && is_dir($old_maildir_path)) {
// Move it, adding a date based suffix. A cronjob should purge or archive.
$thrash_maildir_path = $old_maildir_path . '-deleted-' . date("YmdHis");
$app->system->exec_safe('mv ? ?', $old_maildir_path, $thrash_maildir_path);
......@@ -484,7 +484,7 @@ class mail_plugin {
//* Delete maildomain path
$old_maildomain_path = $mail_config['homedir_path'].'/'.$data['old']['domain'];
if($old_maildomain_path != $mail_config['homedir_path'] && !stristr($old_maildomain_path, '//') && !stristr($old_maildomain_path, '..') && !stristr($old_maildomain_path, '*') && !stristr($old_maildomain_path, '&') && strlen($old_maildomain_path) >= 10 && !empty($data['old']['domain'])) {
if ($mail_config['mailbox_soft_delete'] == 'y') {
if ($mail_config['mailbox_soft_delete'] == 'y' && is_dir($old_maildomain_path)) {
// Move it, adding a date based suffix. A cronjob should purge or archive.
$thrash_maildomain_path = $old_maildomain_path . '-deleted-' . date("YmdHis");
$app->system->exec_safe('mv ? ?', $old_maildomain_path, $thrash_maildomain_path);
......
......@@ -161,7 +161,7 @@ class nginx_plugin {
subjectAltName = @alt_names
[alt_names]
DNS.1 = .$domain";
DNS.1 = $domain";
$ssl_cnf_file = $ssl_dir.'/openssl.conf';
$app->system->file_put_contents($ssl_cnf_file, $ssl_cnf);
......