Wiki + phpBB3 users

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php|uber.leet Forum Index // How do I?
View previous topic :: View next topic  
Author Message
bennelsworth



Joined: 19 May 2008
Posts: 2

PostPosted: Mon May 19, 2008 5:51 am    Post subject: Wiki + phpBB3 users Reply with quote
Thanks for making the "PHPBB/Users_Integration" mod, very handy!

I have a question though, for the first few days of my wiki, the username were handled by wiki untill i added this mod to use the forum users.

I am having the problem with the capitalisation in the middle of usernames which you know wrote about in your changelog.

Thing is, on my forum, by default, only standard username are allowed (lowercase, uppercase and numerics). There is a username which is "UserName" with a capital mid way, i noticed you used php's ucfirst function to format the usernames in your Auth_phpbb.php script and i can understand that. But before i had this mod, i did have a user registered as "UserName" and wiki allowed it, so i tried to edit your script to also allow it, but because you use the username_clean column the names are all lowercase anyway. So i tried to use just the username column instead (since usernames are pretty much clean) and take out the ucfirst function - but when a user logs in now you get "Login error:
You have not specified a valid user name.". I'm guessing this is wikis error because its not in your script - which is what is majoryly confusing me, the username is no different - exact same as from before the mod was installed and after it was installed.

If you can make any sence of what i just said, do you recon its possible to edit your script so that people with usernames such as "UserName" can log in as that and not "Username"? Remember the usernames are clean by default so there wont be any [] tpye characters to annoy wiki.

Thanks alot!
Back to top
View user's profile Send private message
root
Site Admin


Joined: 24 Jun 2005
Posts: 471

PostPosted: Mon May 19, 2008 9:03 am    Post subject: Reply with quote
I do remember the choice to use ucfirst came after many hours of trial and error. And as you can see removing it causes a failed login. Smile But I think

ucfirst("myName") == "MyName"

So your error might be caused by something else. I'd keep messing with editing the script to get it to work. I am sure you will find what you are looking for.
Back to top
View user's profile Send private message
bennelsworth



Joined: 19 May 2008
Posts: 2

PostPosted: Mon May 19, 2008 10:42 am    Post subject: Reply with quote
Ooo that is interesting, if i keep the ucfirst in but change all the username_cleans to username then it works fine on usernames such as "Username", but as soon as it becomes "UserName" it calls it invalid again.

Since ive only just started wiki i am still working my way around it and finding out how it works but to save me time i was wondering if you know what file(s) the log in screen is handled in? I have a feeling something is happening between submitting the form and your script getting the usernames.

Thanks!
Back to top
View user's profile Send private message
root
Site Admin


Joined: 24 Jun 2005
Posts: 471

PostPosted: Wed May 21, 2008 2:12 pm    Post subject: Reply with quote
If you look at the html in your browser you should be able to trace which file you are posting to and then from there trace down the info you are looking for. I remember seeing something in "includes\SpecialUserlogin.php" myself.
Back to top
View user's profile Send private message
Isb1009



Joined: 12 Jul 2008
Posts: 5

PostPosted: Sat Jul 12, 2008 5:23 am    Post subject: Fix to this problem Reply with quote
I've found what the problem is, and have fixed it. I've changed few things, only some username_clean to username.

If you want the changed file, please tell me how to send you the fixed Auth_phpBB.php file.


See you! Wink
Back to top
View user's profile Send private message
root
Site Admin


Joined: 24 Jun 2005
Posts: 471

PostPosted: Mon Jul 14, 2008 12:10 pm    Post subject: Reply with quote
Could you explain what you changed and why it works with the changes you made?
Back to top
View user's profile Send private message
Isb1009



Joined: 12 Jul 2008
Posts: 5

PostPosted: Mon Jul 14, 2008 12:38 pm    Post subject: Reply with quote
I only made the following changes (diff code):
Code:
--- Auth_phpBB.php   2008-07-14 22:18:04.769367500 +0200
+++ Auth_phpBB.php   2008-07-12 14:47:39.914146500 +0200
@@ -493,7 +493,7 @@
             $username = $this->utf8($username); // Convert to UTF8
 
           // Check Database for username. We will return the correct casing of the name.
-          $fstrMySQLQuery = sprintf("SELECT `username_clean`
+          $fstrMySQLQuery = sprintf("SELECT `username`
                              FROM `%s`
                              WHERE `username_clean` = '%s'
                                LIMIT 1",
@@ -506,7 +506,7 @@
 
             while($faryMySQLResult = mysql_fetch_assoc($fresMySQLResult))
             {
-                return ucfirst($faryMySQLResult['username_clean']);
+                return ucfirst($faryMySQLResult['username']);
             }
 
             // At this point the username is invalid and should return just as it was passed.
@@ -536,7 +536,7 @@
             $username = $this->utf8($user->mName); // Convert to UTF8
 
           // Check Database for username and email address.
-          $fstrMySQLQuery = sprintf("SELECT `username_clean`, `user_email`
+          $fstrMySQLQuery = sprintf("SELECT `username`, `user_email`
                              FROM `%s`
                              WHERE `username_clean` = '%s'
                                LIMIT 1",


What happened is that phpBB saves a lower-case version of the username in username_clean, not the correct-case username. These changes are for choosing the correct capitalisation and it still converts the first letter to a capital, so not many changes were made.


Cheers! Wink
Back to top
View user's profile Send private message
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php|uber.leet Forum Index // How do I? All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

alexisBlue v1.2 // Theme Created By: Andrew Charron and Web Hosting Bluebook
Powered by phpBB © 2001, 2002 phpBB Group