Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/NssMySQLAuthPlugin.php |
— | — | @@ -222,6 +222,10 @@ |
223 | 223 | $insert['pwd_uid'] = $uid; |
224 | 224 | |
225 | 225 | $dbw->insert( 'passwd', $insert, __METHOD__ ); |
| 226 | + $dbw->commit(); |
| 227 | + |
| 228 | + $user = User::newFromName( $insert['pwd_name'] ); |
| 229 | + $user->addToDatabase(); |
226 | 230 | |
227 | 231 | return $password; |
228 | 232 | } |
Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AmExport.php |
— | — | @@ -60,4 +60,18 @@ |
61 | 61 | header( "Content-Disposition: inline;filename*=utf-8'en'export.csv" );
|
62 | 62 | return $result;
|
63 | 63 | }
|
| 64 | +
|
| 65 | + public static function setSubtitle() {
|
| 66 | + global $wgOut;
|
| 67 | + $title = SpecialPage::getTitleFor( 'AccountManager' );
|
| 68 | + $wgOut->setSubtitle( wfMsgExt( 'am-download-subtitle',
|
| 69 | + array( 'parse', 'replaceafter' ),
|
| 70 | + Xml::element( 'a', array( 'href' => $title->getLocalURL( 'format=csv') ),
|
| 71 | + wfMsg( 'am-download-cvs' )
|
| 72 | + ),
|
| 73 | + Xml::element( 'a', array( 'href' => $title->getLocalURL( 'format=csvexcel') ),
|
| 74 | + wfMsg( 'am-download-cvsexcel' )
|
| 75 | + )
|
| 76 | + ) );
|
| 77 | + }
|
64 | 78 | }
|
Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AmUserListView.php |
— | — | @@ -9,8 +9,9 @@ |
10 | 10 | $title = SpecialPage::getTitleFor( 'AccountManager' );
|
11 | 11 | $sk = $wgUser->getSkin();
|
12 | 12 |
|
| 13 | + $wgOut->addHtml( Xml::element( 'h2', null, wfMsgExt( 'am-users-by-status', 'parseinline') ) );
|
13 | 14 | foreach ( $actives as $active => $users ) {
|
14 | | - $wgOut->addHtml( Xml::element( 'h2', null, $active ).
|
| 15 | + $wgOut->addHtml( Xml::element( 'h3', null, $active ).
|
15 | 16 | Xml::openElement( 'ul', array(
|
16 | 17 | 'id' => 'nss-user-listview'
|
17 | 18 | ) ) . "\n" );
|
Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AccountManager.i18n.php |
— | — | @@ -16,6 +16,12 @@ |
17 | 17 | 'am-email' => 'e-mail', |
18 | 18 | 'am-active' => 'active', |
19 | 19 | 'am-updated' => 'Your changes have been saved successfully', |
| 20 | + 'am-edit-user' => 'Edit properties for [[User:$1|$1]]', |
| 21 | + 'am-create-user' => 'Create new user account', |
| 22 | + 'am-users-by-status' => 'Users by status', |
| 23 | + 'am-download-subtitle' => 'Download user list as $1 ($2)', |
| 24 | + 'am-download-cvs' => 'CSV', |
| 25 | + 'am-download-cvsexcel' => 'CSV semicolon separated', |
20 | 26 | |
21 | 27 | 'am-rights' => 'rights', |
22 | 28 | 'am-save-changes' => 'Save changes', |
Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AccountManager.php |
— | — | @@ -16,4 +16,4 @@ |
17 | 17 | $wgSpecialPages['AccountManager'] = 'SpecialAccountManager'; |
18 | 18 | |
19 | 19 | $wgUserProperties = array( 'address', 'city' ); |
20 | | - |
| 20 | +$wgUserActivityLevels = array( 'active', 'inactive' ); |
Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AmUserView.php |
— | — | @@ -33,6 +33,12 @@ |
34 | 34 | function createHeader() { |
35 | 35 | global $wgOut; |
36 | 36 | |
| 37 | + if ( $this->user->exists ) { |
| 38 | + $wgOut->addHtml( '<h2>' . wfMsgExt( 'am-edit-user', 'parseinline', |
| 39 | + $this->user->name ) . '</h2>' ); |
| 40 | + } else { |
| 41 | + $wgOut->addHtml( '<h2>' . wfMsgExt( 'am-create-user', 'parseinline' ) . '</h2>' ); |
| 42 | + } |
37 | 43 | $wgOut->addHtml( Xml::openElement( 'form', array( |
38 | 44 | 'action' => $this->title->getLocalUrl( array( |
39 | 45 | 'action' => $this->action, |
— | — | @@ -50,14 +56,23 @@ |
51 | 57 | $label = wfMsg( $amName ); |
52 | 58 | if ( wfEmptyMsg( $amName, $label ) ) |
53 | 59 | $label = $prop; |
| 60 | + |
| 61 | + if ( $prop == 'active' ) { |
| 62 | + global $wgUserActivityLevels; |
| 63 | + $select = new XmlSelect( $amName, false, 'active' ); |
| 64 | + foreach ( $wgUserActivityLevels as $level ) |
| 65 | + $select->addOption( $level ); |
| 66 | + |
| 67 | + $input = $select->getHTML(); |
| 68 | + } else { |
| 69 | + $input = Xml::input( /* $name */ $amName, /* $size */ 40, |
| 70 | + /* $value */ $this->user->get( $prop ), |
| 71 | + array( 'id' => $amName ) ); |
| 72 | + } |
54 | 73 | |
55 | 74 | return ( "\t<tr><td>" . |
56 | 75 | Xml::label( $label, $amName ) . |
57 | | - "</td><td>" . |
58 | | - Xml::input( /* $name */ $amName, /* $size */ false, |
59 | | - /* $value */ $this->user->get( $prop ), |
60 | | - array( 'id' => $amName ) ) . |
61 | | - "</td></tr>\n" |
| 76 | + "</td><td>$input</td></tr>\n" |
62 | 77 | ); |
63 | 78 | } |
64 | 79 | |
Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/SpecialAccountManager.php |
— | — | @@ -75,6 +75,8 @@ |
76 | 76 | return; |
77 | 77 | } |
78 | 78 | |
| 79 | + AmExport::setSubtitle(); |
| 80 | + |
79 | 81 | $username = $wgRequest->getVal( 'user' ); |
80 | 82 | |
81 | 83 | $result = $this->processData(); |