-ensure correct permissions on created /srv/airtime/stor dir

This commit is contained in:
Martin Konecny 2012-05-08 18:14:04 -04:00
parent 0434ffc7bf
commit 6305e4f846

View file

@ -46,7 +46,6 @@ class AirtimeInstall
*/ */
public static function GetVersionInstalled() public static function GetVersionInstalled()
{ {
global $CC_CONFIG;
try { try {
$con = Propel::getConnection(); $con = Propel::getConnection();
} catch (PropelException $e) { } catch (PropelException $e) {
@ -158,8 +157,7 @@ class AirtimeInstall
foreach ($dirs as $dir){ foreach ($dirs as $dir){
if (!file_exists($dir)) { if (!file_exists($dir)) {
@mkdir($dir, 02777, true); if (mkdir($dir, 02775, true)){
if (file_exists($dir)) {
$rp = realpath($dir); $rp = realpath($dir);
echo "* Directory $rp created".PHP_EOL; echo "* Directory $rp created".PHP_EOL;
} else { } else {
@ -179,8 +177,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, "www-data"); $success = chmod($rp, 02775);
$success = chmod($rp, 02770);
} }
} }