Move Session code to a better location in the file.

This commit is contained in:
FusionPBX 2022-04-21 22:15:45 -06:00 committed by GitHub
parent 9ab10fd1d4
commit f73f9b706f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 32 deletions

View File

@ -72,12 +72,44 @@
return $exists;
}
//check to see if the process exists
$pid_exists = process_exists($pid_file);
//prevent the process running more than once
if ($pid_exists) {
echo "Cannot lock pid file {$pid_file}\n";
exit;
}
//fax queue enabled
if ($_SESSION['fax_queue']['enabled']['boolean'] != 'true') {
echo "FAX Queue is disabled in Default Settings\n";
exit;
}
//make sure the /var/run/fusionpbx directory exists
if (!file_exists('/var/run/fusionpbx')) {
$result = mkdir('/var/run/fusionpbx', 0777, true);
if (!$result) {
die('Failed to create /var/run/fusionpbx');
}
}
//create the process id file if the process doesn't exist
if (!$pid_exists) {
//remove the old pid file
if (file_exists($file)) {
unlink($pid_file);
}
//show the details to the user
//echo "The process id is ".getmypid()."\n";
//echo "pid_file: ".$pid_file."\n";
//save the pid file
file_put_contents($pid_file, getmypid());
}
//get the call center settings
$interval = $_SESSION['fax_queue']['interval']['numeric'];
@ -103,38 +135,6 @@
$debug = $_SESSION['fax_queue']['debug']['boolean'];
}
//check to see if the process exists
$pid_exists = process_exists($pid_file);
//prevent the process running more than once
if ($pid_exists) {
echo "Cannot lock pid file {$pid_file}\n";
exit;
}
//make sure the /var/run/fusionpbx directory exists
if (!file_exists('/var/run/fusionpbx')) {
$result = mkdir('/var/run/fusionpbx', 0777, true);
if (!$result) {
die('Failed to create /var/run/fusionpbx');
}
}
//create the process id file if the process doesn't exist
if (!$pid_exists) {
//remove the old pid file
if (file_exists($file)) {
unlink($pid_file);
}
//show the details to the user
//echo "The process id is ".getmypid()."\n";
//echo "pid_file: ".$pid_file."\n";
//save the pid file
file_put_contents($pid_file, getmypid());
}
//get the messages waiting in the email queue
while (true) {