r67110 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67109‎ | r67110 | r67111 >
Date:19:50, 30 May 2010
Author:btongminh
Status:deferred
Tags:
Comment:
* Create accounts in wiki as well on creation
* Add dropdown box for activity
* Other misc UI cleanup
Modified paths:
  • /branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AccountManager.i18n.php (modified) (history)
  • /branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AccountManager.php (modified) (history)
  • /branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AmExport.php (modified) (history)
  • /branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AmUserListView.php (modified) (history)
  • /branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AmUserView.php (modified) (history)
  • /branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/SpecialAccountManager.php (modified) (history)
  • /branches/NssMySQLAuth-rewrite/NssMySQLAuth/NssMySQLAuthPlugin.php (modified) (history)

Diff [purge]

Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/NssMySQLAuthPlugin.php
@@ -222,6 +222,10 @@
223223 $insert['pwd_uid'] = $uid;
224224
225225 $dbw->insert( 'passwd', $insert, __METHOD__ );
 226+ $dbw->commit();
 227+
 228+ $user = User::newFromName( $insert['pwd_name'] );
 229+ $user->addToDatabase();
226230
227231 return $password;
228232 }
Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AmExport.php
@@ -60,4 +60,18 @@
6161 header( "Content-Disposition: inline;filename*=utf-8'en'export.csv" );
6262 return $result;
6363 }
 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+ }
6478 }
Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AmUserListView.php
@@ -9,8 +9,9 @@
1010 $title = SpecialPage::getTitleFor( 'AccountManager' );
1111 $sk = $wgUser->getSkin();
1212
 13+ $wgOut->addHtml( Xml::element( 'h2', null, wfMsgExt( 'am-users-by-status', 'parseinline') ) );
1314 foreach ( $actives as $active => $users ) {
14 - $wgOut->addHtml( Xml::element( 'h2', null, $active ).
 15+ $wgOut->addHtml( Xml::element( 'h3', null, $active ).
1516 Xml::openElement( 'ul', array(
1617 'id' => 'nss-user-listview'
1718 ) ) . "\n" );
Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AccountManager.i18n.php
@@ -16,6 +16,12 @@
1717 'am-email' => 'e-mail',
1818 'am-active' => 'active',
1919 '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',
2026
2127 'am-rights' => 'rights',
2228 'am-save-changes' => 'Save changes',
Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AccountManager.php
@@ -16,4 +16,4 @@
1717 $wgSpecialPages['AccountManager'] = 'SpecialAccountManager';
1818
1919 $wgUserProperties = array( 'address', 'city' );
20 -
 20+$wgUserActivityLevels = array( 'active', 'inactive' );
Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/AmUserView.php
@@ -33,6 +33,12 @@
3434 function createHeader() {
3535 global $wgOut;
3636
 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+ }
3743 $wgOut->addHtml( Xml::openElement( 'form', array(
3844 'action' => $this->title->getLocalUrl( array(
3945 'action' => $this->action,
@@ -50,14 +56,23 @@
5157 $label = wfMsg( $amName );
5258 if ( wfEmptyMsg( $amName, $label ) )
5359 $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+ }
5473
5574 return ( "\t<tr><td>" .
5675 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"
6277 );
6378 }
6479
Index: branches/NssMySQLAuth-rewrite/NssMySQLAuth/AccountManager/SpecialAccountManager.php
@@ -75,6 +75,8 @@
7676 return;
7777 }
7878
 79+ AmExport::setSubtitle();
 80+
7981 $username = $wgRequest->getVal( 'user' );
8082
8183 $result = $this->processData();

Status & tagging log