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.

70 lines
1.8 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/db/language_json_class.php');
  38. //require_once('php/sys/SYSTEM_functions.php');
  39. require_once('php/ui/UI_functions.php');
  40. //require_once('php/web/WEB_functions.php');
  41. if( isset($_GET['Lang']) ){
  42. $UCL=intval( $_GET['Lang'] );
  43. if( $UCL == 0 ) $UCL = 1;
  44. if( ( $UserLang != $UCL ) && ( $UserID > 1 ) ){
  45. $QS = "UPDATE `users` SET `language`={$UCL} WHERE `id`={$UserID}";
  46. $DATABASE->Query( $QS );
  47. };
  48. header( 'location: /' );
  49. exit();
  50. };
  51. $Labels=new Language_json( '/srv/www/web/lib/'.$UserLang.'.json');
  52. if( $UserLang == 3 || $UserLang == 255 ){
  53. $RTL_SITE = true;
  54. } else {
  55. $RTL_SITE = false;
  56. };
  57. ?>