[ Index ]

PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09)

title

Body

[close]

/include/inc_act/ -> act_user.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2009 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
   6   
   7     This script is part of PHPWCMS. The PHPWCMS web content management system is
   8     free software; you can redistribute it and/or modify it under the terms of
   9     the GNU General Public License as published by the Free Software Foundation;
  10     either version 2 of the License, or (at your option) any later version.
  11    
  12     The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
  13     A copy is found in the textfile GPL.txt and important notices to the license 
  14     from the author is found in LICENSE.txt distributed with these scripts.
  15    
  16     This script is distributed in the hope that it will be useful, but WITHOUT ANY 
  17     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  18     PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  19   
  20     This copyright notice MUST APPEAR in all copies of the script!
  21  *************************************************************************************/
  22  
  23  // session_name('hashID');
  24  session_start();
  25  $phpwcms = array();
  26  require_once ('../../config/phpwcms/conf.inc.php');
  27  require_once  ('../inc_lib/default.inc.php');
  28  require_once  (PHPWCMS_ROOT.'/include/inc_lib/dbcon.inc.php');
  29  
  30  require_once  (PHPWCMS_ROOT.'/include/inc_lib/general.inc.php');
  31  checkLogin();
  32  require_once  (PHPWCMS_ROOT.'/include/inc_lib/backend.functions.inc.php');
  33  
  34  if($_SESSION["wcs_user_admin"] == 1) { //Wenn Benutzer Admin-Rechte hat
  35  
  36      //Löschen eines Benutzers
  37      if(isset($_GET["del"])) {
  38          $ui = explode(":", clean_slweg($_GET["del"]));
  39          $user_id = intval($ui[0]);
  40          $user_email = '';
  41          if(isset($ui[1])) {
  42              $user_email = $ui[1];
  43          }
  44          if($user_id <> $_SESSION["wcs_user_id"]) {
  45              $sql =    "UPDATE ".DB_PREPEND."phpwcms_user SET ".
  46                      "usr_login='".generic_string(10)."', ".
  47                      "usr_pass='".md5(generic_string(10))."', ".
  48                      "usr_email='', ".
  49                      "usr_admin=0, ".
  50                      "usr_aktiv=9 ".
  51                      "WHERE usr_id=".$user_id." AND ".
  52                      "usr_email='".aporeplace($user_email)."';";
  53              if($result = mysql_query($sql, $db)) {
  54                  if(!MailVal($user_email,2)) {
  55                      @mail($user_email, "your account", "YOUR PHPWCMS ACCOUNT WAS DELETED\n \ncontact the admin if you have any question.\n\nSee you at ".$phpwcms["site"], "From: ".$phpwcms["admin_email"]."\nReply-To: ".$phpwcms["admin_email"]."\n");
  56                  }
  57              }
  58          }
  59      }
  60      
  61      if(isset($_GET["aktiv"])) {
  62          $ui = explode(":", clean_slweg($_GET["aktiv"]));
  63          $user_id = intval($ui[0]);
  64          $user_aktiv = !empty($ui[1]) ? 1 : 0;
  65          if($user_id <> $_SESSION["wcs_user_id"]) {
  66              $sql =    "UPDATE ".DB_PREPEND."phpwcms_user SET usr_aktiv=".$user_aktiv." WHERE usr_id=".$user_id.";";
  67              mysql_query($sql, $db) or die ("error");
  68          }
  69      }
  70      
  71  } //Ende Abarbeiten Aktion
  72  
  73  headerRedirect(PHPWCMS_URL.'phpwcms.php?do=admin');
  74  
  75  ?>


Generated: Wed Dec 30 05:55:15 2009 Cross-referenced by PHPXref 0.7