Web UI for ARGUS server
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.

73 lines
1.8 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. // if ( $ISR_SITE ){
  3. // $domain_ending='.co.il';
  4. // } else {
  5. // $domain_ending='.com';
  6. // };
  7. $SessionIsAutorised=false;
  8. if( isset($_SESSION['UID']) ){ // User ID transmitted just by cookies
  9. $UserID=$_SESSION['UID'];
  10. } else {
  11. $UserID="";
  12. };
  13. if(isset($_SESSION['SID'])){ // Session ID transmitted just by cookies
  14. $Session=$_SESSION['SID'];
  15. } else $Session="";
  16. if( isset($_GET['UID']) ){ // User ID transmitted just by cookies
  17. $UserID=intval($_GET['UID']);
  18. };
  19. if(isset($_GET['SID'])){ // Session ID transmitted just by cookies
  20. $Session=$_GET['SID'];
  21. };
  22. if(isset($_GET['logout'])){
  23. $UserID=1; // Logout to Guest;
  24. };
  25. if(isset($_SESSION['Lang'])){ // Language settings transmitted by cookie
  26. $UserLang=$_SESSION['Lang'];
  27. } else $UserLang=1;
  28. // New Way Cookie deletion
  29. if ( $UserID==='deleted' ) $UserID='';
  30. if (isset($_POST['login'])) {
  31. $Login=$_POST['login'];
  32. } elseif (isset($_GET['login'])) {
  33. $Login=$_GET['login'];
  34. //$UserID=""; to do logout of previouse user
  35. } elseif ($UserID === "" ) {
  36. $Login="guest";
  37. //$UserID=1;
  38. } else $Login="";
  39. if (isset($_POST['password'])) {
  40. $Password=$_POST['password'];
  41. } else $Password="";
  42. $CUser=new User();
  43. //echo "$Login,$Password,$UserID,$Session";
  44. $SessionIsAutorised=$CUser->Login($Login,$Password,$UserID,$Session);
  45. //echo "$SessionIsAutorised $Login,$Password,$UserID,$Session ";
  46. if ( $SessionIsAutorised && $CUser->Data['id']>1){
  47. $CUser->FillInfo($CUser->Data['id']);
  48. $_SESSION['UID']=$CUser->Data['id'];
  49. $_SESSION['SID']=$CUser->Data['SID'];
  50. $UserLang = $CUser->Data['language'];
  51. $_SESSION['Lang'] = $UserLang;
  52. $SiteID = 1;
  53. };
  54. if ( $CUser->Data['id']==1 ){
  55. $CUser->Data['status']='';
  56. $UserLang = 1;
  57. $_SESSION['UID']=$CUser->Data['id'];
  58. $SiteID = 0;
  59. };
  60. ?>