aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/dashboard/dashboard.inc17
1 files changed, 11 insertions, 6 deletions
diff --git a/packages/dashboard/dashboard.inc b/packages/dashboard/dashboard.inc
index f6752f14..86097eaa 100644
--- a/packages/dashboard/dashboard.inc
+++ b/packages/dashboard/dashboard.inc
@@ -2,7 +2,7 @@
function dashboard_install() {
global $g, $config;
- mwexec("chmod ug+rw /usr/local/www/index.php");
+ 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");
@@ -10,20 +10,25 @@ function dashboard_install() {
mwexec("cp /usr/local/www/fbegin.inc /usr/local/www/fbegin.inc.before_dashboard");
}
mwexec("tar xzvpf /usr/local/pkg/widgets.tgz -C /usr/local/www/");
- mwexec("chmod a-w /usr/local/www/index.php");
- mwexec("chmod a-w /usr/local/www/fbegin.php");
- mwexec("chmod a-w /usr/local/www/graph_cpu.php");
- mwexec("chmod a-w /usr/local/www/stats.php");
+ assign_privs();
}
function dashboard_deinstall() {
global $g, $config;
- mwexec("chmod ug+rw /usr/local/www/index.php");
+ 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");
}
+ assign_privs();
+}
+
+function assign_privs() {
+ 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");
}
?> \ No newline at end of file