[BETA] Restrict Username

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
Makc666
Registered User
Posts: 358
Joined: Fri Mar 07, 2003 12:03 pm
Location: MSK-RU
Name: Maxim
Contact:

Post by Makc666 » Sun Jun 04, 2006 2:14 pm

Wo1f wrote: Greetings al!

Version 1.1.6a has been released. There are no changes in the code per say, this is a "tidy-up" release in preparation for a major release in the form of Restrict Username v1.1.7 [BETA].

Thank you all for your patience,

Regards,
Wolf

Finally I want to install this MOD.
I see that 1.1.7 us coming.
How long we have to wait for it?
Is it ok to install 1.1.6a for now and then upgrade to 1.1.7?
Will be there any problems or so - what do you think? :P

Wo1f
Registered User
Posts: 2039
Joined: Fri Jan 28, 2005 3:20 am

Post by Wo1f » Sun Jun 04, 2006 3:45 pm

Hi Makc666,

It won't be long now. I still need to make an adjustment to "User Shield RC2" (formaly part of "Restrict Username" and known as "Hide Username"), which is to complete the deletion process accurately by cleaning the "group" and the "user_groups" tables. This should be taken care of sometime today or tomorrow. Which means that all available time (which has been sparce in the past couple of months) I have within the next couple of weeks will be dedicated to completing "Restrict Username v1.1.7". I still need to implement a new feature for enabling username masks, as proposed by Arjay on page 5 of this thread. I know how I want to implement this one, so it should be fairly quick and painless, but I'm not a fast coder like some of the pro's here. :razz:

The changes from v1.1.6a to v1.1.7 are very important and dosen't allow me an upgrade path, so in answer to your question it's better to wait... unless you have a demo board with EayMOD then it becomes easy to install, de-install and reinstall as need be. Again, do not install v1.1.6 on a live board, as there will be no upgrade instruction file.

I'm counting on you to be one of the first in line to try it out when it's released. :wink:

Thanks for your interest!
Best regards,
Wolf

Rossco_
Registered User
Posts: 51
Joined: Wed May 17, 2006 12:32 pm

Post by Rossco_ » Mon Jun 26, 2006 8:52 am

Im trying to install this mod but im having some issues getting the sql to run, is there anything that needs changed to get it to run??

When attempte dto run through the php update page it totally fails, then when i try to run it through sql query analyzer i get 'COUNT field incorrect or syntax error'

What gives guys??

Im running the latest version of phpBB (.21)

Wo1f
Registered User
Posts: 2039
Joined: Fri Jan 28, 2005 3:20 am

Post by Wo1f » Mon Jun 26, 2006 5:10 pm

Hi Roscoe,

I just did a new virgin phpbb2 v2.0.21 install, then installed EasyMod and ran the installation file from the installation package, downloaded from the link in the first post. I had not done this for v2.0.21 as I'm now working on Restrict Username v1.1.7.
Wo1f wrote: The changes from v1.1.6a to v1.1.7 are very important and dosen't allow me an upgrade path, so in answer to your question it's better to wait... unless you have a demo board with EayMOD then it becomes easy to install, de-install and reinstall as need be. Again, do not install v1.1.6 on a live board, as there will be no upgrade instruction file.



Results

Installation with EasyMod v0.3.0 was flawless including processing of database modifications. Then I manually deleted all new database entries created by EasyMod and launched the installer file for those not using EM.

This file --> update_restrict_username_config_v1_1_6a.php, which was dropped in a newly created "install" folder off the root of my forum. I then launched it in my browser url field by typing the following:

http://mywebsite/phpbb/install/update_r ... 1_1_6a.php

which returned a successful confirmation screen. To make sure, I then reviewed database changes with phpMyAdmin, and all was modified according to the install file.


Conclusion

I can confirm that Restrict Username v1.1.6a [BETA] will install flawlessly using EasyMod, and I can also confirm that the installer file included in the download package to help those installing this mod manually will also modify the database accurately.


That said...

As I have mentionned to Makc666 one post above yours, I certainly hope you are not installing on a live board, and even more noteworthy, is that I will not be providing an upgrade path from v1.1.6a to v1.1.7 as changes are too extensive for me to contemplate doing this.

