Blame view

php/login.php 834 Bytes
cf76164e6   Ting Chan   20190709
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  <?php
  session_start();
  $hash=hash("md5",$_POST['password']);
  if($_SESSION['languge'] != ""){
   include('../lang/'.$_SESSION['languge'].".php");
  }else{
   include('../lang/cn.php');
  }
  include('../default/login_config.php');
  include('../default/admin_config.php');
   if($_POST['account'] != "" && $_POST['password'] != ""){
    if($_POST['account'] == AD_ACCOUNT && $hash == AD_PASSWORD){
     $_SESSION['account'] = $_POST['account'];
     $_SESSION['password'] = $_POST['password'];
     $status = '1';
    }elseif($_POST['account'] == ACCOUNT && $hash == PASSWORD){
     $_SESSION['account'] = $_POST['account'];
     $_SESSION['password'] = $_POST['password'];
     $status = '1';
    }else{
     $status = '0';
    }
   }else{
    $status = '0';
   }
   $str = array('message'=>$status);
   exec('sudo python /var/www/wave/version.py');
   echo json_encode($str);
   
  ?>