View file users.php

File size: 2.2Kb
<?php
// MyForum - Сервис форумов 
// Copyright © A'lex и KO. All Rights Reserved
// По всем вопросам обращайтесь на email [email protected] или в асю 376920428

include 'config.php';
include 'functions.php';

if ($userinfo['Lever'] < 4 ) {exit;}

if ($mode=='show') {
	$r = mysql_query("SELECT * FROM {$table}{$f}_users");
	for($i=0; $i<mysql_numrows($r); $i++) {
		$a=mysql_fetch_array($r);
		$nick = $a['Nick'];
		$lever = $a['Lever'];
		if ($lever==2) {$label='User';}
		if ($lever==3) {$label='Moder';}
		if ($lever==4) {$label='Admin';}
		if ($nick!=$AdminName) {
			$body.="$label <a href=\"users.php?mode=menu&f=$f&nick=$nick$isid\">$nick</a><br/>\n";
		}
	}
	displaytext('Список пользователей', $Banner, $body, "<a href=\"index.php?f=$f$isid\">Назад</a>", $w);
}

if ($mode=='menu') {
	$r = mysql_query("SELECT * FROM {$table}{$f}_users WHERE Nick='$nick'");
	$a=mysql_fetch_array($r);
	$nick = $a['Nick'];
	$lever = $a['Lever'];
	if ($lever==2) {$label='User';}
	if ($lever==3) {$label='Moder';}
	if ($lever==4) {$label='Admin';}
	$body="<b>Изменить Lever:</b><br/><a href=\"users.php?mode=change&lever=2&f=$f&nick=$nick$isid\">User</a><br/>" .
	"<a href=\"users.php?mode=change&lever=3&f=$f&nick=$nick$isid\">Moder</a><br/>" .
	"<a href=\"users.php?mode=change&lever=4&f=$f&nick=$nick$isid\">Admin</a><br/><br/>" . 
	"<a href=\"users.php?mode=change&lever=0&f=$f&nick=$nick$isid\">Удалить</a><br/>";
	displaytext("$label $nick", $Banner, $body, "<a href=\"users.php?mode=show&f=$f$isid\">Назад</a>", $w);
}

if ($mode=='change') {
	if ($lever>4) {header("Location: http://lleo.aha.ru/na/?7+7r-Ofu4uDy5ev8IPHl8OLo8eAgTXlGb3J1bSElIML7IO-u7-vy4Ovo8fwg7+7x8uDi6PL8IO-u6-zn7uLg8uXr-iDv8ODi4CBHbG9iYWwgYWRtaW4uIMfg4fPk8uUg7uEg-fLu7CElIM3g7+j46PLlIPHi7ukg9O7w8+wg6CDk5evg6fLlIPLg7Cwg9-LuIPXu8ujy5S4gwCB6YWdydXoub3JnIO3lIPLw7uPg6fLlIQ");exit;}
	if ($lever==0) {
		mysql_query("DELETE FROM {$table}{$f}_users WHERE Nick='$nick'");
	} else {
		mysql_query("UPDATE {$table}{$f}_users SET Lever='$lever' WHERE Nick='$nick'");
	}
	header("Location: users.php?mode=show&f=$f$isid");
}

mysql_close($lnk);
?>