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.7 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( 'lib/controller/data/mysqlitedb.db');
  18. $str = @file_get_contents('/proc/uptime');
  19. $num = floatval($str);
  20. $secs = fmod($num, 60); $num = (int)($num / 60);
  21. $mins = $num % 60; $num = (int)($num / 60);
  22. $hours = $num % 24; $num = (int)($num / 24);
  23. $days = $num;
  24. if( !$DATABASE->isConnected && $secs > 120 ) {
  25. header( 'location: /setup/');
  26. exit();
  27. };
  28. //$DATABASE->SetCacheDir( $DBCacheDir );
  29. session_start();
  30. require_once('php/db/logio_class.php');
  31. $LOG = new Logio( LOG_LVL_ALL );
  32. require_once('php/db/user_class.php');
  33. require_once('php/auth/web.php');
  34. require_once('php/db/language_json_class.php');
  35. require_once('php/ui/UI_functions.php');
  36. $UserLang = 1;
  37. if( isset($_GET['Lang']) ){
  38. $UCL=intval( $_GET['Lang'] );
  39. if( $UCL == 0 ) $UCL = 1;
  40. if( ( $UserLang != $UCL ) && ( $UserID > 1 ) ){
  41. $QS = "UPDATE `users` SET `language`={$UCL} WHERE `id`={$UserID}";
  42. $DATABASE->Query( $QS );
  43. };
  44. header( 'location: /' );
  45. exit();
  46. };
  47. $Labels=new Language_json( $SYSPath .'/lib/'.$UserLang.'.json');
  48. if( $UserLang == 3 || $UserLang == 255 ){
  49. $RTL_SITE = true;
  50. } else {
  51. $RTL_SITE = false;
  52. };
  53. ?>