get();
//action add or update
if (is_uuid($_REQUEST["id"])) {
$action = "update";
$conference_profile_param_uuid = $_REQUEST["id"];
}
else {
$action = "add";
}
//set the parent uuid
if (is_uuid($_GET["conference_profile_uuid"])) {
$conference_profile_uuid = $_GET["conference_profile_uuid"];
}
//get http post variables and set them to php variables
if (count($_POST)>0) {
$profile_param_name = $_POST["profile_param_name"];
$profile_param_value = $_POST["profile_param_value"];
$profile_param_enabled = $_POST["profile_param_enabled"];
$profile_param_description = $_POST["profile_param_description"];
}
//process the http post if it exists
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//get the uuid
if ($action == "update") {
$conference_profile_param_uuid = $_POST["conference_profile_param_uuid"];
}
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: conference_profiles.php');
exit;
}
//check for all required data
$msg = '';
if (strlen($profile_param_name) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_name']."
\n"; }
if (strlen($profile_param_value) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_value']."
\n"; }
if (strlen($profile_param_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_enabled']."
\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
$document['title'] = $text['title-conference_profile_param'];
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "
\n";
echo $msg." "; echo " |