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.

82 lines
2.2 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
  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( '/srv/www/web/lib/controller/data/mysqlitedb.db');
  18. $QS="SELECT * FROM system_props LIMIT 1";
  19. $RV = $DATABASE->Query( $QS );
  20. if( 0 && 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. $AP_DATA['work_mode']=0;
  25. $AP_DATA['type']=0;
  26. $AP_DATA['oem_logo']='';
  27. $AP_DATA['build']='';
  28. $AP_DATA['report_cleanup']=20;
  29. $AP_DATA['preserve_empty']=20;
  30. } else {
  31. $AP_DATA = array(
  32. 'anchor_lat'=>0,
  33. 'anchor_lon'=>0,
  34. 'anchor_alt'=>0,
  35. 'map_id'=>0,
  36. 'type'=>0,
  37. 'name'=>'INITIAL_SETUP_MODE',
  38. 'os_info'=>'MUST_RESTART_SERVER',
  39. 'hw_info'=>'MUST_DO_DETECTION',
  40. 'work_mode'=>0,
  41. 'oem_logo'=>'',
  42. 'build'=>'',
  43. 'report_cleanup'=>20,
  44. 'preserve_empty'=>20
  45. );
  46. };
  47. //$QS="SELECT `site_id`, `version_string` FROM `servers` LIMIT 1";
  48. //$RR = $DATABASE->Query( $QS );
  49. if( 0 ){//count( $RR ) ){
  50. $AP_DATA['site_id'] = intval( $RR[0]['site_id']);
  51. $AP_DATA['build'] = $RR[0]['version_string'];
  52. } else {
  53. $AP_DATA['site_id'] = 1;
  54. $AP_DATA['build'] = 'undefined-build';
  55. };
  56. //$DATABASE->SetCacheDir( $DBCacheDir );
  57. session_start();
  58. require_once('php/db/logio_class.php');
  59. $LOG = new Logio( LOG_LVL_ALL );
  60. require_once('php/db/user_class.php');
  61. require_once('php/auth/web.php');
  62. //require_once('php/db/language_class.php');
  63. require_once('php/db/language_json_class.php');
  64. //require_once('php/sys/SYSTEM_functions.php');
  65. require_once('php/ui/UI_functions.php');
  66. //require_once('php/web/WEB_functions.php');
  67. $Labels=new Language_json( $SYSPath . 'lib/'.$UserLang.'.json');
  68. if( $UserLang == 3 || $UserLang == 255 ){
  69. $RTL_SITE = true;
  70. } else {
  71. $RTL_SITE = false;
  72. };
  73. ?>