diff --git a/ag/gm/gm_seite.php b/ag/gm/gm_seite.php
index e7e20c7..b386964 100644
--- a/ag/gm/gm_seite.php
+++ b/ag/gm/gm_seite.php
@@ -24,6 +24,7 @@ include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/bann.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/faq.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/parse.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/user.inc.php');
+include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/usergroup.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/gm/include/attacken.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/gm/include/bilderschau.inc.php');
@@ -64,12 +65,15 @@ function loginUser($user,$pass){
if(checkLoginPassword($user,$pass)){
$test = 'SELECT * from user where nickname = \''.$user.'\'';
$qry = mysql_query($test);
- $result = mysql_fetch_assoc($qry);
- if($result['gm'] == 'ja'){
+ $result = mysql_fetch_assoc($qry);
+ $usergroups = getUserGroups($user);
+
+ if(isUserInGroup($usergroups, Admin)) {
$_SESSION['user'] = $result['id'];
$_SESSION['username'] = $result['nickname'];
$_SESSION['password'] = $result['passwort'];
- echo 'Zum Hauptmenu';
+ $_SESSION['usergroups'] = $usergroups;
+ echo 'Zum Hauptmenu';
}
return true;
}
@@ -134,7 +138,11 @@ function displayOptions(){
Clan-Räume bearbeiten
-
+
Banns und andere unschöne Sachen
@@ -232,7 +240,10 @@ if(checkLoginData($_SESSION['user'],$_SESSION['password'])){
displayNPC($_REQUEST['action'], $_REQUEST['task'], $_REQUEST['charid'], $_REQUEST['table'], $_REQUEST['page'], $REQUEST['data']);
} else if($_REQUEST['choose'] == 'shop'){
displayShop($_REQUEST['action'], $_REQUEST['s_id'],$_REQUEST['info'], $_REQUEST['s_name'] , $_REQUEST['s2_name'], $_REQUEST['s3_name'], $_REQUEST['s_typ'], $_REQUEST['preis'], $_REQUEST['frei'], $_REQUEST['anzahl']);
- } else {
+ } else if($_REQUEST['choose'] == 'usergroups'){
+ //displayUserGroups($_REQUEST['action'], $_REQUEST['uname']);
+ displayUserGroups($_REQUEST['action'] ,$_REQUEST['name'] ,$_REQUEST['ugname'], $_REQUEST['delete'], $_REQUEST['add']);
+ } else {
displayOptions();
}
} else if(isset($_POST['user'])){
diff --git a/ag/gm/include/attacken.inc.php b/ag/gm/include/attacken.inc.php
index 1ee9229..115bd8a 100644
--- a/ag/gm/include/attacken.inc.php
+++ b/ag/gm/include/attacken.inc.php
@@ -1,4 +1,13 @@
+
diff --git a/ag/gm/include/bilderschau.inc.php b/ag/gm/include/bilderschau.inc.php
index e38f598..04e2e8a 100644
--- a/ag/gm/include/bilderschau.inc.php
+++ b/ag/gm/include/bilderschau.inc.php
@@ -1,3 +1,13 @@
+
+
+
+
','');
diff --git a/ag/gm/include/item.inc.php b/ag/gm/include/item.inc.php
index fe354a5..87bfd73 100644
--- a/ag/gm/include/item.inc.php
+++ b/ag/gm/include/item.inc.php
@@ -1,3 +1,13 @@
+
+
+
+
'."\n";
diff --git a/ag/gm/include/shop.inc.php b/ag/gm/include/shop.inc.php
index 30fecf1..c040deb 100644
--- a/ag/gm/include/shop.inc.php
+++ b/ag/gm/include/shop.inc.php
@@ -1,3 +1,13 @@
+
+
+
+ $result['gruppe_id'], "gruppe_name" => $result['gruppe_name']);
+ $i++;
+ }
+
+ return $groups;
+}
+
+function displayUserGroups($action, $name, $ugname, $delete, $add) {
+ if($action === 'search') {
+ $username = validateName($name);
+ if ($delete !== NULL && $delete >= 0) {
+ $qry = 'DELETE FROM user_gruppe_zuordnung WHERE user_id in (SELECT id FROM user WHERE nickname = \''.$username.
+ '\') AND gruppe_id = '.$delete.';';
+ mysql_query($qry);
+ } else if($add !== NULL && $add >= 0) {
+ $qry = 'INSERT INTO user_gruppe_zuordnung(user_id, gruppe_id)
+ VALUES((SELECT id FROM user WHERE nickname = \''.$username.'\'), '.$add.');';
+ mysql_query($qry);
+ }
+
+ $usergroups = getUserGroups($name);
+ $notusergroups = getOtherUserGroups($name);
+
+ ?>
+
+
+
+
+ Usergruppe |
+
+
+
+
+ ';
+ $x = 0;
+ while($row = mysql_fetch_assoc($usergroups_qry)){
+ echo ''.$row['nickname'].' | ';
+ $x++;
+ if($x % 4 == 0) {
+ echo '';
+ $x = 0;
+ }
+ }
+ echo ' '
+ ?>
+
+
+ |
+
+
+ Zurück
+ |
+
+
+ Zum Hauptmenu
+ |
+
+
+
+
+
+
+
-
-
+
+
- |