Re-[Release] Time Ban (CMS by Hen!) by DexterSK

02/11/2013 07:16 ebert.tonna#1
Re-[Release] Aktiv System (CMS by Hen!) by DexterSK

Wieder rein weil gelöscht.
Orginal Thread: [Only registered and activated users can see links. Click Here To Register...]

Hi epvp

Fu*king school

So we start

YOU MUST HAVE MY AKTIV SYSTEM !!
[Only registered and activated users can see links. Click Here To Register...]

I want release my Time Ban System v 1.0

So..
Goto account.account press F6 paste this code and press ENter
PHP Code:
ALTER TABLE account ADD time_ban datetime NOT NULL default '0000-00-00 00:00:00' AFTER login
1. Find and Open your login.php in pages folder
2. Find:
PHP Code:
if($_SESSION['user_admin']>=0) { 
3. 5. Under } This is end of if($_SESSION['user_admin']>=0) {
4. Paste This Code:
PHP Code:
    /* ------------------ DEXTERSK BAN CODE --------------*/
    
$sqlAcc "SELECT account.social_id AS loeschcode,name_checked AS warn,status AS status, safebox.password AS lagerpw,create_time AS create_time,id AS id,email AS email
    FROM account.account 
    LEFT JOIN player.safebox 
    ON account.id=safebox.account_id 
    WHERE account.id='"
.$_SESSION['user_id']."'";
    
    
$qryAcc mysql_query($sqlAcc) or die(mysql_error());
    
$getAcc mysql_fetch_object($qryAcc);
    
$dex "SELECT web_aktiviert AS aktiv, aktiv AS dexo, time_ban AS ban
    FROM account.account 
    LEFT JOIN player.safebox 
    ON account.id=safebox.account_id 
    WHERE account.id='"
.$_SESSION['user_id']."'";
    
$dexi mysql_query($dex) or die(mysql_error());
    
$www mysql_fetch_object($dexi);
    
$zuFall rand(99999,999999999);
    
$aktivHash = ($serverSettings['mail_activation']) ? md5($zuFall):'';
    
$accountStatus = ($serverSettings['mail_activation']) ? 'BLOCK':'OK';      
    
$datum date("Y-m-d H:i:s");
    
$timeban $www->ban;
    
$dexP "0000-00-00 00:00:00";

    if(
$getAcc->status=='OK' and $www->dexo=='1' and $timeban $datum){
    echo 
"<BR><center><p class='topLine' ><B>Your Account is active</B></p></center>";
    }
    if(
$getAcc->status=='OK' and $www->dexo=='0'){
    echo 
"<BR><center><p class='topLine' ><B>Your Account is active</B></p></center>";
    }
    if(
$getAcc->status=='BLOCK' and $www->dexo=='1' and $timeban $datum){
    echo 
"<BR><center><p class='topLine' ><B>Your account is blocked in: $timeban<br></B></p></center>
    "
;}
    if(
$getAcc->status=='BLOCK' and $www->dexo=='0'){
    echo
"<BR><center><p class='topLine' ><B>Your account is not activated.<br>Activate it by clicking on the link below
    <a href="
.$serverSettings['url']."/index.php?s=login&do=aktivieren&hash=".$www->aktiv.">Activate</a>
    </B></p></center>"
;
    }
    if(
$timeban $datum)
    {
        
$sqlCmde="UPDATE account.account SET time_ban='".$dexP."', status='OK' WHERE id='".mysql_real_escape_string($_SESSION['user_id'])."' LIMIT 1";
        
$sqlQry=mysql_query($sqlCmde,$sqlServ);
    }
    
/* ------------------ DEXTERSK BAN CODE --------------*/ 
5. Open users.php in admin folder and add:
PHP Code:
        echo'<li><a href="index.php?s=admin&a=time_ban&acc='.$_GET['acc'].'">Time Ban</a></li>'
6. Create time_ban.php in admin folder and paste:
PHP Code:
 <?PHP
    
if($_SESSION['user_admin']>0
    {
    echo
'<h2>TimeBan By DexterSK</h2>';
    
    
$_7 time() + (24 60 60);              // 7 days
    
$_30 time() + (30 24 60 60);            // 30 days / 1 month
    
$_90 time() + (90 24 60 60);            // 90 days / 3 month
    
$_150 time() + (150 24 60 60);            // 150 days / 5 month
    
$dex $_POST['dlzka_banu'];
    
    
if(isset(
$_GET['acc']) && !empty($_GET['acc'])) 
    {
      if(isset(
$_POST['submit']) && $_POST['submit']=='Ban') {
        
          if(!empty(
$_POST['dovod']) && !empty($_POST['dodatok']) && !empty($_POST['dlzka_banu'])) {
          
            
$sqlCmd "SELECT login FROM account.account WHERE id='".$_GET['acc']."' LIMIT 1";
            
$sqlQry mysql_query($sqlCmd,$sqlServ);
            
            if(
mysql_num_rows($sqlQry)>0
            {
              
$accData mysql_fetch_object($sqlQry);
              
$sqlCmd "UPDATE account.account SET status='BLOCK', time_ban='".mysql_real_escape_string(date("Y-m-d H:i:s"$dex))."' WHERE id='".$_GET['acc']."' LIMIT 1";
              if(
mysql_query($sqlCmd,$sqlServ)) {
                echo
'<p>'.$accData->login.' has been banned</p>';
                echo
'<p><a href="index.php?s=admin&a=users&acc='.$_GET['acc'].'">Späť na prehľad</a></p>';
              }
              
              
$begruendung $_POST['dovod'].': '.$_POST['dodatok'];
              
              
$sqlLog "INSERT INTO ".SQL_HP_DB.".ban_log (admin_id,account_id,zeitpunkt,grund,typ) VALUES ('".$_SESSION['user_id']."','".$_GET['acc']."',NOW(),'".$begruendung."','BLOCK')";
              
$qryLog mysql_query($sqlLog,$sqlHp);
            }
            else
            {
              echo
'<p>Uvedené ID účtu neexistuje!</p>';      
            }
            
          }
          else {
            echo
'<p class="meldung">Vyplnte všetky informácie.</p>';
          }

      }
      
      
$sqlLogin "SELECT login FROM account.account WHERE id='".$_GET['acc']."' LIMIT 1";
      
$qryLogin mysql_query($sqlLogin,$sqlServ);
      
$getLogin mysql_fetch_object($qryLogin);
      
      
?>
      <form action="index.php?s=admin&a=time_ban&acc=<?PHP echo $_GET['acc']; ?>" method="POST">
        <table>
          <tr>
            <th class="topLine">Account:</th>
            <td class="tdunkel"><?PHP echo$getLogin->login $_365 ";?></td>
          </tr>
          <tr>
            <th class="topLine">Reason:</th>
            <td class="tdunkel">
            <select name="dovod">
              <?PHP
              
                
foreach($banGruende AS $dovodA) {
                  echo
'<option value="'.$dovodA.'">'.$dovodA.'</option>';
                }
                
              
?>
            </select>
            Text:
            <input type="text" name="dodatok" size="50" maxlength="150" />
            </td>
          </tr>
          <tr>
            <th class="topLine">Ban Length:</th>
            <td class="tdunkel">
            <select name="dlzka_banu">
<?php
echo'    
                    <option value="'
.$_7.'">7 Days</option>
                    <option value="'
.$_30.'">1 Month</option>
                    <option value="'
.$_90.'">3 Months</option>
                    <option value="'
.$_150.'">5 Months</option>
'
;?>     
            </select>
            </td>
          </tr>
          <tr>
            <th class="topLine" style="text-align:center;" colspan="2"><input type="submit" name="submit" value="Ban"/></th>
          </tr>
        </table>
      </form>
      <?PHP
    
}
    else 
    {
      echo
'<p class="meldung">You did not account ID!</p>';
    }
}
 else {
    echo
'<p class="meldung">You must be logged in for this area.</p>'
}

?>
7. That's ALL Good Night

Video:
02/11/2013 17:23 DexterSK#2
-_-
02/11/2013 18:31 .Onlyx3#3
Mach doch bitte en Sammelthread...
02/12/2013 02:54 amukaçi35#4
thank you :pimp:

%80 tested %0 error
02/13/2013 14:15 DexterSK#5
0% error? :D :D Check the php code kid...
02/13/2013 22:18 blackout85#6
PHP Code:
$sqlCmd "SELECT login FROM account.account WHERE id='".$_GET['acc']."' LIMIT 1"
Lasst die Finger von dem Code da sind Sql Injections möglich!
02/14/2013 04:49 ebert.tonna#7
Quote:
Lasst die Finger von dem Code da sind Sql Injections möglich!
Das sagst du gerade mir. Ich habe das nur als RE-RELEASE gemacht weil der immer alles löscht, das iss ja nicht Sinn und Zweck der Sache hier, aber ich finde das nett das du darauf hinweist.
02/14/2013 06:27 blackout85#8
ich sage es nicht dir sondern den Leuten die es nutzen wollen. Es ist mir klar das es nicht von dir ist.

Jedoch solltest du dich ein wenig damit auskennen da Sie dir sonst auf den Senkel gehen (zu recht) wenn jemand misst durch das teil anstellt.

Zudem ist das Hen CMS in meinen Augen veraltet. Gibt besseres zur Zeit ohne Werbung machen zu wollen. zb [Only registered and activated users can see links. Click Here To Register...]

Gruß Lars