@@ -44,7 +44,7 @@ class Token {
public function verify($hash) {
if (($hash === $this->genHash($this->token)) || ($hash === $this->genHash($this->token, true))) return $this->passwd;
- return "ThisAttemptHasBeenLogged";
+ return null;
}
public function getHash($token) {
@@ -12,8 +12,12 @@ try {
$token = $tokenObj->genToken();
error_log($token);
$hash = readline();
- echo $tokenObj->verify($hash);
+ if ($pass = $tokenObj->verify($hash)) echo "{$pass} -D " . Config::getConfFile('default_db')['database'];
+ else {
+ error_log("This attempt has been logged");
+ echo ".";
+ }
} catch (Exception $e) {
- echo "Unknown error";
+ error_log("Unknown error");
?>
@@ -1,3 +1,3 @@
#!/bin/sh
-mysql -uroot -p$(./getPass.php) 2>/dev/null || echo "Login error"
+mysql -uroot -p$(./getPass.php) 2>/dev/null