Wiki login issues

English support forum

Moderators: white, Hacker, petermad, Stefan2

pplupo
Member
Member
Posts: 102
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Wiki login issues

Post by *pplupo »

I feel I'm double-posting. I saw this 6 years old thread viewtopic.php?f=3&t=8779 and posted it there, but since I got no help I couldn't stop wondering if people were avoiding it because I unburied something too old.
So here it goes... It's exactly the same issue. At the top of the page I can see:

Code: Select all

User name not found or forbidden characters in user name error
Right above the username field, there is:

Code: Select all

Incorrect username or password entered.
Please try again.
However, my username doesn't have forbidden characters, as you can see. It's simply "pplupo".
My password doesn't have special characters either. It has numbers, lower and upper case letters only.

I have already tried changing the password. I have already cleared the cookies. I tried both logged in and logged out of the forum.

I cleared all ghisler* cookies.

I don't know what else I could try.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Wiki login issues

Post by *petermad »

I can add that I can log in to the wiki with my user name petermad, but NOT with other user names that I have here on the Total Commander forum.

So I wonder if it is only usernames of a certain age that works.

My petermad login, which is the oldest, is from 2003. The second oldest login I have is from 2007 - and that does not work with the Wiki.
Last edited by petermad on 2021-05-21, 16:12 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
pplupo
Member
Member
Posts: 102
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Re: Wiki login issues

Post by *pplupo »

Good, I'm not the only one. There is a bug, then. Thank you, petermad!

Maybe the username and password are not being copied to the wiki's table anymore. How was it done before? A trigger? Or was it phbb's code? Because if the wiki was set up to check the forum's table, it should still be working (unless the forum has a new login table for some reason).

Do you know how the integration is done? It has clearly stopped working.
pplupo
Member
Member
Posts: 102
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Re: Wiki login issues

Post by *pplupo »

Maybe this was being used:
https://www.mediawiki.org/wiki/Extension:PHPBB_Auth
Note that even though it's not supported anymore, it still worked in 2017. Your login from 2007 doesn't work anymore, but the latest working version is newer.
Maybe an update would make it work again.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Wiki login issues

Post by *petermad »

Do you know how the integration is done? It has clearly stopped working.
No.

I tried deleting all cookies, also the ones for this forum, butto no avail.

I also tried 5 other browsers, only once (in Chrome) I managed to login whith one of my other user names (from 2018), but after that one occasion, I can now also log in to the wiki as petermad.

Notice - ALL my logins works here on this board.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
pplupo
Member
Member
Posts: 102
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Re: Wiki login issues

Post by *pplupo »

petermad wrote: 2021-05-21, 16:18 UTC
Do you know how the integration is done? It has clearly stopped working.
No.

I tried deleting all cookies, also the ones for this forum, butto no avail.

I also tried 5 other browsers, only once (in Chrome) I managed to login whith one of my other user names (from 2018), but after that one occasion, I can now also log in to the wiki as petermad.

Notice - ALL my logins works here on this board.
I don't want to start creating other logins to see if I can get one to work. Do you have any suggestions?
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Wiki login issues

Post by *petermad »

Do you have any suggestions
No - we need to have Ghisler to look into it - at least now he knows to test with different logins.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
pplupo
Member
Member
Posts: 102
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Re: Wiki login issues

Post by *pplupo »

petermad wrote: 2021-05-21, 21:09 UTC
Do you have any suggestions
No - we need to have Ghisler to look into it - at least now he knows to test with different logins.
Do you know how to call his attention to this? I wish I could contribute to the wiki.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Wiki login issues

Post by *Hacker »

pplupo,
Christian reads everything here.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
pplupo
Member
Member
Posts: 102
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Re: Wiki login issues

Post by *pplupo »

Hacker wrote: 2021-05-21, 22:53 UTC pplupo,
Christian reads everything here.

Roman
ok, cool :-)
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Wiki login issues

Post by *DrShark »

I have only 1 account, and what I experience might not be directly related to a problem described in this topic but I have to say it's not that simple about ghisler.ch wiki user and password as "forum user have to use own forum password to log in on wiki". Some time ago (actually years ago) I have reset my forum account password (with subsequent manual password change), but it seems that didn't change the password on wiki, so now I have different passwords of forum and wiki (which is actually better and more secure). But I can login only to English language wiki, neither password works for German language wiki. I'm not sure whether it is related to that password reset event - I haven't tried to login on German wiki before, but currently the it shows me an error:
Der Benutzername oder das Passwort ist falsch.
Bitte versuche es erneut.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: Wiki login issues

Post by *tuska »

I found this information:
But I was also unable to log in (Wiki German/English) - despite the deletion of cookies.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Wiki login issues

Post by *petermad »

2DrShark
Some time ago (actually years ago) I have reset my forum account password (with subsequent manual password change), but it seems that didn't change the password on wiki, so now I have different passwords of forum and wiki (which is actually better and more secure)
I have never changed my password for the TC Forum accounts with which I cannot login to the Wiki.

It looks more like the account names/passwords from the forum are not all transferred correctly to the Wiki's database.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Wiki login issues

Post by *DrShark »

petermad wrote: 2021-05-22, 10:49 UTCIt looks more like the account names/passwords from the forum are not all transferred correctly to the Wiki's database.
I have now also tried the password from forum account reset email which I got years ago (I then changed it to different one on forum manually) on the German wiki, and it doesn't work there either, so I wonder if my account even exists in German wiki database...

BTW, the password which was sent in a reset email was in the plain text, which is not considered as a good security practice. I got it before the GDPR law was "implemented", so something could change regarding passwords storing policy on ghisler.ch which could also affect wiki connection with new forum accounts
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wiki login issues

