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 - + + + Usergruppen + + 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); + + ?> +
+ + + + + + + + + + + + + + + + + + + + +
User
+ +
+ +
+ + + + '; + } + ?> + +
Usergruppen'.$usergroups[$i]['gruppe_name'].'
+
Zurück +
Zum Hauptmenu +
+
+ + + + + + + + + + + + + + +
Usergruppe
+ + '; + $x = 0; + while($row = mysql_fetch_assoc($usergroups_qry)){ + echo ''; + $x++; + if($x % 4 == 0) { + echo ''; + $x = 0; + } + } + echo '' + ?> + +
'.$row['nickname'].'
+
Zurück +
Zum Hauptmenu +
+ +
+ + + + + + + + + + + + + + + +
User suchen
Username: + +
+ + + + + '; + } + ?> + +
UsergruppeBeschreibung' + .$row['gruppe_name'].''.$row['gruppe_beschreibung'].'
+
Zum Hauptmenu +
+
+ + + -
- - - - - - - - - - - - - - -
Multiuser und Cheater
Zugriffe
Denkwürdige Trades
- Zum Hauptmenu -
-
- +
+ + + + + + + + + + + + + + +
Multiuser und Cheater
Zugriffe +
Denkwürdige + Trades
Zum Hauptmenu +
+
+ -
- - - - - + ?> + + +
Zugriffe
+ + + + + + + + + + + + + + + + + +
Zugriffe
Von: + Bis: + +
+ - - - - - - - - - - - - - -
- Von: - - Bis: - - -
- - + + + + = \''.$low.' 00:00:00\' and occured <= \''.$high.' 23:59:59\' group by u1i, u2i order by anzahl'); - while($row = mysql_fetch_assoc($cheater_qry)){ - echo ''; - } + $cheater_qry = mysql_query('Select u1.nickname as u1n, u1.id as u1i, u2.nickname u2n, u2.id u2i, count(occured) as anzahl from multiuser left join user as u1 on multiuser.user1 = u1.id left join user as u2 on multiuser.user2 = u2.id where occured >= \''.$low.' 00:00:00\' and occured <= \''.$high.' 23:59:59\' group by u1i, u2i order by anzahl'); + while($row = mysql_fetch_assoc($cheater_qry)){ + echo ''; + } ?> -
User1User2AnzahlActionUser1User2AnzahlAction
'.$row['u1n'].''.$row['u2n'].''.$row['anzahl'].'Nachweis | Verwarnen | Bannen
'.$row['u1n'].''.$row['u2n'].''.$row['anzahl'].'Nachweis | Verwarnen | Bannen
-
- Multiuser und Cheatermenü -
- Zum Hauptmenu -
- - - +
Multiuser + und Cheatermenü +
Zum Hauptmenu +
+ + + -
- - - - - + + +
Trades die durch den Auto-Check gefallen sind
+ + + + + + + + + +
Trades die durch den Auto-Check + gefallen sind
Von: + Bis: + +
+ - - - - - - - - - - - - - -
- Von: - - Bis: - - -
- - - Verkäufer + + + + + + + + = \''.$low.' 00:00:00\' and deadline <= \''.$high.' 23:59:59\''; $cheater_qry = mysql_query($sql); while($row = mysql_fetch_assoc($cheater_qry)){ $name = $row['i_name']!=null?$row['i_name']:($row['w_name']!=null?$row['w_name']:$row['s_name']); $cheatv = $row['cheatingverdacht']==0?'OK':'WARNUNG'; echo ''; - } - ?> -
VerkäuferKäuferItemBetragAnzahlDatumAuto-CheckActionKäuferItemBetragAnzahlDatumAuto-CheckAction
'.$row['u1n'].''.$row['u2n'].''.$name.''.$row['betrag'].''.$row['anzahl'].''.$row['deadline'].''.$cheatv.'Nachweis | Rückgängig | OK | Verwarnen | Bannen
-
- Multiuser und Cheatermenü -
- Zum Hauptmenu -
- - - + +
+ + + + Multiuser + und Cheatermenü + + + + Zum Hauptmenu + + + + + + -
- - - - - + + +
Zugriffe
+ + + + + + + + + + + + + + + + + + + + +
Zugriffe
Von: + Bis: + +
+ - - - - - - - - - - - - + + + + + + - - - - - - - - - - -
- Von: - - Bis: - - -
- - + + + + + = \''.$$low.' 0:00:00\' and occured <= \''.$high.' 23:59:59\' order by occured desc'; - $cheater_qry = mysql_query($sql); - while($row = mysql_fetch_assoc($cheater_qry)){ - echo ''; - } + $sql = 'Select u1.nickname as u1n, u1.id as u1i, u2.nickname u2n, u2.id u2i, occured, type from multiuser left join user as u1 on multiuser.user1 = u1.id left join user as u2 on multiuser.user2 = u2.id where user1 = '.$user1.' and user2 = '.$user2.' and occured >= \''.$$low.' 0:00:00\' and occured <= \''.$high.' 23:59:59\' order by occured desc'; + $cheater_qry = mysql_query($sql); + while($row = mysql_fetch_assoc($cheater_qry)){ + echo ''; + } ?> -
User1User2DatumArtActionUser1User2DatumArtAction
'.$row['u1n'].''.$row['u2n'].''.$row['occured'].''.$row['type'].'Verwarnen | Bannen
'.$row['u1n'].''.$row['u2n'].''.$row['occured'].''.$row['type'].'Verwarnen | Bannen
-
Trades
- - + +
VerkäuferKäuferItemBetragAnzahlDatumAuto-CheckAction
+
Trades
+ + + + + + + + + + = \''.$low.' 00:00:00\' and deadline <= \''.$high.' 23:59:59\''; -// echo $sql.'
'; - $cheater_qry = mysql_query($sql); - while($row = mysql_fetch_assoc($cheater_qry)){ - $name = $row['i_name']!=null?$row['i_name']:($row['w_name']!=null?$row['w_name']:$row['s_name']); - $cheatv = $row['cheatingverdacht']==0?'OK':'WARNUNG'; - echo ''; - } + $sql = 'SELECT u1.nickname as u1n, u1.id as u1i, u2.nickname u2n, u2.id u2i, at.anzahl, betrag, deadline, cheatingverdacht, it.name as i_name, si.name as s_name, wm.item as w_name, itemid, tablename FROM auktion_transaktionen at left join sp_item si on tablename = \'sp_ware\' and itemid = si.id left join item as it on tablename = \'ware\' and itemid = it.id left join wochen_markt as wm on tablename = \'wochen_ware\' and itemid = wm.id left join user as u1 on at.anbieter = u1.id left join user as u2 on at.bieter = u2.id where bieter IN ('.$user1.','.$user2.') and anbieter IN('.$user1.','.$user2.') and deadline >= \''.$low.' 00:00:00\' and deadline <= \''.$high.' 23:59:59\''; + // echo $sql.'
'; + $cheater_qry = mysql_query($sql); + while($row = mysql_fetch_assoc($cheater_qry)){ + $name = $row['i_name']!=null?$row['i_name']:($row['w_name']!=null?$row['w_name']:$row['s_name']); + $cheatv = $row['cheatingverdacht']==0?'OK':'WARNUNG'; + echo ''; + } ?> -
VerkäuferKäuferItemBetragAnzahlDatumAuto-CheckAction
'.$row['u1n'].''.$row['u2n'].''.$name.''.$row['betrag'].''.$row['anzahl'].''.$row['deadline'].''.$cheatv.'
'.$row['u1n'].''.$row['u2n'].''.$name.''.$row['betrag'].''.$row['anzahl'].''.$row['deadline'].''.$cheatv.'
-
- -
- Multiuser und Cheatermenü -
- Zum Hauptmenu -
- - +
+
Multiuser + und Cheatermenü +
Zum Hauptmenu +
+ + weiter | '.displayHistoryBackLink()); } } else if($action == 'ban'){ - // Bannt zwei Accounts + // Bannt zwei Accounts if($verify == 1){ $qry = mysql_query('select id, nickname from user where id in ('.$user1.', '.$user2.')'); while($row = mysql_fetch_assoc($qry)){ @@ -261,125 +492,108 @@ function displayBannOptions($action, $username,$opfer,$gamebann,$shoutbann,$fore if($action == '' or $action == NULL){ ?> -
- - - - - - - - - - - - - - - - - - - - -
- User auswählen -
- Username - - -
- Anonid (nur die Zahlen!) - - -
- -
- Zur Übersicht
- Zum Hauptmenu -
-
+
+ + + + + + + + + + + + + + + + + + + +
User auswählen
Username +
Anonid (nur die Zahlen!) +
+
Zur + Übersicht
Zum Hauptmenu +
+
- - - - - - - -
- anon_ wurde im Chat gebannt! -
- Zur Übersicht - Zum Hauptmenu -
+ + + + + + + +
anon_ wurde im Chat gebannt!
Zur + Übersicht Zum + Hauptmenu +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Userstatus bearbeiten -
- Username - - -
Account - Account sperren
- Account entsperren
-
Shoutbox - Shoutbox mute
- Shoutbox demute
-
Forum - Forenaccout sperren
- Forenaccount entsperren
-
- -
- Zur Übersicht - Zum Hauptmenu -
-
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Userstatus bearbeiten
Username +
AccountAccount sperren
+ Account entsperren
+
ShoutboxShoutbox mute
+ Shoutbox demute
+
ForumForenaccout sperren
Forenaccount + entsperren
+
+
Zur + Übersicht Zum + Hauptmenu +
+
- - - - - - - - -
- Änderungen übernommen! -
- Zur Übersicht - Zum Hauptmenu -
+ + + + + + + +
Änderungen übernommen!
Zur + Übersicht Zum + Hauptmenu +
$result['gruppe_id'], "gruppe_name" => $result['gruppe_name']); + $i++; + } + + return $groups; +} + +function isUserInGroup($usergroup, $group) { + for($i = 0; $i < count($usergroup); $i++) { + if(in_array($group, $usergroup[$i])) { + return true; + } + } + return false; +} +?> \ No newline at end of file