Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki

addNewAccount - additional coding

 

 

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded


a.v.a at home

Oct 13, 2008, 1:01 AM

Post #1 of 1 (328 views)
Permalink
addNewAccount - additional coding

Hi,

I am playing with the addNewAccount function in SpecialUserlogin.php.
The extra form fields that are created need to be e-mailed to a sysop
and it worked fine for a day, but the mails are not delivered anymore.
Could someone advice on what the problem might be (except for coding in
the core)?

---

function addNewAccount() {
global $wgUser, $wgEmailAuthentication;

# Create the account and abort if there's a problem doing so
$u = $this->addNewAccountInternal();
if( $u == NULL )
return;

# If we showed up language selection links, and one was in use, be
# smart (and sensible) and save that language as the user's
preference
global $wgLoginLanguageSelector;
if( $wgLoginLanguageSelector && $this->mLanguage )
$u->setOption( 'language', $this->mLanguage );

# Send out an email authentication message if needed
if( $wgEmailAuthentication && User::isValidEmailAddr(
$u->getEmail() ) ) {
global $wgOut;
$error = $u->sendConfirmationMail();
if( WikiError::isError( $error ) ) {
$wgOut->addWikiMsg( 'confirmemail_sendfailed',
$error->getMessage() );
} else {
$wgOut->addWikiMsg( 'confirmemail_oncreate' );
}
}

# Save settings (including confirmation token)
$u->saveSettings();

# If not logged in, assume the new account as the current one
and set session cookies
# then show a "welcome" message or a "need cookies" message as
needed
if( $wgUser->isAnon() ) {
$wgUser = $u;
$wgUser->setCookies();
wfRunHooks( 'AddNewAccount', array( $wgUser ) );
if( $this->hasSessionCookie() ) {
return $this->successfulLogin( 'welcomecreation',
$wgUser->getName(), false );

} else {
return $this->cookieRedirectCheck( 'new' );
}

} else {

# Confirm that the account was created
global $wgOut;
$self = SpecialPage::getTitleFor( 'Userlogin' );
$wgOut->setPageTitle( wfMsgHtml( 'accountcreated' ) );
$wgOut->setArticleRelated( false );
$wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->addHtml( wfMsgWikiHtml( 'accountcreatedtext',
$u->getName() ) );
$wgOut->returnToMain( false, $self );
wfRunHooks( 'AddNewAccount', array( $u ) );


$topic = "Application from user " . $this->mName ."\n";
$text = $this->mName ." wants ... \n\n";

$text .= "Real name: " .$this->mRealName . "\n";
$text .= "Business name: " . $this->mBusinessName . "\n";
$text .= "Address: " . $this->mAddress . "\n";
$text .= "Business type: " . $this->mBusinessType . "\n";
$text .= "Interests: " . $this->mInterests . "\n";
$text .= "Affiliations: " . $this->mAffiliations . "\n";
$text .= "Specific interests: " . $this->mSpecificInterests . "\n";
$text .= "Published work: " . $this->mPublishedWork . "\n";

mail("myemail [at] somesite", $topic, $text, "From:myemail [at] somesite",
"-f myemail [at] somesite");


return true;
}
}
---

Thanks,

Alain

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.