Post by *ghisler(Author) »

I have checked this now, and apparently a lot has changed in the forum software. The login via phpbb worked like this:
- first, it checked whether there was already a wiki account.
- if not, it checked via calls to phpbb whether the user exists, and the password is correct.
- it then created a new wiki account for that user

The password check was completely outdated, so it could only allow users who already had a wiki account before the process was updated.

I have now modified AuthPhpbb.php to work with current phpbb. Please try logging in now!
Here is the modified source code:

Code: Select all

<?php
# Changed by Christian Ghisler, 23.5.2021:
# Support for phpbb 3.3, checkk password via passwords_manager->check
# Changed by Christian Ghisler, 10.6.2013:
# User account must be enabled
# User account must be older than 2 weeks
# User must have at least 1 forum post
# 
# Copyright (C) 2004 Brion Vibber <brion@pobox.com>
# http://www.mediawiki.org/
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or 
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# http://www.gnu.org/copyleft/gpl.html

define('IN_PHPBB', true);
$phpbb_root_path = '../board/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require_once($phpbb_root_path . 'config.php');

include($phpbb_root_path . 'common.' . $phpEx);
global $request;
$request->enable_super_globals();

class PHPbbAuth extends AuthPlugin {
	function PHPbbAuth() {
		$sqlrow	= 0;
	}

	function queryPhpbbMysql($username) {
		global $dbhost, $dbuser, $dbpasswd, $dbname, $table_prefix;

		$link = mysqli_connect($dbhost,$dbuser,$dbpasswd,$dbname);
		if (mysqli_connect_errno())
		{
			print "Failed to connect to MySQL: " . mysqli_connect_error();
		}

		//mysql_select_db($dbname, $link) or die( "Unable to select user database for phpbb authentication" . 
	        //  $dbhost . "," . $dbuser . "," . $dbpasswd . "," . $dbname );
		$query="SELECT * FROM " . $table_prefix . "users WHERE LOWER(username) =
			'" . strtolower($username) . "'";
	      	$result = mysqli_query($link, $query);
		$sqlrow = 0;
		if($result)
		{
			$sqlrow = mysqli_fetch_array($result);
			mysqli_free_result($result);
		}
		mysqli_close($link);
		if ($sqlrow['username']=='') {
			print "User name not found or forbidden characters in user name!";
			return null;
		}
		if ($sqlrow['user_type']==1) {
			print "Account is disabled, sorry!";
			return null;
		}

		if ($sqlrow['user_posts']==0) {
			print "Only users with at least one post in the forum are allowed to write here!";
			return null;
		}

		$user_age = time() - $sqlrow['user_regdate'];
		if ($user_age) {
			if ($user_age<=86400*14) {
				print "Account too young, you must be registered for 14 days or more!";
				return null;
			}
		}
		return $sqlrow;
	}

	/**
	 * Check whether there exists a user account with the given name.
	 * The name will be normalized to MediaWiki's requirements, so
	 * you might need to munge it (for instance, for lowercase initial
	 * letters).
	 *
	 * @param string $username
	 * @return bool
	 * @access public
	 */
	function userExists( $username ) {
		# Override this!
		$sqlrow=$this->queryPhpbbMysql($username);
		if ($sqlrow)
			return true;
		return false;
	}
	
	/**
	 * Check if a username+password pair is a valid login.
	 * The name will be normalized to MediaWiki's requirements, so
	 * you might need to munge it (for instance, for lowercase initial
	 * letters).
	 *
	 * @param string $username
	 * @param string $password
	 * @return bool
	 * @access public
	 */
	function authenticate( $username, $password ) {
		# Override this!
		global $phpbb_container,$phpbb_root_path,$phpEx,$user,$request,$auth;
		$sqlrow=$this->queryPhpbbMysql($username);
		if ($sqlrow) {
			$request->enable_super_globals();
			$passwords_manager = $phpbb_container->get('passwords.manager');
			if ($passwords_manager->check($password, $sqlrow['user_password']))
				return true;
		}
		return false;
	}
	
	/**
	 * Return true if the wiki should create a new local account automatically
	 * when asked to login a user who doesn't exist locally but does in the
	 * external auth database.
	 *
	 * If you don't automatically create accounts, you must still create
	 * accounts in some way. It's not possible to authenticate without
	 * a local account.
	 *
	 * This is just a question, and shouldn't perform any actions.
	 *
	 * @return bool
	 * @access public
	 */
	function autoCreate() {
		return true;
	}
	
	/**
	 * Return true to prevent logins that don't authenticate here from being
	 * checked against the local database's password fields.
	 *
	 * This is just a question, and shouldn't perform any actions.
	 *
	 * @return bool
	 * @access public
	 */
	function strict() {
		return false;     // otherwise requesting a new password doesn't work
	}
	
	/**
	 * When creating a user account, optionally fill in preferences and such.
	 * For instance, you might pull the email address or real name from the
	 * external user database.
	 *
	 * The User object is passed by reference so it can be modified; don't
	 * forget the & on your function declaration.
	 *
	 * @param User $user
	 * @access public
	 */
	function initUser( &$user, $autocreate = false ) {
		$sqlrow=$this->queryPhpbbMysql($user->mName);
		if ($sqlrow) {
			$mail = $sqlrow['user_email'];
			$user->mEmail = $mail;
		}
	}

	public function allowPasswordChange() {
		return false;
	}

	public function allowSetLocalPassword() {
		return false;
	}

	public function updateExternalDB( $user ) {
		return true;
	}
}


?>
Author of Total Commander
https://www.ghisler.com
Post Reply