From 9502d03c981be6e0102c826bb6d85403bca0494f Mon Sep 17 00:00:00 2001 From: Aaron Junker Date: Mon, 14 Sep 2020 19:09:15 +0200 Subject: [PATCH] push --- CHANGELOG.md | 1 + site/admin/login.php | 2 +- site/install/step2.php | 8 +++----- site/lang/en-en.json | 7 ++++++- site/login/changepass.php | 5 ++--- site/login/login.php | 2 +- site/login/register.php | 2 +- site/profile.php | 2 +- site/siteelements/header.php | 16 ++++++++-------- 9 files changed, 24 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a7e22e15..a5c2b511b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ This is a release Candidate version. Issues will be tracked in #49 * Moved blogsite, index and HTTP-Errors to page.php * Added all translations * Updated files to new code conventions +* Changed de.gravatar.com to gravatar.com ## Removed * Removed is_there_usoc.json * /errors/* diff --git a/site/admin/login.php b/site/admin/login.php index e8007bbab..8d1acce03 100644 --- a/site/admin/login.php +++ b/site/admin/login.php @@ -12,7 +12,7 @@ $_POST["B"] = $_SESSION['temp_User_Name']; } while ($zeile = mysqli_fetch_array( $db_erg, MYSQLI_ASSOC)){ - if((strtolower($_POST["B"])==strtolower($zeile["Username"])||strtolower($_POST["B"])==strtolower($zeile["Mail"]))&&(@password_hash($_POST["P"],PASSWORD_DEFAULT,["salt"=>getSetting("login.salt")])==$zeile["Password"]||isset($_SESSION["code"])) ){ + if((strtolower($_POST["B"])==strtolower($zeile["Username"])||strtolower($_POST["B"])==strtolower($zeile["Mail"]))&&(password_verify($_POST["P"],$zeile["Password"])||isset($_SESSION["code"]))){ $login = True; $user_id = $zeile["Id"]; $user_name = $zeile["Username"]; diff --git a/site/install/step2.php b/site/install/step2.php index 54443a67f..52af5b8ec 100644 --- a/site/install/step2.php +++ b/site/install/step2.php @@ -14,15 +14,14 @@ echo "Can't connect to Database."; exit("Error!"); } - $salt = substr(str_shuffle(str_repeat(implode('', range('!','z')), $length)), 0, 25); - $pass = password_hash($_POST["Pass"],PASSWORD_DEFAULT,["salt"=>$salt]); + $pass = password_hash($_POST["Pass"],PASSWORD_DEFAULT); $Name = $_POST["Name"]; $Author = $_POST["Author"]; $lang = $_POST["Lang"]; $UserName = $_POST["UserName"]; $sql= <<Page offline\n

This page is no longer available.

", "error.410": "Gone. This resource is not longer here.", + "register": "register", + "register.g": "Register", "register.succeed": "Register succeeded", "register.closed": "Register closed", "blog.overwiew": "Blog overview", @@ -89,5 +93,6 @@ "admin.welcome": "Welcome!", "profile": "Profile", "profile.settings": "Profile settings", - "" + "profile.changePP": "Change profile picture on Gravatar.com", + "accessibility.skipnavigation": "Skip Navigation" } diff --git a/site/login/changepass.php b/site/login/changepass.php index 2736f2f61..9b2b221ac 100644 --- a/site/login/changepass.php +++ b/site/login/changepass.php @@ -11,7 +11,7 @@ $db_erg = mysqli_query( $db_link, $sql ); while ($zeile = mysqli_fetch_array( $db_erg, MYSQLI_ASSOC)) { - if(md5($zeile["Id"]) == $_SESSION['User_ID']&&$zeile["Password"]==password_hash($_POST["oldpass"],PASSWORD_DEFAULT,["salt"=>$U->getSetting("login.salt")])){ + if(md5($zeile["Id"]) == $_SESSION['User_ID']&&password_verify($_POST["oldpass"],$zeile["Password"])){ $passc = True; } } @@ -25,9 +25,8 @@ $passc = False; echo $U->getLang("login.changepass.fail"); } - echo $passc; if($passc){ - $sql = "UPDATE User SET password='".password_hash($_POST["oldpass"],PASSWORD_DEFAULT,["salt"=>$U->getSetting("login.salt")])."' WHERE Id='".$_SESSION['User_ID']."';"; + $sql = "UPDATE User SET password='".password_hash($_POST["newpass"])."' WHERE Id='".$_SESSION['User_ID']."';"; echo $sql; $db_erg = mysqli_query( $db_link, $sql ); } diff --git a/site/login/login.php b/site/login/login.php index 9efdb7819..508abd21b 100644 --- a/site/login/login.php +++ b/site/login/login.php @@ -12,7 +12,7 @@ $_POST["B"] = $_SESSION['temp_User_Name']; } while ($zeile = mysqli_fetch_array( $db_erg, MYSQLI_ASSOC)){ - if((strtolower($_POST["B"])==strtolower($zeile["Username"])||strtolower($_POST["B"])==strtolower($zeile["Mail"]))&&(@password_hash($_POST["P"],PASSWORD_DEFAULT,["salt"=>getSetting("login.salt")])==$zeile["Password"]||isset($_SESSION["code"])) ){ + if((strtolower($_POST["B"])==strtolower($zeile["Username"])||strtolower($_POST["B"])==strtolower($zeile["Mail"]))&&(password_verify($_POST["P"],$zeile["Password"])||isset($_SESSION["code"])) ){ $login = True; $user_id = $zeile["Id"]; $user_name = $zeile["Username"]; diff --git a/site/login/register.php b/site/login/register.php index 54d88806c..6e02a8c7c 100644 --- a/site/login/register.php +++ b/site/login/register.php @@ -41,7 +41,7 @@ $register = False; } if($register){ - $sql = 'INSERT INTO User (Username, Mail, Password, Type) VALUES ('."'".$_POST["U"]."'".','."'".$_POST["M"]."'".','."'".password_hash($_POST["P"],PASSWORD_DEFAULT,["salt"=>getSetting("login.salt")])."'".',0);'; + $sql = 'INSERT INTO User (Username, Mail, Password, Type) VALUES ('."'".$_POST["U"]."'".','."'".$_POST["M"]."'".','."'".password_hash($_POST["P"],PASSWORD_DEFAULT)."'".',0);'; if($db_erg = mysqli_query( $db_link, $sql )){ echo $U->getLang("register.succeed"); header("Location: ".$USOC["DOMAIN"]); diff --git a/site/profile.php b/site/profile.php index df80e83ea..a35ad2f65 100644 --- a/site/profile.php +++ b/site/profile.php @@ -45,7 +45,7 @@ function onSignIn(googleUser) { getPP(); ?> -

+

#maincontent">Skip navigation + }?>#maincontent">getLang("accessibility.skipnavigation"); ?> Logo

getSetting("site.name") ?>