Source for file AdminDelUserPriv.class.php

Documentation is available at AdminDelUserPriv.class.php

  1. <?php
  2. /**
  3.  * Class AdminDelUserPriv - Admin area
  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.     /**
  17.     * Constructor
  18.     *
  19.     * @uses ConnectDB::sqlSet()
  20.     * @uses ConnectDB::sqlGet()
  21.     * @uses ConnectDB::close()
  22.     * @return void 
  23.     */
  24.     public function __construct ()
  25.         
  26.         // call parent Constructor from class DbConectionMaker
  27.         parent::__construct()
  28.  
  29.         session_start();
  30.  
  31.         header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0');
  32.         
  33.         // create new LangXml Object
  34.         $langObj = new LangXml();
  35.         $lang=$langObj->getLang()->admin[0]->admin_user[0];
  36.         
  37.         if ($_SESSION['etchat_'.$this->_prefix.'user_priv']=="admin"){
  38.                     
  39.         // Test if there any Admins in the DB now
  40.         $res $this->dbObj->sqlGet("select count(etchat_user_id) FROM {$this->_prefix}etchat_user where etchat_user_id <> ".(int)$_GET['id']." AND etchat_userprivilegien = 'admin'");
  41.         
  42.         if ($res[0][0]==0){
  43.             echo "Not possible. There will be no administrators in chat.<br><br><a href=\"./?AdminUserIndex\">back</a>";
  44.             return false;
  45.         }
  46.  
  47.         $this->dbObj->sqlSet("UPDATE {$this->_prefix}etchat_user SET etchat_userpw = NULL, etchat_userprivilegien = 'gast' WHERE etchat_user_id=".(int)$_GET['id']);
  48.         
  49.         $this->dbObj->close();
  50.         header("Location: ./?AdminUserIndex");
  51.             
  52.         }else{
  53.             echo $lang->error[0]->tagData;
  54.             return false;
  55.         }
  56.     }

Documentation generated on Tue, 22 Dec 2009 09:42:42 +0100 by phpDocumentor 1.4.1