Update var_edit.php
This commit is contained in:
+25
-2
@@ -23,9 +23,13 @@
|
|||||||
Contributor(s):
|
Contributor(s):
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//includes
|
||||||
include "root.php";
|
include "root.php";
|
||||||
require_once "resources/require.php";
|
require_once "resources/require.php";
|
||||||
require_once "resources/check_auth.php";
|
require_once "resources/check_auth.php";
|
||||||
|
|
||||||
|
//check permissions
|
||||||
if (permission_exists('var_add') || permission_exists('var_edit')) {
|
if (permission_exists('var_add') || permission_exists('var_edit')) {
|
||||||
//access granted
|
//access granted
|
||||||
}
|
}
|
||||||
@@ -62,14 +66,16 @@ else {
|
|||||||
$var_description = str_replace("''", "'", $var_description);
|
$var_description = str_replace("''", "'", $var_description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//process the post
|
||||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
|
|
||||||
$msg = '';
|
//get the uuid
|
||||||
if ($action == "update") {
|
if ($action == "update") {
|
||||||
$var_uuid = check_str($_POST["var_uuid"]);
|
$var_uuid = check_str($_POST["var_uuid"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//check for all required data
|
//check for all required data
|
||||||
|
$msg = '';
|
||||||
if (strlen($var_name) == 0) { $msg .= $text['message-required'].$text['label-name']."<br>\n"; }
|
if (strlen($var_name) == 0) { $msg .= $text['message-required'].$text['label-name']."<br>\n"; }
|
||||||
//if (strlen($var_value) == 0) { $msg .= $text['message-required'].$text['label-value']."<br>\n"; }
|
//if (strlen($var_value) == 0) { $msg .= $text['message-required'].$text['label-value']."<br>\n"; }
|
||||||
//if (strlen($var_cat) == 0) { $msg .= $text['message-required'].$text['label-category']."<br>\n"; }
|
//if (strlen($var_cat) == 0) { $msg .= $text['message-required'].$text['label-category']."<br>\n"; }
|
||||||
@@ -91,6 +97,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
//add or update the database
|
//add or update the database
|
||||||
if ($_POST["persistformvar"] != "true") {
|
if ($_POST["persistformvar"] != "true") {
|
||||||
if ($action == "add" && permission_exists('var_add')) {
|
if ($action == "add" && permission_exists('var_add')) {
|
||||||
|
//insert the variable
|
||||||
$var_uuid = uuid();
|
$var_uuid = uuid();
|
||||||
$sql = "insert into v_vars ";
|
$sql = "insert into v_vars ";
|
||||||
$sql .= "(";
|
$sql .= "(";
|
||||||
@@ -128,6 +135,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
//synchronize the configuration
|
//synchronize the configuration
|
||||||
save_var_xml();
|
save_var_xml();
|
||||||
|
|
||||||
|
//set the message and redirect the user
|
||||||
messages::add($text['message-add']);
|
messages::add($text['message-add']);
|
||||||
header("Location: vars.php");
|
header("Location: vars.php");
|
||||||
return;
|
return;
|
||||||
@@ -158,6 +166,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
//synchronize the configuration
|
//synchronize the configuration
|
||||||
save_var_xml();
|
save_var_xml();
|
||||||
|
|
||||||
|
//set the message and redirect the user
|
||||||
messages::add($text['message-update']);
|
messages::add($text['message-update']);
|
||||||
header("Location: vars.php");
|
header("Location: vars.php");
|
||||||
return;
|
return;
|
||||||
@@ -340,7 +349,20 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
|
|
||||||
echo " <table>\n";
|
echo " <table>\n";
|
||||||
echo " <tr>\n";
|
echo " <tr>\n";
|
||||||
echo " <tr><td width='200'>iLBC@30i</td><td>iLBC using mode=30 which will win in all cases.</td></tr>\n";
|
echo " <tr><td width='200'>opus@48000h@10i</td><td>Opus 48khz using 10 ms ptime (mono and stereo)</td></tr>\n";
|
||||||
|
echo " <tr><td>opus@48000h@20i</td><td>Opus 48khz using 20 ms ptime (mono and stereo)</td></tr>\n";
|
||||||
|
echo " <tr><td>opus@48000h@40i</td><td>Opus 48khz using 40 ms ptime</td></tr>\n";
|
||||||
|
echo " <tr><td>opus@16000h@10i</td><td>Opus 16khz using 10 ms ptime (mono and stereo)</td></tr>\n";
|
||||||
|
echo " <tr><td>opus@16000h@20i</td><td>Opus 16khz using 20 ms ptime (mono and stereo)</td></tr>\n";
|
||||||
|
echo " <tr><td>opus@16000h@40i</td><td>Opus 16khz using 40 ms ptime</td></tr>\n";
|
||||||
|
echo " <tr><td>opus@8000h@10i</td><td>Opus 8khz using 10 ms ptime (mono and stereo)</td></tr>\n";
|
||||||
|
echo " <tr><td>opus@8000h@20i</td><td>Opus 8khz using 20 ms ptime (mono and stereo)</td></tr>\n";
|
||||||
|
echo " <tr><td>opus@8000h@40i</td><td>Opus 8khz using 40 ms ptime</td></tr>\n";
|
||||||
|
echo " <tr><td>opus@8000h@60i</td><td>Opus 8khz using 60 ms ptime</td></tr>\n";
|
||||||
|
echo " <tr><td>opus@8000h@80i</td><td>Opus 8khz using 80 ms ptime</td></tr>\n";
|
||||||
|
echo " <tr><td>opus@8000h@100i</td><td>Opus 8khz using 100 ms ptime</td></tr>\n";
|
||||||
|
echo " <tr><td>opus@8000h@120i</td><td>Opus 8khz using 120 ms ptime</td></tr>\n";
|
||||||
|
echo " <tr><td>iLBC@30i</td><td>iLBC using mode=30 which will win in all cases.</td></tr>\n";
|
||||||
echo " <tr><td>DVI4@8000h@20i</td><td>IMA ADPCM 8kHz using 20ms ptime. (multiples of 10)</td></tr>\n";
|
echo " <tr><td>DVI4@8000h@20i</td><td>IMA ADPCM 8kHz using 20ms ptime. (multiples of 10)</td></tr>\n";
|
||||||
echo " <tr><td>DVI4@16000h@40i</td><td>IMA ADPCM 16kHz using 40ms ptime. (multiples of 10)</td></tr>\n";
|
echo " <tr><td>DVI4@16000h@40i</td><td>IMA ADPCM 16kHz using 40ms ptime. (multiples of 10)</td></tr>\n";
|
||||||
echo " <tr><td>speex@8000h@20i</td><td>Speex 8kHz using 20ms ptime.</td></tr>\n";
|
echo " <tr><td>speex@8000h@20i</td><td>Speex 8kHz using 20ms ptime.</td></tr>\n";
|
||||||
@@ -391,4 +413,5 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
|
|
||||||
//include header
|
//include header
|
||||||
require_once "resources/footer.php";
|
require_once "resources/footer.php";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user