Browse Source

Update record_path.php

FusionPBX 7 years ago
parent
commit
a1ff4278d8
1 changed files with 13 additions and 11 deletions
  1. 13 11
      upgrade/record_path.php

+ 13 - 11
upgrade/record_path.php

@@ -24,17 +24,15 @@
 	$year = '2017';
 	$year = '2017';
 	$type = 'wav';  //wav or mp3
 	$type = 'wav';  //wav or mp3
 	$execute_sql = true;
 	$execute_sql = true;
+        $document_root = '/var/www/fusionpbx';
 
 
 //check the permission
 //check the permission
-	if(defined('STDIN')) {
-		$document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]);
-		preg_match("/^(.*)\/app\/.*$/", $document_root, $matches);
-		$document_root = $matches[1];
-		set_include_path($document_root);
-		$_SERVER["DOCUMENT_ROOT"] = $document_root;
-		require_once "resources/require.php";
-		$display_type = 'text'; //html, text
-	}
+        if(defined('STDIN')) {
+                set_include_path($document_root);
+                $_SERVER["DOCUMENT_ROOT"] = $document_root;
+                require_once "resources/require.php";
+                $display_type = 'text'; //html, text
+        }
 	else {
 	else {
 		include "root.php";
 		include "root.php";
 		require_once "resources/require.php";
 		require_once "resources/require.php";
@@ -65,9 +63,13 @@
 	}
 	}
 
 
 //send a message
 //send a message
-	if (!$execute_sql) {
+	if ($execute_sql) {
+		echo "\n";
+		echo "-- The following SQL command have been executed.\n";
+	}
+	else {
 		echo "\n";
 		echo "\n";
-		echo "-- Run the SQL commands on the database server\n";
+		echo "-- Run the SQL commands on the database server.\n";
 	}
 	}
 
 
 //include the footer
 //include the footer