CC-2589 : Create "organize" dir when upgrading

make owner of stor and any sub folders www-data.
This commit is contained in:
Naomi Aro 2011-07-26 11:07:25 +02:00
parent 87ac5f0a3a
commit 28ed8ca978
1 changed files with 8 additions and 8 deletions

View File

@ -116,19 +116,19 @@ class AirtimeInstall
} }
} }
/* TODO: This function should be moved to the media-monitor /* TODO: This function should be moved to the media-monitor
* install script. */ * install script. */
public static function InstallStorageDirectory() public static function InstallStorageDirectory()
{ {
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
echo "* Storage directory setup".PHP_EOL; echo "* Storage directory setup".PHP_EOL;
$ini = parse_ini_file(__DIR__."/airtime-install.ini"); $ini = parse_ini_file(__DIR__."/airtime-install.ini");
$stor_dir = $ini["storage_dir"]; $stor_dir = $ini["storage_dir"];
$dirs = array($stor_dir, $stor_dir."/organize"); $dirs = array($stor_dir, $stor_dir."/organize");
foreach ($dirs as $dir){ foreach ($dirs as $dir){
if (!file_exists($dir)) { if (!file_exists($dir)) {
@mkdir($dir, 02777, true); @mkdir($dir, 02777, true);
@ -152,7 +152,7 @@ class AirtimeInstall
echo "* Giving Apache permission to access $rp".PHP_EOL; echo "* Giving Apache permission to access $rp".PHP_EOL;
$success = chgrp($rp, $CC_CONFIG["webServerUser"]); $success = chgrp($rp, $CC_CONFIG["webServerUser"]);
$success = chown($rp, "pypo"); $success = chown($rp, "www-data");
$success = chmod($rp, 02777); $success = chmod($rp, 02777);
} }
} }
@ -270,7 +270,7 @@ class AirtimeInstall
} }
return true; return true;
} }
public static function SetUniqueId() public static function SetUniqueId()
{ {
global $CC_DBC; global $CC_DBC;
@ -404,12 +404,12 @@ class AirtimeInstall
exec("rm -rf \"$path\""); exec("rm -rf \"$path\"");
} }
public static function CreateCronFile(){ public static function CreateCronFile(){
// Create CRON task to run every day. Time of day is initialized to a random time. // Create CRON task to run every day. Time of day is initialized to a random time.
$hour = rand(0,23); $hour = rand(0,23);
$minute = rand(0,59); $minute = rand(0,59);
$fp = fopen('/etc/cron.d/airtime-crons','w'); $fp = fopen('/etc/cron.d/airtime-crons','w');
fwrite($fp, "$minute $hour * * * root /usr/lib/airtime/utils/phone_home_stat\n"); fwrite($fp, "$minute $hour * * * root /usr/lib/airtime/utils/phone_home_stat\n");
fclose($fp); fclose($fp);