If you are looking to test it out on a test board, then by all means be specific as to the error message you received and what installation method you have used. A brief descriptioin of your forum environment (PHP and MySQL versions) would also be very helpful in identifying what may be stopping you from installing this mod successfully.

Let me know,
Wolf


Note: I know I've been promising v1.1.7 to be released soon and haven't delivered yet. I really am trying, but time constraints make it very difficult for me to put enough time aside to complete it at this moment. I am trying and certainly haven't given up on it. It will be released if it's the last thing I do. :lol:

I apologize for the delay...

shakey_1
Registered User
Posts: 58
Joined: Mon Jan 23, 2006 12:08 am

Post by shakey_1 » Mon Jun 26, 2006 10:55 pm

Hey Wo1f, thanks for the heads up. I was wondering what the status of this one was. Hoping it isn't the last thing that you do though... :lol:

Wo1f
Registered User
Posts: 2039
Joined: Fri Jan 28, 2005 3:20 am

Post by Wo1f » Mon Jun 26, 2006 11:23 pm

I wasen't dead err.... really serious about that you know. :lol:

User avatar
ZombieSlayer
Registered User
Posts: 951
Joined: Sun May 02, 2004 3:18 am
Location: California
Contact:

Post by ZombieSlayer » Tue Jun 27, 2006 2:01 am

Well the delay in release is a good thing as far as I'm concerned :) Looks like it will be coming out about the same time CH 2.1.6 is :)

Once the 2 are out (and I finish adapting my MOD) I will see if I can adapt it to work with CH 2.1.6 since I really like this MOD :)

Rossco_
Registered User
Posts: 51
Joined: Wed May 17, 2006 12:32 pm

Post by Rossco_ » Tue Jun 27, 2006 2:13 pm

Thanks for the reply mate, no i took the general advice and it was installed on a test board, after having no luck running the sql script i manually went in and added the items that were stated in the script, after doin that the mod appears to work rather well and does everything that i was hoping it would which is nice.

However whenever i click submit on the general admin/configuration page i get the same error that i was gettin when trying to execute the script, attached is a screen shot

Image

Im using php 4.4.2 and the latest phpbb, version 21 i think it is??

Any ideas??

Cheers

Rossco

Wo1f
Registered User
Posts: 2039
Joined: Fri Jan 28, 2005 3:20 am

Post by Wo1f » Wed Jun 28, 2006 3:51 pm

hmm... are you using MSSQL or Access as a database?

Rossco_
Registered User
Posts: 51
Joined: Wed May 17, 2006 12:32 pm

Post by Rossco_ » Thu Jun 29, 2006 9:28 am

MSSQL mate

Wo1f
Registered User
Posts: 2039
Joined: Fri Jan 28, 2005 3:20 am

Post by Wo1f » Thu Jun 29, 2006 3:12 pm

Just a few tidbits I found with Google. The second quoted paragraph is the one that I believe would most likely cause the error in your context.
Error description wrote: ODBC Error Code = 07001 (Wrong number of parameters)

[Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error

Hint: The cause of this error is usually that your query contains a reference to a field which does not exist. You should verify that the fields included in your query exist and that you have specified their names correctly.

Likely error cause wrote: However, should the text be
enclosed in single quotes (') and not in double quotes ("). At least
on SQL Server enclosing in double quotes produces an error.

Code: Select all

('username_default_unav', '% _ \" ( ) { } [ ] < > \' , \\\ / ! @ # $ ^ ? & * - + \  space'),
I substituted a few characters with their html entity equivalent. I'm of the mind that MSSQL is coughing up the quote. So try this variation by replacing the full line in the update file. You will also need to delete all manually created fields already in the database though (related to this MOD :wink: ). This will also confirm that all fields are created and populated without any more surprises. The html entities will be displayed properly if it goes through.

Code: Select all

('username_default_unav', '% _ " ( ) { } [ ] < > \' , \\\ / ! @ # $ ^ ? & * - + \  space'),

Hope this helps and let me know how you fare,
Wolf

Rossco_
Registered User
Posts: 51
Joined: Wed May 17, 2006 12:32 pm

Post by Rossco_ » Fri Jun 30, 2006 2:55 pm

Afraid not matey, now it coughs up this little gem

Error : [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '`'.PHP Warning: odbc_exec(): SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '`'., SQL state 37000 in SQLExecDirect in c:\inetpub\wwwroot\forum2\db\mssql-odbc.php on line 171

:(

Rossco_
Registered User
Posts: 51
Joined: Wed May 17, 2006 12:32 pm

Post by Rossco_ » Fri Jun 30, 2006 3:38 pm

Ok, heres the issue, MSSQL does not support the multiple value insert that you have used, im currently hunting about for a work around but it doesnt appear to be a well documented issue. I shall keep you updated

Rossco_
Registered User
Posts: 51
Joined: Wed May 17, 2006 12:32 pm

Post by Rossco_ » Fri Jun 30, 2006 4:15 pm

Right, after a bit of pi55ing about i made the equivalent MSSQL script, this runs fine and does all the things your script does :D so then i put it all into php and it all works fine, successful installation :D

Is there any other bits of code that this might fail on Wolf??

Code: Select all

<?php
/***************************************************************************
 *				install.php
 *			-------------------
 *   begin			: Saturday, May 27, 2006
 *   copyright		: (C) 2006 Wo1f
 *   email			:
 *
 *   $Id: install.php,v 1.1.6a 27/05/2006 12:00:00 Wo1f $
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   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.
 *
 ***************************************************************************/

if(substr(strrchr(dirname($HTTP_SERVER_VARS['PHP_SELF']), "/"), 1) != 'install')
{
	die('Please run this file from inside the /install directory!');
}

define('IN_PHPBB', true);
$phpbb_root_path = './../';

include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

$sql = "ALTER TABLE phpbb_users ALTER COLUMN username VARCHAR( 99 ) NOT NULL";

if ( !$db->sql_query($sql))
{
	$error = $db->sql_error();
	echo('<b style="color: red;">Error : </b>' . $error['message']);
}
else
{
	$sql = "INSERT INTO phpbb_config (config_name, config_value)
	SELECT 'username_activate','1'
	UNION ALL
	SELECT 'username_hide_inac','1'
	UNION ALL
	SELECT 'username_allow_nums','0'
	UNION ALL
	SELECT 'username_allow_xchars','0'
	UNION ALL
	SELECT 'username_allow_rchars','0'
	UNION ALL
	SELECT 'username_min_char','4'
	UNION ALL
	SELECT 'username_max_char','25'
	UNION ALL
	SELECT 'username_default_unav','% _ " ( ) { } [ ] < > \ , \\\ / ! @ # $ ^ ? & * - + \ space'
	UNION ALL
	SELECT 'username_current_rchars', '~ . : | ='
	UNION ALL
	SELECT 'username_default_rchars', '~ . : | =';";

	if ( !$db->sql_query($sql))
	{
		$error = $db->sql_error();
		echo('<b style="color: red;">Error : </b>' . $error['message']);
	}
	else
	{
		echo('<b style="color: green;">Successful Installation!!!</b><p />Now Please delete this file and the /install folder!');
	}
}
?>
Cheers

Rossco

Wo1f
Registered User
Posts: 2039
Joined: Fri Jan 28, 2005 3:20 am

Post by Wo1f » Fri Jun 30, 2006 4:37 pm

Rossco_ wrote: Right, after a bit of pi55ing about i made the equivalent MSSQL script, this runs fine and does all the things your script does :D so then i put it all into php and it all works fine, successful installation :D



8O

You daman Rossco_! n1 dude.

I'll update the package with this info for those specifically using MSSQL. Which brings me to hold you responsible to test the MSSQL database installation file for Restrict Username v1.1.7 :lol:

Can I count on your participation?

Rossco_ wrote: Is there any other bits of code that this might fail on Wolf??

I would not be able to confirm one way or another as I can't test this myself, but if the data is populating the DB as you've just confirm, I just don't see how this could create problems elsewhere.


Many thanks for your solution and I hope you'll be around to help me out with this on the next release.

Regards,
Wolf

Post Reply

Return to “[2.0.x] MODs in Development”