Index: trunk/extensions/NssMySQLAuth/NssMySQLAuth.i18n.php |
— | — | @@ -22,6 +22,7 @@ |
23 | 23 | 'nss-save-changes' => 'Save changes', |
24 | 24 | 'nss-create-account-header' => 'Create new account', |
25 | 25 | 'nss-create-account' => 'Create account', |
| 26 | + 'nss-no-mail' => 'Do not send email', |
26 | 27 | 'nss-welcome-mail' => 'An account with username $1 and password $2 has been created for you.', |
27 | 28 | 'nss-welcome-mail-subject' => 'Account creation', |
28 | 29 | |
Index: trunk/extensions/NssMySQLAuth/SpecialAccountManager.php |
— | — | @@ -125,6 +125,8 @@ |
126 | 126 | $wgOut->addHTML( "</table>\n" ); |
127 | 127 | $wgOut->addHTML( "<div id=\"newaccount-submit\">\n". |
128 | 128 | Xml::hidden( 'action', 'create' ). |
| 129 | + Xml::checkLabel( wfMsg( 'nss-no-mail' ), 'nss-no-mail', 'nss-no-mail' ). |
| 130 | + "<br />\n". |
129 | 131 | Xml::element( 'input', array( |
130 | 132 | 'type' => 'submit', |
131 | 133 | 'value' => wfMsg( 'nss-create-account' ) |
— | — | @@ -152,7 +154,8 @@ |
153 | 155 | if( !isset( $this->users[$username] ) ) |
154 | 156 | continue; |
155 | 157 | |
156 | | - if( !in_array( $keyname, $wgUserProperties ) ) |
| 158 | + if( !in_array( $keyname, $wgUserProperties ) && |
| 159 | + !in_array( $keyname, array( 'email', 'active' )) ) |
157 | 160 | continue; |
158 | 161 | |
159 | 162 | $this->users[$username]->set( $keyname, $value ); |
— | — | @@ -198,6 +201,9 @@ |
199 | 202 | } |
200 | 203 | $this->users[$userprops->getName()] = $userprops; |
201 | 204 | |
| 205 | + if ( $wgRequest->getCheck( 'nss-no-mail' ) ) |
| 206 | + return true; |
| 207 | + |
202 | 208 | global $wgPasswordSender; |
203 | 209 | $email = wfMsg( 'nss-welcome-mail', $username, $password ); |
204 | 210 | $mailSubject = wfMsg( 'nss-welcome-mail-subject' ); |
— | — | @@ -252,7 +258,9 @@ |
253 | 259 | $this->username = $username; |
254 | 260 | $this->props = array(); |
255 | 261 | $this->email = $email; |
| 262 | + $this->setInternal( 'email', $email ); |
256 | 263 | $this->active = $active; |
| 264 | + $this->setInternal( 'active', $active ); |
257 | 265 | } |
258 | 266 | function getProps() { |
259 | 267 | return $this->props; |
— | — | @@ -298,6 +306,10 @@ |
299 | 307 | $this->old_props = array(); |
300 | 308 | } |
301 | 309 | $this->old_props[$name] = $this->props[$name] = $value; |
| 310 | + if( $name == 'active' ) |
| 311 | + $this->active = $value; |
| 312 | + if( $name == 'email' ) |
| 313 | + $this->email = $value; |
302 | 314 | } |
303 | 315 | |
304 | 316 | function update() { |
— | — | @@ -314,7 +326,7 @@ |
315 | 327 | if ( isset( $diff['active'] ) ) $this->active = $diff['active']; |
316 | 328 | $dbw->update( 'passwd', |
317 | 329 | array( 'pwd_email' => $this->email, 'pwd_active' => $this->active ), |
318 | | - array( 'pwd_user' => $this->username ), |
| 330 | + array( 'pwd_name' => $this->username ), |
319 | 331 | __METHOD__ |
320 | 332 | ); |
321 | 333 | // Put it into user_props as well for history |