示例#1
0
IF($_POST['submit'])
	{//Submitted add / edit reg user
	IF(USR_CLASS >= 1)
		{$_POST['sender'] = USR_NICK;}
	
	IF($_POST['subject'] != "")
		{
		IF($_POST['body'] != "")
			{
			IF($_POST['receiver'] != "")
				{
				IF($_POST['sender'] != "")
					{
					IF(!USR_CLASS)
						{
						IF(NickExist($_POST['sender'],$DB_hub)) {
							Die(VA_Message($err_msg_guest_sending_as_reg, "error"));
							}
						}
					$time = Time();
					$expires = $time + $VA_setup['messanger_expire_time'];
					$_POST['sender'] = $DB_hub->Real_Escape_String($_POST['sender']);
					$_POST['receiver'] = $DB_hub->Real_Escape_String($_POST['receiver']);
					$_POST['subject'] = $DB_hub->Real_Escape_String($_POST['subject']);
					$_POST['body'] = $DB_hub->Real_Escape_String($_POST['body']);
					
					$query  = "INSERT INTO pi_messages \n";
					$query .= "(sender, date_sent, sender_ip, receiver, date_expires, subject, body) \n";
					$query .= "VALUES ('".$_POST['sender']."', '".$time."', '".$_SERVER['REMOTE_ADDR']."', '".$_POST['receiver']."', '".$expires."', '".$_POST['subject']."', '".$_POST['body']."')";
					$DB_hub->Query($query);
					}
ELSE {
//        Unban request form
?>
	<FORM action="index.php?<?Print $_SERVER['QUERY_STRING'];?>" method="post">
	<TABLE class="b1 fs10px">
		<TR>
			<TD class="b bg_light right">&nbsp;&nbsp;<?Print $text_nick;?>&nbsp;&nbsp;</TD>
			<TD class="bg_light">&nbsp;&nbsp;<?Print $_GET['nick'];?>&nbsp;&nbsp;</TD>
		</TR><TR>
			<TD class="b bg_light right">&nbsp;&nbsp;<?Print $text_ip;?>&nbsp;&nbsp;</TD>
			<TD class="bg_light">&nbsp;&nbsp;<?Print $_GET['ip'];?>&nbsp;&nbsp;</TD>
		</TR><TR>
			<TD class="b bg_light right">&nbsp;&nbsp;<?Print $text_email;?>&nbsp;&nbsp;</TD>
			<TD class="bg_light">
                        <?
                          IF(NickExist($_GET['nick'], $DB_hub)) 
                          {
                          	$result = $DB_hub->Query("SELECT * FROM reglist WHERE nick LIKE '".$_GET['nick']."'");
                          	$row = $result->Fetch_Assoc();
                          	Print $row['email'];
                          	Print "<INPUT class=\"w160px\" name=\"email\" type=\"hidden\" value=".$row['email'].">";
                          }
                          ELSE Print "<INPUT class=\"w160px\" name=\"email\" type=\"text\">";
                        ?>&nbsp;&nbsp;</TD>
		</TR><TR>
			<TD class="b bg_light right top">&nbsp;&nbsp;<?Print $text_comment;?>&nbsp;&nbsp;</TD>
			<TD class="bg_light"><TEXTAREA class="w300px" name="comment" rows=3></TEXTAREA></TD>
		</TR><TR>
			<TD class="bg_light right" colspan=2><INPUT name="send" class="w75px" type="submit" value="<?Print $text_send;?>"></TEXTAREA></TD>
		</TR>
	</TABLE>
示例#3
0
	$register_class = FetchClass($VA_setup['register_class']);
	$disable_class = FetchClass($VA_setup['disable_class']);

	IF($register_class[$row['class']] > USR_CLASS) {
		//User is not allowed to register this class
		Die(VA_Message($err_msg_no_access, "error"));
		}
	IF($disable_class[$row['class']] > USR_CLASS && $row['enabled'] && !$_POST['enabled']) {
		//User tryed to disable this user with no disable rights
		Die(VA_Message($err_msg_no_access, "error"));
		}

	IF($_POST['new'])
		{//Adding new user
		IF(NickExist($_POST['nick'],$DB_hub)) {
			//User already exists
			Die(VA_Message($err_msg_user_exist, "error"));
			}
		ELSE {
			$query  = "INSERT INTO reglist \n";
			$query .= "(nick, class, class_protect, class_hidekick, hide_kick, reg_date, reg_op, pwd_crypt, enabled, note_op, note_usr) \n";
			$query .= "VALUES ('".$_POST['nick']."', '".$_POST['class']."', '".$_POST['class_protect']."', '".$_POST['class_hidekick']."', '".$_POST['hide_kick']."', UNIX_TIMESTAMP(), '".USR_NICK."', 1, '".$_POST['enabled']."', '".$_POST['note_op']."', '".$_POST['note_usr']."')";
		        }
	}
	ELSE {
		//Change existing user settings
		$query  = "UPDATE reglist \n";
		$query .= "SET `nick`='".$_POST['nick']."', `class`='".$_POST['class']."', `class_protect`='".$_POST['class_protect']."', `class_hidekick`='".$_POST['class_hidekick']."', `hide_kick`='".$_POST['hide_kick']."', `enabled`='".$_POST['enabled']."', `note_op`='".$_POST['note_op']."', `note_usr`='".$_POST['note_usr']."' \n";
		$query .= "WHERE `nick` LIKE '".$_POST['oldnick']."'";
		}
//---------------------------------------------------------------------
//	!regnew
	CASE "!rn" :
	CASE "!rnew" :
	CASE "!regnew" :
		$param = Explode(" ", $param);
		$nick = $DB_hub->Real_Escape_String($param[0]);
		$class = $param[1];
		IF(!$class)
			{$class = 1;}

		$register = FetchClass($VA_setup['register_class']);
		IF($register[$class] > USR_CLASS)
			{Die(VA_Message($err_msg_no_access, "error"));}

		IF(!NickExist($nick,$DB_hub))
			VA_Query($DB_hub, "INSERT INTO reglist (nick, class, reg_date, reg_op) VALUES ('".$nick."', '".$class."', UNIX_TIMESTAMP(), '".USR_NICK."')");
		ELSE {
			VA_Alert(SPrintF($err_msg_user_exist, $param[0]), "error", "index.php?".Change_URL_Query("q", $_GET['return'], "return", ""));
			$continue = FALSE;
			}

		BREAK;

//---------------------------------------------------------------------
//	!regpasswd
	CASE "!rpasswd" :
	CASE "!regpasswd" :
		$nick = $DB_hub->Real_Escape_String($param);

		$result = $DB_hub->Query("UPDATE reglist SET pwd_change = 1 WHERE nick LIKE '".$nick."' AND class < ".USR_CLASS." AND 3 <= ".USR_CLASS);
示例#5
0
	{$_GET['page'] = 1;}

$result = $DB_hub->Query("SELECT Count(nick) AS `count` FROM va_unban WHERE status = 0");
$count = $result->Fetch_Assoc();
IF($count['count']==0) Header("Location: index.php");
$pages = (int)($total / 10000 + 1);
$first = 10 * ($_GET['page'] - 1);

Print $total;

IF($pages > 1)
	{Navigation();}

$result = $DB_hub->Query("SELECT * FROM va_unban WHERE status = 0 ORDER BY time DESC");
WHILE($row = $result->Fetch_Assoc()) {
	$registered = NickExist($row['nick'], $DB_hub);

/*	IF($registered)
		{$ban_result = $DB_hub->Query("SELECT * FROM banlist WHERE nick LIKE '".$row['nick']."' AND nick NOT LIKE '_%ban_' AND (`date_limit` > UNIX_TIMESTAMP() OR `date_limit` IS NULL) ORDER BY date_start DESC");}
	ELSE
		{$ban_result = $DB_hub->Query("SELECT * FROM banlist WHERE (nick LIKE '".$row['nick']."' OR ip = '".$row['ip']."') AND (nick NOT LIKE '_%ban_' AND ip NOT LIKE '_%ban_') AND (`date_limit` > UNIX_TIMESTAMP() OR `date_limit` IS NULL) ORDER BY date_start DESC");}*/
	$query = "SELECT * FROM banlist WHERE ";
	IF($row['nick']=="_ipban_")
        $query .= "ip LIKE '".$row['ip']."'";
	ELSEIF($row['ip']=="_nickban_")
        $query .= "nick LIKE '".$row['nick']."'";
        ELSE
        $query .= "nick LIKE '".$row['nick']."' AND ip LIKE '".$row['ip']."'";
        $query .= " AND (`date_limit` > UNIX_TIMESTAMP() OR `date_limit` IS NULL) ORDER BY date_start DESC";
        $ban_result = $DB_hub->Query($query);
	IF($ban_result->num_rows > 0) {