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 (is_array($_POST)) {
$control_name = $_POST["control_name"];
$control_enabled = $_POST["control_enabled"];
$control_description = $_POST["control_description"];
}
//process the user data and save it to the database
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//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 (strlen($control_name) == 0) { $msg .= $text['message-required']." ".$text['label-control_name']."
\n"; }
if (strlen($control_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-control_enabled']."
\n"; }
//if (strlen($control_description) == 0) { $msg .= $text['message-required']." ".$text['label-control_description']."
\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
$document['title'] = $text['title-conference_control'];
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "
\n";
echo $msg." "; echo " |