PageRenderTime 23ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/include/inc_act/act_user.php

http://phpwcms.googlecode.com/
PHP | 63 lines | 45 code | 8 blank | 10 comment | 10 complexity | ddd86e39995d0626e708faeffadcd130 MD5 | raw file
Possible License(s): AGPL-1.0, LGPL-2.1, ISC, MIT, LGPL-3.0, GPL-2.0, MPL-2.0-no-copyleft-exception, LGPL-2.0, BSD-3-Clause
  1. <?php
  2. /**
  3. * phpwcms content management system
  4. *
  5. * @author Oliver Georgi <oliver@phpwcms.de>
  6. * @copyright Copyright (c) 2002-2013, Oliver Georgi
  7. * @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2
  8. * @link http://www.phpwcms.de
  9. *
  10. **/
  11. session_start();
  12. $phpwcms = array();
  13. require_once ('../../config/phpwcms/conf.inc.php');
  14. require_once ('../inc_lib/default.inc.php');
  15. require_once (PHPWCMS_ROOT.'/include/inc_lib/dbcon.inc.php');
  16. require_once (PHPWCMS_ROOT.'/include/inc_lib/general.inc.php');
  17. checkLogin();
  18. require_once (PHPWCMS_ROOT.'/include/inc_lib/backend.functions.inc.php');
  19. if($_SESSION["wcs_user_admin"] == 1) { //Wenn Benutzer Admin-Rechte hat
  20. //Löschen eines Benutzers
  21. if(isset($_GET["del"])) {
  22. $ui = explode(":", clean_slweg($_GET["del"]));
  23. $user_id = intval($ui[0]);
  24. $user_email = '';
  25. if(isset($ui[1])) {
  26. $user_email = $ui[1];
  27. }
  28. if($user_id <> $_SESSION["wcs_user_id"]) {
  29. $sql = "UPDATE ".DB_PREPEND."phpwcms_user SET ".
  30. "usr_login='".generic_string(10)."', ".
  31. "usr_pass='".md5(generic_string(10))."', ".
  32. "usr_email='', ".
  33. "usr_admin=0, ".
  34. "usr_aktiv=9 ".
  35. "WHERE usr_id=".$user_id." AND ".
  36. "usr_email='".aporeplace($user_email)."';";
  37. if($result = mysql_query($sql, $db)) {
  38. if(is_valid_email($user_email)) {
  39. @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");
  40. }
  41. }
  42. }
  43. }
  44. if(isset($_GET["aktiv"])) {
  45. $ui = explode(":", clean_slweg($_GET["aktiv"]));
  46. $user_id = intval($ui[0]);
  47. $user_aktiv = !empty($ui[1]) ? 1 : 0;
  48. if($user_id <> $_SESSION["wcs_user_id"]) {
  49. $sql = "UPDATE ".DB_PREPEND."phpwcms_user SET usr_aktiv=".$user_aktiv." WHERE usr_id=".$user_id.";";
  50. mysql_query($sql, $db) or die ("error");
  51. }
  52. }
  53. } //Ende Abarbeiten Aktion
  54. headerRedirect(PHPWCMS_URL.'phpwcms.php?do=admin');
  55. ?>