NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Commit

[Web] Fix password issue on first login when adding new admin

4d5ebafc
andryyy <[email protected]> 4 years, 11 months ago
data/web/inc/functions.admin.inc.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Diff

diff --git a/data/web/inc/functions.admin.inc.php b/data/web/inc/functions.admin.inc.php
index af1474cd..9f42fd72 100644
--- a/data/web/inc/functions.admin.inc.php
+++ b/data/web/inc/functions.admin.inc.php
@@ -15,8 +15,8 @@ function admin($_action, $_data = null) {
   !isset($_data_log['password2']) ?: $_data_log['password2'] = '*';
   switch ($_action) {
     case 'add':
-      $username		= strtolower(trim($_data['username']));
-      $password		= $_data['password'];
+      $username   = strtolower(trim($_data['username']));
+      $password   = $_data['password'];
       $password2  = $_data['password2'];
       $active     = intval($_data['active']);
       if (!ctype_alnum(str_replace(array('_', '.', '-'), '', $username)) || empty ($username) || $username == 'API') {
@@ -51,7 +51,7 @@ function admin($_action, $_data = null) {
       if (password_check($password, $password2) !== true) {
         return false;
       }
-      $password_hashed = hash_password($password_new);
+      $password_hashed = hash_password($password);
       $stmt = $pdo->prepare("INSERT INTO `admin` (`username`, `password`, `superadmin`, `active`)
         VALUES (:username, :password_hashed, '1', :active)");
       $stmt->execute(array(