/**
  * Fetches the errors, returns it in JSON.
  *
  * @return _TestJsonStringClass
  */
 public static function Fetch()
 {
     if (!ErrorHandle::HasErrors()) {
         return false;
     }
     ErrorFetcher::$last_errors = ErrorFetcher::OutputError();
     return json_encode(ErrorFetcher::OutputError());
 }
 /**
  * Authenticates the users password and username, checking if it is valid and entered collectly.
  *
  * @param $username
  *
  * @param $password
  *
  * @return bool
  */
 public function Authenticate($username, $password)
 {
     if (!$this->UsernameValid($username)) {
         ErrorHandle::LogError("Username is Invalid", __CLASS__);
         return false;
     }
     $userid = $this->FindUserID($username);
     if ($this->ValidUser($userid)) {
         if (!$this->CheckPassword($password, $this->GetSalt($userid))) {
             ErrorHandle::LogError("Password is Invalid", __CLASS__);
             return false;
         }
         return true;
     }
     ErrorHandle::LogError("Could not complete this authentication request", __CLASS__);
     return false;
 }