Extension talk:ConfirmAccount/archive 1

Download link is busted. &#91;user:jldupont&#124;Jean-Lou Dupont] 21:44, 12 July 2007 (UTC)
 * I haven't yet uploaded it. It's only 1/3 done :) Aaron 21:49, 12 July 2007 (UTC)
 * Up now. Aaron 07:42, 15 July 2007 (UTC)

Query Error
I am getting an error that says, "ERROR 1101 (42000): BLOB/TEXT column 'acr_bio' can't have a default value" when trying to run the ConfirmAccount.sql query. I'm using MediaWiki version 1.10.0, PHP 5.2.3, and MySQL 5.0.41-community-nt.

Do you know how to correct this? I bet it's something simple as I'm very new at this. Thanks!

-Craig
 * You are probably in strict mode, either way, I've changed the code a tad for that. Aaron 06:26, 3 August 2007 (UTC)
 * Thanks, that worked. One more quewstion though (for now).  I am creating a private wiki where users have to be logged in to see any content and currently have "$wgGroupPermissions['*']['read'] = false;" The problem is that new users are not allowed to view the "Special:RequestAccount" page. Is there a way to set the permission for only this page? - Craig
 * Go to localsettings.php and add $wgWhitelistRead = array('Special:RequestAccount');. I might as well add it to the code. Aaron 19:10, 7 August 2007 (UTC)

No signup possible when extension is active
This extension sounds to be exactly what I was looking for. My problem is, that I don't get it working. In the moment, when I include the extension, the signup link is removed from the Special:Userlogin page. That seems to be the case because in SpecialConfirmAccount.php I read: $wgGroupPermissions['*']['createaccount'] = false; Okay, if I change this to true after including the extension, the extension is disabled, because everybody can create his account without confirmation. But what's the trick to get to some confirmation page? Do I have to modify SpecialUserlogin.php? --Rrosenfeld 16:35, 18 July 2007 (UTC)
 * The "create account" link is replaced with a "request one" link. See this test site for example. Aaron 19:00, 18 July 2007 (UTC)
 * That's what I expected, when I read the documentation and the code. My problem is, that the "request one" link does not appear and when I manually enter Special:RequestAccount this tells me that authentication is required.  I already added "Special:RequestAccount" and  "Spezial:RequestAccount" to $wgWhitelistRead, but this doesn't help. I see what you mean on your demo site, but cannot get this behavior on my one. --Rrosenfeld 20:01, 18 July 2007 (UTC)
 * What do you mean by "authentication is required". Is that what it actually says? Aaron 20:08, 18 July 2007 (UTC)
 * My fault was to try to enter "Special:RequestAccount" via the wiki search. This gives me "Login Required.  You must log in to view other pages.".  But if I enter Special:RequestAccount directly to the URL, I get the intended form and can register a new user.  One problem persists: The Special:RequestAccount link on Special:Userlogin is still missing. --Rrosenfeld 20:29, 18 July 2007 (UTC)
 * Ah, now I found a workaround: If I replace 'header' with 'link' in SpecialConfirmAccount.php function efAddRequestLoginText, the link to Special:RequestAccount is shown on my system. BTW: Is someone working on a German translation of this extension?  If not, I'll try one in the next days... --Rrosenfeld 20:55, 18 July 2007 (UTC)
 * Not that I know of. Submit a patch to bugzilla as a bug for de translations (and any else you can/want to do). Anyways, setting the header seems to work on the test site, maybe it only works on MW 1.10+. I may need some extra backwards-compatibility checking. Aaron 22:12, 18 July 2007 (UTC)
 * For the records: I'm using 1.10.1 --Rrosenfeld 07:02, 19 July 2007 (UTC)
 * Right, I checked, and headers for the login template were there too, and the hook my extension uses to set it. Not sure why it's not working for you. Aaron 07:51, 19 July 2007 (UTC)
 * In my case (MW 1.10.0), I found that the 'header' hook for plugins is missing from the userloginForm in template/Userlogin.php. Adding it fixes the problem, as does the workaround of changing 'header' to 'link' in SpecialConfirmAccount.php. --Jennis 13:03, 29 July 2007 (UTC)

Hi, hope anyone reads this :-) I'm still have the problem that the "request one" link does not appear. In addition to that, the following ist very strange to me: The Folder Name of the downloaded extension ist "Confirm Account" (containing a blank), the line of code one has to add in the LocalSettings.php is "include_once('extensions/ConfirmAccount/SpecialConfirmAccount.php');" - and there is no blank between "Confirm" and "Account"! So this path is wrong and that explaines why the extension does not work. But when i change the Foldername to "ConfirmAccount" the Main Page (index.php) of the Wiki does not show up - the browser shows only a white page.

