Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ include "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; if (permission_exists('group_add')) { //access allowed } else { echo "access denied"; return; } //add multi-lingual support require_once "app_languages.php"; foreach($text as $key => $value) { $text[$key] = $value[$_SESSION['domain']['language']['code']]; } //get the http values and set them as variables $path = check_str($_GET["path"]); $msg = check_str($_GET["msg"]); $group_name = check_str($_POST["group_name"]); $group_description = check_str($_POST["group_description"]); if (strlen($group_name) > 0) { $sql_insert = "insert into v_groups "; $sql_insert .= "("; $sql_insert .= "domain_uuid, "; $sql_insert .= "group_uuid, "; $sql_insert .= "group_name, "; $sql_insert .= "group_description "; $sql_insert .= ")"; $sql_insert .= "values "; $sql_insert .= "("; $sql_insert .= "'$domain_uuid', "; $sql_insert .= "'".uuid()."', "; $sql_insert .= "'$group_name', "; $sql_insert .= "'$group_description' "; $sql_insert .= ")"; if (!$db->exec($sql_insert)) { //echo $db->errorCode() . "
"; $info = $db->errorInfo(); print_r($info); // $info[0] == $db->errorCode() unified error code // $info[1] is the driver specific error code // $info[2] is the driver specific error string } //redirect the user $_SESSION["message"] = $text['message-add']; header("Location: groups.php"); return; } //include the header include "resources/header.php"; $document['title'] = $text['title-group_add']; //show the content echo "
"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " ".$text['header-group_add']."\n"; echo "

\n"; echo " ".$text['description-group_add']."\n"; echo "
\n"; echo " "; echo " \n"; echo "
\n"; echo "
"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo $text['label-group_name'].":\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['label-group_description'].":\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo " \n"; echo " \n"; echo "
\n"; echo "
"; echo "
"; echo "

"; echo "

"; //include the footer include "resources/footer.php"; ?>