Source for file Insert2Blacklist.class.php

Documentation is available at Insert2Blacklist.class.php

  1. <?php
  2. /**
  3.  * Insert2Blacklist, insert the user to the Blacklist
  4.  *
  5.  * LICENSE: CREATIVE COMMONS PUBLIC LICENSE  "Namensnennung — Nicht-kommerziell 2.0"
  6.  *
  7.  * @copyright  2009 <SEDesign />
  8.  * @license    http://creativecommons.org/licenses/by-nc/2.0/de/
  9.  * @version    $3.0.6$
  10.  * @link       http://www.sedesign.de/de_produkte_chat-v3.html
  11.  * @since      File available since Alpha 1.0
  12.  */
  13.  
  14. {
  15.     /**
  16.     * Constructor
  17.     *
  18.     * @uses ConnectDB::sqlGet()
  19.     * @uses ConnectDB::sqlSet()
  20.     * @uses ConnectDB::close()
  21.     * @uses LangXml object creation
  22.     * @uses LangXml::getLang() parser method
  23.     * @uses Blacklist object creation
  24.     * @uses Blacklist::insertUser()
  25.     * @return void 
  26.     */
  27.     public function __construct (){
  28.     
  29.         // call parent Constructor from class DbConectionMaker
  30.         parent::__construct();
  31.         
  32.         session_start();
  33.  
  34.         header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0');
  35.         
  36.         // create new LangXml Object
  37.         $langObj = new LangXml();
  38.         $lang=$langObj->getLang()->admin[0]->add2blacklist[0];
  39.         
  40.         if($_SESSION['etchat_'.$this->_prefix.'user_priv']=="admin" || $_SESSION['etchat_'.$this->_prefix.'user_priv']=="mod"){
  41.                 
  42.             $ip=$this->dbObj->sqlGet("SELECT etchat_onlineip FROM {$this->_prefix}etchat_useronline WHERE etchat_onlineuser_fid = ".(int)$_POST['user_id']);
  43.             
  44.             if (is_array($ip)){    
  45.                 if ($_POST['time']>0) {
  46.                     // create new Blacklist Object
  47.                     $blObj = new Blacklist($this->dbObj);
  48.                     $blObj->insertUser((int)$_POST['user_id'],(int)$_POST['time']);
  49.                 }else{
  50.                     $this->dbObj->sqlSet("INSERT INTO {$this->_prefix}etchat_kick_user (etchat_kicked_user_id, etchat_kicked_user_time) VALUES (".(int)$_POST['user_id'].", ".(date("U")+30).")");
  51.                 }
  52.             }else{
  53.                 echo $lang->user_away[0]->tagData;
  54.             }
  55.             
  56.             $this->dbObj->close();
  57.  
  58.         }else{
  59.             echo $lang->session_lost[0]->tagData;
  60.         }
  61.     }

Documentation generated on Thu, 05 May 2011 14:05:56 +0000 by phpDocumentor 1.4.3