Fatal error: Call to undefined method User::isPingLimitable extensions/ConfirmAccount/ConfirmAccount_body.php on line 216
I'm using MW 1.9.2 - cheers, Martin.
 * Hmmm, that functions was added in 1.10, I forgot. I'll have to find some way to do an existence check for 1.8-1.9 support. Aaron 19:14, 18 July 2007 (UTC)
 * OK, fixed. Aaron 19:21, 18 July 2007 (UTC)

German Translation
You'll find a first draft of a German translation at http://www.spinnaker.de/tmp/ConfirmAccount.i18n.php.txt (sorry, no idea, how to corretly file a bug report for this) --Rrosenfeld 11:08, 25 July 2007 (UTC)
 * OK, let me know when it's done :) Aaron 04:24, 30 July 2007 (UTC)
 * I just upgraded it to the current state of ConfirmAccount.i18n.php (r24385). --Rrosenfeld 12:46, 6 August 2007 (UTC)

Remove HTML code from confirmaccount-email-body[1-4]
I had some trouble with the accept/reject E-Mails, which contained HTML code (  and the like). --Rrosenfeld 11:12, 25 July 2007 (UTC)
 * This fixed on SVN a few days ago after a user pointed it out. Also, I did no a schema change with acr_rejected, so make sure yours is char(14) and not a boolean. I'll be marking this as stable after final code review, which is when people should be using extensions, otherwise things might change a bit. Aaron 10:27, 26 July 2007 (UTC)

Wishlist
I'm looking for a mechanism to send an information mail to the bureaucrats (or a subset of them?), that a new user registered and confirmed his e-mail. I'm not fully sure how to implement this, but it would hurt if someone waits for a long time in the queue without noticing him. As a workaround I could set up a cron job that sends out a list of all registered and not rejected account requests to the bureaucreats, but a mail just in time could be nicer. --Rrosenfeld 14:57, 25 July 2007 (UTC)

Send confirmemail to Administrator

 * Patch function sendConfirmationMail in /includes/user.php after row 2220

function sendConfirmationMail { global $wgContLang; $expiration = null; // gets passed-by-ref and defined in next line. $url = $this->confirmationTokenUrl( $expiration ); $mEmailToConfim = $this->mEmail; global $wgEmergencyContact; $this->mEmail = $wgEmergencyContact; return $this->sendMail( wfMsg( 'confirmemail_subject' ), wfMsg( 'confirmemail_body', wfGetIP, $this->getName, $url, $wgContLang->timeanddate( $expiration, false ), $mEmailToConfim) ); }


 * Has the confirmation mail code above been successfully tested? I'm having problems with not receiving a notification email. I've tried changing my emergency contact email to a couple different accounts. --Estimmel 16:41, 8 August 2007 (UTC)


 * Patch confirmedittext + confirmemail_oncreate + confirmemail_body in /languages/messages/
 * German example MessagesDe.php in row 600

'confirmedittext'          => 'Ihre E-Mail-Adresse muß erst bestätigt werden, bevor Sie Inhalte bearbeiten können.',


 * German example: MessagesDe.php in row 2081

'confirmemail_oncreate'  => 'Eine E-Mail zur Bestätigung der E-Mail-Adresse wurde an den Administrator gesandt. Die Anmeldung kann erst erfolgen, wenn das Benutzerkonto aktiviert wurde. Dafür ist auch diese Bestätigung der E-Mail-Adresse notwendig.',


 * German example: MessagesDe.php from row 2091

'confirmemail_body'      => 'Hallo  -Administrator, jemand mit der IP-Adresse $1, hat eine Bestätigung der E-Mail-Adresse: $5 für das Benutzerkonto "$2" für   angefordert. Um die E-Mail-Funktion für (wieder) zu aktivieren und um zu bestätigen, dass dieses Benutzerkonto wirklich zu der E-Mail-Adresse: gehört, klick bitte folgenden Link in Deinem Browser: $3 Der Bestätigungscode ist bis $4 gültig. Wenn diese E-Mail-Adresse *NICHT* zu dem genannten Benutzerkonto gehört, klick den Link bitte *NICHT* an. --- : ',

Schema change
See r24472 on SVN, I've changed the db table. I'll be marking this as stable soon, and from then on, future schema changes will be done automatically and with update.php without breaking things ;) Aaron 18:00, 30 July 2007 (UTC)

Wikimedia.org
Would this extension be useful on the official website of wikimedia.org, it might be a good idea. 123.108.83.114 11:09, 5 August 2007 (UTC)

Send account request to Administrator
After a new user confirmed the e-mail of his account request, the administrator receive an e-mail notification about this pending request with a direct link to Special:ConfirmAccounts. Tested in english an german.

