1
0

addUser.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /* $Id: addUser.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. $newUser = tfb_getRequestVar('newUser');
  23. $pass1 = tfb_getRequestVar('pass1');
  24. $userType = tfb_getRequestVar('userType');
  25. // new user ?
  26. $newUser = strtolower($newUser);
  27. if (!(IsUser($newUser))) {
  28. addNewUser($newUser, $pass1, $userType);
  29. AuditAction($cfg["constants"]["admin"], $cfg['_NEWUSER'].": ".$newUser);
  30. @header("location: admin.php?op=showUsers");
  31. exit();
  32. }
  33. // init template-instance
  34. tmplInitializeInstance($cfg["theme"], "page.admin.addUser.tmpl");
  35. // set vars
  36. $tmpl->setvar('newUser', $newUser);
  37. //
  38. $tmpl->setvar('_TRYDIFFERENTUSERID', $cfg['_TRYDIFFERENTUSERID']);
  39. $tmpl->setvar('_HASBEENUSED', $cfg['_HASBEENUSED']);
  40. //
  41. tmplSetTitleBar("Administration - Add User");
  42. tmplSetAdminMenu();
  43. tmplSetFoot();
  44. tmplSetIidVars();
  45. // parse template
  46. $tmpl->pparse();
  47. ?>