khanat-opennel-code/code/ryzom/tools/server/ryzom_ams/www/html/func/add_sgroup.php
2013-07-15 17:29:19 +02:00

34 lines
No EOL
1.1 KiB
PHP

<?php
function add_sgroup(){
if(WebUsers::isLoggedIn()){
if( WebUsers::isAdmin()){
$name = filter_var($_POST['Name'],FILTER_SANITIZE_STRING);
$inner_tag = filter_var($_POST['Tag'], FILTER_SANITIZE_STRING);
$tag = "[" . $inner_tag . "]";
$result['RESULT_OF_ADDING'] = Support_Group::createSupportGroup($name, $tag);
$result['permission'] = $_SESSION['permission'];
$result['no_visible_elements'] = 'FALSE';
$result['username'] = $_SESSION['user'];
global $SITEBASE;
require_once($SITEBASE . 'inc/sgroup_list.php');
$result= array_merge($result, sgroup_list());
helpers :: loadtemplate( 'sgroup_list', $result);
exit;
}else{
//ERROR: No access!
$_SESSION['error_code'] = "403";
header("Location: index.php?page=error");
exit;
}
}else{
//ERROR: not logged in!
header("Location: index.php");
exit;
}
}