Mariusz Muszyński 8 лет назад
Родитель
Сommit
e89bfafc3a

+ 1 - 1
SE/se-lib/Token.php

@@ -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) {

+ 6 - 2
SE/stuff/scripts/secureMysql/getPass.php

@@ -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 - 1
SE/stuff/scripts/secureMysql/login.sh

@@ -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