Web Interface For Lite Argus Control modules
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.

69 lines
2.0 KiB

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