Skip to content

Commit d5f2d5f

Browse files
author
Marius Cramer
committed
- ported some patches
1 parent 024e132 commit d5f2d5f

File tree

13 files changed

+135
-16
lines changed

13 files changed

+135
-16
lines changed

install/install.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,8 @@
713713

714714
} //* << $install_mode / 'Standard' or Genius
715715

716+
$inst->create_mount_script();
717+
716718
//* Create md5 filelist
717719
$md5_filename = '/usr/local/ispconfig/security/data/file_checksums_'.date('Y-m-d_h-i').'.md5';
718720
exec('find /usr/local/ispconfig -type f -print0 | xargs -0 md5sum > '.$md5_filename);

install/lib/installer_base.lib.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,6 +2442,32 @@ public function install_crontab() {
24422442

24432443
}
24442444

2445+
public function create_mount_script(){
2446+
global $app, $conf;
2447+
$mount_script = '/usr/local/ispconfig/server/scripts/backup_dir_mount.sh';
2448+
$mount_command = '';
2449+
2450+
if(is_file($mount_script)) return;
2451+
if(is_file('/etc/rc.local')){
2452+
$rc_local = file('/etc/rc.local');
2453+
if(is_array($rc_local) && !empty($rc_local)){
2454+
foreach($rc_local as $line){
2455+
$line = trim($line);
2456+
if(substr($line, 0, 1) == '#') continue;
2457+
if(strpos($line, 'sshfs') !== false && strpos($line, '/var/backup') !== false){
2458+
$mount_command = "#!/bin/sh\n\n";
2459+
$mount_command .= $line."\n\n";
2460+
file_put_contents($mount_script, $mount_command);
2461+
chmod($mount_script, 0755);
2462+
chown($mount_script, 'root');
2463+
chgrp($mount_script, 'root');
2464+
break;
2465+
}
2466+
}
2467+
}
2468+
}
2469+
}
2470+
24452471
// This function is called at the end of the update process and contains code to clean up parts of old ISPCONfig releases
24462472
public function cleanup_ispconfig() {
24472473
global $app,$conf;

install/tpl/server.ini.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ firewall=bastille
1616
loglevel=2
1717
admin_notify_events=1
1818
backup_dir=/var/backup
19-
backup_dir_is_mount=n
19+
backup_dir_is_mount=y
2020
backup_mode=rootgz
2121
backup_delete=y
2222
monit_url=

install/update.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,8 @@
516516
//* Set default servers
517517
setDefaultServers();
518518

519+
$inst->create_mount_script();
520+
519521
//* Create md5 filelist
520522
$md5_filename = '/usr/local/ispconfig/security/data/file_checksums_'.date('Y-m-d_h-i').'.md5';
521523
exec('find /usr/local/ispconfig -type f -print0 | xargs -0 md5sum > '.$md5_filename);

interface/lib/classes/tools_monitor.inc.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ function showFail2ban() {
488488
$data = unserialize($record['data']);
489489
if ($data == '') {
490490
$html .= '<p>'.
491-
'fail2ban is not installed at this server.<br />' .
491+
'fail2ban is not installed on this server.<br />' .
492492
'See more (for debian) <a href="http://www.howtoforge.com/fail2ban_debian_etch" target="htf">here...</a>'.
493493
'</p>';
494494
}
@@ -522,8 +522,7 @@ function showMongoDB() {
522522
$data = unserialize($record['data']);
523523
if ($data == '') {
524524
$html .= '<p>'.
525-
'MongoDB is not installed at this server.<br />' .
526-
'See more (for debian) <a href="http://www.howtoforge.com/fail2ban_debian_etch" target="htf">here...</a>'.
525+
'MongoDB is not installed on this server.<br />' .
527526
'</p>';
528527
}
529528
else {

interface/web/admin/form/server_config.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
'backup_dir_is_mount' => array(
183183
'datatype' => 'VARCHAR',
184184
'formtype' => 'CHECKBOX',
185-
'default' => 'n',
185+
'default' => 'y',
186186
'value' => array(0 => 'n', 1 => 'y')
187187
),
188188
'backup_mode' => array(

interface/web/sites/templates/web_vhost_domain_edit.htm

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,16 @@ <h1><tmpl_var name="list_head_txt"></h1>
333333
}
334334

335335
function reloadWebIP() {
336-
ISPConfig.loadOptionInto('ip_address','sites/ajax_get_ip.php?ip_type=IPv4&server_id='+serverId+'&client_group_id='+clientGroupId);
337-
ISPConfig.loadOptionInto('ipv6_address','sites/ajax_get_ip.php?ip_type=IPv6&server_id='+serverId+'&client_group_id='+clientGroupId);
336+
ISPConfig.loadOptionInto('ip_address','sites/ajax_get_ip.php?ip_type=IPv4&server_id='+serverId+'&client_group_id='+clientGroupId<tmpl_if name="use_combobox" value="y">, rerenderSelect2</tmpl_if>);
337+
ISPConfig.loadOptionInto('ipv6_address','sites/ajax_get_ip.php?ip_type=IPv6&server_id='+serverId+'&client_group_id='+clientGroupId<tmpl_if name="use_combobox" value="y">, rerenderSelect2</tmpl_if>);
338+
<tmpl_if name="use_combobox" value="y">
339+
//$('#ip_address').add('#ipv6_address').select2();
340+
</tmpl_if>
338341
}
342+
343+
function rerenderSelect2(elem) {
344+
$('#'+elem).select2();
345+
}
339346

340347
function reloadFastcgiPHPVersions(noFormChange) {
341348
jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {server_id : serverId, php_type : jQuery('#php').val(), type : "getphpfastcgi", client_group_id : clientGroupId}, function(data) {

interface/web/sites/web_vhost_domain_edit.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,10 @@ function onShowEnd() {
719719
if(is_array($tmp_client) && !empty($tmp_client) && trim($this->dataRecord['ssl_organisation']) == '' && trim($this->dataRecord['ssl_locality']) == '' && trim($this->dataRecord['ssl_state']) == '' && trim($this->dataRecord['ssl_organisation_unit']) == '') $app->tpl->setVar("show_helper_links", true);
720720
}
721721

722+
$sys_config = $app->getconf->get_global_config('misc');
723+
if($sys_config['use_combobox'] == 'y') {
724+
$app->tpl->setVar('use_combobox', 'y');
725+
}
722726
parent::onShowEnd();
723727
}
724728

interface/web/themes/default/assets/javascripts/ispconfig.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ var ISPConfig = {
464464
});
465465
},
466466

467-
loadOptionInto: function(elementid,pagename) {
467+
loadOptionInto: function(elementid,pagename,callback) {
468468
var pageContentObject2 = $.ajax({
469469
type: "GET",
470470
url: pagename,
@@ -482,6 +482,9 @@ var ISPConfig = {
482482
foo2.value=elemente[i];
483483
el.appendChild(foo2);
484484
}
485+
if (typeof(callback) != 'undefined') {
486+
callback(elementid,pagename);
487+
}
485488
},
486489
error: function() {
487490
ISPConfig.reportError('Ajax Request was not successful. 119');

interface/web/themes/default/assets/stylesheets/select2.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ disabled look for disabled choices in the results dropdown
442442
}
443443
.select2-results .select2-disabled {
444444
background: #f4f4f4;
445-
display: list-item;
445+
display: none;
446446
cursor: default;
447447
}
448448

0 commit comments

Comments
 (0)