[GH-ISSUE #144] Password Change not workin #93

Closed
opened 2026-02-28 01:20:56 +03:00 by kerem · 3 comments
Owner

Originally created by @righter83 on GitHub (Apr 4, 2017).
Original GitHub issue: https://github.com/tuxis-ie/nsedit/issues/144

Hi

I'm not able to change the password via "About Me".
I got no error in logs but after submit the form, there is still the old PW in the SQLite3-DB.
If i change it via "Users" tab it is workin. I see also in the nsedit logfile, that there is no username, but I can see the username in the form:

via About Me:
Updating password and/or settings for . Admin: 1

via Users:
Updating password and/or settings for admin. Admin: 1

Originally created by @righter83 on GitHub (Apr 4, 2017). Original GitHub issue: https://github.com/tuxis-ie/nsedit/issues/144 Hi I'm not able to change the password via "About Me". I got no error in logs but after submit the form, there is still the old PW in the SQLite3-DB. If i change it via "Users" tab it is workin. I see also in the nsedit logfile, that there is no username, but I can see the username in the form: via About Me: `Updating password and/or settings for . Admin: 1` via Users: `Updating password and/or settings for admin. Admin: 1`
kerem closed this issue 2026-02-28 01:20:57 +03:00
Author
Owner

@righter83 commented on GitHub (Apr 6, 2017):

I found the problem.
You send the emailadress instead of the id.
I've patched it the following way in includes/misc.php in function update_user:

if (is_numeric($id))
    {
        $q = $db->prepare('SELECT * FROM users WHERE id = ?');
        $q->bindValue(1, $id, SQLITE3_INTEGER);
        $result = $q->execute();
        $userinfo = $result->fetchArray(SQLITE3_ASSOC);
        $q->close();
        $username = $userinfo['emailaddress'];
    }
    else
    {
        $q = $db->prepare('SELECT * FROM users WHERE emailaddress = ?');
        $q->bindValue(1, $id, SQLITE3_TEXT);
        $result = $q->execute();
        $userinfo = $result->fetchArray(SQLITE3_ASSOC);
        $q->close();
        $username = $id;
        $id = $userinfo['id'];
    }
<!-- gh-comment-id:292177032 --> @righter83 commented on GitHub (Apr 6, 2017): I found the problem. You send the emailadress instead of the id. I've patched it the following way in includes/misc.php in function update_user: ``` if (is_numeric($id)) { $q = $db->prepare('SELECT * FROM users WHERE id = ?'); $q->bindValue(1, $id, SQLITE3_INTEGER); $result = $q->execute(); $userinfo = $result->fetchArray(SQLITE3_ASSOC); $q->close(); $username = $userinfo['emailaddress']; } else { $q = $db->prepare('SELECT * FROM users WHERE emailaddress = ?'); $q->bindValue(1, $id, SQLITE3_TEXT); $result = $q->execute(); $userinfo = $result->fetchArray(SQLITE3_ASSOC); $q->close(); $username = $id; $id = $userinfo['id']; } ```
Author
Owner

@Kraeutergarten commented on GitHub (Apr 21, 2017):

I can confirm this bug.

<!-- gh-comment-id:296189303 --> @Kraeutergarten commented on GitHub (Apr 21, 2017): I can confirm this bug.
Author
Owner

@tuxis-ie commented on GitHub (Apr 28, 2017):

This is fixed in 6be5f2f29c

<!-- gh-comment-id:297972363 --> @tuxis-ie commented on GitHub (Apr 28, 2017): This is fixed in 6be5f2f29c48756017d29c867f64ffe395a2d995
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nsedit#93
No description provided.