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.

63 lines
1.7 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 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. /*
  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. */
  18. require_once( 'php/db/SQLite_Class.php');
  19. $DATABASE = new SQLite_DB( 'lib/controller/data/mysqlitedb.db');
  20. $str = @file_get_contents('/proc/uptime');
  21. $num = floatval($str);
  22. $secs = fmod($num, 60); $num = (int)($num / 60);
  23. $mins = $num % 60; $num = (int)($num / 60);
  24. $hours = $num % 24; $num = (int)($num / 24);
  25. $days = $num;
  26. if( !$DATABASE->isConnected && $secs > 120 ) {
  27. header( 'location: /setup/');
  28. exit();
  29. };
  30. //$DATABASE->SetCacheDir( $DBCacheDir );
  31. session_start();
  32. require_once('php/db/logio_class.php');
  33. $LOG = new Logio( LOG_LVL_ALL );
  34. require_once('php/db/user_class.php');
  35. require_once('php/auth/web.php');
  36. require_once('php/db/language_class.php');
  37. //require_once('php/sys/SYSTEM_functions.php');
  38. require_once('php/ui/UI_functions.php');
  39. //require_once('php/web/WEB_functions.php');
  40. if( isset($_GET['Lang'])){
  41. $UCL=$_GET['Lang']/1;
  42. if ($UCL) $_SESSION['userlang']=$UCL; else $_SESSION['userlang']=$UserLang;
  43. }
  44. if( isset($_SESSION['userlang']) )$Labels=new Language( $_SESSION['userlang'] ); // '_php');
  45. else $Labels=new Language( $UserLang );// '_php');
  46. if( $UserLang == 3 || $UserLang == 255 ){
  47. $RTL_SITE = true;
  48. } else {
  49. $RTL_SITE = false;
  50. };
  51. ?>