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.

68 lines
2.0 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. error_reporting( E_ALL );
  3. require_once('settings.php');
  4. require_once('defines.php');
  5. // SET DATA CONNECTION AND GLOBAL USER VARIABLES
  6. $TT_123 = explode( '.', PHP_VERSION );
  7. if( $TT_123[0] == '4' ){
  8. require_once( 'php/db/MySQL_class.php' );
  9. $DATABASE = new MySQL_DB($DBHost, $DBName, $DBUser, $DBPassword);
  10. } elseif( $TT_123[0] > '4' ){
  11. require_once( 'php/db/MySQLi_class.php' );
  12. $DATABASE = new MySQLi_DB($DBHost, $DBName, $DBUser, $DBPassword);
  13. } else {
  14. exit();
  15. };
  16. //require_once( 'php/db/SQLite_Class.php');
  17. //$DATABASE = new SQLite_DB( $SYSPath . '/lib/controller/data/mysqlitedb.db');
  18. $QS="SELECT * FROM system_props LIMIT 1";
  19. $RV = $DATABASE->Query( $QS );
  20. if( count( $RV ) ){
  21. $AP_DATA = $RV[0];
  22. if( $AP_DATA['hw_info'] == '' ) $AP_DATA['hw_info'] = 'MUST_DO_DETECTION';
  23. if( $AP_DATA['os_info'] == '' ) $AP_DATA['os_info'] = 'MUST_RESTART_SERVER';
  24. } else {
  25. $AP_DATA = array(
  26. 'anchor_lat'=>0,
  27. 'anchor_lon'=>0,
  28. 'anchor_alt'=>0,
  29. 'type'=>0,
  30. 'name'=>'INITIAL_SETUP_MODE',
  31. 'os_info'=>'MUST_RESTART_SERVER',
  32. 'hw_info'=>'MUST_DO_DETECTION'
  33. );
  34. };
  35. //$QS="SELECT `site_id`, `version_string` FROM `servers` LIMIT 1";
  36. //$RR = $DATABASE->Query( $QS );
  37. if( 0 ){//count( $RR ) ){
  38. $AP_DATA['site_id'] = intval( $RR[0]['site_id']);
  39. $AP_DATA['build'] = $RR[0]['version_string'];
  40. } else {
  41. $AP_DATA['site_id'] = 1;
  42. $AP_DATA['build'] = 'undefined-build';
  43. };
  44. //$DATABASE->SetCacheDir( $DBCacheDir );
  45. session_start();
  46. require_once('php/db/logio_class.php');
  47. $LOG = new Logio( LOG_LVL_ALL );
  48. require_once('php/db/user_class.php');
  49. require_once('php/auth/web.php');
  50. //require_once('php/db/language_class.php');
  51. require_once('php/db/language_json_class.php');
  52. //require_once('php/sys/SYSTEM_functions.php');
  53. require_once('php/ui/UI_functions.php');
  54. //require_once('php/web/WEB_functions.php');
  55. $Labels=new Language_json( $SYSPath .'/lib/'.$UserLang.'.json');
  56. if( $UserLang == 3 || $UserLang == 255 ){
  57. $RTL_SITE = true;
  58. } else {
  59. $RTL_SITE = false;
  60. };
  61. ?>