From 535f13c1846dc9a18e57ad84a3dbbb7983f022b0 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Tue, 2 Jul 2013 10:38:23 +0200 Subject: [PATCH] Fixing PHP Warnings in Registration page * Fix API Key generation not using SALT when creating hash * This should not affect existing API keys since hashes are compared * Fix PHP Warning for RECAPTCHA if disabled Fixes #328 --- public/include/classes/user.class.php | 2 +- public/templates/mmcFE/register/default.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/include/classes/user.class.php b/public/include/classes/user.class.php index 07cf6107..bbce3571 100644 --- a/public/include/classes/user.class.php +++ b/public/include/classes/user.class.php @@ -449,7 +449,7 @@ class User { $this->setErrorMessage( 'Invalid PIN' ); return false; } - $apikey = hash("sha256",$username.$salt); + $apikey = hash("sha256",$username.$this->salt); if ($this->mysqli->query("SELECT id FROM $this->table LIMIT 1")->num_rows > 0) { $stmt = $this->mysqli->prepare(" INSERT INTO $this->table (username, pass, email, pin, api_key) diff --git a/public/templates/mmcFE/register/default.tpl b/public/templates/mmcFE/register/default.tpl index 94cdf0f8..3316dfa9 100644 --- a/public/templates/mmcFE/register/default.tpl +++ b/public/templates/mmcFE/register/default.tpl @@ -10,7 +10,7 @@ Email: Email Repeat: PIN: (4 digit number. Remember this pin!) - {nocache}{$RECAPTCHA}{/nocache} + {nocache}{$RECAPTCHA|default:""}{/nocache}