Skip to content
Commits on Source (9)
...@@ -502,13 +502,21 @@ class installer_dist extends installer_base { ...@@ -502,13 +502,21 @@ class installer_dist extends installer_base {
$content = str_replace('{mysql_server_port}', $conf["mysql"]["port"], $content); $content = str_replace('{mysql_server_port}', $conf["mysql"]["port"], $content);
$content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content);
$content = str_replace('{hostname}', $conf['hostname'], $content); $content = str_replace('{hostname}', $conf['hostname'], $content);
$content = str_replace('{amavis_config_dir}', $conf['amavis']['config_dir'], $content);
wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content); wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content);
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640); chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640);
if(!is_file($conf['amavis']['config_dir'].'/60-dkim')) {
touch($conf['amavis']['config_dir'].'/60-dkim');
chmod($conf['amavis']['config_dir'].'/60-dkim', 0640);
}
// for CentOS 7.2 only // for CentOS 7.2 only
if($dist['confid'] == 'centos72') { if($dist['confid'] == 'centos72') {
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0750); chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0750);
chgrp($conf['amavis']['config_dir'].'/amavisd.conf', 'amavis'); chgrp($conf['amavis']['config_dir'].'/amavisd.conf', 'amavis');
chmod($conf['amavis']['config_dir'].'/60-dkim', 0750);
chgrp($conf['amavis']['config_dir'].'/60-dkim', 'amavis');
} }
......
...@@ -307,7 +307,7 @@ function get_distname() { ...@@ -307,7 +307,7 @@ function get_distname() {
$distid = 'centos53'; $distid = 'centos53';
$distbaseid = 'fedora'; $distbaseid = 'fedora';
swriteln("Operating System: CentOS 5 or compatible\n"); swriteln("Operating System: CentOS 5 or compatible\n");
} elseif(stristr($content, 'CentOS Linux release 6')) { } elseif(stristr($content, 'CentOS Linux release 6') || stristr($content, 'CentOS release 6')) {
$distname = 'CentOS'; $distname = 'CentOS';
$distver = 'Unknown'; $distver = 'Unknown';
$distid = 'centos53'; $distid = 'centos53';
......
...@@ -244,7 +244,7 @@ class remoting_server extends remoting { ...@@ -244,7 +244,7 @@ class remoting_server extends remoting {
return false; return false;
} }
if (!empty($session_id)) { if (!empty($session_id)) {
if($server_id === 0) $ispc_app_version = array('ispc_app_version' => ISPC_APP_VERSION); if($server_id == 0) $ispc_app_version = array('ispc_app_version' => ISPC_APP_VERSION);
else { else {
$rec = $app->db->queryOneRecord("SELECT data FROM monitor_data WHERE type = 'ispc_info' AND server_id = ?", $server_id); $rec = $app->db->queryOneRecord("SELECT data FROM monitor_data WHERE type = 'ispc_info' AND server_id = ?", $server_id);
$rec = unserialize($rec['data']); $rec = unserialize($rec['data']);
......
...@@ -136,6 +136,13 @@ ...@@ -136,6 +136,13 @@
<select name="dmarc_sp" id="dmarc_sp" class="form-control">{tmpl_var name='dmarc_sp'}</select> <select name="dmarc_sp" id="dmarc_sp" class="form-control">{tmpl_var name='dmarc_sp'}</select>
</div> </div>
</div> </div>
<div class="form-group">
<label for="ttl" class="col-sm-2 control-label">{tmpl_var name='ttl_txt'}</label>
<div class="col-sm-3">
<input type="text" name="ttl" id="ttl" value="{tmpl_var name='ttl'}" class="form-control" />
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">{tmpl_var name='active_txt'}</label> <label class="col-sm-2 control-label">{tmpl_var name='active_txt'}</label>
......
...@@ -14,8 +14,6 @@ export TMPDIR=<tmpl_var name='document_root'>/tmp ...@@ -14,8 +14,6 @@ export TMPDIR=<tmpl_var name='document_root'>/tmp
export TEMP=<tmpl_var name='document_root'>/tmp export TEMP=<tmpl_var name='document_root'>/tmp
exec <tmpl_var name='php_fcgi_bin'> \ exec <tmpl_var name='php_fcgi_bin'> \
<tmpl_if name="security_level" op="==" value="20"> -d open_basedir="<tmpl_var name='open_basedir'>" \ <tmpl_if name="security_level" op="==" value="20"> -d open_basedir="<tmpl_var name='open_basedir'>" \
-d disable_functions="" \
-d suhosin.executor.func.blacklist="" \
-d upload_tmp_dir=<tmpl_var name='document_root'>/tmp \ -d upload_tmp_dir=<tmpl_var name='document_root'>/tmp \
-d session.save_path=<tmpl_var name='document_root'>/tmp \ -d session.save_path=<tmpl_var name='document_root'>/tmp \
-d sendmail_path="/usr/sbin/sendmail -t -i -f webmaster@<tmpl_var name='domain'>" \ -d sendmail_path="/usr/sbin/sendmail -t -i -f webmaster@<tmpl_var name='domain'>" \
......
...@@ -278,7 +278,7 @@ class monitor_tools { ...@@ -278,7 +278,7 @@ class monitor_tools {
$distver = 'Unknown'; $distver = 'Unknown';
$distid = 'centos53'; $distid = 'centos53';
$distbaseid = 'fedora'; $distbaseid = 'fedora';
} elseif(stristr($content, 'CentOS Linux release 6')) { } elseif(stristr($content, 'CentOS Linux release 6') || stristr($content, 'CentOS release 6')) {
$distname = 'CentOS'; $distname = 'CentOS';
$distver = 'Unknown'; $distver = 'Unknown';
$distid = 'centos53'; $distid = 'centos53';
......
...@@ -461,7 +461,7 @@ class shelluser_base_plugin { ...@@ -461,7 +461,7 @@ class shelluser_base_plugin {
if(is_file('/root/.ssh/authorized_keys')) $app->system->file_put_contents($sshkeys, $app->system->file_get_contents('/root/.ssh/authorized_keys')); if(is_file('/root/.ssh/authorized_keys')) $app->system->file_put_contents($sshkeys, $app->system->file_get_contents('/root/.ssh/authorized_keys'));
// Remove duplicate keys // Remove duplicate keys
$existing_keys = @file($sshkeys); $existing_keys = @file($sshkeys, FILE_IGNORE_NEW_LINES);
$new_keys = explode("\n", $userkey); $new_keys = explode("\n", $userkey);
$final_keys_arr = @array_merge($existing_keys, $new_keys); $final_keys_arr = @array_merge($existing_keys, $new_keys);
$new_final_keys_arr = array(); $new_final_keys_arr = array();
...@@ -479,7 +479,7 @@ class shelluser_base_plugin { ...@@ -479,7 +479,7 @@ class shelluser_base_plugin {
} }
//* Get the keys //* Get the keys
$existing_keys = file($sshkeys); $existing_keys = file($sshkeys, FILE_IGNORE_NEW_LINES);
$new_keys = explode("\n", $sshrsa); $new_keys = explode("\n", $sshrsa);
$old_keys = explode("\n", $this->data['old']['ssh_rsa']); $old_keys = explode("\n", $this->data['old']['ssh_rsa']);
...@@ -487,7 +487,9 @@ class shelluser_base_plugin { ...@@ -487,7 +487,9 @@ class shelluser_base_plugin {
if(is_array($old_keys)) { if(is_array($old_keys)) {
foreach($old_keys as $key => $val) { foreach($old_keys as $key => $val) {
$k = array_search(trim($val), $existing_keys); $k = array_search(trim($val), $existing_keys);
unset($existing_keys[$k]); if ($k !== false) {
unset($existing_keys[$k]);
}
} }
} }
......
...@@ -480,7 +480,7 @@ class shelluser_jailkit_plugin { ...@@ -480,7 +480,7 @@ class shelluser_jailkit_plugin {
if(is_file('/root/.ssh/authorized_keys')) $app->system->file_put_contents($sshkeys, $app->system->file_get_contents('/root/.ssh/authorized_keys')); if(is_file('/root/.ssh/authorized_keys')) $app->system->file_put_contents($sshkeys, $app->system->file_get_contents('/root/.ssh/authorized_keys'));
// Remove duplicate keys // Remove duplicate keys
$existing_keys = @file($sshkeys); $existing_keys = @file($sshkeys, FILE_IGNORE_NEW_LINES);
$new_keys = explode("\n", $userkey); $new_keys = explode("\n", $userkey);
$final_keys_arr = @array_merge($existing_keys, $new_keys); $final_keys_arr = @array_merge($existing_keys, $new_keys);
$new_final_keys_arr = array(); $new_final_keys_arr = array();
...@@ -497,7 +497,7 @@ class shelluser_jailkit_plugin { ...@@ -497,7 +497,7 @@ class shelluser_jailkit_plugin {
$this->app->log("ssh-rsa authorisation keyfile created in ".$sshkeys, LOGLEVEL_DEBUG); $this->app->log("ssh-rsa authorisation keyfile created in ".$sshkeys, LOGLEVEL_DEBUG);
} }
//* Get the keys //* Get the keys
$existing_keys = file($sshkeys); $existing_keys = file($sshkeys, FILE_IGNORE_NEW_LINES);
$new_keys = explode("\n", $sshrsa); $new_keys = explode("\n", $sshrsa);
$old_keys = explode("\n", $this->data['old']['ssh_rsa']); $old_keys = explode("\n", $this->data['old']['ssh_rsa']);
...@@ -505,7 +505,9 @@ class shelluser_jailkit_plugin { ...@@ -505,7 +505,9 @@ class shelluser_jailkit_plugin {
if(is_array($old_keys)) { if(is_array($old_keys)) {
foreach($old_keys as $key => $val) { foreach($old_keys as $key => $val) {
$k = array_search(trim($val), $existing_keys); $k = array_search(trim($val), $existing_keys);
unset($existing_keys[$k]); if ($k !== false) {
unset($existing_keys[$k]);
}
} }
} }
......