Source for file ChangeModPw.class.php

Documentation is available at ChangeModPw.class.php

  1. <?php
  2. /**
  3.  * ChangeModPw, sets new Pw for Mods
  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. class ChangeModPw extends DbConectionMaker
  15. {
  16.     /**
  17.     * Constructor
  18.     *
  19.     * @uses ConnectDB::sqlSet()
  20.     * @uses ConnectDB::close()
  21.     * @return void 
  22.     */
  23.     public function __construct (){
  24.     
  25.         // call parent Constructor from class DbConectionMaker
  26.         parent::__construct();
  27.     
  28.         session_start();
  29.         
  30.         // all documentc requested per AJAX should have this part to turn off the browser and proxy cache for any XHR request
  31.         header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0');
  32.         
  33.         if ($_SESSION['etchat_'.$this->_prefix.'user_priv']=="admin" || $_SESSION['etchat_'.$this->_prefix.'user_priv']=="mod"){
  34.             $this->dbObj->sqlSet("UPDATE {$this->_prefix}etchat_user SET etchat_userpw = '".md5($_POST['modpw'])."' WHERE etchat_user_id = ".(int)$_SESSION['etchat_'.$this->_prefix.'user_id']);
  35.             echo "1";
  36.         }
  37.         
  38.         // close DB connection
  39.         $this->dbObj->close();
  40.     }

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