1
0

updateUser.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /* $Id: updateUser.php 2893 2007-04-14 13:20:30Z b4rt $ */
  3. /*******************************************************************************
  4. LICENSE
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License (GPL)
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. To read the license please visit http://www.gnu.org/copyleft/gpl.html
  14. *******************************************************************************/
  15. // prevent direct invocation
  16. if ((!isset($cfg['user'])) || (isset($_REQUEST['cfg']))) {
  17. @ob_end_clean();
  18. @header("location: ../../../index.php");
  19. exit();
  20. }
  21. /******************************************************************************/
  22. $user_id = tfb_getRequestVar('user_id');
  23. $org_user_id = tfb_getRequestVar('org_user_id');
  24. $pass1 = tfb_getRequestVar('pass1');
  25. $userType = tfb_getRequestVar('userType');
  26. $hideOffline = tfb_getRequestVar('hideOffline');
  27. $user_id = strtolower($user_id);
  28. if (!(IsUser($user_id) && ($user_id != $org_user_id))) {
  29. // Admin is changing id or password through edit screen
  30. if (($user_id == $cfg["user"] || $cfg["user"] == $org_user_id) && $pass1 != "") {
  31. // this will expire the user
  32. $_SESSION['user'] = md5($cfg["pagetitle"]);
  33. }
  34. updateThisUser($user_id, $org_user_id, $pass1, $userType, $hideOffline);
  35. AuditAction($cfg["constants"]["admin"], $cfg['_EDITUSER'].": ".$user_id);
  36. @header("location: admin.php");
  37. exit();
  38. }
  39. // init template-instance
  40. tmplInitializeInstance($cfg["theme"], "page.admin.updateUser.tmpl");
  41. // set vars
  42. $tmpl->setvar('user_id', $user_id);
  43. $tmpl->setvar('org_user_id', $org_user_id);
  44. //
  45. $tmpl->setvar('_TRYDIFFERENTUSERID', $cfg['_TRYDIFFERENTUSERID']);
  46. $tmpl->setvar('_HASBEENUSED', $cfg['_HASBEENUSED']);
  47. $tmpl->setvar('_RETURNTOEDIT', $cfg['_RETURNTOEDIT']);
  48. //
  49. tmplSetTitleBar("Administration - Update User");
  50. tmplSetAdminMenu();
  51. tmplSetFoot();
  52. tmplSetIidVars();
  53. // parse template
  54. $tmpl->pparse();
  55. ?>