}
$u->saveSettings();
- mailPasswordInternal($u);
+ if (mailPasswordInternal($u) == NULL)
+ {
+ return;
+ }
$wgOut->setPageTitle( wfMsg( "accmailtitle" ) );
$wgOut->setRobotpolicy( "noindex,nofollow" );
global $wgUser, $wgOut, $wpPassword, $wpRetype, $wpName, $wpRemember;
global $wpEmail, $wgDeferredUpdateList;
- if (!userAllowedToCreateAccount()) {
+ if (!$wgUser->isAllowedToCreateAccount()) {
userNotPrivilegedMessage();
return;
}
/* private */ function mailPasswordInternal( $u )
{
- global $wgUser, $wpName, $wgDeferredUpdateList, $wgOutputEncoding;
+ global $wpName, $wgDeferredUpdateList, $wgOutputEncoding;
global $wgPasswordSender;
if ( "" == $u->getEmail() ) {
-/* private */ function userAllowedToCreateAccount()
-{
- global $wgUser, $wgWhitelistAccount;
- $allowed = false;
-
- if (!$wgWhitelistAccount) { return 1; }; // default behaviour
- foreach ($wgWhitelistAccount as $right => $ok) {
- $userHasRight = (!strcmp($right, "user") || in_array($right, $wgUser->getRights()));
- $allowed |= ($ok && $userHasRight);
- }
- return $allowed;
-}
function userNotPrivilegedMessage()
<input tabindex=3 type=submit name=\"wpLoginattempt\" value=\"{$li}\">
</td></tr>");
- if (userAllowedToCreateAccount($wgUser)) {
+ if ($wgUser->isAllowedToCreateAccount()) {
$wgOut->addHTML("<tr><td colspan=3> </td></tr><tr>
<td align=right>$ypa:</td>
$ipblock->insert();
}
+
+
+ function isAllowedToCreateAccount()
+ {
+ global $wgWhitelistAccount;
+ $allowed = false;
+
+ if (!$wgWhitelistAccount) { return 1; }; // default behaviour
+ foreach ($wgWhitelistAccount as $right => $ok) {
+ $userHasRight = (!strcmp($right, "user") || in_array($right, $this->getRights()));
+ $allowed |= ($ok && $userHasRight);
+ }
+ return $allowed;
+ }
+
+
+
}
?>