From 28ed8ca978a9fc75d88f1b502937bf373e1320b7 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Tue, 26 Jul 2011 11:07:25 +0200 Subject: [PATCH] CC-2589 : Create "organize" dir when upgrading make owner of stor and any sub folders www-data. --- install_minimal/include/AirtimeInstall.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/install_minimal/include/AirtimeInstall.php b/install_minimal/include/AirtimeInstall.php index 5ce52c05b..1459ff2d7 100644 --- a/install_minimal/include/AirtimeInstall.php +++ b/install_minimal/include/AirtimeInstall.php @@ -116,19 +116,19 @@ class AirtimeInstall } } - + /* TODO: This function should be moved to the media-monitor * install script. */ public static function InstallStorageDirectory() { global $CC_CONFIG, $CC_DBC; echo "* Storage directory setup".PHP_EOL; - + $ini = parse_ini_file(__DIR__."/airtime-install.ini"); $stor_dir = $ini["storage_dir"]; - + $dirs = array($stor_dir, $stor_dir."/organize"); - + foreach ($dirs as $dir){ if (!file_exists($dir)) { @mkdir($dir, 02777, true); @@ -152,7 +152,7 @@ class AirtimeInstall echo "* Giving Apache permission to access $rp".PHP_EOL; $success = chgrp($rp, $CC_CONFIG["webServerUser"]); - $success = chown($rp, "pypo"); + $success = chown($rp, "www-data"); $success = chmod($rp, 02777); } } @@ -270,7 +270,7 @@ class AirtimeInstall } return true; } - + public static function SetUniqueId() { global $CC_DBC; @@ -404,12 +404,12 @@ class AirtimeInstall exec("rm -rf \"$path\""); } - + public static function CreateCronFile(){ // Create CRON task to run every day. Time of day is initialized to a random time. $hour = rand(0,23); $minute = rand(0,59); - + $fp = fopen('/etc/cron.d/airtime-crons','w'); fwrite($fp, "$minute $hour * * * root /usr/lib/airtime/utils/phone_home_stat\n"); fclose($fp);