mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
I got the permissions wrong (#1616)
it should have been in octal mod (leading 0) also updated the fax application as it needs the stickygid too
This commit is contained in:
@@ -217,7 +217,7 @@ else {
|
||||
echo " <a href='javascript:void(0);' onclick=\"send_cmd('calls_exec.php?cmd='+get_park_cmd(escape('$uuid'), '".$tmp_domain."'));\">".$text['label-park']."</a> \n";
|
||||
//record start/stop
|
||||
$tmp_dir = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/".date("Y")."/".date("M")."/".date("d");
|
||||
mkdir($tmp_dir, 1777, true);
|
||||
mkdir($tmp_dir, 02770, true);
|
||||
$tmp_file = $tmp_dir."/".$uuid.".wav";
|
||||
if (file_exists($tmp_file)) {
|
||||
//stop
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
//if the public directory doesn't exist then create it
|
||||
if ($domains_processed == 1) {
|
||||
if (strlen($_SESSION['switch']['dialplan']['dir']) > 0) {
|
||||
if (!is_dir($_SESSION['switch']['dialplan']['dir'].'/public')) { mkdir($_SESSION['switch']['dialplan']['dir'].'/public',2777,true); }
|
||||
if (!is_dir($_SESSION['switch']['dialplan']['dir'].'/public')) { mkdir($_SESSION['switch']['dialplan']['dir'].'/public',02770,true); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
//make sure the public directory and xml file exist
|
||||
if (strlen($_SESSION['switch']['dialplan']['dir']) > 0) {
|
||||
if (!is_dir($_SESSION['switch']['dialplan']['dir'].'/public'.$_SESSION['domains'][$domain_uuid]['domain_name'])) {
|
||||
mkdir($_SESSION['switch']['dialplan']['dir'].'/public/'.$_SESSION['domains'][$domain_uuid]['domain_name'],2777,true);
|
||||
mkdir($_SESSION['switch']['dialplan']['dir'].'/public/'.$_SESSION['domains'][$domain_uuid]['domain_name'],02770,true);
|
||||
}
|
||||
$file = $_SESSION['switch']['dialplan']['dir']."/public/".$_SESSION['domains'][$domain_uuid]['domain_name'].".xml";
|
||||
if (!file_exists($file)) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
//if the extensions dir doesn't exist then create it
|
||||
if ($domains_processed == 1) {
|
||||
if (strlen($_SESSION['switch']['extensions']['dir']) > 0) {
|
||||
if (!is_dir($_SESSION['switch']['extensions']['dir'])) { mkdir($_SESSION['switch']['extensions']['dir'],2770,true); }
|
||||
if (!is_dir($_SESSION['switch']['extensions']['dir'])) { mkdir($_SESSION['switch']['extensions']['dir'],02770,true); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -397,7 +397,7 @@ if (!class_exists('extension')) {
|
||||
$xml .= " </user>\n";
|
||||
|
||||
if (!is_readable($_SESSION['switch']['extensions']['dir']."/".$row['user_context'])) {
|
||||
mkdir($_SESSION['switch']['extensions']['dir']."/".$row['user_context'],2755,true);
|
||||
mkdir($_SESSION['switch']['extensions']['dir']."/".$row['user_context'],02770,true);
|
||||
}
|
||||
if (strlen($extension) > 0) {
|
||||
$fout = fopen($_SESSION['switch']['extensions']['dir']."/".$row['user_context']."/v_".$extension.".xml","w");
|
||||
|
||||
@@ -64,24 +64,19 @@ else {
|
||||
|
||||
//make sure the directories exist
|
||||
if (!is_dir($_SESSION['switch']['storage']['dir'])) {
|
||||
mkdir($_SESSION['switch']['storage']['dir']);
|
||||
chmod($dir_fax_sent,0774);
|
||||
mkdir($_SESSION['switch']['storage']['dir'],02770,true);
|
||||
}
|
||||
if (!is_dir($fax_dir.'/'.$fax_extension)) {
|
||||
mkdir($fax_dir.'/'.$fax_extension,0774,true);
|
||||
chmod($fax_dir.'/'.$fax_extension,0774);
|
||||
mkdir($fax_dir.'/'.$fax_extension,02770,true);
|
||||
}
|
||||
if (!is_dir($dir_fax_inbox)) {
|
||||
mkdir($dir_fax_inbox,0774,true);
|
||||
chmod($dir_fax_inbox,0774);
|
||||
mkdir($dir_fax_inbox,02770,true);
|
||||
}
|
||||
if (!is_dir($dir_fax_sent)) {
|
||||
mkdir($dir_fax_sent,0774,true);
|
||||
chmod($dir_fax_sent,0774);
|
||||
mkdir($dir_fax_sent,02770,true);
|
||||
}
|
||||
if (!is_dir($dir_fax_temp)) {
|
||||
mkdir($dir_fax_temp,0774,true);
|
||||
chmod($dir_fax_temp,0774);
|
||||
mkdir($dir_fax_temp,02770,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -145,24 +145,19 @@ else {
|
||||
|
||||
//make sure the directories exist
|
||||
if (!is_dir($_SESSION['switch']['storage']['dir'])) {
|
||||
mkdir($_SESSION['switch']['storage']['dir']);
|
||||
chmod($dir_fax_sent,0774);
|
||||
mkdir($_SESSION['switch']['storage']['dir'],02770,true);
|
||||
}
|
||||
if (!is_dir($fax_dir.'/'.$fax_extension)) {
|
||||
mkdir($fax_dir.'/'.$fax_extension,0774,true);
|
||||
chmod($fax_dir.'/'.$fax_extension,0774);
|
||||
mkdir($fax_dir.'/'.$fax_extension,02770,true);
|
||||
}
|
||||
if (!is_dir($dir_fax_inbox)) {
|
||||
mkdir($dir_fax_inbox,0774,true);
|
||||
chmod($dir_fax_inbox,0774);
|
||||
mkdir($dir_fax_inbox,02770,true);
|
||||
}
|
||||
if (!is_dir($dir_fax_sent)) {
|
||||
mkdir($dir_fax_sent,0774,true);
|
||||
chmod($dir_fax_sent,0774);
|
||||
mkdir($dir_fax_sent,02770,true);
|
||||
}
|
||||
if (!is_dir($dir_fax_temp)) {
|
||||
mkdir($dir_fax_temp,0774,true);
|
||||
chmod($dir_fax_temp,0774);
|
||||
mkdir($dir_fax_temp,02770,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -206,32 +206,25 @@ function fax_split_dtmf(&$fax_number, &$fax_dtmf){
|
||||
|
||||
//make sure the directories exist
|
||||
if (!is_dir($_SESSION['switch']['storage']['dir'])) {
|
||||
mkdir($_SESSION['switch']['storage']['dir']);
|
||||
chmod($_SESSION['switch']['storage']['dir'],0774);
|
||||
mkdir($_SESSION['switch']['storage']['dir'],02770,true);
|
||||
}
|
||||
if (!is_dir($_SESSION['switch']['storage']['dir'].'/fax')) {
|
||||
mkdir($_SESSION['switch']['storage']['dir'].'/fax');
|
||||
chmod($_SESSION['switch']['storage']['dir'].'/fax',0774);
|
||||
mkdir($_SESSION['switch']['storage']['dir'].'/fax',02770,true);
|
||||
}
|
||||
if (!is_dir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'])) {
|
||||
mkdir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name']);
|
||||
chmod($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'],0774);
|
||||
mkdir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'],02770,true);
|
||||
}
|
||||
if (!is_dir($fax_dir.'/'.$fax_extension)) {
|
||||
mkdir($fax_dir.'/'.$fax_extension,0774,true);
|
||||
chmod($fax_dir.'/'.$fax_extension,0774);
|
||||
mkdir($fax_dir.'/'.$fax_extension,02770,true);
|
||||
}
|
||||
if (!is_dir($dir_fax_inbox)) {
|
||||
mkdir($dir_fax_inbox,0774,true);
|
||||
chmod($dir_fax_inbox,0774);
|
||||
mkdir($dir_fax_inbox,02770,true);
|
||||
}
|
||||
if (!is_dir($dir_fax_sent)) {
|
||||
mkdir($dir_fax_sent,0774,true);
|
||||
chmod($dir_fax_sent,0774);
|
||||
mkdir($dir_fax_sent,02770,true);
|
||||
}
|
||||
if (!is_dir($dir_fax_temp)) {
|
||||
mkdir($dir_fax_temp,0774,true);
|
||||
chmod($dir_fax_temp,0774);
|
||||
mkdir($dir_fax_temp,02770,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ else {
|
||||
//process sampling rate(s)
|
||||
if (isset($sampling_rate_dirs)) foreach ($sampling_rate_dirs as $sampling_rate_dir) {
|
||||
if (!is_dir($music_on_hold_dir."/".$path_mod.$new_category_name."/".$sampling_rate_dir)) {
|
||||
mkdir($music_on_hold_dir."/".$path_mod.$new_category_name."/".$sampling_rate_dir, 2777, true);
|
||||
mkdir($music_on_hold_dir."/".$path_mod.$new_category_name."/".$sampling_rate_dir, 02770, true);
|
||||
}
|
||||
if (is_dir($music_on_hold_dir."/".$path_mod.$new_category_name."/".$sampling_rate_dir)) {
|
||||
copy($_FILES['upload_file']['tmp_name'], $music_on_hold_dir."/".$path_mod.$new_category_name."/".$sampling_rate_dir."/".$new_file_name);
|
||||
@@ -149,7 +149,7 @@ else {
|
||||
//process sampling rate(s)
|
||||
if (isset($sampling_rate_dirs)) foreach ($sampling_rate_dirs as $sampling_rate_dir) {
|
||||
if (!is_dir($music_on_hold_dir."/".$path_mod.$_POST['upload_category']."/".$sampling_rate_dir)) {
|
||||
mkdir($music_on_hold_dir."/".$path_mod.$_POST['upload_category']."/".$sampling_rate_dir, 2777, true);
|
||||
mkdir($music_on_hold_dir."/".$path_mod.$_POST['upload_category']."/".$sampling_rate_dir, 02770, true);
|
||||
}
|
||||
if (is_dir($music_on_hold_dir."/".$path_mod.$_POST['upload_category']."/".$sampling_rate_dir)) {
|
||||
copy($_FILES['upload_file']['tmp_name'], $music_on_hold_dir."/".$path_mod.$_POST['upload_category']."/".$sampling_rate_dir."/".$new_file_name);
|
||||
@@ -165,7 +165,7 @@ else {
|
||||
//process sampling rate(s)
|
||||
if (isset($sampling_rate_dirs)) foreach ($sampling_rate_dirs as $sampling_rate_dir) {
|
||||
if (!is_dir($music_on_hold_dir."/".$sampling_rate_dir)) {
|
||||
mkdir($music_on_hold_dir."/".$sampling_rate_dir, 2777, true);
|
||||
mkdir($music_on_hold_dir."/".$sampling_rate_dir, 02770, true);
|
||||
}
|
||||
if (is_dir($music_on_hold_dir."/".$sampling_rate_dir)) {
|
||||
copy($_FILES['upload_file']['tmp_name'], $music_on_hold_dir."/".$sampling_rate_dir."/".$new_file_name);
|
||||
|
||||
@@ -69,7 +69,7 @@ if ($domains_processed == 1) {
|
||||
foreach ($conf_lang_folders as $conf_lang_folder) {
|
||||
//create phrases folder, if necessary
|
||||
if (!file_exists($conf_lang_folder."/phrases/")) {
|
||||
mkdir($conf_lang_folder."/phrases/", 2777);
|
||||
mkdir($conf_lang_folder."/phrases/", 02770);
|
||||
}
|
||||
//parse language, open xml file
|
||||
$conf_lang = substr($conf_lang_folder, -2);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
//if the recordings directory doesn't exist then create it
|
||||
if (strlen($_SESSION['switch']['recordings']['dir']."/".$domain_name) > 0) {
|
||||
if (!is_readable($_SESSION['switch']['recordings']['dir']."/".$domain_name)) { mkdir($_SESSION['switch']['recordings']['dir']."/".$domain_name,2770,true); }
|
||||
if (!is_readable($_SESSION['switch']['recordings']['dir']."/".$domain_name)) { mkdir($_SESSION['switch']['recordings']['dir']."/".$domain_name,02770,true); }
|
||||
}
|
||||
|
||||
if ($domains_processed == 1) {
|
||||
|
||||
@@ -155,7 +155,7 @@ require_once "resources/check_auth.php";
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
if (count($result) == 0 && !file_exists($v_greeting_dir.'/'.$file_name)) {
|
||||
//move the uploaded greeting
|
||||
mkdir($v_greeting_dir, 2777, true);
|
||||
mkdir($v_greeting_dir, 02770, true);
|
||||
move_uploaded_file($_FILES['file']['tmp_name'], $v_greeting_dir.'/'.$file_name);
|
||||
//set newly uploaded greeting as active greeting for voicemail box
|
||||
$sql = "update v_voicemails ";
|
||||
|
||||
@@ -89,7 +89,7 @@ if ($domains_processed == 1) {
|
||||
foreach ($voicemails as $row) {
|
||||
$path = $_SESSION['switch']['voicemail']['dir'].'/default/'.$row['domain_name'].'/'.$row['voicemail_id'];
|
||||
if (!file_exists($path)) {
|
||||
mkdir($path, 2777, true);
|
||||
mkdir($path, 02770, true);
|
||||
}
|
||||
}
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
@@ -386,7 +386,7 @@ if (!class_exists('xml_cdr')) {
|
||||
catch(PDOException $e) {
|
||||
$tmp_dir = $_SESSION['switch']['log']['dir'].'/xml_cdr/failed/';
|
||||
if(!file_exists($tmp_dir)) {
|
||||
mkdir($tmp_dir, 2777, true);
|
||||
mkdir($tmp_dir, 02770, true);
|
||||
}
|
||||
if ($_SESSION['cdr']['format']['text'] == "xml") {
|
||||
$tmp_file = $uuid.'.xml';
|
||||
@@ -413,7 +413,7 @@ if (!class_exists('xml_cdr')) {
|
||||
$tmp_day = date("d", $tmp_time);
|
||||
$tmp_dir = $_SESSION['switch']['log']['dir'].'/xml_cdr/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
||||
if(!file_exists($tmp_dir)) {
|
||||
mkdir($tmp_dir, 2777, true);
|
||||
mkdir($tmp_dir, 02770, true);
|
||||
}
|
||||
if ($_SESSION['cdr']['format']['text'] == "xml") {
|
||||
$tmp_file = $uuid.'.xml';
|
||||
|
||||
@@ -440,7 +440,7 @@
|
||||
catch(PDOException $e) {
|
||||
$tmp_dir = $_SESSION['switch']['log']['dir'].'/xml_cdr/failed/';
|
||||
if(!file_exists($tmp_dir)) {
|
||||
mkdir($tmp_dir, 2777, true);
|
||||
mkdir($tmp_dir, 02770, true);
|
||||
}
|
||||
if ($_SESSION['cdr']['format']['text'] == "xml") {
|
||||
$tmp_file = $uuid.'.xml';
|
||||
@@ -467,7 +467,7 @@
|
||||
$tmp_day = date("d", $tmp_time);
|
||||
$tmp_dir = $_SESSION['switch']['log']['dir'].'/xml_cdr/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
||||
if(!file_exists($tmp_dir)) {
|
||||
mkdir($tmp_dir, 2777, true);
|
||||
mkdir($tmp_dir, 02770, true);
|
||||
}
|
||||
if ($_SESSION['cdr']['format']['text'] == "xml") {
|
||||
$tmp_file = $uuid.'.xml';
|
||||
|
||||
Reference in New Issue
Block a user