DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • May 26, 2019, 08:51:11 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Charakterspezifischer Bann - 0.9.7  (Read 2815 times)
0 Members and 1 Guest are viewing this topic.
Hadriel
Guest
« on: September 26, 2005, 11:13:23 AM »

Gleicher Thread wie @ Englisch 097 - nur auf deutsch Wink

user.php
Code:
suche:
$sql = "SELECT name,lastip,uniqueid FROM accounts WHERE acctid=\"$_GET[userid]\"";
 
ersetze mit:

$sql = "SELECT name,lastip,uniqueid,login FROM accounts WHERE acctid=\"$_GET[userid]\"";

search:

    output("<input type='radio' value='ip' name='type' checked> IP: <input name='ip' value=\"".HTMLEntities($row[lastip])."\">`n",true);

add before:

output("<input type='radio' value='name' name='type'> Name: <input name='name' value=\"".HTMLEntities($row[login])."\">`n",true);

suche:

    $sql = "INSERT INTO bans (";
    if ($_POST[type]=="ip"){
        $sql.="ipfilter";
    }else{
        $sql.="uniqueid";
    }
    $sql.=",banexpire,banreason) VALUES (";
    if ($_POST[type]=="ip"){
        $sql.="\"$_POST[ip]\"";
    }else{
        $sql.="\"$_POST[id]\"";
    }

ersetzen mit:

if ($_POST[type]=="ip"){
      $sql.="ipfilter";
  }else if ($_POST[type]=="id"){
      $sql.="uniqueid";
  }else{
        $sql.="bannedchar";
        }
  $sql.=",banexpire,banreason) VALUES (";
  if ($_POST[type]=="ip"){
      $sql.="\"$_POST[ip]\"";
  }else if ($_POST[type]=="id"){
      $sql.="\"$_POST[id]\"";
  }else{
        $sql.="\"$_POST[name]\"";
        }

common.php

Code:

suche:

function checkban($login=false){
    global $session;
    if ($session['banoverride']) return false;
    if ($login===false){
        $ip=$_SERVER[REMOTE_ADDR];
        $id=$_COOKIE[lgi];
        //echo "<br>Orig output: $ip, $id<br>";
    }else{
        $sql = "SELECT lastip,uniqueid,banoverride FROM accounts WHERE login='$login'";
        $result = db_query($sql) or die(db_error(LINK));
        $row = db_fetch_assoc($result);
        if ($row['banoverride']){
            $session['banoverride']=true;
            //echo "`nYou are absolved of your bans, son.";
            return false;
        }else{
            //echo "`nNo absolution here, son.";
        }
        db_free_result($result);
        $ip=$row['lastip'];
        $id=$row['uniqueid'];
        //echo "<br>Secondary output: $ip, $id<br>";
    }
    $sql = "select * from bans where ((substring('$ip',1,length(ipfilter))=ipfilter AND ipfilter<>'') OR (uniqueid='$id' AND uniqueid<>'')) AND (banexpire='0000-00-00' OR banexpire>'".date("Y-m-d")."')";
    //echo $sql;
    $result = db_query($sql) or die(db_error(LINK));
    if (db_num_rows($result)>0){
        // $msg.=$session['message'];
        $session=array();
        //$session['message'] = $msg;
        //echo "Session Abandonment";
        $session[message].="`n`4Du bist einer Verbannung zum Opfer gefallen:`n";
        for ($i=0;$i<db_num_rows($result);$i++){
            $row = db_fetch_assoc($result);
            $session[message].=$row[banreason];
            if ($row[banexpire]=="0000-00-00") $session[message].="  `\$Die Verbannung ist permanent!`0";
            if ($row[banexpire]!="0000-00-00") $session[message].="  `^Der Bann wird am ".date("M d, Y",strtotime($row[banexpire]))." aufgehoben `0";
            $session[message].="`n";
        }
        $session[message].="`4Wenn du willst, kannst du mit einer Anfrage nach dem Grund fragen.";
        header("Location: index.php");
        exit();
    }
    db_free_result($result);
}

ersetzen mit:

function checkban($login=false){
   global $session;
   if ($session['banoverride']) return false;
   if ($login===false){
      $ip=$_SERVER[REMOTE_ADDR];
      $id=$_COOKIE[lgi];
      //echo "<br>Orig output: $ip, $id<br>";
   }else{
      $sql = "SELECT lastip,uniqueid,login,banoverride FROM accounts WHERE login='$login'";
      $result = db_query($sql) or die(db_error(LINK));
      $row = db_fetch_assoc($result);
      if ($row['banoverride']){
         $session['banoverride']=true;
         //echo "`nYou are absolved of your bans, son.";
         return false;
      }else{
         //echo "`nNo absolution here, son.";
      }
      db_free_result($result);
      $ip=$row['lastip'];
      $id=$row['uniqueid'];
                $name=$row['login'];
      //echo "<br>Secondary output: $ip, $id<br>";
   }
   $sql = "select * from bans where ((substring('$ip',1,length(ipfilter))=ipfilter AND ipfilter<>'') OR (uniqueid='$id' AND uniqueid<>'') OR (bannedchar='$name' AND bannedchar<>'')) AND (banexpire='0000-00-00' OR banexpire>'".date("Y-m-d")."')";
   //echo $sql;
   $result = db_query($sql) or die(db_error(LINK));
   if (db_num_rows($result)>0){
       // $msg.=$session['message'];
      $session=array();
      //$session['message'] = $msg;
      //echo "Session Abandonment";
      $session[message].="`n`4Du bist einer Verbannung zum Opfer gefallen:`n";
      for ($i=0;$i<db_num_rows($result);$i++){
         $row = db_fetch_assoc($result);
         $session[message].=$row[banreason];
         if ($row[banexpire]=="0000-00-00") $session[message].="  `\$Die Verbannung ist permanent!`0";
         if ($row[banexpire]!="0000-00-00") $session[message].="  `^Der Bann wird am ".date("M d, Y",strtotime($row[banexpire]))." aufgehoben `0";
         $session[message].="`n";
      }
      $session[message].="`4Wenn du willst, kannst du mit einer Anfrage nach dem Grund fragen.";
      header("Location: index.php");
      exit();
   }
   db_free_result($result);
}

SQL:
Code:

ALTER TABLE `bans` ADD `bannedchar` VARCHAR( 255 ) NOT NULL


~Hadriel
« Last Edit: September 26, 2005, 11:29:22 AM by Hadriel » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
32 Guests, 1 User
Daenerys
Home Forums News Downloads Login Register Advanced Search