Patch function in extensions/ConfirmAccount/ConfirmAccount_body.php
function confirmEmailToken( $code ) { global $wgUser, $wgOut; # Confirm if this token is in the pending requests $name = $this->requestFromEmailToken( $code ); if( $name !== false ) { # Send mail to admin after e-mail has been confirmed global $wgEmergencyContact; $u = User::newFromName( $name, 'creatable' ); $u->setEmail( $wgEmergencyContact ); $title = Title::makeTitle( NS_SPECIAL, 'ConfirmAccounts' ); $url = $title->getFullUrl; $u->sendMail (wfMsg('requestaccount-email-subj-admin'),                               wfMsg('requestaccount-email-body-admin', $name, $url)); $this->confirmEmail( $name ); $wgOut->addWikiText( wfMsgHtml( 'request-account-econf' )); $wgOut->returnToMain; return; }               # Maybe the user confirmed after account was created... $user = User::newFromConfirmationCode( $code ); if( is_object( $user ) ) { if( $user->confirmEmail ) { $message = $wgUser->isLoggedIn ? 'confirmemail_loggedin' : 'confirmemail_success'; $wgOut->addWikiText( wfMsg( $message ) ); if( !$wgUser->isLoggedIn ) { $title = SpecialPage::getTitleFor( 'Userlogin' ); $wgOut->returnToMain( true, $title->getPrefixedText ); }                       } else { $wgOut->addWikiText( wfMsg( 'confirmemail_error' ) ); }               } else { $wgOut->addWikiText( wfMsg( 'confirmemail_invalid' ) ); }       }

Translation file
Get the translation file from rrosenfeld at http://www.spinnaker.de/tmp/ConfirmAccount.i18n.php.txt and extend the english and german section:

English section: 'requestaccount-email-subj-admin' => ' Request account', 'requestaccount-email-body-admin' => 'The account "$1" has request an account and is waiting for confirmation. The e-mail address has been confirmed. You can confirm the request here "$2".',

German section: 'requestaccount-email-subj-admin' => ' Antrag auf Account', 'requestaccount-email-body-admin' => 'Das Benutzerkonto "$1" hat einen Antrag auf einen Account gestellt. Die Emailadresse wurde bereits bestätigt. Du kannst den Antrag unter "$2" freischalten.',

regards --schweny 22:50, 13 August 2007 (UTC)

Version 1.8.1
I wanted to install the extension with V. 1.8.1

SpecialPage::getTitleFor

don't exist in SpecialPage for this version.

Instead of :

$title = SpecialPage::getTitleFor( 'ConfirmAccounts' );

try :

$title = Title::newFromText ('Special:ConfirmAccounts') ;

After confirm, it is User::createnew that is missing !

I added function createnew and newFromId in User.php :

static function newFromId( $id ) { $u = new User; $u->mId = $id; $u->mFrom = 'id'; return $u; } 	static function createNew( $name, $params = array ) { $user = new User; //		$user->load; $user->loadFromSession; if ( isset( $params['options'] ) ) { $user->mOptions = $params['options'] + $user->mOptions; unset( $params['options'] ); } 		$dbw = wfGetDB( DB_MASTER ); $seqVal = $dbw->nextSequenceValue( 'user_user_id_seq' ); $fields = array( 			'user_id' => $seqVal, 			'user_name' => $name, 			'user_password' => $user->mPassword, 			'user_newpassword' => $user->mNewpassword, //			'user_newpass_time' => $dbw->timestamp( $user->mNewpassTime ), 			'user_email' => $user->mEmail, 			'user_email_authenticated' => $dbw->timestampOrNull( $user->mEmailAuthenticated ), 			'user_real_name' => $user->mRealName, 			'user_options' => $user->encodeOptions, 			'user_token' => $user->mToken, 			'user_registration' => $dbw->timestamp( $user->mRegistration ) //			'user_editcount' => 0, 		); foreach ( $params as $name => $value ) { $fields["user_$name"] = $value; } 		$dbw->insert( 'user', $fields, __METHOD__, array( 'IGNORE' ) ); if ( $dbw->affectedRows ) { $newUser = User::newFromId( $dbw->insertId ); } else { $newUser = null; } 		return $newUser; }

It seems to work now ! except that when your enter a bad email, you can't reject it (nor accept) !

I tried to translate in french. It's not so good but it can help. See here : 

JZ 21:00, 18 August 2007 (UTC)


 * Bah, I just bumped the minimal version needed. Aaron 22:42, 18 August 2007 (UTC)


 * Thanks to you. It was not easy but now it works fine and it is very useful ! JZ 17:45, 20 August 2007 (UTC)

Extension don't work in opera/IE
When I press "Request account" button in Opera/IE/Konqueror page only reloads and nothing happens (I'm using latest version of MediaWiki).

What do you think about this ugly bug?
 * Works fine for me. Aaron 19:23, 26 August 2007 (UTC)
 * Very interesting... ;) I'm checked the source and found that this line returns false:

$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) )
 * I have tested it in IE 5, Opera 9.23 (under linux), Konqueror 3.5.6 and Firefox 2.0.6. And only in Firefox all works fine :(
 * I fixed some fucked up non-XHTML valid html. Maybe it will work for you now. Either way, it worked on IE 7/Opera 9.2/FF 2.0.6 on me. Aaron 06:27, 27 August 2007 (UTC)