mirror of
				https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
				synced 2025-11-04 04:30:22 -05:00 
			
		
		
		
	Fix #6 - compatibility issues
This commit is contained in:
		
							parent
							
								
									195d91c28e
								
							
						
					
					
						commit
						ffd2b58f0c
					
				@ -11,7 +11,7 @@ class Token
 | 
				
			|||||||
   * @param timestamp $expire expiration time
 | 
					   * @param timestamp $expire expiration time
 | 
				
			||||||
   * @return String token
 | 
					   * @return String token
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
  public static function new($id, $data, $expire)
 | 
					  public static function add($id, $data, $expire)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    global $mysqli;
 | 
					    global $mysqli;
 | 
				
			||||||
    $salt = uniqid(mt_rand(), true);
 | 
					    $salt = uniqid(mt_rand(), true);
 | 
				
			||||||
 | 
				
			|||||||
@ -251,7 +251,7 @@ class User
 | 
				
			|||||||
            if (isset($_POST['remember'])&&$_POST['remember'])
 | 
					            if (isset($_POST['remember'])&&$_POST['remember'])
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
              $year = strtotime('+356 days', time());
 | 
					              $year = strtotime('+356 days', time());
 | 
				
			||||||
              $token = Token::new($id, 'remember', $year);
 | 
					              $token = Token::add($id, 'remember', $year);
 | 
				
			||||||
              setcookie('token', $token, $year, "/");
 | 
					              setcookie('token', $token, $year, "/");
 | 
				
			||||||
              setcookie('user', $id, $year, "/");
 | 
					              setcookie('user', $id, $year, "/");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -283,7 +283,7 @@ class User
 | 
				
			|||||||
      $year = strtotime('+356 days', time());
 | 
					      $year = strtotime('+356 days', time());
 | 
				
			||||||
      unset($_COOKIE['token']);
 | 
					      unset($_COOKIE['token']);
 | 
				
			||||||
      $_SESSION['user'] = $id;
 | 
					      $_SESSION['user'] = $id;
 | 
				
			||||||
      $token = Token::new($id, 'remember', $year);
 | 
					      $token = Token::add($id, 'remember', $year);
 | 
				
			||||||
      setcookie('token', $token, $year);
 | 
					      setcookie('token', $token, $year);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
@ -482,7 +482,7 @@ class User
 | 
				
			|||||||
    $id = $query->fetch_assoc()['id'];    
 | 
					    $id = $query->fetch_assoc()['id'];    
 | 
				
			||||||
    $time = strtotime('+1 day', time());
 | 
					    $time = strtotime('+1 day', time());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $token = Token::new($id, 'passwd', $time);
 | 
					    $token = Token::add($id, 'passwd', $time);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $link = WEB_URL."/admin/?do=lost-password&id=$id&token=$token";
 | 
					    $link = WEB_URL."/admin/?do=lost-password&id=$id&token=$token";
 | 
				
			||||||
    $to      = $email;
 | 
					    $to      = $email;
 | 
				
			||||||
@ -507,7 +507,7 @@ class User
 | 
				
			|||||||
    $time = strtotime('+1 day', time());
 | 
					    $time = strtotime('+1 day', time());
 | 
				
			||||||
    $id = $this->id;
 | 
					    $id = $this->id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $token = Token::new($id, 'email;$email', $time);
 | 
					    $token = Token::add($id, 'email;$email', $time);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $link = WEB_URL."/admin/?do=change-email&id=$id&token=$token";
 | 
					    $link = WEB_URL."/admin/?do=change-email&id=$id&token=$token";
 | 
				
			||||||
 | 
				
			|||||||
@ -83,7 +83,8 @@ if(isset($_POST['server']) && empty($message))
 | 
				
			|||||||
	$array = explode(";", $sql);
 | 
						$array = explode(";", $sql);
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	foreach ($array as $value) {
 | 
						foreach ($array as $value) {
 | 
				
			||||||
		if (empty(trim($value)))
 | 
							$val = trim($value);
 | 
				
			||||||
 | 
							if (empty($val))
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user