Usergruppen Verwaltung in das GM-Panel eingebaut

main
radiskull 14 years ago
parent 2812c1ad80
commit 143672601b

@ -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/faq.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/parse.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/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/attacken.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/gm/include/bilderschau.inc.php'); include_once($_SERVER['DOCUMENT_ROOT'].'ag/gm/include/bilderschau.inc.php');
@ -65,10 +66,13 @@ function loginUser($user,$pass){
$test = 'SELECT * from user where nickname = \''.$user.'\''; $test = 'SELECT * from user where nickname = \''.$user.'\'';
$qry = mysql_query($test); $qry = mysql_query($test);
$result = mysql_fetch_assoc($qry); $result = mysql_fetch_assoc($qry);
if($result['gm'] == 'ja'){ $usergroups = getUserGroups($user);
if(isUserInGroup($usergroups, Admin)) {
$_SESSION['user'] = $result['id']; $_SESSION['user'] = $result['id'];
$_SESSION['username'] = $result['nickname']; $_SESSION['username'] = $result['nickname'];
$_SESSION['password'] = $result['passwort']; $_SESSION['password'] = $result['passwort'];
$_SESSION['usergroups'] = $usergroups;
echo '<a href="'.$_SERVER['PHP_SELF'].'">Zum Hauptmenu</a>'; echo '<a href="'.$_SERVER['PHP_SELF'].'">Zum Hauptmenu</a>';
} }
return true; return true;
@ -134,7 +138,11 @@ function displayOptions(){
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=clanitems">Clan-R&auml;ume bearbeiten</a> <a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=clanitems">Clan-R&auml;ume bearbeiten</a>
</td> </td>
</tr> </tr>
<tr>
<td>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=usergroups">Usergruppen</a>
</td>
</tr>
<tr> <tr>
<td> <td>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=bann">Banns und andere unsch&ouml;ne Sachen</a> <a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=bann">Banns und andere unsch&ouml;ne Sachen</a>
@ -232,7 +240,10 @@ if(checkLoginData($_SESSION['user'],$_SESSION['password'])){
displayNPC($_REQUEST['action'], $_REQUEST['task'], $_REQUEST['charid'], $_REQUEST['table'], $_REQUEST['page'], $REQUEST['data']); displayNPC($_REQUEST['action'], $_REQUEST['task'], $_REQUEST['charid'], $_REQUEST['table'], $_REQUEST['page'], $REQUEST['data']);
} else if($_REQUEST['choose'] == 'shop'){ } 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']); 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(); displayOptions();
} }
} else if(isset($_POST['user'])){ } else if(isset($_POST['user'])){

@ -1,4 +1,13 @@
<?php <?php
/*
* Created on 31.05.2011
*
* @copyright (c) 2011 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
?>
<?php
function displayAttackeOptions($action, $attackname, $attackid, $depth, $name, $starke, $verteidigung, $speed, $hp, $mp, $rassen, $level, $geld, $type, $info, $req_atk, $req_lvl, $Frucht, $runden, $maxlvl){ function displayAttackeOptions($action, $attackname, $attackid, $depth, $name, $starke, $verteidigung, $speed, $hp, $mp, $rassen, $level, $geld, $type, $info, $req_atk, $req_lvl, $Frucht, $runden, $maxlvl){
if($action === NULL){ if($action === NULL){
?> ?>

@ -1,3 +1,13 @@
<?php
/*
* Created on 31.05.2011
*
* @copyright (c) 2011 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
?>
<?php /** <?php /**
* TODO: 2-3 Ansichten * TODO: 2-3 Ansichten
* Sortiert nach erstelldatum, zufällig * Sortiert nach erstelldatum, zufällig

@ -1,3 +1,13 @@
<?php
/*
* Created on 31.05.2011
*
* @copyright (c) 2011 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
?>
<?php <?php
function displayClanItems($action, $raumid, $raumname, $staerke, $verteidigung, $glueck, $ausdauer, $geschwindigkeit, $info){ function displayClanItems($action, $raumid, $raumname, $staerke, $verteidigung, $glueck, $ausdauer, $geschwindigkeit, $info){
if($action == ''){ if($action == ''){

@ -1,3 +1,13 @@
<?php
/*
* Created on 31.05.2011
*
* @copyright (c) 2011 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
?>
<?php <?php
function displayFaq($action, $faqentry,$parent,$header,$body, $child){ function displayFaq($action, $faqentry,$parent,$header,$body, $child){
$themes = getTableOfContents('<option value="###ID###">','</option>'); $themes = getTableOfContents('<option value="###ID###">','</option>');

@ -1,3 +1,13 @@
<?php
/*
* Created on 31.05.2011
*
* @copyright (c) 2011 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
?>
<?php <?php
function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_itemtable,$page, $data){ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_itemtable,$page, $data){
if(!is_numeric($page) || $page < 0){ $page = 0; } if(!is_numeric($page) || $page < 0){ $page = 0; }

@ -1,3 +1,13 @@
<?php
/*
* Created on 31.05.2011
*
* @copyright (c) 2011 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
?>
<?php <?php
function displayQuestNPC($action, $name, $starke, $speed, $verteidigung, $ausdauer, $hp, $mp, $level, $orte,$id, $anzahl, $confirm, $glueck){ function displayQuestNPC($action, $name, $starke, $speed, $verteidigung, $ausdauer, $hp, $mp, $level, $orte,$id, $anzahl, $confirm, $glueck){
if($action != 'delete' && $action != 'change' && $action != 'create'){ if($action != 'delete' && $action != 'change' && $action != 'create'){

@ -1,3 +1,13 @@
<?php
/*
* Created on 31.05.2011
*
* @copyright (c) 2011 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
?>
<?php <?php
function displayNPC($action, $task, $charid, $table, $page, $data){ function displayNPC($action, $task, $charid, $table, $page, $data){
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">'."\n"; echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">'."\n";

@ -1,3 +1,13 @@
<?php
/*
* Created on 31.05.2011
*
* @copyright (c) 2011 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
?>
<?php <?php
function displayShop($action, $s_id, $info, $s_name, $s2_name, $s3_name, $s_typ, $preis, $frei, $anzahl){ function displayShop($action, $s_id, $info, $s_name, $s2_name, $s3_name, $s_typ, $preis, $frei, $anzahl){
if($action == ''){ if($action == ''){

@ -1,76 +1,283 @@
<?php
/*
* Created on 31.05.2011
*
* @copyright (c) 2011 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
?>
<?php
function getOtherUserGroups($user) {
$qry = null;
$groups = array();
//prüfen welcher wert für user steht (id oder name)
if(validateInteger($user, null) != null) {
$test = 'SELECT gruppe_id, gruppe_name FROM user_gruppe WHERE gruppe_id not in
(SELECT gruppe_id FROM user_gruppe_zuordnung WHERE user_id = \''.$user.'\')';
$qry = mysql_query($test);
} else if (validateString($user) != null) {
$test = 'SELECT gruppe_id, gruppe_name FROM user_gruppe WHERE gruppe_id not in
(SELECT ugz.gruppe_id FROM user u INNER JOIN user_gruppe_zuordnung ugz ON
u.id=ugz.user_id WHERE nickname = \''.$user.'\')';
$qry = mysql_query($test);
}
$i = 0;
while ($result = mysql_fetch_assoc($qry)) {
$groups[$i] = array("gruppe_id" => $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);
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<input name="choose" value="usergroups" type="hidden"></input>
<input name="action" value="search" type="hidden"></input>
<input name="name" value="<?php echo $username; ?>" type="hidden"></input>
<table width="80%">
<tr>
<th align="center" colspan="3">User <?php echo $username;?></th>
</tr>
<tr>
<td align="center"><select id="input" name="delete">
<option value="-1">Gruppe ausw&auml;hlen</option>
<?php
for($i = 0; $i < count($usergroups); $i++) {
echo '<option value="'.$usergroups[$i]['gruppe_id'].'">'.$usergroups[$i]['gruppe_name'].'</option>';
}
?>
</select> <input type="submit" value="löschen" />
</tr>
<tr>
<td align="center"><select id="input" name="add">
<option value="-1">Gruppe ausw&auml;hlen</option>
<?php
for($i = 0; $i < count($notusergroups); $i++) {
echo '<option value="'.$notusergroups[$i]['gruppe_id'].'">'.$notusergroups[$i]['gruppe_name'].'</option>';
}
?>
</select> <input type="submit" value="hinzufügen" />
</tr>
<tr>
<td colspan="3">
<table border="1" width="100%">
<tr>
<th>Usergruppen</th>
<?php
for($i = 0; $i < count($usergroups); $i++) {
echo '<tr><td align="center">'.$usergroups[$i]['gruppe_name'].'</td>';
}
?>
</table>
</td>
</tr>
<tr>
<td align="center" colspan="3"><a
href="<?php echo $_SERVER['PHP_SELF'].'?choose=usergroups'; ?>">Zur&uuml;ck</a>
</td>
</tr>
<tr>
<td align="center" colspan="3"><a
href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a>
</td>
</tr>
</table>
</form>
<?php
} else if($action === 'show') {
$username = validateName($ugname);
$sqlqry = 'SELECT u.nickname FROM user_gruppe_zuordnung ugz
INNER JOIN user_gruppe ug ON ug.gruppe_id=ugz.gruppe_id
INNER JOIN user u ON ugz.user_id=u.id WHERE ug.gruppe_name = \''.$ugname.'\';';
$usergroups_qry = mysql_query($sqlqry);
?>
<table width="80%">
<tr>
<th align="center" colspan="3">Usergruppe <?php echo $ugname;?></th>
</tr>
<tr>
<td colspan="3">
<table border="1" width="100%">
<?php
$count = ceil(mysql_num_rows($usergroups_qry) / 4);
echo '<tr>';
$x = 0;
while($row = mysql_fetch_assoc($usergroups_qry)){
echo '<td align="center" width = "25%">'.$row['nickname'].'</td>';
$x++;
if($x % 4 == 0) {
echo '</tr><tr>';
$x = 0;
}
}
echo '</tr>'
?>
</table>
</td>
</tr>
<tr>
<td align="center" colspan="3"><a
href="<?php echo $_SERVER['PHP_SELF'].'?choose=usergroups'; ?>">Zur&uuml;ck</a>
</td>
</tr>
<tr>
<td align="center" colspan="3"><a
href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a>
</td>
</tr>
</table>
<?php
} else {
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<input name="choose" value="usergroups" type="hidden"></input>
<input name="action" value="search" type="hidden"></input>
<table width="80%">
<tr>
<th align="center" colspan="3">User suchen</th>
</tr>
<tr>
<td align="center">Username: <input name="name" value="" />
<input type="submit" value="search" />
</td>
</tr>
<tr>
<td colspan="3">
<table border="1" width="100%">
<tr>
<th>Usergruppe</th>
<th>Beschreibung</th>
<?php
$usergroups_qry = mysql_query('SELECT gruppe_name, gruppe_beschreibung FROM user_gruppe ug;');
while($row = mysql_fetch_assoc($usergroups_qry)){
echo '<tr><td align="center"><a href="'
.$_SERVER['PHP_SELF'].'?choose=usergroups&action=show&ugname='.$row['gruppe_name'].'">'
.$row['gruppe_name'].'</a></td><td>'.$row['gruppe_beschreibung'].'</td></tr>';
}
?>
</table>
</td>
</tr>
<tr>
<td align="center" colspan="3"><a
href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a>
</td>
</tr>
</table>
</form>
<?php
}
}?>
<?php <?php
function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verify){ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verify){
if($action === null){ if($action === null){
?> ?>
<form action="" method="POST"> <form action="" method="POST">
<input name="choose" value="cheat" type="hidden"></input> <input name="choose" value="cheat" type="hidden"></input>
<table> <table>
<tr> <tr>
<th align="center" colspan="2">Multiuser und Cheater</th> <th align="center" colspan="2">Multiuser und Cheater</th>
</tr> </tr>
<tr> <tr>
<td align="center" colspan="2"><a href="<?php echo $_SERVER['PHP_SELF'].'?choose=cheat&action=access'; ?>">Zugriffe</a></td> <td align="center" colspan="2"><a
</tr> href="<?php echo $_SERVER['PHP_SELF'].'?choose=cheat&action=access'; ?>">Zugriffe</a>
<tr> </td>
<td align="center" colspan="2"><a href="<?php echo $_SERVER['PHP_SELF'].'?choose=cheat&action=trades'; ?>">Denkwürdige Trades</a></td> </tr>
</tr> <tr>
<tr> <td align="center" colspan="2"><a
<td align="center" colspan="2"> href="<?php echo $_SERVER['PHP_SELF'].'?choose=cheat&action=trades'; ?>">Denkwürdige
<a href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a> Trades</a></td>
</td> </tr>
</tr> <tr>
</table> <td align="center" colspan="2"><a
</form> href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a>
<?php </td>
</tr>
</table>
</form>
<?php
} else if($action == 'access'){ } else if($action == 'access'){
$minmax = mysql_fetch_assoc(mysql_query('SELECT DATE(min(occured)) as min, DATE(max(occured)) as max FROM multiuser')); $minmax = mysql_fetch_assoc(mysql_query('SELECT DATE(min(occured)) as min, DATE(max(occured)) as max FROM multiuser'));
$low = $from===null?$minmax['min']:$from; $low = $from===null?$minmax['min']:$from;
$high = $until===null?$minmax['max']:$until; $high = $until===null?$minmax['max']:$until;
?> ?>
<form action="" method="POST"> <form action="" method="POST">
<input name="choose" value="cheat" type="hidden" /> <input name="choose" value="cheat" type="hidden" />
<table> <table>
<tr> <tr>
<th align="center" colspan="3">Zugriffe</th> <th align="center" colspan="3">Zugriffe</th>
</tr> </tr>
<tr>
<td align="center">Von: <input name="from"
value="<?php echo $low; ?>" />
</td>
<td align="center">Bis: <input name="until"
value="<?php echo $high; ?>" />
</td>
<td align="center"><input type="submit" value="aktualisieren" />
</td>
</tr>
<tr>
<td colspan="3">
<table border="1">
<tr> <tr>
<td align="center"> <th>User1</th>
Von: <input name="from" value="<?php echo $low; ?>" /> <th>User2</th>
</td> <th>Anzahl</th>
<td align="center"> <th>Action</th>
Bis: <input name="until" value="<?php echo $high; ?>" />
</td>
<td align="center">
<input type="submit" value="aktualisieren" />
</td>
</tr>
<tr>
<td colspan="3">
<table border="1">
<tr><th>User1</th><th>User2</th><th>Anzahl</th><th>Action</th>
<?php <?php
$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'); $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)){ while($row = mysql_fetch_assoc($cheater_qry)){
echo '<tr><td>'.$row['u1n'].'</td><td>'.$row['u2n'].'</td><td>'.$row['anzahl'].'</td><td><a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=show&from='.$low.'&until='.$high.'&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Nachweis</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=vwarn&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Verwarnen</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=ban&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Bannen</a></td></tr>'; echo '<tr><td>'.$row['u1n'].'</td><td>'.$row['u2n'].'</td><td>'.$row['anzahl'].'</td><td><a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=show&from='.$low.'&until='.$high.'&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Nachweis</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=vwarn&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Verwarnen</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=ban&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Bannen</a></td></tr>';
} }
?> ?>
</table>
</td>
</tr>
<tr>
<td align="center" colspan="3">
<a href="<?php echo $_SERVER['PHP_SELF'].'?choose=cheat'; ?>">Multiuser und Cheatermen&uuml;</a>
</td>
</tr>
<tr>
<td align="center" colspan="3">
<a href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a>
</td>
</tr>
</table>
</form>
<?php </table>
</td>
</tr>
<tr>
<td align="center" colspan="3"><a
href="<?php echo $_SERVER['PHP_SELF'].'?choose=cheat'; ?>">Multiuser
und Cheatermen&uuml;</a>
</td>
</tr>
<tr>
<td align="center" colspan="3"><a
href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a>
</td>
</tr>
</table>
</form>
<?php
} else if($action == 'trades'){ } else if($action == 'trades'){
// Hier ist wichtig, zu hohe Trades und Trades in den Clans // Hier ist wichtig, zu hohe Trades und Trades in den Clans
@ -78,28 +285,36 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
$low = $from===null?$minmax['min']:$from; $low = $from===null?$minmax['min']:$from;
$high = $until===null?$minmax['max']:$until; $high = $until===null?$minmax['max']:$until;
?> ?>
<form action="" method="POST"> <form action="" method="POST">
<input name="choose" value="cheat" type="hidden" /> <input name="choose" value="cheat" type="hidden" />
<table> <table>
<tr> <tr>
<th align="center" colspan="3">Trades die durch den Auto-Check gefallen sind</th> <th align="center" colspan="3">Trades die durch den Auto-Check
</tr> gefallen sind</th>
</tr>
<tr>
<td align="center">Von: <input name="from"
value="<?php echo $low; ?>" />
</td>
<td align="center">Bis: <input name="until"
value="<?php echo $high; ?>" />
</td>
<td align="center"><input type="submit" value="aktualisieren" />
</td>
</tr>
<tr>
<td colspan="3">
<table border="1" width="100%">
<tr> <tr>
<td align="center"> <th>Verk&auml;ufer</th>
Von: <input name="from" value="<?php echo $low; ?>" /> <th>K&auml;ufer</th>
</td> <th>Item</th>
<td align="center"> <th>Betrag</th>
Bis: <input name="until" value="<?php echo $high; ?>" /> <th>Anzahl</th>
</td> <th>Datum</th>
<td align="center"> <th>Auto-Check</th>
<input type="submit" value="aktualisieren" /> <th>Action</th>
</td> <?php
</tr>
<tr>
<td colspan="3">
<table border="1" width="100%">
<tr><th>Verk&auml;ufer</th><th>K&auml;ufer</th><th>Item</th><th>Betrag</th><th>Anzahl</th><th>Datum</th><th>Auto-Check</th><th>Action</th>
<?php
$sql = 'SELECT at.transaktionsid, 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 cheatingverdacht = 1 and deadline >= \''.$low.' 00:00:00\' and deadline <= \''.$high.' 23:59:59\''; $sql = 'SELECT at.transaktionsid, 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 cheatingverdacht = 1 and deadline >= \''.$low.' 00:00:00\' and deadline <= \''.$high.' 23:59:59\'';
$cheater_qry = mysql_query($sql); $cheater_qry = mysql_query($sql);
while($row = mysql_fetch_assoc($cheater_qry)){ while($row = mysql_fetch_assoc($cheater_qry)){
@ -107,24 +322,26 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
$cheatv = $row['cheatingverdacht']==0?'OK':'WARNUNG'; $cheatv = $row['cheatingverdacht']==0?'OK':'WARNUNG';
echo '<tr><td align="center">'.$row['u1n'].'</td><td align="center">'.$row['u2n'].'</td><td align="center">'.$name.'</td><td align="center">'.$row['betrag'].'</td><td align="center">'.$row['anzahl'].'</td><td align="center">'.$row['deadline'].'</td><td align="center">'.$cheatv.'</td><td><a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=show&from='.$low.'&until='.$high.'&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Nachweis</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=undo&tradeid='.$row['transaktionsid'].'">R&uuml;ckg&auml;ngig</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=markok&tradeid='.$row['transaktionsid'].'">OK</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=vwarn&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Verwarnen</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=ban&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Bannen</a></td></tr>'; echo '<tr><td align="center">'.$row['u1n'].'</td><td align="center">'.$row['u2n'].'</td><td align="center">'.$name.'</td><td align="center">'.$row['betrag'].'</td><td align="center">'.$row['anzahl'].'</td><td align="center">'.$row['deadline'].'</td><td align="center">'.$cheatv.'</td><td><a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=show&from='.$low.'&until='.$high.'&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Nachweis</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=undo&tradeid='.$row['transaktionsid'].'">R&uuml;ckg&auml;ngig</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=markok&tradeid='.$row['transaktionsid'].'">OK</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=vwarn&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Verwarnen</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=ban&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Bannen</a></td></tr>';
} }
?> ?>
</table>
</td>
</tr>
<tr>
<td align="center" colspan="3">
<a href="<?php echo $_SERVER['PHP_SELF'].'?choose=cheat'; ?>">Multiuser und Cheatermen&uuml;</a>
</td>
</tr>
<tr>
<td align="center" colspan="3">
<a href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a>
</td>
</tr>
</table>
</form>
<?php </table>
</td>
</tr>
<tr>
<td align="center" colspan="3"><a
href="<?php echo $_SERVER['PHP_SELF'].'?choose=cheat'; ?>">Multiuser
und Cheatermen&uuml;</a>
</td>
</tr>
<tr>
<td align="center" colspan="3"><a
href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a>
</td>
</tr>
</table>
</form>
<?php
} else if($action == 'show'){ } else if($action == 'show'){
// Zeigt die Verbindungen zwischen 2 Usern auf // Zeigt die Verbindungen zwischen 2 Usern auf
$minmax = mysql_fetch_assoc(mysql_query('SELECT DATE(min(occured)) as min, DATE(max(occured)) as max FROM multiuser')); $minmax = mysql_fetch_assoc(mysql_query('SELECT DATE(min(occured)) as min, DATE(max(occured)) as max FROM multiuser'));
@ -132,75 +349,89 @@ function displayCheater($action, $from, $until, $user1, $user2, $tradeid, $verif
$high = $until===null?$minmax['max']:$until; $high = $until===null?$minmax['max']:$until;
?> ?>
<form action="" method="POST"> <form action="" method="POST">
<input name="choose" value="cheat" type="hidden" /> <input name="choose" value="cheat" type="hidden" />
<table> <table>
<tr> <tr>
<th align="center" colspan="3">Zugriffe</th> <th align="center" colspan="3">Zugriffe</th>
</tr> </tr>
<tr>
<td align="center">Von: <input name="from"
value="<?php echo $low; ?>" />
</td>
<td align="center">Bis: <input name="until"
value="<?php echo $high; ?>" />
</td>
<td align="center"><input type="submit" value="aktualisieren" />
</td>
</tr>
<tr>
<td colspan="3">
<table border="1" width="100%">
<tr> <tr>
<td align="center"> <th>User1</th>
Von: <input name="from" value="<?php echo $low; ?>" /> <th>User2</th>
</td> <th>Datum</th>
<td align="center"> <th>Art</th>
Bis: <input name="until" value="<?php echo $high; ?>" /> <th>Action</th>
</td>
<td align="center">
<input type="submit" value="aktualisieren" />
</td>
</tr>
<tr>
<td colspan="3">
<table border="1" width="100%">
<tr><th>User1</th><th>User2</th><th>Datum</th><th>Art</th><th>Action</th>
<?php <?php
$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'; $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); $cheater_qry = mysql_query($sql);
while($row = mysql_fetch_assoc($cheater_qry)){ while($row = mysql_fetch_assoc($cheater_qry)){
echo '<tr><td align="center">'.$row['u1n'].'</td><td align="center">'.$row['u2n'].'</td><td align="center">'.$row['occured'].'</td><td align="center">'.$row['type'].'</td><td align="center"><a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=vwarn&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Verwarnen</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=ban&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Bannen</a></td></tr>'; echo '<tr><td align="center">'.$row['u1n'].'</td><td align="center">'.$row['u2n'].'</td><td align="center">'.$row['occured'].'</td><td align="center">'.$row['type'].'</td><td align="center"><a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=vwarn&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Verwarnen</a> | <a href="'.$_SERVER['PHP_SELF'].'?choose=cheat&action=ban&user1='.$row['u1i'].'&user2='.$row['u2i'].'">Bannen</a></td></tr>';
} }
?> ?>
</table>
</td> </table>
</tr> </td>
<tr> </tr>
<th align="center" colspan="3">Trades</th> <tr>
</tr> <th align="center" colspan="3">Trades</th>
<tr> </tr>
<td colspan="3"> <tr>
<table border="1" width="100%"> <td colspan="3">
<tr><th>Verk&auml;ufer</th><th>K&auml;ufer</th><th>Item</th><th>Betrag</th><th>Anzahl</th><th>Datum</th><th>Auto-Check</th><th>Action</th> <table border="1" width="100%">
<tr>
<th>Verk&auml;ufer</th>
<th>K&auml;ufer</th>
<th>Item</th>
<th>Betrag</th>
<th>Anzahl</th>
<th>Datum</th>
<th>Auto-Check</th>
<th>Action</th>
<?php <?php
$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\''; $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.'<br>'; // echo $sql.'<br>';
$cheater_qry = mysql_query($sql); $cheater_qry = mysql_query($sql);
while($row = mysql_fetch_assoc($cheater_qry)){ 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']); $name = $row['i_name']!=null?$row['i_name']:($row['w_name']!=null?$row['w_name']:$row['s_name']);
$cheatv = $row['cheatingverdacht']==0?'OK':'WARNUNG'; $cheatv = $row['cheatingverdacht']==0?'OK':'WARNUNG';
echo '<tr><td align="center">'.$row['u1n'].'</td><td align="center">'.$row['u2n'].'</td><td align="center">'.$name.'</td><td align="center">'.$row['betrag'].'</td><td align="center">'.$row['anzahl'].'</td><td align="center">'.$row['deadline'].'</td><td align="center">'.$cheatv.'</td><td></td></tr>'; echo '<tr><td align="center">'.$row['u1n'].'</td><td align="center">'.$row['u2n'].'</td><td align="center">'.$name.'</td><td align="center">'.$row['betrag'].'</td><td align="center">'.$row['anzahl'].'</td><td align="center">'.$row['deadline'].'</td><td align="center">'.$cheatv.'</td><td></td></tr>';
} }
?> ?>
</table>
</td> </table>
</tr> </td>
<tr> </tr>
<td align="center" colspan="3"> <tr>
<?php echo displayHistoryBackLink(); ?> <td align="center" colspan="3"><?php echo displayHistoryBackLink(); ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<td align="center" colspan="3"> <td align="center" colspan="3"><a
<a href="<?php echo $_SERVER['PHP_SELF'].'?choose=cheat'; ?>">Multiuser und Cheatermen&uuml;</a> href="<?php echo $_SERVER['PHP_SELF'].'?choose=cheat'; ?>">Multiuser
</td> und Cheatermen&uuml;</a>
</tr> </td>
<tr> </tr>
<td align="center" colspan="3"> <tr>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a> <td align="center" colspan="3"><a
</td> href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a>
</tr> </td>
</table> </tr>
</form> </table>
<?php </form>
<?php
} else if($action == 'vwarn'){ } else if($action == 'vwarn'){
// Spricht eine Verwarnung zwischen 2 Usern aus // Spricht eine Verwarnung zwischen 2 Usern aus
if($verify == 1){ if($verify == 1){
@ -261,125 +492,108 @@ function displayBannOptions($action, $username,$opfer,$gamebann,$shoutbann,$fore
if($action == '' or $action == NULL){ if($action == '' or $action == NULL){
?> ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<input type="hidden" name="choose" value="bann"></input> <input type="hidden" name="choose" value="bann"></input> <input
<input type="hidden" name = "action" value="search"></input> type="hidden" name="action" value="search"></input>
<table> <table>
<tr> <tr>
<th colspan="2"> <th colspan="2">User auswählen</th>
User auswählen </tr>
</th> <tr>
</tr> <td>Username</td>
<tr> <td><input name="username"></input>
<td> </td>
Username </tr>
</td> <tr>
<td> <td>Anonid (nur die Zahlen!)</td>
<input name="username"></input> <td><input name="anonid"></input>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td colspan="2"><input type="submit" value="suchen">
Anonid (nur die Zahlen!) </td>
</td> </tr>
<td> <tr>
<input name="anonid"></input> <td><a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=bann">Zur
</td> &Uuml;bersicht</a><br> <a
</tr> href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a>
<tr> </td>
<td colspan="2"> </tr>
<input type="submit" value="suchen"> </table>
</td> </form>
</tr>
<tr>
<td>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=bann">Zur &Uuml;bersicht</a><br>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a>
</td>
</tr>
</table>
</form>
<?php <?php
} else if(is_numeric($anonid)){ } else if(is_numeric($anonid)){
mysql_query('UPDATE anon_chatter set muted = 1 where anon_id = '.$anonid); mysql_query('UPDATE anon_chatter set muted = 1 where anon_id = '.$anonid);
?> ?>
<table> <table>
<tr> <tr>
<td> <td>anon_<?php echo $anonid; ?> wurde im Chat gebannt!</td>
anon_<?php echo $anonid; ?> wurde im Chat gebannt! </tr>
</td> <tr>
</tr> <td><a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=bann">Zur
<tr> &Uuml;bersicht</a> <a href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum
<td> Hauptmenu</a>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=bann">Zur &Uuml;bersicht</a> </td>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a> </tr>
</td> </table>
</tr>
</table>
<?php <?php
} else if($action == "search"){ } else if($action == "search"){
// Auslagern ;D // Auslagern ;D
$qry = mysql_query('Select nickname, id from user where nickname like \''.$username.'%\''); $qry = mysql_query('Select nickname, id from user where nickname like \''.$username.'%\'');
?> ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<input type="hidden" name="choose" value="bann"></input> <input type="hidden" name="choose" value="bann"></input> <input
<input type="hidden" name = "action" value="finish_him"></input> type="hidden" name="action" value="finish_him"></input>
<table> <table>
<tr> <tr>
<th colspan="2"> <th colspan="2">Userstatus bearbeiten</th>
Userstatus bearbeiten </tr>
</th> <tr>
</tr> <td>Username</td>
<tr> <td><select name="opfer">
<td> <?php
Username while($result = mysql_fetch_assoc($qry)){
</td> echo '<option value="'.$result['id'].'">'.$result['nickname'].'</option>';
<td> }
<select name="opfer"> ?>
<?php </select>
while($result = mysql_fetch_assoc($qry)){ </td>
echo '<option value="'.$result['id'].'">'.$result['nickname'].'</option>'; </tr>
} <tr>
?> <td>Account</td>
</select> <td><input type="radio" name="gamebann" value="1">Account sperren<br>
</td> <input type="radio" name="gamebann" value="2">Account entsperren<br>
</tr> </td>
<tr> </tr>
<td>Account</td> <tr>
<td> <td>Shoutbox</td>
<input type="radio" name="gamebann" value="1">Account sperren<br> <td><input type="radio" name="shoutbann" value="1">Shoutbox mute<br>
<input type="radio" name="gamebann" value="2">Account entsperren<br> <input type="radio" name="shoutbann" value="2">Shoutbox demute<br>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Shoutbox</td> <td>Forum</td>
<td> <td><input type="radio" name="forenbann" value="1"
<input type="radio" name="shoutbann" value="1">Shoutbox mute<br> disabled="disabled">Forenaccout sperren<br> <input type="radio"
<input type="radio" name="shoutbann" value="2">Shoutbox demute<br> name="forenbann" value="2" disabled="disabled">Forenaccount
</td> entsperren<br>
</tr> </td>
<tr> </tr>
<td>Forum</td> <tr>
<td> <td colspan="2"><input type="submit"
<input type="radio" name="forenbann" value="1" disabled="disabled">Forenaccout sperren<br> value="Banns zuweisen/l&ouml;schen">
<input type="radio" name="forenbann" value="2" disabled="disabled">Forenaccount entsperren<br> </td>
</td> </tr>
</tr> <tr>
<tr> <td><a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=bann">Zur
<td colspan="2"> &Uuml;bersicht</a> <a href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum
<input type="submit" value="Banns zuweisen/l&ouml;schen"> Hauptmenu</a>
</td> </td>
</tr> </tr>
<tr> </table>
<td> </form>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=bann">Zur &Uuml;bersicht</a>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a>
</td>
</tr>
</table>
</form>
<?php <?php
} else if($action == "finish_him"){ } else if($action == "finish_him"){
if($gamebann == 1){ if($gamebann == 1){
logaction('Nutzer mit der id '.$opfer.' wurde gebannt.'); logaction('Nutzer mit der id '.$opfer.' wurde gebannt.');
@ -396,19 +610,17 @@ function displayBannOptions($action, $username,$opfer,$gamebann,$shoutbann,$fore
releaseSpamblock($opfer); releaseSpamblock($opfer);
} }
?> ?>
<table> <table>
<tr> <tr>
<td> <td>&Auml;nderungen &uuml;bernommen!</td>
&Auml;nderungen &uuml;bernommen! </tr>
</td> <tr>
</tr> <td><a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=bann">Zur
<tr> &Uuml;bersicht</a> <a href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum
<td> Hauptmenu</a>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?choose=bann">Zur &Uuml;bersicht</a> </td>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>">Zum Hauptmenu</a> </tr>
</td> </table>
</tr>
</table>
<?php <?php
} }
} }

@ -0,0 +1,50 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
//Konstanten
define("Admin", 1);
define("Tester", 2);
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/parse.inc.php');
function getUserGroups($user) {
$qry = null;
$groups = array();
//prüfen welcher wert für user steht (id oder name)
if(validateInteger($user, null) != null) {
$test = 'SELECT ug.gruppe_name, ug.gruppe_id FROM user_gruppe_zuordnung as ugz
INNER JOIN user_gruppe as ug ON ugz.gruppe_id=ug.gruppe_id
WHERE ugz.user_id = \''.$user.'\'';
$qry = mysql_query($test);
} else if (validateString($user) != null) {
$test = 'SELECT ug.gruppe_name, ug.gruppe_id FROM user_gruppe_zuordnung as ugz
INNER JOIN user_gruppe as ug ON ugz.gruppe_id=ug.gruppe_id
INNER JOIN user as u ON u.id=ugz.user_id
WHERE u.nickname = \''.$user.'\'';
$qry = mysql_query($test);
}
$i = 0;
while ($result = mysql_fetch_assoc($qry)) {
$groups[$i] = array("gruppe_id" => $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;
}
?>
Loading…
Cancel
Save