aboutsummaryrefslogtreecommitdiffstats
path: root/config/dashboard/dashboard.inc
diff options
context:
space:
mode:
authorrob <rob@ubuntu.local>2009-04-11 02:53:58 -0700
committerrob <rob@ubuntu.local>2009-04-11 02:53:58 -0700
commit00ca1313d055ddf8c2823b7f76c553ed75d765dd (patch)
tree23a611405fa7c99dc957b87aed83537707885565 /config/dashboard/dashboard.inc
parent83d4c55637161dc97fd611fa4faf3f1872dcc8da (diff)
parent81372f3fb6e45543837b7e0746b9c5f4f2b50c93 (diff)
downloadpfsense-packages-00ca1313d055ddf8c2823b7f76c553ed75d765dd.tar.gz
pfsense-packages-00ca1313d055ddf8c2823b7f76c553ed75d765dd.tar.bz2
pfsense-packages-00ca1313d055ddf8c2823b7f76c553ed75d765dd.zip
Merge commit 'mainline/master'
Diffstat (limited to 'config/dashboard/dashboard.inc')
-rw-r--r--config/dashboard/dashboard.inc34
1 files changed, 24 insertions, 10 deletions
diff --git a/config/dashboard/dashboard.inc b/config/dashboard/dashboard.inc
index b147632e..07f4610c 100644
--- a/config/dashboard/dashboard.inc
+++ b/config/dashboard/dashboard.inc
@@ -4,10 +4,17 @@ function dashboard_install() {
global $g, $config;
assign_privs();
if(!file_exists("/usr/local/www/index.php.before_dashboard")) {
- /* backup the pre-dashboard index.php file */
- mwexec("cp /usr/local/www/index.php /usr/local/www/index.php.before_dashboard");
- /* backup the pre-dashboard fbegin.inc file */
- mwexec("cp /usr/local/www/fbegin.inc /usr/local/www/fbegin.inc.before_dashboard");
+ /* backup the pre-dashboard files */
+ mwexec("mv /usr/local/www/index.php /usr/local/www/index.php.before_dashboard");
+ mwexec("mv /usr/local/www/fbegin.inc /usr/local/www/fbegin.inc.before_dashboard");
+ mwexec("mv /usr/local/www/diag_logs_filter.php /usr/local/www/diag_logs_filter.php.before_dashboard");
+ mwexec("mv /usr/local/www/diag_logs_filter_dynamic.php /usr/local/www/diag_logs_filter_dynamic.php.before_dashboard");
+ } else {
+ /* Move the files, since we do not know what version they are, don't try to keep them. */
+ mwexec("mv /usr/local/www/index.php /usr/local/www/index.php.tmp");
+ mwexec("mv /usr/local/www/fbegin.inc /usr/local/www/fbegin.inc.tmp");
+ mwexec("mv /usr/local/www/diag_logs_filter.php /usr/local/www/diag_logs_filter.php.tmp");
+ mwexec("mv /usr/local/www/diag_logs_filter_dynamic.php /usr/local/www/diag_logs_filter_dynamic.php.tmp");
}
mwexec("tar xzvpf /usr/local/pkg/widgets.tgz -C /");
assign_privs();
@@ -18,21 +25,28 @@ function dashboard_deinstall() {
assign_privs();
if(file_exists("/usr/local/www/index.php.before_dashboard")) {
/* restore the files prior to the dashboard package installation */
- mwexec("cp /usr/local/www/index.php.before_dashboard /usr/local/www/index.php");
- mwexec("cp /usr/local/www/fbegin.inc.before_dashboard /usr/local/www/fbegin.inc");
+ mwexec("mv /usr/local/www/index.php.before_dashboard /usr/local/www/index.php");
+ mwexec("mv /usr/local/www/fbegin.inc.before_dashboard /usr/local/www/fbegin.inc");
+ mwexec("mv /usr/local/www/diag_logs_filter.php.before_dashboard /usr/local/www/diag_logs_filter.php");
+ mwexec("mv /usr/local/www/diag_logs_filter_dynamic.php.before_dashboard /usr/local/www/diag_logs_filter_dynamic.php");
}
assign_privs();
}
function assign_privs() {
+ /* Fix permissions on replaced files */
mwexec("chown root:wheel /usr/local/www/index.php");
mwexec("chown root:wheel /usr/local/www/fbegin.php");
mwexec("chown root:wheel /usr/local/www/graph_cpu.php");
mwexec("chown root:wheel /usr/local/www/stats.php");
- mwexec("chmod a+rw /usr/local/www/index.php");
- mwexec("chmod a+rw /usr/local/www/fbegin.php");
- mwexec("chmod a+rw /usr/local/www/graph_cpu.php");
- mwexec("chmod a+rw /usr/local/www/stats.php");
+ mwexec("chown root:wheel /usr/local/www/diag_logs_filter.php");
+ mwexec("chown root:wheel /usr/local/www/diag_logs_filter_dynamic.php");
+ mwexec("chmod ug+rw,o-w /usr/local/www/index.php");
+ mwexec("chmod ug+rw,o-w /usr/local/www/fbegin.php");
+ mwexec("chmod ug+rw,o-w /usr/local/www/graph_cpu.php");
+ mwexec("chmod ug+rw,o-w /usr/local/www/stats.php");
+ mwexec("chmod ug+rw,o-w /usr/local/www/diag_logs_filter.php");
+ mwexec("chmod ug+rw,o-w /usr/local/www/diag_logs_filter_dynamic.php");
}
?> \ No newline at end of file