From fe6bb22f6cb84fd9c6d202ca8d8e9e44e4cb8982 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 24 Mar 2015 08:02:23 +0100 Subject: [PATCH] src: whitespace sweep --- src/etc/inc/config.inc | 1 - src/etc/inc/config.lib.inc | 28 +++++++++---------- src/etc/inc/globals.inc | 1 - src/etc/rc.bootup | 1 - src/opnsense/scripts/remote_backup.php | 3 +- src/pkg/openvpn-client-export.inc | 16 +++++------ src/www/diag_backup.php | 38 +++++++++++++------------- src/www/services_ntpd.php | 2 +- src/www/services_ntpd_gps.php | 8 +++--- src/www/vpn_openvpn_export.php | 2 +- src/www/vpn_openvpn_export_shared.php | 16 +++++------ 11 files changed, 56 insertions(+), 60 deletions(-) diff --git a/src/etc/inc/config.inc b/src/etc/inc/config.inc index 735e6f7b3..9c7fb9f4e 100644 --- a/src/etc/inc/config.inc +++ b/src/etc/inc/config.inc @@ -144,4 +144,3 @@ if (!$timezone) { } date_default_timezone_set("$timezone"); - diff --git a/src/etc/inc/config.lib.inc b/src/etc/inc/config.lib.inc index 4b393cc24..fc70c043c 100644 --- a/src/etc/inc/config.lib.inc +++ b/src/etc/inc/config.lib.inc @@ -93,7 +93,7 @@ function parse_config_bootup() if (count($backups) > 0) { log_error("No config.xml found, attempting last known config restore."); file_notice("config.xml", gettext("No config.xml found, attempting last known config restore."), "pfSenseConfigurator", ""); - $cnf->restoreBackup($backups[0]); + $cnf->restoreBackup($backups[0]); } else { echo sprintf(gettext("XML configuration file not found. %s cannot continue booting."), $g['product_name']) . "\n"; mwexec("/sbin/halt"); @@ -356,7 +356,7 @@ function cleanup_backups() { } $cnf = OPNsense\Core\Config::getInstance(); - + $cnt=1; foreach ($cnf->getBackups() as $filename) { if ($cnt > $revisions ) { @@ -451,11 +451,11 @@ function backup_to_google_drive() { if ( isset($config->system->remotebackup) && isset($config->system->remotebackup->GDriveEnabled) && $config->system->remotebackup->GDriveEnabled == "on" ){ $client->login($config->system->remotebackup->GDriveEmail->__toString(), $config->system->remotebackup->GDriveP12key->__toString() ); // backup source data to local strings (plain/encrypted) - $confdata = file_get_contents('/conf/config.xml') ; + $confdata = file_get_contents('/conf/config.xml') ; $confdata_enc = encrypt_data($confdata, $config->system->remotebackup->GDrivePassword->__toString()) ; - tagfile_reformat($confdata_enc, $confdata_enc, "config.xml"); - - + tagfile_reformat($confdata_enc, $confdata_enc, "config.xml"); + + // read filelist (config-*.xml) and cleanup old files $files = $client->listFiles($config->system->remotebackup->GDriveFolderID->__toString()); $configfiles = array(); @@ -465,9 +465,9 @@ function backup_to_google_drive() { } } krsort($configfiles); - + if (isset($config->system->remotebackup->GDriveBackupCount) && is_numeric($config->system->remotebackup->GDriveBackupCount->__toString())) { - $fcount = 0; + $fcount = 0; foreach ($configfiles as $filename => $file) { if ($fcount > $config->system->remotebackup->GDriveBackupCount->__toString()) { log_error("remove " . $filename . " from Google Drive" ); @@ -480,18 +480,18 @@ function backup_to_google_drive() { // backup new file if changed (or if first in backup) $target_filename = "config-".time().".xml"; if (count($configfiles) > 1) { - // compare last backup with current, only save new + // compare last backup with current, only save new $bck_data_enc = $client->download($configfiles[array_keys($configfiles)[0]]); $bck_data = decrypt_data($bck_data_enc, $config->system->remotebackup->GDrivePassword->__toString()); if ($bck_data == $confdata) { $target_filename = null; - } - } + } + } if (!is_null($target_filename)) { log_error("backup configuration as " . $target_filename); $configfiles[$target_filename] = $client->upload($config->system->remotebackup->GDriveFolderID->__toString(),$target_filename, $confdata_enc ); - } - + } + // return filelist return $configfiles; @@ -499,7 +499,7 @@ function backup_to_google_drive() { } // not configured / issue, return empty list - return array(); + return array(); } register_shutdown_function('pfSense_clear_globals'); diff --git a/src/etc/inc/globals.inc b/src/etc/inc/globals.inc index 009712340..334c79d0d 100644 --- a/src/etc/inc/globals.inc +++ b/src/etc/inc/globals.inc @@ -130,4 +130,3 @@ function is_install_media() return true; } - diff --git a/src/etc/rc.bootup b/src/etc/rc.bootup index a1d58cf91..fd2c7ceaa 100755 --- a/src/etc/rc.bootup +++ b/src/etc/rc.bootup @@ -376,4 +376,3 @@ if ($ipsec_dynamic_hosts) { } led_normalize(); - diff --git a/src/opnsense/scripts/remote_backup.php b/src/opnsense/scripts/remote_backup.php index 11adb3d07..188add08f 100755 --- a/src/opnsense/scripts/remote_backup.php +++ b/src/opnsense/scripts/remote_backup.php @@ -1,9 +1,8 @@ #!/usr/local/bin/php - +
-
-
+
+

- -
+ +
- +
@@ -761,7 +761,7 @@ function backuparea_change(obj) { - + @@ -769,7 +769,7 @@ function backuparea_change(obj) {
:
-
+
@@ -783,8 +783,8 @@ function backuparea_change(obj) { - - + + diff --git a/src/www/services_ntpd.php b/src/www/services_ntpd.php index ad6fa5588..315e3a3eb 100644 --- a/src/www/services_ntpd.php +++ b/src/www/services_ntpd.php @@ -197,7 +197,7 @@ include("head.inc"); if (add < 10) { var TimeServerID = 'timeserver' + add; document.getElementById(TimeServerID).style.display = 'block'; - + //then revise the add another server line if (add < 9) { var next = add + 1; diff --git a/src/www/services_ntpd_gps.php b/src/www/services_ntpd_gps.php index 0f1ce0f50..2fa4db904 100644 --- a/src/www/services_ntpd_gps.php +++ b/src/www/services_ntpd_gps.php @@ -103,8 +103,8 @@ if ($_POST) { $config['ntpd']['gps']['flag1'] = $_POST['gpsflag1']; } elseif (isset($config['ntpd']['gps']['flag1'])) { unset($config['ntpd']['gps']['flag1']); - } - + } + if (!empty($_POST['gpsflag2'])) $config['ntpd']['gps']['flag2'] = $_POST['gpsflag2']; elseif (isset($config['ntpd']['gps']['flag2'])) @@ -586,9 +586,9 @@ SureGPS = #Sure Electronics SKG16B diff --git a/src/www/vpn_openvpn_export.php b/src/www/vpn_openvpn_export.php index bab717f76..d34efd855 100644 --- a/src/www/vpn_openvpn_export.php +++ b/src/www/vpn_openvpn_export.php @@ -578,7 +578,7 @@ function useproxy_changed(obj) { print_info_box($savemsg); ?> - +
- +
-