Fork of FusionPBX but with LDAP kinda working
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.5 KiB

2 years ago
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <markjcrane@fusionpbx.com>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2012
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <markjcrane@fusionpbx.com>
  20. */
  21. //session handling
  22. //start the session
  23. if (function_exists('session_start')) {
  24. if (!isset($_SESSION)) {
  25. session_start();
  26. }
  27. }
  28. //regenerate sessions to avoid session id attacks such as session fixation
  29. if (array_key_exists('security',$_SESSION) && $_SESSION['security']['session_rotate']['boolean'] == "true") {
  30. $_SESSION['session']['last_activity'] = time();
  31. if (!isset($_SESSION['session']['created'])) {
  32. $_SESSION['session']['created'] = time();
  33. } else if (time() - $_SESSION['session']['created'] > 28800) {
  34. // session started more than 8 hours ago
  35. session_regenerate_id(true); // rotate the session id
  36. $_SESSION['session']['created'] = time(); // update creation time
  37. }
  38. }
  39. ?>