get();
//action add or update
if (is_uuid($_REQUEST["id"])) {
$action = "update";
$conference_control_uuid = $_REQUEST["id"];
}
else {
$action = "add";
}
//get http post variables and set them to php variables
if (count($_POST) > 0) {
$control_name = $_POST["control_name"];
$control_enabled = $_POST["control_enabled"] ?: 'false';
$control_description = $_POST["control_description"];
}
//process the user data and save it to the database
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
//get the uuid from the POST
if ($action == "update") {
$conference_control_uuid = $_POST["conference_control_uuid"];
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: conference_controls.php');
exit;
}
//check for all required data
$msg = '';
if (empty($control_name)) { $msg .= $text['message-required']." ".$text['label-control_name']."
\n"; }
if (empty($control_enabled)) { $msg .= $text['message-required']." ".$text['label-control_enabled']."
\n"; }
//if (empty($control_description)) { $msg .= $text['message-required']." ".$text['label-control_description']."
\n"; }
if (!empty($msg) && empty($_POST["persistformvar"])) {
$document['title'] = $text['title-conference_control'];
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "
| \n";
echo $msg." "; echo " |