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.

64 lines
1.6 KiB

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