File: //home/httpd/mech_ftp/baretube.com/admin/cli/resetScriptPermissions.php
<?
require("../../mb.php");
if ($argv[1]) {
foreach ($argv as $arg) {
$e = explode("=", $arg);
if (count($e) == 2) {
$command = $e[0];
$param = $e[1];
} else {
$command = $e[0];
}
}
}
if(!$command) {
exit("This file will reset all required directories to 777.\nIf you are sure you want to do this, please execute it as follows: php resetScriptPermissions.php imsure\n");
}
if($command == 'imsure') {
if($basepath) {
shell_exec("chmod -R 777 $basepath/cache");
shell_exec("chmod -R 777 $basepath/content");
shell_exec("chmod -R 777 $basepath/media");
shell_exec("chmod -R 777 $basepath/ftp*");
shell_exec("chmod -R 777 $basepath/csv*");
shell_exec("chmod -R 777 $basepath/temp_users_uploads");
shell_exec("chmod -R 777 $basepath/admin/scripts");
shell_exec("chmod -R 777 $basepath/admin/logs");
exit("Done");
} else {
exit("Basepath not set!");
}
}
?>