EPESI BIM • Business Information Manager • Cloud CRM/ERP http://epe.si/
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.

init_js.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. if (!defined('_VALID_ACCESS'))
  3. define('_VALID_ACCESS',1);
  4. require_once('include/data_dir.php');
  5. if(!file_exists(DATA_DIR.'/config.php'))
  6. die();
  7. if(!is_writable(DATA_DIR))
  8. die();
  9. require_once('include/config.php');
  10. require_once('include/error.php');
  11. require_once('include/database.php');
  12. if(defined('CID')) {
  13. if(constant('CID')!==false) die('alert(\'Invalid update script defined custom CID. Please try to refresh site manually.\');');
  14. } else
  15. define('CID',false); //i know that i won't access $_SESSION['client']
  16. require_once('include/session.php');
  17. // if it's direct request to this file return content-type: text/javascript
  18. // otherwise it's include and do not send header.
  19. if (isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__)
  20. header("Content-type: text/javascript");
  21. $client_id = isset($_SESSION['num_of_clients'])?$_SESSION['num_of_clients']:0;
  22. $client_id_next = $client_id+1;
  23. $_SESSION['num_of_clients'] = $client_id_next;
  24. //DBSession::destroy_client(session_id(),$client_id);
  25. if($client_id-5>=0) {
  26. EpesiSession::destroy_client(session_id(),$client_id-5);
  27. $_SESSION['session_destroyed'][$client_id-5] = 1;
  28. }
  29. session_commit();
  30. ?>Epesi.init(<?php print($client_id); ?>,'<?php print(rtrim(str_replace('\\','/',dirname($_SERVER['PHP_SELF'])),'/').'/process.php'); ?>','<?php print(http_build_query($_GET));?>');