[MediaWiki-commits] [Gerrit] mediawiki...OpenIDConnect[master]: Added namespace for library class.

2018-01-20 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405422 )

Change subject: Added namespace for library class.
..

Added namespace for library class.

Bug: T185366
Change-Id: I76a00d3b9bf89fcde3670f9c102af73caeec39c9
---
M OpenIDConnect.class.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenIDConnect 
refs/changes/22/405422/1

diff --git a/OpenIDConnect.class.php b/OpenIDConnect.class.php
index da7e8a8..0f7c92d 100644
--- a/OpenIDConnect.class.php
+++ b/OpenIDConnect.class.php
@@ -24,6 +24,7 @@
 
 use \MediaWiki\Session\SessionManager;
 use \MediaWiki\Auth\AuthManager;
+use \Jumbojett\OpenIDConnectClient;
 
 class OpenIDConnect extends PluggableAuth {
 

-- 
To view, visit https://gerrit.wikimedia.org/r/405422
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76a00d3b9bf89fcde3670f9c102af73caeec39c9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenIDConnect
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VersionCompare[master]: Make tests pass.

2018-01-20 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405411 )

Change subject: Make tests pass.
..

Make tests pass.

Bug:T185372
Change-Id: I8e6a4095fefab6d0e49a915bb38460931fcc92b9
---
A Gruntfile.js
M includes/SpecialVersionCompare.php
A package.json
3 files changed, 41 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VersionCompare 
refs/changes/11/405411/1

diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 000..a45071e
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,21 @@
+/*jshint node:true */
+module.exports = function ( grunt ) {
+   grunt.loadNpmTasks( 'grunt-jsonlint' );
+   grunt.loadNpmTasks( 'grunt-banana-checker' );
+
+   grunt.initConfig( {
+   banana: {
+   all: 'i18n/'
+   },
+   jsonlint: {
+   all: [
+   '**/*.json',
+   '!node_modules/**',
+   '!vendor/**'
+   ]
+   }
+   } );
+
+   grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+   grunt.registerTask( 'default', 'test' );
+};
diff --git a/includes/SpecialVersionCompare.php 
b/includes/SpecialVersionCompare.php
index df61395..bf1fda3 100644
--- a/includes/SpecialVersionCompare.php
+++ b/includes/SpecialVersionCompare.php
@@ -48,15 +48,16 @@
$htmlForm->prepareForm()->displayForm( false );
 
if ( $url1 === '' && $url1 !== $url2 ) {
-   $url1 = $GLOBALS['wgServer'] .  
$GLOBALS['wgScriptPath'] . '/api.php';
+   $url1 = $GLOBALS['wgServer'] . $GLOBALS['wgScriptPath'] 
. '/api.php';
} elseif ( $url2 === '' && $url1 !== $url2 ) {
-   $url2 = $GLOBALS['wgServer'] .  
$GLOBALS['wgScriptPath'] . '/api.php';
+   $url2 = $GLOBALS['wgServer'] . $GLOBALS['wgScriptPath'] 
. '/api.php';
}
 
if ( $url1 !== '' && $url2 !== '' ) {
$info1 = $this->getVersionInfo( $url1 );
if ( is_null( $info1 ) ) {
-   $html = Html::openElement( 'p', [ 'class' => 
'error' ] ) .
+   $html = Html::element( 'br' ) .
+   Html::openElement( 'p', [ 'class' => 
'error' ] ) .
wfMessage( 'version-compare-url-error', 
$url1 )->text() .
Html::closeElement( 'p' );
$output->addHTML( $html );
@@ -65,7 +66,8 @@
 
$info2 = $this->getVersionInfo( $url2 );
if ( is_null( $info2 ) ) {
-   $html = Html::openElement( 'p', [ 'class' => 
'error' ] ) .
+   $html = Html::element( 'br' ) .
+   Html::openElement( 'p', [ 'class' => 
'error' ] ) .
wfMessage( 'version-compare-url-error', 
$url2 )->text() .
Html::closeElement( 'p' );
$output->addHTML( $html );
@@ -81,7 +83,9 @@
$json = [];
$query =

"?action=query=siteinfo=general%7Cextensions%7Cskins=json";
-   $ret = @file_get_contents( $url . $query );
+   \MediaWiki\suppressWarnings();
+   $ret = file_get_contents( $url . $query );
+   \MediaWiki\restoreWarnings();
if ( $ret === false ) {
return null;
}
diff --git a/package.json b/package.json
new file mode 100644
index 000..bcf5b13
--- /dev/null
+++ b/package.json
@@ -0,0 +1,11 @@
+{
+   "private": true,
+   "scripts": {
+   "test": "grunt test"
+   },
+   "devDependencies": {
+   "grunt": "1.0.1",
+   "grunt-banana-checker": "0.5.0",
+   "grunt-jsonlint": "1.1.0"
+   }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/405411
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e6a4095fefab6d0e49a915bb38460931fcc92b9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VersionCompare
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Fix Special:AllComments, add optional button label, formatting

2018-01-19 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405394 )

Change subject: Fix Special:AllComments, add optional button label, formatting
..

Fix Special:AllComments, add optional button label, formatting

Bug:T184731
Bug:T175855
Change-Id: Ie4b4965a4a1df77d3135c8b4b897243617cafa40
---
A .phpcs.xml
M composer.json
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/ApiCSBase.php
M includes/ApiCSDeleteComment.php
M includes/ApiCSPostComment.php
M includes/Comment.php
M includes/CommentStreams.php
M includes/CommentStreamsAllComments.php
M includes/CommentStreamsHooks.php
M includes/EchoCSPresentationModel.php
M resources/CommentStreams.css
M resources/CommentStreams.js
15 files changed, 106 insertions(+), 69 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/94/405394/1

diff --git a/.phpcs.xml b/.phpcs.xml
new file mode 100644
index 000..b0464c3
--- /dev/null
+++ b/.phpcs.xml
@@ -0,0 +1,8 @@
+
+
+   
+   
+   .
+   
+   
+
diff --git a/composer.json b/composer.json
index 7d306d5..182cb75 100644
--- a/composer.json
+++ b/composer.json
@@ -2,14 +2,17 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/mediawiki-codesniffer": "^15.0",
"mediawiki/minus-x": "0.2.1"
},
"scripts": {
"test": [
"parallel-lint . --exclude vendor --exclude 
node_modules",
+   "phpcs -p -s",
"minus-x check ."
],
"fix": [
+   "phpcbf",
"minus-x fix ."
]
}
diff --git a/extension.json b/extension.json
index 23f6d2b..024b33f 100644
--- a/extension.json
+++ b/extension.json
@@ -67,6 +67,8 @@
"commentstreams-api-error-unwatch",

"commentstreams-validation-error-nocommenttitle",
"commentstreams-validation-error-nocommenttext",
+   "commentstreams-buttontext-add",
+   "commentstreams-buttontext-reply",
"commentstreams-buttontooltip-add",
"commentstreams-buttontooltip-reply",
"commentstreams-buttontooltip-edit",
@@ -154,6 +156,7 @@
"CommentStreamsEnableTalk": false,
"CommentStreamsNewestStreamsOnTop": true,
"CommentStreamsModeratorFastDelete": false,
+   "CommentStreamsShowLabels": true,
"CommentStreamsEnableVoting": false,
"CommentStreamsInitiallyCollapsedNamespaces" : [],
"CommentStreamsUserRealNamePropertyName" : null,
diff --git a/i18n/en.json b/i18n/en.json
index 501fac6..22c2842 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -80,6 +80,8 @@
"commentstreams-api-error-unwatch": "Error unwatching comment.",
"commentstreams-validation-error-nocommenttitle": "You must enter a 
comment title.",
"commentstreams-validation-error-nocommenttext": "You must enter 
comment text.",
+   "commentstreams-buttontext-add": "ADD A COMMENT",
+   "commentstreams-buttontext-reply": "REPLY",
"commentstreams-buttontooltip-add": "add a comment",
"commentstreams-buttontooltip-reply": "reply",
"commentstreams-buttontooltip-edit": "edit",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 113c5bc..bfaf1d4 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -82,6 +82,8 @@
"commentstreams-api-error-unwatch": "Error message.",
"commentstreams-validation-error-nocommenttitle": "Error message.",
"commentstreams-validation-error-nocommenttext": "Error message.",
+   "commentstreams-buttontext-add": "User interface button label. Upper 
case for stylistic reasons.",
+   "commentstreams-buttontext-reply": "User interface button label. Upper 
case for stylistic reasons.",
"commentstreams-buttontooltip-add": "User interface button tooltip.",
"commentstreams-buttontooltip-reply": "User interface button 
tooltip.\n{{Identical|Reply}}",
"commentstreams-buttontooltip-edit": "User interface button 
tooltip.\n{{Identical|Edit}}",
diff --git a/includes/ApiCSBase.php b/includes/ApiCSBase.php
index 78ac2e2..e524e97 100644
--- a/includes/ApiCSBase.php
+++ b/includes/ApiCSBase.php
@@ -29,7 +29,7 @@
/**
 * @param ApiMain $main main module
 * @param string $action name of this module
-* @param boolean $edit whether this API module will be editing the 
database
+* @param bool $edit whether this API module will be editing the 
database
 */
public function 

[MediaWiki-commits] [Gerrit] mediawiki...VersionCompare[master]: Initial commit.

2018-01-19 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/405328 )

Change subject: Initial commit.
..


Initial commit.

Change-Id: I9dfac34962ce1dadcb216e0b2fafc7098983e1f4
---
A .gitignore
A .phpcs.xml
A CODE_OF_CONDUCT.md
A COPYING
A composer.json
A extension.json
A i18n/VersionCompare.i18n.alias.php
A i18n/en.json
A i18n/qqq.json
A includes/SpecialVersionCompare.php
A resources/VersionCompare.css
11 files changed, 760 insertions(+), 0 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..db8a779
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/node_modules
+/vendor
+/composer.lock
diff --git a/.phpcs.xml b/.phpcs.xml
new file mode 100644
index 000..b0464c3
--- /dev/null
+++ b/.phpcs.xml
@@ -0,0 +1,8 @@
+
+
+   
+   
+   .
+   
+   
+
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000..d8e5d08
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1 @@
+The development of this software is covered by a [Code of 
Conduct](https://www.mediawiki.org/wiki/Code_of_Conduct).
diff --git a/COPYING b/COPYING
new file mode 100644
index 000..d159169
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,339 @@
+GNU GENERAL PUBLIC LICENSE
+   Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term 

[MediaWiki-commits] [Gerrit] integration/config[master]: Add tests for Extension:VersionCompare

2018-01-19 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405352 )

Change subject: Add tests for Extension:VersionCompare
..

Add tests for Extension:VersionCompare

Change-Id: Ie4d7dc3a888da7422de167fd2c50a24e10aff5bb
---
M zuul/layout.yaml
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/52/405352/3

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index b8c47f0..5c2e677 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -6703,6 +6703,11 @@
  - name: extension-unittests-generic
  - name: mwgate-npm
 
+  - name: mediawiki/extensions/VersionCompare
+template:
+ - name: extension-unittests-composer
+ - name: mwgate-npm
+
   - name: mediawiki/extensions/VIKI
 template:
  - name: extension-unittests-composer-non-voting

-- 
To view, visit https://gerrit.wikimedia.org/r/405352
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4d7dc3a888da7422de167fd2c50a24e10aff5bb
Gerrit-PatchSet: 3
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VersionCompare[master]: Initial commit.

2018-01-19 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405328 )

Change subject: Initial commit.
..

Initial commit.

Change-Id: I9dfac34962ce1dadcb216e0b2fafc7098983e1f4
---
A .gitignore
A .phpcs.xml
A CODE_OF_CONDUCT.md
A COPYING
A composer.json
A extension.json
A i18n/VersionCompare.i18n.alias.php
A i18n/en.json
A i18n/qqq.json
A includes/SpecialVersionCompare.php
A resources/VersionCompare.css
11 files changed, 760 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VersionCompare 
refs/changes/28/405328/1

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..db8a779
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/node_modules
+/vendor
+/composer.lock
diff --git a/.phpcs.xml b/.phpcs.xml
new file mode 100644
index 000..b0464c3
--- /dev/null
+++ b/.phpcs.xml
@@ -0,0 +1,8 @@
+
+
+   
+   
+   .
+   
+   
+
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000..d8e5d08
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1 @@
+The development of this software is covered by a [Code of 
Conduct](https://www.mediawiki.org/wiki/Code_of_Conduct).
diff --git a/COPYING b/COPYING
new file mode 100644
index 000..d159169
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,339 @@
+GNU GENERAL PUBLIC LICENSE
+   Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is 

[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Improved debug logging.

2018-01-04 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402100 )

Change subject: Improved debug logging.
..

Improved debug logging.

Change-Id: Iff8282cf78ac80cce7263c2a0a2bbf9276249575
---
M includes/PluggableAuth.php
M includes/PluggableAuthHooks.php
M includes/PluggableAuthLogin.php
M includes/PluggableAuthPrimaryAuthenticationProvider.php
4 files changed, 19 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PluggableAuth 
refs/changes/00/402100/1

diff --git a/includes/PluggableAuth.php b/includes/PluggableAuth.php
index 87ea991..8ecf4e4 100644
--- a/includes/PluggableAuth.php
+++ b/includes/PluggableAuth.php
@@ -36,7 +36,10 @@
 * @return PluggableAuth a PluggableAuth object
 */
public static function singleton() {
+   wfDebugLog( 'PluggableAuth', 'Getting PluggableAuth singleton' 
);
+   wfDebugLog( 'PluggableAuth', 'Class name: ' .  
$GLOBALS['wgPluggableAuth_Class'] );
if ( !is_null( self::$instance ) ) {
+   wfDebugLog( 'PluggableAuth', 'Singleton already exists' 
);
return self::$instance;
} elseif ( isset( $GLOBALS['wgPluggableAuth_Class'] ) &&
class_exists( $GLOBALS['wgPluggableAuth_Class'] ) &&
@@ -45,7 +48,7 @@
self::$instance = new $GLOBALS['wgPluggableAuth_Class'];
return self::$instance;
}
-   wfDebug( 'Could not get authentication plugin instance.' );
+   wfDebugLog( 'PluggableAuth', 'Could not get authentication 
plugin instance.' );
return false;
}
 }
diff --git a/includes/PluggableAuthHooks.php b/includes/PluggableAuthHooks.php
index 0683b45..ee1e977 100644
--- a/includes/PluggableAuthHooks.php
+++ b/includes/PluggableAuthHooks.php
@@ -89,12 +89,12 @@
if ( $old_user === false ) {
return;
}
-   wfDebug( 'Deauthenticating ' . $old_name );
+   wfDebugLog( 'PluggableAuth', 'Deauthenticating ' . $old_name );
$pluggableauth = PluggableAuth::singleton();
if ( $pluggableauth ) {
$pluggableauth->deauthenticate( $old_user );
}
-   wfDebug( 'Deauthenticated ' . $old_name );
+   wfDebugLog( 'PluggableAuth', 'Deauthenticated ' . $old_name );
}
 
/**
diff --git a/includes/PluggableAuthLogin.php b/includes/PluggableAuthLogin.php
index 833bb40..7d88107 100644
--- a/includes/PluggableAuthLogin.php
+++ b/includes/PluggableAuthLogin.php
@@ -21,6 +21,7 @@
 * @param string|null $param parameters (ignored)
 */
public function execute( $param ) {
+   wfDebugLog( 'PluggableAuth', 'In execute()' );
$authManager = AuthManager::singleton();
$user = $this->getUser();
$pluggableauth = PluggableAuth::singleton();
@@ -35,11 +36,11 @@
$user->mEmail = $email;
$user->mEmailAuthenticated = 
wfTimestamp();
$user->mTouched = wfTimestamp();
-   wfDebug( 'Authenticated new user: ' . 
$username );
+   wfDebugLog( 'PluggableAuth', 
'Authenticated new user: ' . $username );
} else {
$user->mId = $id;
$user->loadFromId();
-   wfDebug( 'Authenticated existing user: 
' . $user->mName );
+   wfDebugLog( 'PluggableAuth', 
'Authenticated existing user: ' . $user->mName );
}
Hooks::run( 'PluggableAuthPopulateGroups', [ 
$user ] );
$authorized = true;
@@ -51,20 +52,20 @@
self::REALNAME_SESSION_KEY, 
$realname );

$authManager->setAuthenticationSessionData(
self::EMAIL_SESSION_KEY, $email 
);
-   wfDebug( 'User is authorized.' );
+   wfDebugLog( 'PluggableAuth', 'User is 
authorized.' );
} else {
-   wfDebug( 'Authorization failure.' );
+   wfDebugLog( 'PluggableAuth', 
'Authorization failure.' );
$error = wfMessage( 
'pluggableauth-not-authorized', $username )->text();
}
} else {
-  

[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Update composer so it is loadable via local VCS

2018-01-03 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/401404 )

Change subject: Update composer so it is loadable via local VCS
..


Update composer so it is loadable via local VCS

I would like to use this to register on Packagist.

Change-Id: I6903ae1641c3ac3f12dd3909a7b6106b8cfb9056
---
A .phpcs.xml
A .phpmd.xml
M composer.json
M includes/PluggableAuth.php
M includes/PluggableAuthBeginAuthenticationRequest.php
M includes/PluggableAuthContinueAuthenticationRequest.php
M includes/PluggableAuthLogin.php
M includes/PluggableAuthPrimaryAuthenticationProvider.php
8 files changed, 130 insertions(+), 10 deletions(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.phpcs.xml b/.phpcs.xml
new file mode 100644
index 000..f148e13
--- /dev/null
+++ b/.phpcs.xml
@@ -0,0 +1,7 @@
+
+
+  
+  includes
+  
+  
+
diff --git a/.phpmd.xml b/.phpmd.xml
new file mode 100644
index 000..2c2ab34
--- /dev/null
+++ b/.phpmd.xml
@@ -0,0 +1,29 @@
+
+http://pmd.sf.net/ruleset/1.0.0;
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 
http://pmd.sf.net/ruleset_xml_schema.xsd;
+xsi:noNamespaceSchemaLocation=" 
http://pmd.sf.net/ruleset_xml_schema.xsd;>
+
+   
+   
+   
+   
+   
+   
+   
+   
+   
+
+   
+   
+
+   
+
+   
+   
+   
+
+   
+   
+   
+
diff --git a/composer.json b/composer.json
index 7d306d5..9486e46 100644
--- a/composer.json
+++ b/composer.json
@@ -1,16 +1,42 @@
 {
+   "name": "mediawiki/pluggable-auth",
+   "license": "MIT",
+   "type": "mediawiki-extension",
+   "homepage": "https://www.mediawiki.org/wiki/Extension:PluggableAuth;,
+   "description": "An authentication framework for MediaWiki",
+   "keywords": [
+   "extension",
+   "wiki",
+   "mediawiki",
+   "authentication"
+   ],
+   "authors": [
+   {
+   "name": "Cindy Cicalese",
+   "email": "cin...@gmail.com",
+   "role": "Contributor"
+   }
+   ],
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"jakub-onderka/php-console-highlighter": "0.3.2",
-   "mediawiki/minus-x": "0.2.1"
+   "mediawiki/minus-x": "0.2.1",
+   "mediawiki/mediawiki-codesniffer": "15.0.0",
+   "phpunit/phpunit": "4.8.36",
+   "phpmd/phpmd": "~2.1"
},
"scripts": {
+   "phpunit": "php $MW_INSTALL_PATH/tests/phpunit/phpunit.php -c 
.phpunit.xml.dist",
+   "phpdbg": "phpdbg -qrr 
$MW_INSTALL_PATH/tests/phpunit/phpunit.php -c .phpunit.xml.dist",
"test": [
"parallel-lint . --exclude vendor --exclude 
node_modules",
-   "minus-x check ."
+   "minus-x check .",
+   "phpmd includes text .phpmd.xml || :",
+   "phpcs -p -s"
],
"fix": [
-   "minus-x fix ."
+   "minus-x fix .",
+   "phpcbf"
]
}
 }
diff --git a/includes/PluggableAuth.php b/includes/PluggableAuth.php
index b85d8d1..87ea991 100644
--- a/includes/PluggableAuth.php
+++ b/includes/PluggableAuth.php
@@ -5,11 +5,12 @@
/**
 * @since 1.0
 *
-* @param int &$id
-* @param string &$username
-* @param string &$realname
-* @param string &$email
-* @param string &$errorMessage
+* @param int &$id The user's user ID
+* @param string &$username The user's user name
+* @param string &$realname The user's real name
+* @param string &$email The user's email address
+* @param string &$errorMessage Returns a descritive message if
+*  there's an error
 */
abstract public function authenticate( &$id, &$username, &$realname,
&$email, &$errorMessage );
@@ -17,14 +18,14 @@
/**
 * @since 1.0
 *
-* @param User &$user
+* @param User &$user The user
 */
abstract public function deauthenticate( User &$user );
 
/**
 * @since 1.0
 *
-* @param int $id
+* @param int $id The user's user ID
 */
abstract public function saveExtraAttributes( $id );
 
@@ -32,6 +33,7 @@
 
/**
 * @since 2.0
+* @return PluggableAuth a PluggableAuth object
 */
public static function singleton() {
if ( !is_null( self::$instance ) ) 

[MediaWiki-commits] [Gerrit] mediawiki...PhabTaskGraph[master]: Handle status array when passed as list

2017-12-21 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399769 )

Change subject: Handle status array when passed as list
..

Handle status array when passed as list

Change-Id: Icf140f6f305267068d0a1b80585e686c5764f6e4
---
M includes/SpecialPhabTaskGraph.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PhabTaskGraph 
refs/changes/69/399769/1

diff --git a/includes/SpecialPhabTaskGraph.php 
b/includes/SpecialPhabTaskGraph.php
index 9672ca6..6b161f4 100644
--- a/includes/SpecialPhabTaskGraph.php
+++ b/includes/SpecialPhabTaskGraph.php
@@ -36,8 +36,11 @@
}
 
$statusarray = $request->getArray( 'status' );
-   if ( $statusarray == [] ) {
+   $size = count( $statusarray );
+   if ( $size === 0 ) {
$statusarray = [ 'open', 'stalled' ];
+   } elseif ( $size === 1 ) {
+   $statusarray = array_map( 'trim', explode( ',' , 
$statusarray[0] ) );
}
 
$tasks = $request->getText( 'tasks' );

-- 
To view, visit https://gerrit.wikimedia.org/r/399769
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf140f6f305267068d0a1b80585e686c5764f6e4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhabTaskGraph
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...ExternalData[master]: Adds "json xssi prefix length" parameter

2017-12-20 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399456 )

Change subject: Adds "json xssi prefix length" parameter
..

Adds "json xssi prefix length" parameter

Some JSON sources prefix the JSON with text the prevent Cross
Site Script Inclusion (XSSI) attacks. This prefix must be
stripped before passing the text to a JSON parser.  The new
"json xssi prefix length" parameter indicates how long the
prefix that needs to be stripped is. For example, see
https://gerrit-review.googlesource.com/Documentation/rest-api.html#output.

Change-Id: I88d849b5c8201ac03cdb3f2e085d9460a4f93bc2
---
M ED_ParserFunctions.php
M ED_Utils.php
2 files changed, 13 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ExternalData 
refs/changes/56/399456/1

diff --git a/ED_ParserFunctions.php b/ED_ParserFunctions.php
index de79f8b..78b7c1a 100644
--- a/ED_ParserFunctions.php
+++ b/ED_ParserFunctions.php
@@ -123,8 +123,14 @@
$cacheExpireTime = $edgCacheExpireTime;
}
 
+   if ( array_key_exists( 'json xssi prefix length', $args) ) {
+   $prefixLength = $args['json xssi prefix length'];
+   } else {
+   $prefixLength = 0;
+   }
+
$postData = array_key_exists( 'post data', $args ) ? 
$args['post data'] : '';
-   $external_values = EDUtils::getDataFromURL( $url, $format, 
$mappings, $postData, $cacheExpireTime );
+   $external_values = EDUtils::getDataFromURL( $url, $format, 
$mappings, $postData, $cacheExpireTime, $prefixLength );
if ( is_string( $external_values ) ) {
// It's an error message - display it on the screen.
return EDUtils::formatErrorMessage( $external_values );
diff --git a/ED_Utils.php b/ED_Utils.php
index 5293713..8274c30 100644
--- a/ED_Utils.php
+++ b/ED_Utils.php
@@ -876,7 +876,8 @@
}
}
 
-   static function getJSONData( $json ) {
+   static function getJSONData( $json, $prefixLength ) {
+   $json = substr( $json, $prefixLength );
$json_tree = FormatJson::decode( $json, true );
if ( is_null( $json_tree ) ) {
// It's probably invalid JSON.
@@ -955,7 +956,7 @@
}
}
 
-   static private function getDataFromText( $contents, $format, $mappings, 
$source ) {
+   static private function getDataFromText( $contents, $format, $mappings, 
$source, $prefixLength = 0 ) {
// For now, this is only done for the CSV formats.
if ( is_array( $format ) ) {
list( $format, $delimiter ) = $format;
@@ -972,7 +973,7 @@
} elseif ( $format == 'csv with header' ) {
return self::getCSVData( $contents, true, $delimiter );
} elseif ( $format == 'json' ) {
-   return self::getJSONData( $contents );
+   return self::getJSONData( $contents, $prefixLength );
} elseif ( $format == 'gff' ) {
return self::getGFFData( $contents );
} else {
@@ -1007,14 +1008,14 @@
}
}
 
-   static public function getDataFromURL( $url, $format, $mappings, 
$postData = null, $cacheExpireTime ) {
+   static public function getDataFromURL( $url, $format, $mappings, 
$postData = null, $cacheExpireTime, $prefixLength ) {
$url_contents = self::fetchURL( $url, $postData, 
$cacheExpireTime );
// Show an error message if there's nothing there.
if ( empty( $url_contents ) ) {
return "Error: No contents found at URL $url.";
}
 
-   return self::getDataFromText( $url_contents, $format, 
$mappings, $url );
+   return self::getDataFromText( $url_contents, $format, 
$mappings, $url, $prefixLength );
}
 
static private function getDataFromPath( $path, $format, $mappings ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/399456
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I88d849b5c8201ac03cdb3f2e085d9460a4f93bc2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ExternalData
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...JSBreadCrumbs[master]: Parsed messages to fix PLURAL fix.

2017-12-12 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397963 )

Change subject: Parsed messages to fix PLURAL fix.
..

Parsed messages to fix PLURAL fix.

Change-Id: I131a1932003590929230aefb8136e5e16102b013
---
M includes/JSBreadCrumbsHooks.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/JSBreadCrumbs 
refs/changes/63/397963/1

diff --git a/includes/JSBreadCrumbsHooks.php b/includes/JSBreadCrumbsHooks.php
index c57cab9..9e75142 100644
--- a/includes/JSBreadCrumbsHooks.php
+++ b/includes/JSBreadCrumbsHooks.php
@@ -41,13 +41,13 @@
if ( $horizontal ) {
$vars['CSSSelector'] = 
$GLOBALS['wgJSBreadCrumbsCSSSelectorHorizontal'];
$vars['LeadingDescription'] = wfMessage( 
'jsbreadcrumbs-intro-horizontal',
-   $vars['SiteMaxCrumbs'] )->plain();
+   $vars['SiteMaxCrumbs'] )->parse();
$vars['MaxLength'] =
$user->getOption( 
'jsbreadcrumbs-maxlength-horizontal' );
} else {
$vars['CSSSelector'] = 
$GLOBALS['wgJSBreadCrumbsCSSSelectorVertical'];
$vars['LeadingDescription'] = wfMessage( 
'jsbreadcrumbs-intro-vertical',
-   $vars['SiteMaxCrumbs'] )->plain();
+   $vars['SiteMaxCrumbs'] )->parse();
$vars['MaxLength'] =
$user->getOption( 
'jsbreadcrumbs-maxlength-vertical' );
}
@@ -68,7 +68,7 @@
if ( $message->isBlank() ) {
$vars['Action'] = $action;
} else {
-   $vars['Action'] = $message->plain();
+   $vars['Action'] = $message->parse();
}
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/397963
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I131a1932003590929230aefb8136e5e16102b013
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/JSBreadCrumbs
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Handle integers passed as link text

2017-12-02 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394755 )

Change subject: Handle integers passed as link text
..

Handle integers passed as link text

This issue occurs on the Special:Log page when viewing the patrol
log in MW 1.30+.

Bug: T181669
Change-Id: I997224257dc62284469168c9752f72367d0496e1
---
M includes/DisplayTitleHooks.php
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DisplayTitle 
refs/changes/55/394755/1

diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index c03add4..b790a07 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -115,10 +115,12 @@
$text = null;
if ( is_string( $html ) ) {
$text = $html;
-   } elseif ( get_class( $html ) == 'HtmlArmor' ) {
+   } elseif ( is_integer( $html ) ) {
+   $text = (string)$html;
+   } elseif ( is_object( $html ) && get_class( $html ) == 
'HtmlArmor' ) {
$text = HtmlArmor::getHtml( $html );
}
-   if ( $text !== null ) {
+   if ( !is_null( $text ) ) {
$title = Title::newFromText( $text );
if ( !is_null( $title ) ) {
if ( $target->getSubjectNsText() === '' 
) {

-- 
To view, visit https://gerrit.wikimedia.org/r/394755
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I997224257dc62284469168c9752f72367d0496e1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DisplayTitle
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add HtmlArmor to self links

2017-12-02 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394749 )

Change subject: Add HtmlArmor to self links
..

Add HtmlArmor to self links

Change-Id: I8ab40eda041ebd915ad4dc991e720db6e126fe87
---
M includes/Linker.php
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/49/394749/1

diff --git a/includes/Linker.php b/includes/Linker.php
index a0332cf..b871722 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -189,6 +189,10 @@
return $ret;
}
 
+   if ( is_object( $html ) && get_class( $html ) == 'HtmlArmor' ) {
+   $html = HtmlArmor::getHtml( $html );
+   }
+
if ( $html == '' ) {
$html = htmlspecialchars( $nt->getPrefixedText() );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/394749
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ab40eda041ebd915ad4dc991e720db6e126fe87
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...JSBreadCrumbs[master]: Fix plural in i18n messages

2017-11-30 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394515 )

Change subject: Fix plural in i18n messages
..

Fix plural in i18n messages

Change-Id: I911cd2b8bed9d676e65833106465abdd0505cdbf
---
M i18n/en.json
M i18n/qqq.json
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/JSBreadCrumbs 
refs/changes/15/394515/3

diff --git a/i18n/en.json b/i18n/en.json
index a0f70c8..d87b3ea 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -8,8 +8,8 @@
},
"jsbreadcrumbs-desc": "Adds a trail of bread crumbs below the tab bar",
"jsbreadcrumbs-horizontal-separator": "»",
-   "jsbreadcrumbs-intro-horizontal": "Last $1 Pages Viewed: ",
-   "jsbreadcrumbs-intro-vertical": "Last $1 Pages Viewed",
+   "jsbreadcrumbs-intro-horizontal": "Last {{PLURAL:$1|Page|$1 Pages}} 
Viewed: ",
+   "jsbreadcrumbs-intro-vertical": "Last {{PLURAL:$1|Page|$1 Pages}} 
Viewed",
"prefs-jsbreadcrumbs": "Bread Crumbs",
"prefs-jsbreadcrumbs-showaction": "Show action bread crumbs",
"prefs-jsbreadcrumbs-showcrumbs": "Display bread crumbs",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 795eafe..e8066cf 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -11,8 +11,8 @@
},
"jsbreadcrumbs-desc": "{{desc|name=JS Bread 
Crumbs|url=https://www.mediawiki.org/wiki/Extension:JSBreadCrumbs}};,
"jsbreadcrumbs-horizontal-separator": "{{optional}}",
-   "jsbreadcrumbs-intro-horizontal": "Used as bread crumb description when 
the bread crumbs are horizontal.\n\nThis message includes a parameter for the 
number of crumbs shown and is followed by \":\" and bread crumbs 
(\"»\"-separated links).",
-   "jsbreadcrumbs-intro-vertical": "Used as bread crumb description when 
the bread crumbs are vertical.\n\nThis message includes a parameter for the 
number of crumbs shown and is followed by \":\" and bread crumbs 
(\"»\"-separated links).",
+   "jsbreadcrumbs-intro-horizontal": "Used as bread crumb description when 
the bread crumbs are horizontal.\n\nThis message includes a parameter for the 
number of crumbs shown and is followed by bread crumbs separated by 
jsbreadcrumbs-horizontal-separator).",
+   "jsbreadcrumbs-intro-vertical": "Used as bread crumb description when 
the bread crumbs are vertical.\n\nThis message includes a parameter for the 
number of crumbs shown and is followed by bread crumbs on separate lines).",
"prefs-jsbreadcrumbs": "This is the name of the extension JS Bread 
Crumbs (https://www.mediawiki.org/wiki/Extension:JSBreadCrumbs). The expression 
\"Bread Crumbs\" designates a kind of navigation bar (see 
https://en.wiktionary.org/wiki/breadcrumbs).",
"prefs-jsbreadcrumbs-showaction": "Used as checkbox label in 
[[Special:Preferences]].",
"prefs-jsbreadcrumbs-showcrumbs": "Used as checkbox label in 
[[Special:Preferences]].",

-- 
To view, visit https://gerrit.wikimedia.org/r/394515
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I911cd2b8bed9d676e65833106465abdd0505cdbf
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/JSBreadCrumbs
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Raimond Spekking 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Follow 1 level of redirect getting display title.

2017-11-26 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393350 )

Change subject: Follow 1 level of redirect getting display title.
..


Follow 1 level of redirect getting display title.

Change-Id: I9675c87d4dc2042fde643a2cd190b95ae8343aa6
---
M extension.json
M includes/DisplayTitleHooks.php
2 files changed, 26 insertions(+), 16 deletions(-)

Approvals:
  Kghbln: Looks good to me, but someone else must approve
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index ff5bf23..3775ed5 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "DisplayTitle",
-   "version": "1.5.2",
+   "version": "1.5.3",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]",
"[https://www.semantic-mediawiki.org/wiki/User:Oetterer Tobias 
Oetterer]"
diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index c7fb01f..647a99e 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -226,23 +226,33 @@
 */
private static function getDisplayTitle( Title $title, &$displaytitle,
$wrap = false ) {
-   $pagetitle = $title->getPrefixedText();
-   // remove fragment
-   $title = Title::newFromText( $pagetitle );
-   if ( $title instanceof Title ) {
-   $values = PageProps::getInstance()->getProperties( 
$title, 'displaytitle' );
-   $id = $title->getArticleID();
-   if ( array_key_exists( $id, $values ) ) {
-   $value = $values[$id];
-   if ( trim( str_replace( '', '', 
strip_tags( $value ) ) ) !== '' &&
-   $value !== $pagetitle ) {
-   $displaytitle = $value;
-   if ( $wrap ) {
-   $displaytitle = new HtmlArmor( 
$displaytitle );
-   }
-   return true;
+   $title = $title->createFragmentTarget('');
+   $originalPageName = $title->getPrefixedText();
+   $wikipage = new WikiPage( $title );
+   $redirect = false;
+   $redirectTarget = $wikipage->getRedirectTarget();
+   if ( !is_null( $redirectTarget ) ) {
+   $redirect = true;
+   $title = $redirectTarget;
+   }
+   $id = $title->getArticleID();
+   $values = PageProps::getInstance()->getProperties( $title, 
'displaytitle' );
+   if ( array_key_exists( $id, $values ) ) {
+   $value = $values[$id];
+   if ( trim( str_replace( '', '', strip_tags( 
$value ) ) ) !== '' &&
+   $value !== $originalPageName ) {
+   $displaytitle = $value;
+   if ( $wrap ) {
+   $displaytitle = new HtmlArmor( 
$displaytitle );
}
+   return true;
}
+   } else if ( $redirect ) {
+   $displaytitle = $title->getPrefixedText();
+   if ( $wrap ) {
+   $displaytitle = new HtmlArmor( $displaytitle );
+   }
+   return true;
}
return false;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/393350
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9675c87d4dc2042fde643a2cd190b95ae8343aa6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DisplayTitle
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: Kghbln 
Gerrit-Reviewer: Samwilson 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Follow 1 level of redirect getting display title.

2017-11-24 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393350 )

Change subject: Follow 1 level of redirect getting display title.
..

Follow 1 level of redirect getting display title.

Change-Id: I9675c87d4dc2042fde643a2cd190b95ae8343aa6
---
M extension.json
M includes/DisplayTitleHooks.php
2 files changed, 17 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DisplayTitle 
refs/changes/50/393350/1

diff --git a/extension.json b/extension.json
index ff5bf23..3775ed5 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "DisplayTitle",
-   "version": "1.5.2",
+   "version": "1.5.3",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]",
"[https://www.semantic-mediawiki.org/wiki/User:Oetterer Tobias 
Oetterer]"
diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index c7fb01f..4299a88 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -226,22 +226,23 @@
 */
private static function getDisplayTitle( Title $title, &$displaytitle,
$wrap = false ) {
-   $pagetitle = $title->getPrefixedText();
-   // remove fragment
-   $title = Title::newFromText( $pagetitle );
-   if ( $title instanceof Title ) {
-   $values = PageProps::getInstance()->getProperties( 
$title, 'displaytitle' );
-   $id = $title->getArticleID();
-   if ( array_key_exists( $id, $values ) ) {
-   $value = $values[$id];
-   if ( trim( str_replace( '', '', 
strip_tags( $value ) ) ) !== '' &&
-   $value !== $pagetitle ) {
-   $displaytitle = $value;
-   if ( $wrap ) {
-   $displaytitle = new HtmlArmor( 
$displaytitle );
-   }
-   return true;
+   $title = $title->createFragmentTarget('');
+   $wikipage = new WikiPage( $title );
+   $redirectTarget = $wikipage->getRedirectTarget();
+   if ( !is_null( $redirectTarget ) ) {
+   $title = $redirectTarget;
+   }
+   $id = $title->getArticleID();
+   $values = PageProps::getInstance()->getProperties( $title, 
'displaytitle' );
+   if ( array_key_exists( $id, $values ) ) {
+   $value = $values[$id];
+   if ( trim( str_replace( '', '', strip_tags( 
$value ) ) ) !== '' &&
+   $value !== $title->getPrefixedText() ) {
+   $displaytitle = $value;
+   if ( $wrap ) {
+   $displaytitle = new HtmlArmor( 
$displaytitle );
}
+   return true;
}
}
return false;

-- 
To view, visit https://gerrit.wikimedia.org/r/393350
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9675c87d4dc2042fde643a2cd190b95ae8343aa6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DisplayTitle
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Fix override of link text.

2017-11-24 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393000 )

Change subject: Fix override of link text.
..


Fix override of link text.

Only override provided link text with the display title if the
provided link text is a case sensitive match for the target page name.
Previously, a case insensitive match would be overridden by the display
title. This reverts to the original behavior.
Also fix undefined variable.

Bug: T180413
Bug: T180409
Change-Id: I56409df8cef4ab08583a2a0003385a3c4793a57d
---
M extension.json
M includes/DisplayTitleHooks.php
2 files changed, 20 insertions(+), 8 deletions(-)

Approvals:
  Kghbln: Looks good to me, but someone else must approve
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index 8227bbb..ff5bf23 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "DisplayTitle",
-   "version": "1.5.1",
+   "version": "1.5.2",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]",
"[https://www.semantic-mediawiki.org/wiki/User:Oetterer Tobias 
Oetterer]"
diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index 642abb3..c7fb01f 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -112,16 +112,26 @@
private static function handleLink( Title $target, &$html ) {
if ( isset( $html ) ) {
$title = null;
+   $text = null;
if ( is_string( $html ) ) {
-   $title = Title::newFromText( $html );
+   $text = $html;
} elseif ( get_class( $html ) == 'HtmlArmor' ) {
-   $title = Title::newFromText( 
HtmlArmor::getHtml( $html ) );
+   $text = HtmlArmor::getHtml( $html );
}
-   if ( !is_null( $title ) &&
-   $title->getText() === $target->getText() &&
-   ( $title->getSubjectNsText() === 
$target->getSubjectNsText() ||
-   $title->getSubjectNsText() === '' ) ) {
-   self::getDisplayTitle( $target, $html, true );
+   if ( $text !== null ) {
+   $title = Title::newFromText( $text );
+   if ( !is_null( $title ) ) {
+   if ( $target->getSubjectNsText() === '' 
) {
+   if ( $text === 
$target->getText() ) {
+   self::getDisplayTitle( 
$target, $html, true );
+   }
+   } else {
+   if ( $title->getText() === 
$target->getText() &&
+   
$title->getSubjectNsText() === $target->getSubjectNsText() ) {
+   self::getDisplayTitle( 
$target, $html, true );
+   }
+   }
+   }
}
} else {
self::getDisplayTitle( $target, $html, true );
@@ -148,6 +158,8 @@
$found = self::getDisplayTitle( $title, $displaytitle );
} elseif ( $title->getSubjectPage()->exists() ) {
$found = self::getDisplayTitle( 
$title->getSubjectPage(), $displaytitle );
+   } else {
+   $found = false;
}
if ( $found ) {
$subtitle = $title->getPrefixedText();

-- 
To view, visit https://gerrit.wikimedia.org/r/393000
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I56409df8cef4ab08583a2a0003385a3c4793a57d
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/DisplayTitle
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: Kghbln 
Gerrit-Reviewer: Samwilson 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Fix HTML formatting in title.

2017-11-24 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393057 )

Change subject: Fix HTML formatting in title.
..


Fix HTML formatting in title.

Also add test for italics in title
Also add phpcs to composer testing.

Bug: T181228
Change-Id: I2e5dfb586e5169dd7c3b0c4ffdca84974c2163c8
---
M composer.json
M includes/DisplayTitleHooks.php
A tests/phpunit/DisplayTitleTest.php
3 files changed, 80 insertions(+), 6 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Verified
  Samwilson: Looks good to me, but someone else must approve



diff --git a/composer.json b/composer.json
index 392434c..ce8c3fe 100644
--- a/composer.json
+++ b/composer.json
@@ -2,15 +2,18 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"jakub-onderka/php-console-highlighter": "0.3.2",
-   "mediawiki/minus-x": "0.2.0"
+   "mediawiki/minus-x": "0.2.0",
+   "mediawiki/mediawiki-codesniffer": "^14.1"
},
"scripts": {
"test": [
"parallel-lint . --exclude vendor --exclude 
node_modules",
-   "minus-x check ."
+   "minus-x check .",
+   "phpcs -p -s"
],
"fix": [
-   "minus-x fix ."
+   "minus-x fix .",
+   "phpcbf"
]
}
 }
diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index 7d2c0e1..642abb3 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -121,10 +121,10 @@
$title->getText() === $target->getText() &&
( $title->getSubjectNsText() === 
$target->getSubjectNsText() ||
$title->getSubjectNsText() === '' ) ) {
-   self::getDisplayTitle( $target, $html );
+   self::getDisplayTitle( $target, $html, true );
}
} else {
-   self::getDisplayTitle( $target, $html );
+   self::getDisplayTitle( $target, $html, true );
}
return true;
}
@@ -208,10 +208,12 @@
 * @since 1.0
 * @param Title $title the Title object for the page
 * @param string &$displaytitle to return the display title, if set
+* @param boolean $wrap whether to wrap result in HtmlArmor
 * @return boolean true if the page has a displaytitle page property 
that is
 * different from the prefixed page name, false otherwise
 */
-   private static function getDisplayTitle( Title $title, &$displaytitle ) 
{
+   private static function getDisplayTitle( Title $title, &$displaytitle,
+   $wrap = false ) {
$pagetitle = $title->getPrefixedText();
// remove fragment
$title = Title::newFromText( $pagetitle );
@@ -223,6 +225,9 @@
if ( trim( str_replace( '', '', 
strip_tags( $value ) ) ) !== '' &&
$value !== $pagetitle ) {
$displaytitle = $value;
+   if ( $wrap ) {
+   $displaytitle = new HtmlArmor( 
$displaytitle );
+   }
return true;
}
}
diff --git a/tests/phpunit/DisplayTitleTest.php 
b/tests/phpunit/DisplayTitleTest.php
new file mode 100644
index 000..9a7a1c0
--- /dev/null
+++ b/tests/phpunit/DisplayTitleTest.php
@@ -0,0 +1,66 @@
+setMwGlobals( 'wgAllowDisplayTitle', true );
+   $this->setMwGlobals( 'wgRestrictDisplayTitle', false );
+   }
+
+   /**
+* Set the wikitext contents of a test page.
+* @param string|Title $title The title of the page.
+* @param string $wikitext The page contents.
+* @return WikiPage
+*/
+   protected function setPageContent( $title, $wikitext ) {
+   if ( is_string( $title ) ) {
+   $title = Title::newFromText( $title );
+   }
+   $page = new WikiPage( $title );
+   $page->doEditContent( new WikitextContent( $wikitext ), '' );
+   return $page;
+   }
+
+   /**
+* @dataProvider testCorrectRetrievalProvider
+*/
+   public function testCorrectRetrieval( $p1Title, $p1Display, $p2Title, 
$p2Text, $p2HtmlPattern ) {
+   // First page has a custom display title.
+   $wikiText1 = "{{DISPLAYTITLE:$p1Display}}";
+   $this->setPageContent( $p1Title, $wikiText1 );

[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Fix override of link text.

2017-11-22 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393000 )

Change subject: Fix override of link text.
..

Fix override of link text.

Only override provided link text with the display title if the
provided link text is a case sensitive match for the target page name.
Previously, a case insensitive match would be overridden by the display
title. This reverts to the original behavior.

Change-Id: I56409df8cef4ab08583a2a0003385a3c4793a57d
---
M extension.json
M includes/DisplayTitleHooks.php
2 files changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DisplayTitle 
refs/changes/00/393000/1

diff --git a/extension.json b/extension.json
index 8227bbb..ff5bf23 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "DisplayTitle",
-   "version": "1.5.1",
+   "version": "1.5.2",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]",
"[https://www.semantic-mediawiki.org/wiki/User:Oetterer Tobias 
Oetterer]"
diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index 7d2c0e1..fdf8d58 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -113,12 +113,14 @@
if ( isset( $html ) ) {
$title = null;
if ( is_string( $html ) ) {
-   $title = Title::newFromText( $html );
+   $text = $html;
+   $title = Title::newFromText( $text );
} elseif ( get_class( $html ) == 'HtmlArmor' ) {
-   $title = Title::newFromText( 
HtmlArmor::getHtml( $html ) );
+   $text = HtmlArmor::getHtml( $html );
+   $title = Title::newFromText( $text );
}
if ( !is_null( $title ) &&
-   $title->getText() === $target->getText() &&
+   $text === $target->getText() &&
( $title->getSubjectNsText() === 
$target->getSubjectNsText() ||
$title->getSubjectNsText() === '' ) ) {
self::getDisplayTitle( $target, $html );

-- 
To view, visit https://gerrit.wikimedia.org/r/393000
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I56409df8cef4ab08583a2a0003385a3c4793a57d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DisplayTitle
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Fixed error for logged in users on info action

2017-11-02 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/388253 )

Change subject: Fixed error for logged in users on info action
..

Fixed error for logged in users on info action

T179620

Change-Id: Ifcbf6b7c572224b7fa46403f2fd93373da91c1d0
---
A composer.json
M extension.json
M includes/DisplayTitleHooks.php
3 files changed, 14 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DisplayTitle 
refs/changes/53/388253/1

diff --git a/composer.json b/composer.json
new file mode 100644
index 000..4bcc67a
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,11 @@
+{
+   "require-dev": {
+   "mediawiki/mediawiki-codesniffer": "14.1.0"
+   },
+   "scripts": {
+   "fix": "phpcbf",
+   "test": [
+   "phpcs -p -s"
+   ]
+   }
+}
diff --git a/extension.json b/extension.json
index 23f0ea2..8227bbb 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "DisplayTitle",
-   "version": "1.5",
+   "version": "1.5.1",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]",
"[https://www.semantic-mediawiki.org/wiki/User:Oetterer Tobias 
Oetterer]"
diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index 4e45b2f..88694fb 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -34,30 +34,9 @@
}
 
/**
-* Implements PersonalUrls hook.
-* See https://www.mediawiki.org/wiki/Manual:Hooks/PersonalUrls
-* Handle links. Implements HtmlPageLinkRendererBegin hook of 
LinkRenderer class.
-*
-* @since 1.5
-* @param array &$personal_urls the array of URLs set up so far
-* @param Title $title the Title object of the current article
-* @param SkinTemplate $skin SkinTemplate object providing context
-*/
-   public static function onPersonalUrls( array &$personal_urls, Title 
$title,
-   SkinTemplate $skin ) {
-   if ( $skin->getUser()->isLoggedIn() &&
-   isset( $personal_urls['userpage'] ) ) {
-   $pagename = $personal_urls['userpage']['text'];
-   $title = $skin->getUser()->getUserPage();
-   self::getDisplayTitle( $title, $pagename );
-   $personal_urls['userpage']['text'] = $pagename;
-   }
-   }
-
-   /**
 * Implements HtmlPageLinkRendererBegin hook.
 * See 
https://www.mediawiki.org/wiki/Manual:Hooks/HtmlPageLinkRendererBegin
-* Handle links to other pages.
+* Handle links. Implements HtmlPageLinkRendererBegin hook of 
LinkRenderer class.
 *
 * @since 1.4
 * @param LinkRenderer $linkRenderer the LinkRenderer object
@@ -111,7 +90,7 @@
$title = null;
if ( is_string( $html ) ) {
$title = Title::newFromText( $html );
-   } elseif ( get_class( $html ) == 'HtmlArmor' ) {
+   } else if ( get_class( $html ) == 'HtmlArmor' ) {
$title = Title::newFromText( 
HtmlArmor::getHtml( $html ) );
}
if ( !is_null( $title ) &&

-- 
To view, visit https://gerrit.wikimedia.org/r/388253
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifcbf6b7c572224b7fa46403f2fd93373da91c1d0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DisplayTitle
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...JSBreadCrumbs[master]: Refactored.

2017-11-01 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387966 )

Change subject: Refactored.
..

Refactored.

Change-Id: If08cc5bfe5b9ecf566e6be8f658d970a666e78e0
---
D JSBreadCrumbs.hooks.php
D JSBreadCrumbs.php
A extension.json
M i18n/en.json
M i18n/qqq.json
A includes/JSBreadCrumbsHooks.php
D js/BreadCrumbs.js
R resources/JSBreadCrumbs.css
A resources/JSBreadCrumbs.js
9 files changed, 317 insertions(+), 397 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/JSBreadCrumbs 
refs/changes/66/387966/1

diff --git a/JSBreadCrumbs.hooks.php b/JSBreadCrumbs.hooks.php
deleted file mode 100644
index 0e248e5..000
--- a/JSBreadCrumbs.hooks.php
+++ /dev/null
@@ -1,149 +0,0 @@
-isAllowed('read') ) {
-   if ( self::enableBreadCrumbs() ) {
-   $out->addModules( 'ext.JSBreadCrumbs' );
-   }
-   }
-
-   return true;
-   }
-
-   /**
-* MakeGlobalVariablesScript hook
-*
-* @param array $vars
-* @param OutputPage $outPage
-*
-* @return bool
-*/
-   public static function addJSVars( $vars, $outPage ) {
-   global $wgJSBreadCrumbsSeparator, $wgJSBreadCrumbsCookiePath, 
$wgJSBreadCrumbsCSSSelector, $wgJSBreadCrumbsSkinCSSArray,
-   $wgJSBreadCrumbsSkinCSSSelector, $wgUser;
-
-   if ( !self::enableBreadCrumbs() ) {
-   return true;
-   }
-
-   // Allow localized separator to be overriden
-   if ( $wgJSBreadCrumbsSeparator !== '' ) {
-   $separator = $wgJSBreadCrumbsSeparator;
-   } else {
-   $separator = wfMessage( "jsbreadcrumbs-separator" 
)->escaped();
-   }
-
-   $variables = array();
-
-   $skinName = $outPage->getSkin()->getSkinName();
-   if(array_key_exists($skinName, $wgJSBreadCrumbsSkinCSSArray)) {
-   $outPage->addJsConfigVars('wgJSBreadCrumbsCSSSelector', 
$wgJSBreadCrumbsSkinCSSArray[$skinName]);
-   } else {
-   $outPage->addJsConfigVars('wgJSBreadCrumbsCSSSelector', 
$wgJSBreadCrumbsSkinCSSSelector);
-   }
-
-   $outPage->addJsConfigVars('wgJSBreadCrumbsMaxCrumbs', 
$wgUser->getOption( "jsbreadcrumbs-numberofcrumbs" ));
-   $outPage->addJsConfigVars('wgJSBreadCrumbsShowSidebar', 
$wgUser->getOption( "jsbreadcrumbs-showcrumbssidebar" ));
-   
$outPage->addJsConfigVars('wgJSBreadCrumbsPervasiveWikiFarm', 
$wgUser->getOption ("jsbreadcrumbs-pervasivewikifarm" ));
-   $outPage->addJsConfigVars('wgJSBreadCrumbsSeparator', 
$separator);
-   $outPage->addJsConfigVars('wgJSBreadCrumbsCookiePath', 
$wgJSBreadCrumbsCookiePath);
-   
$outPage->addJsConfigVars('wgJSBreadCrumbsLeadingDescription', 
$wgUser->getOption( "jsbreadcrumbs-leading-description" ));
-   
$outPage->addJsConfigVars('wgJSBreadCrumbsShowSiteName', $wgUser->getOption( 
"jsbreadcrumbs-showsite" ));
-
-
-   global $wgTitle;
-   if ( self::getDisplayTitle($wgTitle, $displayTitle) ) {
-
-   if(trim( str_replace( '', '', strip_tags( 
$displayTitle ) ) ) != '' ) {
-   
$outPage->addJsConfigVars('wgJSBreadCrumbsPageName', $displayTitle );
-   } else {
-   
$outPage->addJsConfigVars('wgJSBreadCrumbsPageName', 
$wgTitle->getPrefixedText());
-   }
-   } else {
-   $outPage->addJsConfigVars('wgJSBreadCrumbsPageName', 
$wgTitle->getPrefixedText());
-   }
-
-   $vars = array_merge( $vars, $variables );
-
-   return true;
-   }
-
-   /**
-* GetPreferences hook
-*
-* Add module-releated items to the preferences
-*/
-   public static function addPreferences( $user, $defaultPreferences ) {
-   $defaultPreferences['jsbreadcrumbs-showcrumbs'] = array(
-   'type' => 'toggle',
-   'label-message' => 'prefs-jsbreadcrumbs-showcrumbs',
-   'section' => 'rendering/jsbreadcrumbs',
-   );
-
-   $defaultPreferences['jsbreadcrumbs-showcrumbssidebar'] = array(
-   'type' => 'toggle',
-   'label-message' => 
'prefs-jsbreadcrumbs-showcrumbssidebar',
-   'section' => 'rendering/jsbreadcrumbs',
-   );
-
-   $defaultPreferences['jsbreadcrumbs-showsite'] = array(
-   'type' => 'toggle',
-   'label-message' => 'prefs-jsbreadcrumbs-showsite',
-

[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Fix link to user page in header (personal URLs)

2017-10-31 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/387759 )

Change subject: Fix link to user page in header (personal URLs)
..


Fix link to user page in header (personal URLs)

Change-Id: Ic7f26c2f84a4d240feab784901cad3d634f0eb46
---
M extension.json
M includes/DisplayTitleHooks.php
2 files changed, 25 insertions(+), 3 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/extension.json b/extension.json
index 2c4a8ec..23f0ea2 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "DisplayTitle",
-   "version": "1.4",
+   "version": "1.5",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]",
"[https://www.semantic-mediawiki.org/wiki/User:Oetterer Tobias 
Oetterer]"
@@ -25,6 +25,7 @@
"ParserFirstCallInit": 
"DisplayTitleHooks::onParserFirstCallInit",
"ParserBeforeStrip": "DisplayTitleHooks::onParserBeforeStrip",
"BeforePageDisplay": "DisplayTitleHooks::onBeforePageDisplay",
+   "PersonalUrls": "DisplayTitleHooks::onPersonalUrls",
"HtmlPageLinkRendererBegin": 
"DisplayTitleHooks::onHtmlPageLinkRendererBegin",
"ScribuntoExternalLibraries": 
"DisplayTitleHooks::onScribuntoExternalLibraries",
"SelfLinkBegin": "DisplayTitleHooks::onSelfLinkBegin"
diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index 88694fb..4e45b2f 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -34,9 +34,30 @@
}
 
/**
+* Implements PersonalUrls hook.
+* See https://www.mediawiki.org/wiki/Manual:Hooks/PersonalUrls
+* Handle links. Implements HtmlPageLinkRendererBegin hook of 
LinkRenderer class.
+*
+* @since 1.5
+* @param array &$personal_urls the array of URLs set up so far
+* @param Title $title the Title object of the current article
+* @param SkinTemplate $skin SkinTemplate object providing context
+*/
+   public static function onPersonalUrls( array &$personal_urls, Title 
$title,
+   SkinTemplate $skin ) {
+   if ( $skin->getUser()->isLoggedIn() &&
+   isset( $personal_urls['userpage'] ) ) {
+   $pagename = $personal_urls['userpage']['text'];
+   $title = $skin->getUser()->getUserPage();
+   self::getDisplayTitle( $title, $pagename );
+   $personal_urls['userpage']['text'] = $pagename;
+   }
+   }
+
+   /**
 * Implements HtmlPageLinkRendererBegin hook.
 * See 
https://www.mediawiki.org/wiki/Manual:Hooks/HtmlPageLinkRendererBegin
-* Handle links. Implements HtmlPageLinkRendererBegin hook of 
LinkRenderer class.
+* Handle links to other pages.
 *
 * @since 1.4
 * @param LinkRenderer $linkRenderer the LinkRenderer object
@@ -90,7 +111,7 @@
$title = null;
if ( is_string( $html ) ) {
$title = Title::newFromText( $html );
-   } else if ( get_class( $html ) == 'HtmlArmor' ) {
+   } elseif ( get_class( $html ) == 'HtmlArmor' ) {
$title = Title::newFromText( 
HtmlArmor::getHtml( $html ) );
}
if ( !is_null( $title ) &&

-- 
To view, visit https://gerrit.wikimedia.org/r/387759
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic7f26c2f84a4d240feab784901cad3d634f0eb46
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DisplayTitle
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Fix link to user page in header (personal URLs)

2017-10-31 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387759 )

Change subject: Fix link to user page in header (personal URLs)
..

Fix link to user page in header (personal URLs)

Change-Id: Ic7f26c2f84a4d240feab784901cad3d634f0eb46
---
M extension.json
M includes/DisplayTitleHooks.php
2 files changed, 24 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DisplayTitle 
refs/changes/59/387759/1

diff --git a/extension.json b/extension.json
index 2c4a8ec..23f0ea2 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "DisplayTitle",
-   "version": "1.4",
+   "version": "1.5",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]",
"[https://www.semantic-mediawiki.org/wiki/User:Oetterer Tobias 
Oetterer]"
@@ -25,6 +25,7 @@
"ParserFirstCallInit": 
"DisplayTitleHooks::onParserFirstCallInit",
"ParserBeforeStrip": "DisplayTitleHooks::onParserBeforeStrip",
"BeforePageDisplay": "DisplayTitleHooks::onBeforePageDisplay",
+   "PersonalUrls": "DisplayTitleHooks::onPersonalUrls",
"HtmlPageLinkRendererBegin": 
"DisplayTitleHooks::onHtmlPageLinkRendererBegin",
"ScribuntoExternalLibraries": 
"DisplayTitleHooks::onScribuntoExternalLibraries",
"SelfLinkBegin": "DisplayTitleHooks::onSelfLinkBegin"
diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index 88694fb..0a9f249 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -34,9 +34,30 @@
}
 
/**
+* Implements PersonalUrls hook.
+* See https://www.mediawiki.org/wiki/Manual:Hooks/PersonalUrls
+* Handle links. Implements HtmlPageLinkRendererBegin hook of 
LinkRenderer class.
+*
+* @since 1.5
+* @param array &$personal_urls the array of URLs set up so far
+* @param Title $title the Title object of the current article
+* @param SkinTemplate $skin SkinTemplate object providing context
+*/
+   public static function onPersonalUrls( array &$personal_urls, Title 
$title,
+   SkinTemplate $skin ) {
+   if ( $skin->getUser()->isLoggedIn() &&
+   isset( $personal_urls['userpage'] ) ) {
+   $pagename = $personal_urls['userpage']['text'];
+   $title = $skin->getUser()->getUserPage();
+   self::getDisplayTitle( $title, $pagename );
+   $personal_urls['userpage']['text'] = $pagename;
+   }
+   }
+
+   /**
 * Implements HtmlPageLinkRendererBegin hook.
 * See 
https://www.mediawiki.org/wiki/Manual:Hooks/HtmlPageLinkRendererBegin
-* Handle links. Implements HtmlPageLinkRendererBegin hook of 
LinkRenderer class.
+* Handle links to other pages.
 *
 * @since 1.4
 * @param LinkRenderer $linkRenderer the LinkRenderer object

-- 
To view, visit https://gerrit.wikimedia.org/r/387759
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7f26c2f84a4d240feab784901cad3d634f0eb46
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DisplayTitle
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Text that should have overridden link text was being ignored.

2017-10-31 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/387750 )

Change subject: Text that should have overridden link text was being ignored.
..


Text that should have overridden link text was being ignored.

Change-Id: Ia04c0a7371edffa4512100f1cd6d884ae49e6701
---
M includes/DisplayTitleHooks.php
1 file changed, 8 insertions(+), 3 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index 280b331..88694fb 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -82,12 +82,17 @@
 *
 * @since 1.3
 * @param Title $target the Title object that the link is pointing to
-* @param string &$html the HTML of the link text
+* @param string|HtmlArmor &$html the HTML of the link text
 * @return bool continue checking hooks
 */
private static function handleLink( Title $target, &$html ) {
-   if ( isset( $html ) && is_string( $html ) ) {
-   $title = Title::newFromText( $html );
+   if ( isset( $html ) ) {
+   $title = null;
+   if ( is_string( $html ) ) {
+   $title = Title::newFromText( $html );
+   } else if ( get_class( $html ) == 'HtmlArmor' ) {
+   $title = Title::newFromText( 
HtmlArmor::getHtml( $html ) );
+   }
if ( !is_null( $title ) &&
$title->getText() === $target->getText() &&
( $title->getSubjectNsText() === 
$target->getSubjectNsText() ||

-- 
To view, visit https://gerrit.wikimedia.org/r/387750
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia04c0a7371edffa4512100f1cd6d884ae49e6701
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DisplayTitle
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Text that should have overridden link text was being ignored.

2017-10-31 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387750 )

Change subject: Text that should have overridden link text was being ignored.
..

Text that should have overridden link text was being ignored.

Change-Id: Ia04c0a7371edffa4512100f1cd6d884ae49e6701
---
M extension.json
M includes/DisplayTitleHooks.php
2 files changed, 9 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DisplayTitle 
refs/changes/50/387750/1

diff --git a/extension.json b/extension.json
index 2c4a8ec..22e9444 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "DisplayTitle",
-   "version": "1.4",
+   "version": "1.4.1",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]",
"[https://www.semantic-mediawiki.org/wiki/User:Oetterer Tobias 
Oetterer]"
diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index 280b331..88694fb 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -82,12 +82,17 @@
 *
 * @since 1.3
 * @param Title $target the Title object that the link is pointing to
-* @param string &$html the HTML of the link text
+* @param string|HtmlArmor &$html the HTML of the link text
 * @return bool continue checking hooks
 */
private static function handleLink( Title $target, &$html ) {
-   if ( isset( $html ) && is_string( $html ) ) {
-   $title = Title::newFromText( $html );
+   if ( isset( $html ) ) {
+   $title = null;
+   if ( is_string( $html ) ) {
+   $title = Title::newFromText( $html );
+   } else if ( get_class( $html ) == 'HtmlArmor' ) {
+   $title = Title::newFromText( 
HtmlArmor::getHtml( $html ) );
+   }
if ( !is_null( $title ) &&
$title->getText() === $target->getText() &&
( $title->getSubjectNsText() === 
$target->getSubjectNsText() ||

-- 
To view, visit https://gerrit.wikimedia.org/r/387750
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia04c0a7371edffa4512100f1cd6d884ae49e6701
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DisplayTitle
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Updated to use LinkRenderer

2017-10-28 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/387066 )

Change subject: Updated to use LinkRenderer
..


Updated to use LinkRenderer

Converted LinkBegin hook to HtmlPageLinkRendererBegin
Moved source files into includes subdirectory
Fixed style errors in DisplayTitleLuaLibrary found by phpcs

Change-Id: I61968a0d96f777cac6627ea22de33e39e0b16e86
---
M COPYING
D DisplayTitle.i18n.magic.php
M extension.json
A includes/DisplayTitle.i18n.magic.php
R includes/DisplayTitleHooks.php
R includes/DisplayTitleLuaLibrary.php
R includes/displaytitle.lua
7 files changed, 40 insertions(+), 89 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/COPYING b/COPYING
index 20db8a2..469811e 100644
--- a/COPYING
+++ b/COPYING
@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright (c) 2016 The MITRE Corporation
+Copyright (c) 2016-2017 The MITRE Corporation
 
 Permission is hereby granted, free of charge, to any person obtaining a
 copy of this software and associated documentation files (the "Software"),
diff --git a/DisplayTitle.i18n.magic.php b/DisplayTitle.i18n.magic.php
deleted file mode 100644
index 6c6dc4e..000
--- a/DisplayTitle.i18n.magic.php
+++ /dev/null
@@ -1,28 +0,0 @@
- [ 0, 'getdisplaytitle' ]
-];
diff --git a/extension.json b/extension.json
index c31581d..2c4a8ec 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "DisplayTitle",
-   "version": "1.3",
+   "version": "1.4",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]",
"[https://www.semantic-mediawiki.org/wiki/User:Oetterer Tobias 
Oetterer]"
@@ -15,17 +15,17 @@
]
},
"ExtensionMessagesFiles": {
-   "DisplayTitleMagic": "DisplayTitle.i18n.magic.php"
+   "DisplayTitleMagic": "includes/DisplayTitle.i18n.magic.php"
},
"AutoloadClasses": {
-   "DisplayTitleHooks": "DisplayTitleHooks.php",
-   "DisplayTitleLuaLibrary": "DisplayTitleLuaLibrary.php"
+   "DisplayTitleHooks": "includes/DisplayTitleHooks.php",
+   "DisplayTitleLuaLibrary": "includes/DisplayTitleLuaLibrary.php"
},
"Hooks": {
"ParserFirstCallInit": 
"DisplayTitleHooks::onParserFirstCallInit",
"ParserBeforeStrip": "DisplayTitleHooks::onParserBeforeStrip",
"BeforePageDisplay": "DisplayTitleHooks::onBeforePageDisplay",
-   "LinkBegin": "DisplayTitleHooks::onLinkBegin",
+   "HtmlPageLinkRendererBegin": 
"DisplayTitleHooks::onHtmlPageLinkRendererBegin",
"ScribuntoExternalLibraries": 
"DisplayTitleHooks::onScribuntoExternalLibraries",
"SelfLinkBegin": "DisplayTitleHooks::onSelfLinkBegin"
},
diff --git a/includes/DisplayTitle.i18n.magic.php 
b/includes/DisplayTitle.i18n.magic.php
new file mode 100644
index 000..8a8bd11
--- /dev/null
+++ b/includes/DisplayTitle.i18n.magic.php
@@ -0,0 +1,7 @@
+ [ 0, 'getdisplaytitle' ]
+];
diff --git a/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
similarity index 76%
rename from DisplayTitleHooks.php
rename to includes/DisplayTitleHooks.php
index 3990273..280b331 100644
--- a/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -1,25 +1,4 @@
 https://www.mediawiki.org/wiki/Manual:Hooks/LinkBegin
-* Handle links. Implements LinkBegin hook of Linker class.
+* Implements HtmlPageLinkRendererBegin hook.
+* See 
https://www.mediawiki.org/wiki/Manual:Hooks/HtmlPageLinkRendererBegin
+* Handle links. Implements HtmlPageLinkRendererBegin hook of 
LinkRenderer class.
 *
-* @since 1.0
-* @param string $dummy no longer used
-* @param Title $target the Title object that the link is pointing to
-* @param string &$html the HTML of the link text
-* @param array &$customAttribs HTML attributes
-* @param string &$query query string
-* @param array &$options options
+* @since 1.4
+* @param LinkRenderer $linkRenderer the LinkRenderer object
+* @param LinkTarget $target the LinkTarget that the link is pointing to
+* @param string|HtmlArmor &$text the contents that the  tag should 
have
+* @param array &$extraAttribs the HTML attributes that the  tag 
should have
+* @param string &$query the query string to add to the generated URL
 * @param string &$ret the value to return if the hook returns false
 * @return bool continue checking hooks
 */
-   public static function onLinkBegin( $dummy, Title $target, &$html,
-   &$customAttribs, &$query, &$options, &$ret ) {
-   return self::handleLink( $target, $html );
+   public static function onHtmlPageLinkRendererBegin(
+   

[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Updated to use LinkRenderer

2017-10-28 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387066 )

Change subject: Updated to use LinkRenderer
..

Updated to use LinkRenderer

Converted LinkBegin hook to HtmlPageLinkRendererBegin
Moved source files into includes subdirectory
Fixed style errors in DisplayTitleLuaLibrary found by phpcs

Change-Id: I61968a0d96f777cac6627ea22de33e39e0b16e86
---
M COPYING
D DisplayTitle.i18n.magic.php
M extension.json
A includes/DisplayTitle.i18n.magic.php
R includes/DisplayTitleHooks.php
R includes/DisplayTitleLuaLibrary.php
R includes/displaytitle.lua
7 files changed, 40 insertions(+), 89 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DisplayTitle 
refs/changes/66/387066/1

diff --git a/COPYING b/COPYING
index 20db8a2..469811e 100644
--- a/COPYING
+++ b/COPYING
@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright (c) 2016 The MITRE Corporation
+Copyright (c) 2016-2017 The MITRE Corporation
 
 Permission is hereby granted, free of charge, to any person obtaining a
 copy of this software and associated documentation files (the "Software"),
diff --git a/DisplayTitle.i18n.magic.php b/DisplayTitle.i18n.magic.php
deleted file mode 100644
index 6c6dc4e..000
--- a/DisplayTitle.i18n.magic.php
+++ /dev/null
@@ -1,28 +0,0 @@
- [ 0, 'getdisplaytitle' ]
-];
diff --git a/extension.json b/extension.json
index c31581d..2c4a8ec 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "DisplayTitle",
-   "version": "1.3",
+   "version": "1.4",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]",
"[https://www.semantic-mediawiki.org/wiki/User:Oetterer Tobias 
Oetterer]"
@@ -15,17 +15,17 @@
]
},
"ExtensionMessagesFiles": {
-   "DisplayTitleMagic": "DisplayTitle.i18n.magic.php"
+   "DisplayTitleMagic": "includes/DisplayTitle.i18n.magic.php"
},
"AutoloadClasses": {
-   "DisplayTitleHooks": "DisplayTitleHooks.php",
-   "DisplayTitleLuaLibrary": "DisplayTitleLuaLibrary.php"
+   "DisplayTitleHooks": "includes/DisplayTitleHooks.php",
+   "DisplayTitleLuaLibrary": "includes/DisplayTitleLuaLibrary.php"
},
"Hooks": {
"ParserFirstCallInit": 
"DisplayTitleHooks::onParserFirstCallInit",
"ParserBeforeStrip": "DisplayTitleHooks::onParserBeforeStrip",
"BeforePageDisplay": "DisplayTitleHooks::onBeforePageDisplay",
-   "LinkBegin": "DisplayTitleHooks::onLinkBegin",
+   "HtmlPageLinkRendererBegin": 
"DisplayTitleHooks::onHtmlPageLinkRendererBegin",
"ScribuntoExternalLibraries": 
"DisplayTitleHooks::onScribuntoExternalLibraries",
"SelfLinkBegin": "DisplayTitleHooks::onSelfLinkBegin"
},
diff --git a/includes/DisplayTitle.i18n.magic.php 
b/includes/DisplayTitle.i18n.magic.php
new file mode 100644
index 000..8a8bd11
--- /dev/null
+++ b/includes/DisplayTitle.i18n.magic.php
@@ -0,0 +1,7 @@
+ [ 0, 'getdisplaytitle' ]
+];
diff --git a/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
similarity index 76%
rename from DisplayTitleHooks.php
rename to includes/DisplayTitleHooks.php
index 3990273..280b331 100644
--- a/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -1,25 +1,4 @@
 https://www.mediawiki.org/wiki/Manual:Hooks/LinkBegin
-* Handle links. Implements LinkBegin hook of Linker class.
+* Implements HtmlPageLinkRendererBegin hook.
+* See 
https://www.mediawiki.org/wiki/Manual:Hooks/HtmlPageLinkRendererBegin
+* Handle links. Implements HtmlPageLinkRendererBegin hook of 
LinkRenderer class.
 *
-* @since 1.0
-* @param string $dummy no longer used
-* @param Title $target the Title object that the link is pointing to
-* @param string &$html the HTML of the link text
-* @param array &$customAttribs HTML attributes
-* @param string &$query query string
-* @param array &$options options
+* @since 1.4
+* @param LinkRenderer $linkRenderer the LinkRenderer object
+* @param LinkTarget $target the LinkTarget that the link is pointing to
+* @param string|HtmlArmor &$text the contents that the  tag should 
have
+* @param array &$extraAttribs the HTML attributes that the  tag 
should have
+* @param string &$query the query string to add to the generated URL
 * @param string &$ret the value to return if the hook returns false
 * @return bool continue checking hooks
 */
-   public static function onLinkBegin( $dummy, Title $target, &$html,
-   &$customAttribs, &$query, &$options, &$ret ) {
-   return self::handleLink( $target, $html );
+   public static function 

[MediaWiki-commits] [Gerrit] mediawiki...CreateUserPage[master]: Added $wgCreateUserPage_OnLogin.

2017-10-28 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387064 )

Change subject: Added $wgCreateUserPage_OnLogin.
..

Added $wgCreateUserPage_OnLogin.

Change-Id: I63c7b69a2efc68d9212bc001c8efdecf9c00c4d5
---
M extension.json
M includes/CreateUserPageHooks.php
2 files changed, 38 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CreateUserPage 
refs/changes/64/387064/1

diff --git a/extension.json b/extension.json
index 14921e9..f91e519 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CreateUserPage",
-   "version": "1.1.1",
+   "version": "1.2",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
],
@@ -18,11 +18,15 @@
},
"Hooks": {
"UserLoginComplete": [
-   "CreateUserPageHooks::checkForUserPage"
+   "CreateUserPageHooks::onUserLoginComplete"
+   ],
+   "OutputPageParserOutput": [
+   "CreateUserPageHooks::onOutputPageParserOutput"
]
},
"config": {
-   "CreateUserPage_PageContent": "{{User}}"
+   "CreateUserPage_PageContent": "{{User}}",
+   "CreateUserPage_OnLogin": true
},
"manifest_version": 1
 }
diff --git a/includes/CreateUserPageHooks.php b/includes/CreateUserPageHooks.php
index acaf6ec..85d4b5a 100755
--- a/includes/CreateUserPageHooks.php
+++ b/includes/CreateUserPageHooks.php
@@ -1,35 +1,42 @@
 https://www.mediawiki.org/wiki/Manual:Hooks/UserLoginComplete
+* Check for existence of user page if $wgCreateUserPage_OnLogin is true
+*
+* @param User &$user the user object that was create on login
+* @param string &$inject_html any HTML to inject after the login 
success message
+*/
+   public static function onUserLoginComplete( User &$user, &$inject_html 
) {
+   if ( $GLOBALS["wgCreateUserPage_OnLogin"] ) {
+   self::checkForUserPage( $user );
+   }
+   }
+
+   /**
+* Implements OutputPageParserOutput hook.
+* See 
https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageParserOutput
+* Check for existence of user page if $wgCreateUserPage_OnLogin is fale
+*
+* @param OutputPage &$out the OutputPage object to which wikitext is 
added
+* @param ParserOutput $parseroutput a PaerserOutput object
+*/
+   public static function onOutputPageParserOutput( OutputPage &$out,
+   ParserOutput $parseroutput ) {
+   if ( !$GLOBALS["wgCreateUserPage_OnLogin"] ) {
+   self::checkForUserPage( $out->getUser() );
+   }
+   }
+
+   private static function checkForUserPage( User $user ) {
$title = Title::newFromText( 'User:' . $user->mName );
if ( !is_null( $title ) && !$title->exists() ) {
$page = new WikiPage( $title );
$pageContent = new WikitextContent( 
$GLOBALS['wgCreateUserPage_PageContent'] );
-   $page->doEditContent( $pageContent, 'create user page', 
EDIT_NEW);
+   $page->doEditContent( $pageContent, 'create user page', 
EDIT_NEW );
}
}
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/387064
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63c7b69a2efc68d9212bc001c8efdecf9c00c4d5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CreateUserPage
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Removed foreign key that was causing errors on page deletion.

2017-10-20 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/384998 )

Change subject: Removed foreign key that was causing errors on page deletion.
..


Removed foreign key that was causing errors on page deletion.

T178502
T178503

Change-Id: I7a3336c059f510e5b6fc583f3541170eccedc76a
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/CommentStreamsHooks.php
M sql/commentData.sql
A sql/dropForeignKey1.sql
A sql/dropForeignKey2.sql
M sql/votes.sql
M sql/watch.sql
9 files changed, 29 insertions(+), 15 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/extension.json b/extension.json
index 99a24fe..23f6d2b 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CommentStreams",
-   "version": "4.0",
+   "version": "4.1",
"author": [
"[http://www.mediawiki.org/wiki/User:Jji Jason Ji]",
"[http://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
diff --git a/i18n/en.json b/i18n/en.json
index e5f7d77..501fac6 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -7,6 +7,7 @@
},
"commentstreams-desc": "Allows commenting on wiki pages",
"commentstreams-error-prohibitedaction": "Action $1 is not allowed on 
comment pages.",
+   "commentstreams-error-comment-on-deleted-page": "The page with which 
this comment is associated has been deleted.",
"commentstreams-author-anonymous": "anonymous",
"apihelp-csQueryComment-description": "Return the title, user, creation 
timestamp, and wikitext of a comment. Either pageid or title must be provided.",
"apihelp-csQueryComment-summary": "Return the title, user, creation 
timestamp, and wikitext of a comment. Either pageid or title must be provided.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 01e077c..f52a487 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -8,6 +8,7 @@
},
"commentstreams-desc": 
"{{desc|name=CommentStreams|url=https://www.mediawiki.org/wiki/Extension:CommentStreams}};,
"commentstreams-error-prohibitedaction": "Error message.",
+   "commentstreams-error-comment-on-deleted-page": "Error message.",
"commentstreams-author-anonymous": "The name displayed for anonymous 
comment authors\n{{Identical|Anonymous}}",
"apihelp-csQueryComment-description": 
"{{doc-apihelp-description|csQueryComment}}",
"apihelp-csQueryComment-summary": 
"{{doc-apihelp-summary|csQueryComment}}",
diff --git a/includes/CommentStreamsHooks.php b/includes/CommentStreamsHooks.php
index aaa5623..54015ea 100644
--- a/includes/CommentStreamsHooks.php
+++ b/includes/CommentStreamsHooks.php
@@ -39,6 +39,10 @@
$updater->addExtensionTable( 'cs_watchlist', $dir . 'watch.sql' 
);
$updater->modifyExtensionField( 'cs_comment_data', 'page_id',
$dir . 'updateFieldNames.sql' );
+   $updater->dropExtensionIndex( 'cs_comment_data', 
'assoc_page_id',
+   $dir . 'dropForeignKey1.sql' );
+   $updater->dropExtensionIndex( 'cs_comment_data', 
'cst_assoc_page_id',
+   $dir . 'dropForeignKey2.sql' );
return true;
}
 
@@ -107,8 +111,12 @@
}
$link = Linker::link( $associatedTitle, '< ' . 
$displaytitle );
$output->setSubtitle( $link );
-   $output->addWikitext( $comment->getHTML() );
+   } else {
+   $message =
+   wfMessage( 
'commentstreams-error-comment-on-deleted-page' )->text();
+   $output->addHTML( '' . 
$message . '' );
}
+   $output->addWikitext( $comment->getHTML() );
}
return false;
}
@@ -324,6 +332,7 @@

$GLOBALS['wgGroupPermissions']['csmoderator']['cs-moderator-edit'] =
false;
}
+   $GLOBALS['wgAvailableRights'][] = 'cs-comment';
$GLOBALS['wgAvailableRights'][] = 'cs-moderator-edit';
$GLOBALS['wgAvailableRights'][] = 'cs-moderator-delete';
$GLOBALS['wgLogTypes'][] = 'commentstreams';
diff --git a/sql/commentData.sql b/sql/commentData.sql
index fd817ea..d8d26d7 100644
--- a/sql/commentData.sql
+++ b/sql/commentData.sql
@@ -1,9 +1,8 @@
 CREATE TABLE IF NOT EXISTS /*_*/cs_comment_data
 (
-page_id int(10) unsigned,
-assoc_page_id int(10) unsigned,
-parent_page_id int(10) unsigned,
-comment_title varbinary(255),
-PRIMARY KEY (page_id),
-FOREIGN KEY (assoc_page_id) REFERENCES page(page_id)
+cst_page_id int(10) unsigned,
+cst_assoc_page_id int(10) unsigned,

[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Removed foreign key that was causing errors on page deletion.

2017-10-18 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384998 )

Change subject: Removed foreign key that was causing errors on page deletion.
..

Removed foreign key that was causing errors on page deletion.

T178502

Change-Id: I7a3336c059f510e5b6fc583f3541170eccedc76a
---
M includes/CommentStreamsHooks.php
M sql/commentData.sql
A sql/dropForeignKey1.sql
A sql/dropForeignKey2.sql
M sql/votes.sql
M sql/watch.sql
6 files changed, 20 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/98/384998/1

diff --git a/includes/CommentStreamsHooks.php b/includes/CommentStreamsHooks.php
index aaa5623..7f285f0 100644
--- a/includes/CommentStreamsHooks.php
+++ b/includes/CommentStreamsHooks.php
@@ -39,6 +39,10 @@
$updater->addExtensionTable( 'cs_watchlist', $dir . 'watch.sql' 
);
$updater->modifyExtensionField( 'cs_comment_data', 'page_id',
$dir . 'updateFieldNames.sql' );
+   $updater->dropExtensionIndex( 'cs_comment_data', 
'assoc_page_id',
+   $dir . 'dropForeignKey1.sql' );
+   $updater->dropExtensionIndex( 'cs_comment_data', 
'cst_assoc_page_id',
+   $dir . 'dropForeignKey2.sql' );
return true;
}
 
diff --git a/sql/commentData.sql b/sql/commentData.sql
index fd817ea..d8d26d7 100644
--- a/sql/commentData.sql
+++ b/sql/commentData.sql
@@ -1,9 +1,8 @@
 CREATE TABLE IF NOT EXISTS /*_*/cs_comment_data
 (
-page_id int(10) unsigned,
-assoc_page_id int(10) unsigned,
-parent_page_id int(10) unsigned,
-comment_title varbinary(255),
-PRIMARY KEY (page_id),
-FOREIGN KEY (assoc_page_id) REFERENCES page(page_id)
+cst_page_id int(10) unsigned,
+cst_assoc_page_id int(10) unsigned,
+cst_parent_page_id int(10) unsigned,
+cst_comment_title varbinary(255),
+PRIMARY KEY (cst_page_id)
 );
diff --git a/sql/dropForeignKey1.sql b/sql/dropForeignKey1.sql
new file mode 100644
index 000..a8b4d94
--- /dev/null
+++ b/sql/dropForeignKey1.sql
@@ -0,0 +1,2 @@
+ALTER TABLE /*_*/cs_comment_data DROP FOREIGN KEY cs_comment_data_ibfk_1;
+ALTER TABLE /*_*/cs_comment_data DROP INDEX assoc_page_id;
diff --git a/sql/dropForeignKey2.sql b/sql/dropForeignKey2.sql
new file mode 100644
index 000..f2f7ae4
--- /dev/null
+++ b/sql/dropForeignKey2.sql
@@ -0,0 +1,2 @@
+ALTER TABLE /*_*/cs_comment_data DROP FOREIGN KEY cs_comment_data_ibfk_1;
+ALTER TABLE /*_*/cs_comment_data DROP INDEX cst_assoc_page_id;
diff --git a/sql/votes.sql b/sql/votes.sql
index 4820db5..cffdcb2 100644
--- a/sql/votes.sql
+++ b/sql/votes.sql
@@ -1,7 +1,7 @@
 CREATE TABLE IF NOT EXISTS /*_*/cs_votes
 (
-page_id int(10) unsigned NOT NULL,
-user_id int(10) unsigned NOT NULL,
-vote tinyint NOT NULL,
-INDEX (page_id, user_id)
+cst_v_page_id int(10) unsigned NOT NULL,
+cst_v_user_id int(10) unsigned NOT NULL,
+cst_v_vote tinyint NOT NULL,
+INDEX (cst_v_page_id, cst_v_user_id)
 );
diff --git a/sql/watch.sql b/sql/watch.sql
index 0d39e2f..33e05ae 100644
--- a/sql/watch.sql
+++ b/sql/watch.sql
@@ -1,6 +1,6 @@
 CREATE TABLE IF NOT EXISTS /*_*/cs_watchlist
 (
-page_id int(10) unsigned NOT NULL,
-user_id int(10) unsigned NOT NULL,
-INDEX (page_id, user_id)
+cst_wl_page_id int(10) unsigned NOT NULL,
+cst_wl_user_id int(10) unsigned NOT NULL,
+INDEX (cst_wl_page_id, cst_wl_user_id)
 );

-- 
To view, visit https://gerrit.wikimedia.org/r/384998
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a3336c059f510e5b6fc583f3541170eccedc76a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_29]: Fix login button label to accept RawMessage.

2017-10-17 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384916 )

Change subject: Fix login button label to accept RawMessage.
..

Fix login button label to accept RawMessage.

The label is already a Message at this point. For Messages that
are not RawMessages, the call to wfMessage() does not do any harm.
However, for RawMessages, it causes the label to appear in <>.
Removing the call to wfMessage() does not harm regular Messages
and fixes the problem for RawMessages.

Change-Id: I943628e2a1fbf6fff579dd52c1058ca2ef125d34
(cherry picked from commit b1ddb0cef127d75e2045d4cc3aba4d612b2f7676)
---
M includes/specialpage/AuthManagerSpecialPage.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/16/384916/1

diff --git a/includes/specialpage/AuthManagerSpecialPage.php 
b/includes/specialpage/AuthManagerSpecialPage.php
index fbc3022a..5dfe279 100644
--- a/includes/specialpage/AuthManagerSpecialPage.php
+++ b/includes/specialpage/AuthManagerSpecialPage.php
@@ -679,7 +679,7 @@
];
 
if ( $type === 'submit' && isset( $singleFieldInfo['label'] ) ) 
{
-   $descriptor['default'] = wfMessage( 
$singleFieldInfo['label'] )->plain();
+   $descriptor['default'] = 
$singleFieldInfo['label']->plain();
} elseif ( $type !== 'submit' ) {
$descriptor += array_filter( [
// help-message is omitted as it is usually not 
really useful for a web interface

-- 
To view, visit https://gerrit.wikimedia.org/r/384916
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I943628e2a1fbf6fff579dd52c1058ca2ef125d34
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_29
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_30]: Fix login button label to accept RawMessage.

2017-10-17 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384915 )

Change subject: Fix login button label to accept RawMessage.
..

Fix login button label to accept RawMessage.

The label is already a Message at this point. For Messages that
are not RawMessages, the call to wfMessage() does not do any harm.
However, for RawMessages, it causes the label to appear in <>.
Removing the call to wfMessage() does not harm regular Messages
and fixes the problem for RawMessages.

Change-Id: I943628e2a1fbf6fff579dd52c1058ca2ef125d34
(cherry picked from commit b1ddb0cef127d75e2045d4cc3aba4d612b2f7676)
---
M includes/specialpage/AuthManagerSpecialPage.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/15/384915/1

diff --git a/includes/specialpage/AuthManagerSpecialPage.php 
b/includes/specialpage/AuthManagerSpecialPage.php
index 0cdc55f..95729f3 100644
--- a/includes/specialpage/AuthManagerSpecialPage.php
+++ b/includes/specialpage/AuthManagerSpecialPage.php
@@ -679,7 +679,7 @@
];
 
if ( $type === 'submit' && isset( $singleFieldInfo['label'] ) ) 
{
-   $descriptor['default'] = wfMessage( 
$singleFieldInfo['label'] )->plain();
+   $descriptor['default'] = 
$singleFieldInfo['label']->plain();
} elseif ( $type !== 'submit' ) {
$descriptor += array_filter( [
// help-message is omitted as it is usually not 
really useful for a web interface

-- 
To view, visit https://gerrit.wikimedia.org/r/384915
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I943628e2a1fbf6fff579dd52c1058ca2ef125d34
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_30
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Allow override of button text. Coding style.

2017-10-17 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/384768 )

Change subject: Allow override of button text. Coding style.
..


Allow override of button text. Coding style.

Change-Id: I2bbbc7a1750945cb8d301780fcbcaf65ac405078
---
M extension.json
M includes/PluggableAuthBeginAuthenticationRequest.php
2 files changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index 9b4954e..39667cd 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "PluggableAuth",
-   "version": "5.3",
+   "version": "5.4",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
],
@@ -50,6 +50,7 @@
"PluggableAuth_EnableAutoLogin": false,
"PluggableAuth_EnableLocalLogin": false,
"PluggableAuth_EnableLocalProperties": false,
+   "PluggableAuth_ButtonLabel": null,
"PluggableAuth_ExtraLoginFields": []
},
"manifest_version": 1
diff --git a/includes/PluggableAuthBeginAuthenticationRequest.php 
b/includes/PluggableAuthBeginAuthenticationRequest.php
index 2ca9b74..a749748 100644
--- a/includes/PluggableAuthBeginAuthenticationRequest.php
+++ b/includes/PluggableAuthBeginAuthenticationRequest.php
@@ -7,9 +7,16 @@
ButtonAuthenticationRequest {
 
public function __construct() {
+   if ( isset( $GLOBALS['wgPluggableAuth_ButtonLabelMessage'] ) ) {
+   $label = wfMessage( 
$GLOBALS['wgPluggableAuth_ButtonLabelMessage'] );
+   } elseif ( $GLOBALS['wgPluggableAuth_ButtonLabel'] ) {
+   $label = new RawMessage( 
$GLOBALS['wgPluggableAuth_ButtonLabel'] );
+   } else {
+   $label = wfMessage( 'pluggableauth-loginbutton-label' );
+   }
parent::__construct(
'pluggableauthlogin',
-   wfMessage( 'pluggableauth-loginbutton-label' ),
+   $label,
wfMessage( 'pluggableauth-loginbutton-help' ),
true );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/384768
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2bbbc7a1750945cb8d301780fcbcaf65ac405078
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Coding style.

2017-10-17 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/384911 )

Change subject: Coding style.
..


Coding style.

Change-Id: Ie4f261843f864fee5d4071ec10616ec3b944afd4
---
M includes/PluggableAuth.php
M includes/PluggableAuthBeginAuthenticationRequest.php
M includes/PluggableAuthLogin.php
M includes/PluggableAuthPrimaryAuthenticationProvider.php
4 files changed, 12 insertions(+), 13 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/includes/PluggableAuth.php b/includes/PluggableAuth.php
index a0ea3f1..b85d8d1 100644
--- a/includes/PluggableAuth.php
+++ b/includes/PluggableAuth.php
@@ -5,11 +5,11 @@
/**
 * @since 1.0
 *
-* @param &$id
-* @param &$username
-* @param &$realname
-* @param &$email
-* @param &$errorMessage
+* @param int &$id
+* @param string &$username
+* @param string &$realname
+* @param string &$email
+* @param string &$errorMessage
 */
abstract public function authenticate( &$id, &$username, &$realname,
&$email, &$errorMessage );
@@ -24,7 +24,7 @@
/**
 * @since 1.0
 *
-* @param $id
+* @param int $id
 */
abstract public function saveExtraAttributes( $id );
 
@@ -45,6 +45,5 @@
}
wfDebug( 'Could not get authentication plugin instance.' );
return false;
-
}
 }
diff --git a/includes/PluggableAuthBeginAuthenticationRequest.php 
b/includes/PluggableAuthBeginAuthenticationRequest.php
index fb3f151..2ca9b74 100644
--- a/includes/PluggableAuthBeginAuthenticationRequest.php
+++ b/includes/PluggableAuthBeginAuthenticationRequest.php
@@ -9,9 +9,9 @@
public function __construct() {
parent::__construct(
'pluggableauthlogin',
-   wfMessage('pluggableauth-loginbutton-label'),
-   wfMessage('pluggableauth-loginbutton-help'),
-   true);
+   wfMessage( 'pluggableauth-loginbutton-label' ),
+   wfMessage( 'pluggableauth-loginbutton-help' ),
+   true );
}
 
public function getFieldInfo() {
diff --git a/includes/PluggableAuthLogin.php b/includes/PluggableAuthLogin.php
index 113b226..8cf5f94 100644
--- a/includes/PluggableAuthLogin.php
+++ b/includes/PluggableAuthLogin.php
@@ -56,7 +56,7 @@
} else {
wfDebug( 'Authentication failure.' );
if ( is_null( $error ) ) {
-   $error = wfMessage( 
'pluggableauth-authentication-failure')->text();
+   $error = wfMessage( 
'pluggableauth-authentication-failure' )->text();
} else {
if ( !is_string( $error ) ) {
$error = strval( $error );
@@ -71,7 +71,7 @@
}
$returnToUrl = $authManager->getAuthenticationSessionData(
self::RETURNTOURL_SESSION_KEY );
-   if ( is_null( $returnToUrl) || count( $returnToUrl ) === 0 ) {
+   if ( is_null( $returnToUrl ) || count( $returnToUrl ) === 0 ) {
wfDebug( 'ERROR: return to URL is null or empty' );
} else {
$this->getOutput()->redirect( $returnToUrl );
diff --git a/includes/PluggableAuthPrimaryAuthenticationProvider.php 
b/includes/PluggableAuthPrimaryAuthenticationProvider.php
index 3f47ca0..655bbff 100644
--- a/includes/PluggableAuthPrimaryAuthenticationProvider.php
+++ b/includes/PluggableAuthPrimaryAuthenticationProvider.php
@@ -54,7 +54,7 @@
wfMessage( 
'pluggableauth-authentication-workflow-failure' ) );
}
$error = $this->manager->getAuthenticationSessionData(
-   PluggableAuthLogin::ERROR_SESSION_KEY ) ;
+   PluggableAuthLogin::ERROR_SESSION_KEY );
if ( !is_null( $error ) ) {
$this->manager->removeAuthenticationSessionData(
PluggableAuthLogin::ERROR_SESSION_KEY );

-- 
To view, visit https://gerrit.wikimedia.org/r/384911
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie4f261843f864fee5d4071ec10616ec3b944afd4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org

[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Coding style.

2017-10-17 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384911 )

Change subject: Coding style.
..

Coding style.

Change-Id: Ie4f261843f864fee5d4071ec10616ec3b944afd4
---
M includes/PluggableAuth.php
M includes/PluggableAuthBeginAuthenticationRequest.php
M includes/PluggableAuthLogin.php
M includes/PluggableAuthPrimaryAuthenticationProvider.php
4 files changed, 12 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PluggableAuth 
refs/changes/11/384911/1

diff --git a/includes/PluggableAuth.php b/includes/PluggableAuth.php
index a0ea3f1..b85d8d1 100644
--- a/includes/PluggableAuth.php
+++ b/includes/PluggableAuth.php
@@ -5,11 +5,11 @@
/**
 * @since 1.0
 *
-* @param &$id
-* @param &$username
-* @param &$realname
-* @param &$email
-* @param &$errorMessage
+* @param int &$id
+* @param string &$username
+* @param string &$realname
+* @param string &$email
+* @param string &$errorMessage
 */
abstract public function authenticate( &$id, &$username, &$realname,
&$email, &$errorMessage );
@@ -24,7 +24,7 @@
/**
 * @since 1.0
 *
-* @param $id
+* @param int $id
 */
abstract public function saveExtraAttributes( $id );
 
@@ -45,6 +45,5 @@
}
wfDebug( 'Could not get authentication plugin instance.' );
return false;
-
}
 }
diff --git a/includes/PluggableAuthBeginAuthenticationRequest.php 
b/includes/PluggableAuthBeginAuthenticationRequest.php
index fb3f151..2ca9b74 100644
--- a/includes/PluggableAuthBeginAuthenticationRequest.php
+++ b/includes/PluggableAuthBeginAuthenticationRequest.php
@@ -9,9 +9,9 @@
public function __construct() {
parent::__construct(
'pluggableauthlogin',
-   wfMessage('pluggableauth-loginbutton-label'),
-   wfMessage('pluggableauth-loginbutton-help'),
-   true);
+   wfMessage( 'pluggableauth-loginbutton-label' ),
+   wfMessage( 'pluggableauth-loginbutton-help' ),
+   true );
}
 
public function getFieldInfo() {
diff --git a/includes/PluggableAuthLogin.php b/includes/PluggableAuthLogin.php
index 113b226..8cf5f94 100644
--- a/includes/PluggableAuthLogin.php
+++ b/includes/PluggableAuthLogin.php
@@ -56,7 +56,7 @@
} else {
wfDebug( 'Authentication failure.' );
if ( is_null( $error ) ) {
-   $error = wfMessage( 
'pluggableauth-authentication-failure')->text();
+   $error = wfMessage( 
'pluggableauth-authentication-failure' )->text();
} else {
if ( !is_string( $error ) ) {
$error = strval( $error );
@@ -71,7 +71,7 @@
}
$returnToUrl = $authManager->getAuthenticationSessionData(
self::RETURNTOURL_SESSION_KEY );
-   if ( is_null( $returnToUrl) || count( $returnToUrl ) === 0 ) {
+   if ( is_null( $returnToUrl ) || count( $returnToUrl ) === 0 ) {
wfDebug( 'ERROR: return to URL is null or empty' );
} else {
$this->getOutput()->redirect( $returnToUrl );
diff --git a/includes/PluggableAuthPrimaryAuthenticationProvider.php 
b/includes/PluggableAuthPrimaryAuthenticationProvider.php
index 3f47ca0..655bbff 100644
--- a/includes/PluggableAuthPrimaryAuthenticationProvider.php
+++ b/includes/PluggableAuthPrimaryAuthenticationProvider.php
@@ -54,7 +54,7 @@
wfMessage( 
'pluggableauth-authentication-workflow-failure' ) );
}
$error = $this->manager->getAuthenticationSessionData(
-   PluggableAuthLogin::ERROR_SESSION_KEY ) ;
+   PluggableAuthLogin::ERROR_SESSION_KEY );
if ( !is_null( $error ) ) {
$this->manager->removeAuthenticationSessionData(
PluggableAuthLogin::ERROR_SESSION_KEY );

-- 
To view, visit https://gerrit.wikimedia.org/r/384911
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4f261843f864fee5d4071ec10616ec3b944afd4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org

[MediaWiki-commits] [Gerrit] integration/config[master]: Replace cical...@mitre.org with cin...@gmail.com.

2017-10-17 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384900 )

Change subject: Replace cical...@mitre.org with cin...@gmail.com.
..

Replace cical...@mitre.org with cin...@gmail.com.

Change-Id: I64201e27560b41d323d61d266fa970452cc059bd
---
M zuul/layout.yaml
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/00/384900/2

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index a6f6ca3..acd982a 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -75,7 +75,7 @@
 | cenarium\.sysop@gmail\.com
 | christian@quelltextlich\.at
 | christoph\.neuroth@gmail\.com
-| cicalese@mitre\.org
+| cindom@gmail\.com
 | codereview@emsenhuber\.ch
 | CommodoreFabianus@gmx\.de
 | crazy4sb@gmail\.com
@@ -373,7 +373,7 @@
- ^benestar\.wikimedia@gmail\.com$
- ^bryan\.tongminh@gmail\.com$
- ^cenarium\.sysop@gmail\.com$ # Cenarium
-   - ^cicalese@mitre\.org$
+   - ^cindom@gmail\.com$
- ^codereview@emsenhuber\.ch$
- ^CommodoreFabianus@gmx\.de$ # XZise, Pywikibot maintainer
- ^d_entous@yahoo\.com$

-- 
To view, visit https://gerrit.wikimedia.org/r/384900
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I64201e27560b41d323d61d266fa970452cc059bd
Gerrit-PatchSet: 2
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PhabTaskGraph[master]: Fix help for projects field.

2017-10-17 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384844 )

Change subject: Fix help for projects field.
..

Fix help for projects field.

T177212
Change-Id: Ifb2ec703297d9772d13381924b7eb9ba20e42329
---
M i18n/en.json
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PhabTaskGraph 
refs/changes/44/384844/3

diff --git a/i18n/en.json b/i18n/en.json
index 137ff30..b67cc8e 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,8 +13,8 @@
"phabtaskgraph-status-field-label": "Status",
"phabtaskgraph-width-field-label": "Width",
"phabtaskgraph-height-field-label": "Height",
-   "phabtaskgraph-tasks-field-help": "comma-separated list of task IDs 
(starting \"T\" optional); e.g. T123456",
-   "phabtaskgraph-projects-field-help": "comma-separated list of project 
names; e.g. MediaWiki-Platform-Team",
+   "phabtaskgraph-tasks-field-help": "comma-separated list of task IDs 
(starting \"T\" optional); e.g. 'T123456, T654321'",
+   "phabtaskgraph-projects-field-help": "comma-separated list of project 
names; e.g. 'MediaWiki-Platform-Team, Epic'",
"phabtaskgraph-width-field-help": "default: 800",
"phabtaskgraph-height-field-help": "default: 800",
"phabtaskgraph-status-open": "Open",

-- 
To view, visit https://gerrit.wikimedia.org/r/384844
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb2ec703297d9772d13381924b7eb9ba20e42329
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/PhabTaskGraph
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PhabTaskGraph[master]: Fix help for projects field.

2017-10-17 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/384844 )

Change subject: Fix help for projects field.
..


Fix help for projects field.

T177212
Change-Id: Ifb2ec703297d9772d13381924b7eb9ba20e42329
---
M i18n/en.json
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/i18n/en.json b/i18n/en.json
index 137ff30..b67cc8e 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,8 +13,8 @@
"phabtaskgraph-status-field-label": "Status",
"phabtaskgraph-width-field-label": "Width",
"phabtaskgraph-height-field-label": "Height",
-   "phabtaskgraph-tasks-field-help": "comma-separated list of task IDs 
(starting \"T\" optional); e.g. T123456",
-   "phabtaskgraph-projects-field-help": "comma-separated list of project 
names; e.g. MediaWiki-Platform-Team",
+   "phabtaskgraph-tasks-field-help": "comma-separated list of task IDs 
(starting \"T\" optional); e.g. 'T123456, T654321'",
+   "phabtaskgraph-projects-field-help": "comma-separated list of project 
names; e.g. 'MediaWiki-Platform-Team, Epic'",
"phabtaskgraph-width-field-help": "default: 800",
"phabtaskgraph-height-field-help": "default: 800",
"phabtaskgraph-status-open": "Open",

-- 
To view, visit https://gerrit.wikimedia.org/r/384844
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifb2ec703297d9772d13381924b7eb9ba20e42329
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/PhabTaskGraph
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Allow override of button text. Coding style.

2017-10-17 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384768 )

Change subject: Allow override of button text. Coding style.
..

Allow override of button text. Coding style.

Change-Id: I2bbbc7a1750945cb8d301780fcbcaf65ac405078
---
M extension.json
M includes/PluggableAuth.php
M includes/PluggableAuthBeginAuthenticationRequest.php
M includes/PluggableAuthLogin.php
M includes/PluggableAuthPrimaryAuthenticationProvider.php
5 files changed, 17 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PluggableAuth 
refs/changes/68/384768/1

diff --git a/extension.json b/extension.json
index 9b4954e..87bc7ed 100644
--- a/extension.json
+++ b/extension.json
@@ -50,6 +50,7 @@
"PluggableAuth_EnableAutoLogin": false,
"PluggableAuth_EnableLocalLogin": false,
"PluggableAuth_EnableLocalProperties": false,
+   "PluggableAuth_ButtonLabel": null,
"PluggableAuth_ExtraLoginFields": []
},
"manifest_version": 1
diff --git a/includes/PluggableAuth.php b/includes/PluggableAuth.php
index a0ea3f1..b85d8d1 100644
--- a/includes/PluggableAuth.php
+++ b/includes/PluggableAuth.php
@@ -5,11 +5,11 @@
/**
 * @since 1.0
 *
-* @param &$id
-* @param &$username
-* @param &$realname
-* @param &$email
-* @param &$errorMessage
+* @param int &$id
+* @param string &$username
+* @param string &$realname
+* @param string &$email
+* @param string &$errorMessage
 */
abstract public function authenticate( &$id, &$username, &$realname,
&$email, &$errorMessage );
@@ -24,7 +24,7 @@
/**
 * @since 1.0
 *
-* @param $id
+* @param int $id
 */
abstract public function saveExtraAttributes( $id );
 
@@ -45,6 +45,5 @@
}
wfDebug( 'Could not get authentication plugin instance.' );
return false;
-
}
 }
diff --git a/includes/PluggableAuthBeginAuthenticationRequest.php 
b/includes/PluggableAuthBeginAuthenticationRequest.php
index fb3f151..da50eb2 100644
--- a/includes/PluggableAuthBeginAuthenticationRequest.php
+++ b/includes/PluggableAuthBeginAuthenticationRequest.php
@@ -7,11 +7,13 @@
ButtonAuthenticationRequest {
 
public function __construct() {
-   parent::__construct(
-   'pluggableauthlogin',
-   wfMessage('pluggableauth-loginbutton-label'),
-   wfMessage('pluggableauth-loginbutton-help'),
-   true);
+   if ( $GLOBALS['wgPluggableAuth_ButtonLabel'] ) {
+   $label = new RawMessage( 
$GLOBALS['wgPluggableAuth_ButtonLabel'] );
+   } else {
+   $label = wfMessage( 'pluggableauth-loginbutton-label' );
+   }
+   parent::__construct( 'pluggableauthlogin', $label,
+   wfMessage( 'pluggableauth-loginbutton-help' ), true );
}
 
public function getFieldInfo() {
diff --git a/includes/PluggableAuthLogin.php b/includes/PluggableAuthLogin.php
index 113b226..8cf5f94 100644
--- a/includes/PluggableAuthLogin.php
+++ b/includes/PluggableAuthLogin.php
@@ -56,7 +56,7 @@
} else {
wfDebug( 'Authentication failure.' );
if ( is_null( $error ) ) {
-   $error = wfMessage( 
'pluggableauth-authentication-failure')->text();
+   $error = wfMessage( 
'pluggableauth-authentication-failure' )->text();
} else {
if ( !is_string( $error ) ) {
$error = strval( $error );
@@ -71,7 +71,7 @@
}
$returnToUrl = $authManager->getAuthenticationSessionData(
self::RETURNTOURL_SESSION_KEY );
-   if ( is_null( $returnToUrl) || count( $returnToUrl ) === 0 ) {
+   if ( is_null( $returnToUrl ) || count( $returnToUrl ) === 0 ) {
wfDebug( 'ERROR: return to URL is null or empty' );
} else {
$this->getOutput()->redirect( $returnToUrl );
diff --git a/includes/PluggableAuthPrimaryAuthenticationProvider.php 
b/includes/PluggableAuthPrimaryAuthenticationProvider.php
index 3f47ca0..655bbff 100644
--- a/includes/PluggableAuthPrimaryAuthenticationProvider.php
+++ b/includes/PluggableAuthPrimaryAuthenticationProvider.php
@@ -54,7 +54,7 @@
wfMessage( 
'pluggableauth-authentication-workflow-failure' ) );
}
$error = 

[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Added optional extra fields for authentication request.

2017-10-17 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/384625 )

Change subject: Added optional extra fields for authentication request.
..


Added optional extra fields for authentication request.

Change-Id: I15ecbc81304294548ae9cf1aed32a3dc44a38f03
---
M extension.json
M includes/PluggableAuthBeginAuthenticationRequest.php
M includes/PluggableAuthLogin.php
M includes/PluggableAuthPrimaryAuthenticationProvider.php
4 files changed, 23 insertions(+), 4 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/extension.json b/extension.json
index c1fdc48..9b4954e 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "PluggableAuth",
-   "version": "5.2",
+   "version": "5.3",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
],
@@ -49,7 +49,8 @@
"config": {
"PluggableAuth_EnableAutoLogin": false,
"PluggableAuth_EnableLocalLogin": false,
-   "PluggableAuth_EnableLocalProperties": false
+   "PluggableAuth_EnableLocalProperties": false,
+   "PluggableAuth_ExtraLoginFields": []
},
"manifest_version": 1
 }
diff --git a/includes/PluggableAuthBeginAuthenticationRequest.php 
b/includes/PluggableAuthBeginAuthenticationRequest.php
index 9bcbe49..fb3f151 100644
--- a/includes/PluggableAuthBeginAuthenticationRequest.php
+++ b/includes/PluggableAuthBeginAuthenticationRequest.php
@@ -1,8 +1,10 @@
 action !== AuthManager::ACTION_LOGIN ) {
+   return [];
+   }
+   return array_merge( 
$GLOBALS['wgPluggableAuth_ExtraLoginFields'],
+   parent::getFieldInfo() );
+   }
 }
diff --git a/includes/PluggableAuthLogin.php b/includes/PluggableAuthLogin.php
index 0eb4cca..113b226 100644
--- a/includes/PluggableAuthLogin.php
+++ b/includes/PluggableAuthLogin.php
@@ -7,6 +7,7 @@
const RETURNTOURL_SESSION_KEY = 'PluggableAuthLoginReturnToUrl';
const RETURNTOPAGE_SESSION_KEY = 'PluggableAuthLoginReturnToPage';
const RETURNTOQUERY_SESSION_KEY = 'PluggableAuthLoginReturnToQuery';
+   const EXTRALOGINFIELDS_SESSION_KEY = 
'PluggableAuthLoginExtraLoginFields';
const USERNAME_SESSION_KEY = 'PluggableAuthLoginUsername';
const REALNAME_SESSION_KEY = 'PluggableAuthLoginRealname';
const EMAIL_SESSION_KEY = 'PluggableAuthLoginEmail';
diff --git a/includes/PluggableAuthPrimaryAuthenticationProvider.php 
b/includes/PluggableAuthPrimaryAuthenticationProvider.php
index 4b62b5b..3f47ca0 100644
--- a/includes/PluggableAuthPrimaryAuthenticationProvider.php
+++ b/includes/PluggableAuthPrimaryAuthenticationProvider.php
@@ -15,9 +15,17 @@
if ( !$request ) {
return AuthenticationResponse::newAbstain();
}
+   $extraLoginFields = [];
+   foreach ( $GLOBALS['wgPluggableAuth_ExtraLoginFields'] as $key 
=> $value ) {
+   if ( isset( $request, $key ) ) {
+   $extraLoginFields[$key] = $request->$key;
+   }
+   }
$url = Title::newFromText( 'Special:PluggableAuthLogin' 
)->getFullURL();
$this->manager->setAuthenticationSessionData(
PluggableAuthLogin::RETURNTOURL_SESSION_KEY, 
$request->returnToUrl );
+   $this->manager->setAuthenticationSessionData(
+   PluggableAuthLogin::EXTRALOGINFIELDS_SESSION_KEY, 
$extraLoginFields );
if ( isset( $_GET['returnto'] ) ) {
$returnto = $_GET['returnto'];
} else {
@@ -124,7 +132,7 @@
switch ( $action ) {
case AuthManager::ACTION_LOGIN:
return [
-new 
PluggableAuthBeginAuthenticationRequest()
+   new 
PluggableAuthBeginAuthenticationRequest()
];
default:
return [];

-- 
To view, visit https://gerrit.wikimedia.org/r/384625
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I15ecbc81304294548ae9cf1aed32a3dc44a38f03
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: MarkAHershberger 
Gerrit-Reviewer: Robert Vogel 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix login button label to accept RawMessage.

2017-10-17 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384731 )

Change subject: Fix login button label to accept RawMessage.
..

Fix login button label to accept RawMessage.

Change-Id: I943628e2a1fbf6fff579dd52c1058ca2ef125d34
---
M includes/specialpage/AuthManagerSpecialPage.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/31/384731/2

diff --git a/includes/specialpage/AuthManagerSpecialPage.php 
b/includes/specialpage/AuthManagerSpecialPage.php
index 0cdc55f..95729f3 100644
--- a/includes/specialpage/AuthManagerSpecialPage.php
+++ b/includes/specialpage/AuthManagerSpecialPage.php
@@ -679,7 +679,7 @@
];
 
if ( $type === 'submit' && isset( $singleFieldInfo['label'] ) ) 
{
-   $descriptor['default'] = wfMessage( 
$singleFieldInfo['label'] )->plain();
+   $descriptor['default'] = 
$singleFieldInfo['label']->plain();
} elseif ( $type !== 'submit' ) {
$descriptor += array_filter( [
// help-message is omitted as it is usually not 
really useful for a web interface

-- 
To view, visit https://gerrit.wikimedia.org/r/384731
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I943628e2a1fbf6fff579dd52c1058ca2ef125d34
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Fixed alias file path

2017-10-17 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/384697 )

Change subject: Fixed alias file path
..


Fixed alias file path

Change-Id: I365b5c64f6a5de03109c37b2b49a3ae24b6a2810
---
M extension.json
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index 20b3714..c1fdc48 100644
--- a/extension.json
+++ b/extension.json
@@ -16,7 +16,7 @@
]
},
"ExtensionMessagesFiles": {
-   "PluggableAuthAlias": "PluggableAuth.alias.php"
+   "PluggableAuthAlias": "includes/PluggableAuth.alias.php"
},
"AutoloadClasses": {
"PluggableAuth": "includes/PluggableAuth.php",

-- 
To view, visit https://gerrit.wikimedia.org/r/384697
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I365b5c64f6a5de03109c37b2b49a3ae24b6a2810
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Added optional extra fields for authentication request.

2017-10-16 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384625 )

Change subject: Added optional extra fields for authentication request.
..

Added optional extra fields for authentication request.

Change-Id: I15ecbc81304294548ae9cf1aed32a3dc44a38f03
---
M extension.json
M includes/PluggableAuthBeginAuthenticationRequest.php
M includes/PluggableAuthLogin.php
M includes/PluggableAuthPrimaryAuthenticationProvider.php
4 files changed, 22 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PluggableAuth 
refs/changes/25/384625/1

diff --git a/extension.json b/extension.json
index 20b3714..0705026 100644
--- a/extension.json
+++ b/extension.json
@@ -49,7 +49,8 @@
"config": {
"PluggableAuth_EnableAutoLogin": false,
"PluggableAuth_EnableLocalLogin": false,
-   "PluggableAuth_EnableLocalProperties": false
+   "PluggableAuth_EnableLocalProperties": false,
+   "PluggableAuth_ExtraLoginFields": []
},
"manifest_version": 1
 }
diff --git a/includes/PluggableAuthBeginAuthenticationRequest.php 
b/includes/PluggableAuthBeginAuthenticationRequest.php
index 9bcbe49..fb3f151 100644
--- a/includes/PluggableAuthBeginAuthenticationRequest.php
+++ b/includes/PluggableAuthBeginAuthenticationRequest.php
@@ -1,8 +1,10 @@
 action !== AuthManager::ACTION_LOGIN ) {
+   return [];
+   }
+   return array_merge( 
$GLOBALS['wgPluggableAuth_ExtraLoginFields'],
+   parent::getFieldInfo() );
+   }
 }
diff --git a/includes/PluggableAuthLogin.php b/includes/PluggableAuthLogin.php
index 0eb4cca..113b226 100644
--- a/includes/PluggableAuthLogin.php
+++ b/includes/PluggableAuthLogin.php
@@ -7,6 +7,7 @@
const RETURNTOURL_SESSION_KEY = 'PluggableAuthLoginReturnToUrl';
const RETURNTOPAGE_SESSION_KEY = 'PluggableAuthLoginReturnToPage';
const RETURNTOQUERY_SESSION_KEY = 'PluggableAuthLoginReturnToQuery';
+   const EXTRALOGINFIELDS_SESSION_KEY = 
'PluggableAuthLoginExtraLoginFields';
const USERNAME_SESSION_KEY = 'PluggableAuthLoginUsername';
const REALNAME_SESSION_KEY = 'PluggableAuthLoginRealname';
const EMAIL_SESSION_KEY = 'PluggableAuthLoginEmail';
diff --git a/includes/PluggableAuthPrimaryAuthenticationProvider.php 
b/includes/PluggableAuthPrimaryAuthenticationProvider.php
index 4b62b5b..3f47ca0 100644
--- a/includes/PluggableAuthPrimaryAuthenticationProvider.php
+++ b/includes/PluggableAuthPrimaryAuthenticationProvider.php
@@ -15,9 +15,17 @@
if ( !$request ) {
return AuthenticationResponse::newAbstain();
}
+   $extraLoginFields = [];
+   foreach ( $GLOBALS['wgPluggableAuth_ExtraLoginFields'] as $key 
=> $value ) {
+   if ( isset( $request, $key ) ) {
+   $extraLoginFields[$key] = $request->$key;
+   }
+   }
$url = Title::newFromText( 'Special:PluggableAuthLogin' 
)->getFullURL();
$this->manager->setAuthenticationSessionData(
PluggableAuthLogin::RETURNTOURL_SESSION_KEY, 
$request->returnToUrl );
+   $this->manager->setAuthenticationSessionData(
+   PluggableAuthLogin::EXTRALOGINFIELDS_SESSION_KEY, 
$extraLoginFields );
if ( isset( $_GET['returnto'] ) ) {
$returnto = $_GET['returnto'];
} else {
@@ -124,7 +132,7 @@
switch ( $action ) {
case AuthManager::ACTION_LOGIN:
return [
-new 
PluggableAuthBeginAuthenticationRequest()
+   new 
PluggableAuthBeginAuthenticationRequest()
];
default:
return [];

-- 
To view, visit https://gerrit.wikimedia.org/r/384625
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I15ecbc81304294548ae9cf1aed32a3dc44a38f03
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Moved PHP files to includes and license to COPYING.

2017-10-16 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/384555 )

Change subject: Moved PHP files to includes and license to COPYING.
..


Moved PHP files to includes and license to COPYING.

Change-Id: I9dc600efcbd5dc1f97b8a4e6b13508b894da7e61
---
A COPYING
D PluggableAuth.alias.php
D PluggableAuth.class.php
D PluggableAuthBeginAuthenticationRequest.php
D PluggableAuthContinueAuthenticationRequest.php
M extension.json
A includes/PluggableAuth.alias.php
A includes/PluggableAuth.php
A includes/PluggableAuthBeginAuthenticationRequest.php
A includes/PluggableAuthContinueAuthenticationRequest.php
R includes/PluggableAuthHooks.php
R includes/PluggableAuthLogin.php
R includes/PluggableAuthPrimaryAuthenticationProvider.php
13 files changed, 130 insertions(+), 242 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/COPYING b/COPYING
new file mode 100644
index 000..69cbaab
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,19 @@
+Copyright (c) 2015-2017 The MITRE Corporation
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/PluggableAuth.alias.php b/PluggableAuth.alias.php
deleted file mode 100644
index b6ac5ee..000
--- a/PluggableAuth.alias.php
+++ /dev/null
@@ -1,15 +0,0 @@
- array( 'PluggableAuthLogin' ),
-);
diff --git a/PluggableAuth.class.php b/PluggableAuth.class.php
deleted file mode 100644
index 0584d6c..000
--- a/PluggableAuth.class.php
+++ /dev/null
@@ -1,72 +0,0 @@
-getAuthenticationSessionData(
-   PluggableAuthLogin::ERROR_SESSION_KEY );
-   if ( is_null( $error ) ) {
-   $this->username = 
$authManager->getAuthenticationSessionData(
-   PluggableAuthLogin::USERNAME_SESSION_KEY );
-   $authManager->removeAuthenticationSessionData(
-   PluggableAuthLogin::USERNAME_SESSION_KEY );
-   }
-   return true;
-   }
-}
diff --git a/extension.json b/extension.json
index 02088f1..20b3714 100644
--- a/extension.json
+++ b/extension.json
@@ -19,12 +19,12 @@
"PluggableAuthAlias": "PluggableAuth.alias.php"
},
"AutoloadClasses": {
-   "PluggableAuth": "PluggableAuth.class.php",
-   "PluggableAuthHooks": "PluggableAuthHooks.php",
-   "PluggableAuthPrimaryAuthenticationProvider": 
"PluggableAuthPrimaryAuthenticationProvider.php",
-   "PluggableAuthBeginAuthenticationRequest": 
"PluggableAuthBeginAuthenticationRequest.php",
-   "PluggableAuthContinueAuthenticationRequest": 
"PluggableAuthContinueAuthenticationRequest.php",
-   "PluggableAuthLogin": "PluggableAuthLogin.php"
+   "PluggableAuth": "includes/PluggableAuth.php",
+   "PluggableAuthHooks": "includes/PluggableAuthHooks.php",
+   "PluggableAuthPrimaryAuthenticationProvider": 
"includes/PluggableAuthPrimaryAuthenticationProvider.php",
+   "PluggableAuthBeginAuthenticationRequest": 
"includes/PluggableAuthBeginAuthenticationRequest.php",
+   "PluggableAuthContinueAuthenticationRequest": 
"includes/PluggableAuthContinueAuthenticationRequest.php",
+   "PluggableAuthLogin": "includes/PluggableAuthLogin.php"
},
"callback": "PluggableAuthHooks::onRegistration",
"Hooks": {
diff --git a/includes/PluggableAuth.alias.php b/includes/PluggableAuth.alias.php
new file mode 100644
index 000..df3accf
--- /dev/null
+++ b/includes/PluggableAuth.alias.php
@@ -0,0 +1,16 @@
+ ['PluggableAuthLogin'],
+];
diff --git a/includes/PluggableAuth.php b/includes/PluggableAuth.php
new file mode 100644
index 000..a0ea3f1
--- /dev/null
+++ b/includes/PluggableAuth.php
@@ -0,0 +1,50 @@
+getAuthenticationSessionData(
+   PluggableAuthLogin::ERROR_SESSION_KEY );
+   

[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Moved PHP files to includes and license to COPYING.

2017-10-16 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384555 )

Change subject: Moved PHP files to includes and license to COPYING.
..

Moved PHP files to includes and license to COPYING.

Change-Id: I9dc600efcbd5dc1f97b8a4e6b13508b894da7e61
---
A COPYING
D PluggableAuth.alias.php
D PluggableAuth.class.php
D PluggableAuthBeginAuthenticationRequest.php
D PluggableAuthContinueAuthenticationRequest.php
M extension.json
A includes/PluggableAuth.alias.php
A includes/PluggableAuth.php
A includes/PluggableAuthBeginAuthenticationRequest.php
A includes/PluggableAuthContinueAuthenticationRequest.php
R includes/PluggableAuthHooks.php
R includes/PluggableAuthLogin.php
R includes/PluggableAuthPrimaryAuthenticationProvider.php
13 files changed, 130 insertions(+), 242 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PluggableAuth 
refs/changes/55/384555/1

diff --git a/COPYING b/COPYING
new file mode 100644
index 000..69cbaab
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,19 @@
+Copyright (c) 2015-2017 The MITRE Corporation
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/PluggableAuth.alias.php b/PluggableAuth.alias.php
deleted file mode 100644
index b6ac5ee..000
--- a/PluggableAuth.alias.php
+++ /dev/null
@@ -1,15 +0,0 @@
- array( 'PluggableAuthLogin' ),
-);
diff --git a/PluggableAuth.class.php b/PluggableAuth.class.php
deleted file mode 100644
index 0584d6c..000
--- a/PluggableAuth.class.php
+++ /dev/null
@@ -1,72 +0,0 @@
-getAuthenticationSessionData(
-   PluggableAuthLogin::ERROR_SESSION_KEY );
-   if ( is_null( $error ) ) {
-   $this->username = 
$authManager->getAuthenticationSessionData(
-   PluggableAuthLogin::USERNAME_SESSION_KEY );
-   $authManager->removeAuthenticationSessionData(
-   PluggableAuthLogin::USERNAME_SESSION_KEY );
-   }
-   return true;
-   }
-}
diff --git a/extension.json b/extension.json
index 02088f1..20b3714 100644
--- a/extension.json
+++ b/extension.json
@@ -19,12 +19,12 @@
"PluggableAuthAlias": "PluggableAuth.alias.php"
},
"AutoloadClasses": {
-   "PluggableAuth": "PluggableAuth.class.php",
-   "PluggableAuthHooks": "PluggableAuthHooks.php",
-   "PluggableAuthPrimaryAuthenticationProvider": 
"PluggableAuthPrimaryAuthenticationProvider.php",
-   "PluggableAuthBeginAuthenticationRequest": 
"PluggableAuthBeginAuthenticationRequest.php",
-   "PluggableAuthContinueAuthenticationRequest": 
"PluggableAuthContinueAuthenticationRequest.php",
-   "PluggableAuthLogin": "PluggableAuthLogin.php"
+   "PluggableAuth": "includes/PluggableAuth.php",
+   "PluggableAuthHooks": "includes/PluggableAuthHooks.php",
+   "PluggableAuthPrimaryAuthenticationProvider": 
"includes/PluggableAuthPrimaryAuthenticationProvider.php",
+   "PluggableAuthBeginAuthenticationRequest": 
"includes/PluggableAuthBeginAuthenticationRequest.php",
+   "PluggableAuthContinueAuthenticationRequest": 
"includes/PluggableAuthContinueAuthenticationRequest.php",
+   "PluggableAuthLogin": "includes/PluggableAuthLogin.php"
},
"callback": "PluggableAuthHooks::onRegistration",
"Hooks": {
diff --git a/includes/PluggableAuth.alias.php b/includes/PluggableAuth.alias.php
new file mode 100644
index 000..df3accf
--- /dev/null
+++ b/includes/PluggableAuth.alias.php
@@ -0,0 +1,16 @@
+ ['PluggableAuthLogin'],
+];
diff --git a/includes/PluggableAuth.php b/includes/PluggableAuth.php
new file mode 100644
index 000..a0ea3f1
--- /dev/null
+++ b/includes/PluggableAuth.php
@@ -0,0 +1,50 @@
+getAuthenticationSessionData(
+   PluggableAuthLogin::ERROR_SESSION_KEY );
+

[MediaWiki-commits] [Gerrit] mediawiki...TitleIcon[master]: Fix rendering in search results

2017-10-10 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/379833 )

Change subject: Fix rendering in search results
..


Fix rendering in search results

Wrap the string containing the title icon and link text
in an instance of HtmlArmor in order to prevent the html
from being escaped when it is rendered. Note that using
HtmlArmor increases the required MediaWiki version
to 1.28.

Change-Id: Ifd38a19d18c96339180ade7d56aad3ffd043ce6e
---
M TitleIcon.php
M extension.json
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/TitleIcon.php b/TitleIcon.php
index 1365971..cc8b2f6 100644
--- a/TitleIcon.php
+++ b/TitleIcon.php
@@ -160,7 +160,7 @@
public function handleSearchTitle( &$text ) {
$iconhtml = $this->getIconHTML();
if ( strlen( $iconhtml ) > 0 ) {
-   $text = $iconhtml . Linker::link( $this->title );
+   $text = new HtmlArmor($iconhtml . Linker::link( 
$this->title ));
}
}
 
diff --git a/extension.json b/extension.json
index da5bb4b..8e62df6 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Title Icon",
-   "version": "3.0",
+   "version": "4.0",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
],

-- 
To view, visit https://gerrit.wikimedia.org/r/379833
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd38a19d18c96339180ade7d56aad3ffd043ce6e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/TitleIcon
Gerrit-Branch: master
Gerrit-Owner: Matthew-a-thompson 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PhabTaskGraph[master]: Fixed jiggling on mouseout when graph is already at rest.

2017-09-26 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/380909 )

Change subject: Fixed jiggling on mouseout when graph is already at rest.
..


Fixed jiggling on mouseout when graph is already at rest.

Change-Id: Icfd127625a836977cc977ef5dd900f4e3c7373d1
---
M resources/PhabTaskGraph.js
1 file changed, 16 insertions(+), 12 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/resources/PhabTaskGraph.js b/resources/PhabTaskGraph.js
index c41a78c..3f975fd 100644
--- a/resources/PhabTaskGraph.js
+++ b/resources/PhabTaskGraph.js
@@ -146,13 +146,15 @@
}
});
 
-   var stop_tooltip = false;
-   var stop_drag = false;
+   var dragging = false;
+   var paused = false;
 
node
.on('mouseover', function (d) {
-   stop_tooltip = true;
-   force.stop();
+   if (force.alpha()) {
+   force.stop();
+   paused = true;
+   }
tooltip
.transition()
.duration(200)
@@ -165,9 +167,9 @@
 
node
.on('mouseout', function (d) {
-   stop_tooltip = false;
-   if (!stop_drag) {
+   if (!dragging && paused) {
force.resume();
+   paused = false;
}
tooltip
.transition()
@@ -182,8 +184,11 @@
drag
.on('dragstart', function (d) {
d3.event.sourceEvent.stopPropagation();
-   stop_drag = true;
-   force.stop();
+   dragging = true;
+   if (force.alpha()) {
+   force.stop();
+   paused = true;
+   }
});
 
drag
@@ -201,10 +206,9 @@
d.fixed = !d.fixed;
}
tick();
-   stop_drag = false;
-   if (!stop_tooltip) {
-   force.resume();
-   }
+   dragging = false;
+   force.resume();
+   paused = false;
});
 
node

-- 
To view, visit https://gerrit.wikimedia.org/r/380909
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icfd127625a836977cc977ef5dd900f4e3c7373d1
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PhabTaskGraph
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PhabTaskGraph[master]: Fixed jiggling on mouseout when graph is already at rest.

2017-09-26 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/380909 )

Change subject: Fixed jiggling on mouseout when graph is already at rest.
..

Fixed jiggling on mouseout when graph is already at rest.

Change-Id: Icfd127625a836977cc977ef5dd900f4e3c7373d1
---
M resources/PhabTaskGraph.js
1 file changed, 19 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PhabTaskGraph 
refs/changes/09/380909/1

diff --git a/resources/PhabTaskGraph.js b/resources/PhabTaskGraph.js
index c41a78c..fe991a9 100644
--- a/resources/PhabTaskGraph.js
+++ b/resources/PhabTaskGraph.js
@@ -146,13 +146,17 @@
}
});
 
-   var stop_tooltip = false;
-   var stop_drag = false;
+   var displaying_tooltip = false;
+   var dragging = false;
+   var paused = false;
 
node
.on('mouseover', function (d) {
-   stop_tooltip = true;
-   force.stop();
+   displaying_tooltip = true;
+   if (force.alpha()) {
+   force.stop();
+   paused = true;
+   }
tooltip
.transition()
.duration(200)
@@ -165,9 +169,10 @@
 
node
.on('mouseout', function (d) {
-   stop_tooltip = false;
-   if (!stop_drag) {
+   displaying_tooltip = false;
+   if (!dragging && paused) {
force.resume();
+   paused = false;
}
tooltip
.transition()
@@ -182,8 +187,11 @@
drag
.on('dragstart', function (d) {
d3.event.sourceEvent.stopPropagation();
-   stop_drag = true;
-   force.stop();
+   dragging = true;
+   if (force.alpha()) {
+   force.stop();
+   paused = true;
+   }
});
 
drag
@@ -201,10 +209,9 @@
d.fixed = !d.fixed;
}
tick();
-   stop_drag = false;
-   if (!stop_tooltip) {
-   force.resume();
-   }
+   dragging = false;
+   force.resume();
+   paused = false;
});
 
node

-- 
To view, visit https://gerrit.wikimedia.org/r/380909
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icfd127625a836977cc977ef5dd900f4e3c7373d1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhabTaskGraph
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Missing message.

2017-09-24 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/380320 )

Change subject: Missing message.
..


Missing message.

Change-Id: If1de385d7b3ed4dd0f9bdd8d7a013468d18af516
---
M i18n/en.json
M i18n/qqq.json
2 files changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/i18n/en.json b/i18n/en.json
index aedf7ad..e5f7d77 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -141,6 +141,7 @@
"logentry-commentstreams-reply-delete": "$1 {{GENDER:$2|deleted}} reply 
$3",
"logentry-commentstreams-reply-moderator-delete": "$1 
{{GENDER:$2|(moderator) deleted}} reply $3",
"commentstreamsallcomments": "All Comments",
+   "commentstreams-allcomments-nocommentsfound": "No comments found.",
"commentstreams-allcomments-label-page": "Comment Page",
"commentstreams-allcomments-label-associatedpage": "Associated Page",
"commentstreams-allcomments-label-commenttitle": "Comment Title",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 88d5c78..9c57dab 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -141,6 +141,7 @@
"logentry-commentstreams-reply-delete": "The template of the log entry 
message",
"logentry-commentstreams-reply-moderator-delete": "The template of the 
log entry message",
"commentstreamsallcomments": "Special page title",
+   "commentstreams-allcomments-nocommentsfound": "Message to user.",
"commentstreams-allcomments-label-page": "Table column label",
"commentstreams-allcomments-label-associatedpage": "Table column label",
"commentstreams-allcomments-label-commenttitle": "Table column label",

-- 
To view, visit https://gerrit.wikimedia.org/r/380320
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If1de385d7b3ed4dd0f9bdd8d7a013468d18af516
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Missing message.

2017-09-24 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/380320 )

Change subject: Missing message.
..

Missing message.

Change-Id: If1de385d7b3ed4dd0f9bdd8d7a013468d18af516
---
M i18n/en.json
M i18n/qqq.json
2 files changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/20/380320/1

diff --git a/i18n/en.json b/i18n/en.json
index aedf7ad..e5f7d77 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -141,6 +141,7 @@
"logentry-commentstreams-reply-delete": "$1 {{GENDER:$2|deleted}} reply 
$3",
"logentry-commentstreams-reply-moderator-delete": "$1 
{{GENDER:$2|(moderator) deleted}} reply $3",
"commentstreamsallcomments": "All Comments",
+   "commentstreams-allcomments-nocommentsfound": "No comments found.",
"commentstreams-allcomments-label-page": "Comment Page",
"commentstreams-allcomments-label-associatedpage": "Associated Page",
"commentstreams-allcomments-label-commenttitle": "Comment Title",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 88d5c78..9c57dab 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -141,6 +141,7 @@
"logentry-commentstreams-reply-delete": "The template of the log entry 
message",
"logentry-commentstreams-reply-moderator-delete": "The template of the 
log entry message",
"commentstreamsallcomments": "Special page title",
+   "commentstreams-allcomments-nocommentsfound": "Message to user.",
"commentstreams-allcomments-label-page": "Table column label",
"commentstreams-allcomments-label-associatedpage": "Table column label",
"commentstreams-allcomments-label-commenttitle": "Table column label",

-- 
To view, visit https://gerrit.wikimedia.org/r/380320
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If1de385d7b3ed4dd0f9bdd8d7a013468d18af516
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Prefixed column names so as not to conflict with columns in ...

2017-09-23 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/379968 )

Change subject: Prefixed column names so as not to conflict with columns in 
other tables.
..


Prefixed column names so as not to conflict with columns in other tables.

Change-Id: I32267fb69d6979386178ea6e9cad1f71ef65432a
---
M extension.json
M includes/Comment.php
M includes/CommentStreamsAllComments.php
M includes/CommentStreamsHooks.php
A sql/updateFieldNames.sql
5 files changed, 133 insertions(+), 76 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/extension.json b/extension.json
index 15e1660..99a24fe 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CommentStreams",
-   "version": "3.10",
+   "version": "4.0",
"author": [
"[http://www.mediawiki.org/wiki/User:Jji Jason Ji]",
"[http://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
diff --git a/includes/Comment.php b/includes/Comment.php
index 4f6de3d..17c5af0 100644
--- a/includes/Comment.php
+++ b/includes/Comment.php
@@ -140,10 +140,10 @@
$result = $dbw->insert(
'cs_comment_data',
[
-   'page_id' => $wikipage->getId(),
-   'assoc_page_id' => $assoc_page_id,
-   'parent_page_id' => $parent_page_id,
-   'comment_title' => $comment_title
+   'cst_page_id' => $wikipage->getId(),
+   'cst_assoc_page_id' => $assoc_page_id,
+   'cst_parent_page_id' => $parent_page_id,
+   'cst_comment_title' => $comment_title
],
__METHOD__
);
@@ -182,17 +182,23 @@
$dbr = wfGetDB( DB_SLAVE );
$result = $dbr->selectRow(
'cs_comment_data',
-   [ 'assoc_page_id', 'parent_page_id', 'comment_title' ],
-   [ 'page_id' => $this->getId() ],
+   [
+   'cst_assoc_page_id',
+   'cst_parent_page_id',
+   'cst_comment_title'
+   ],
+   [
+   'cst_page_id' => $this->getId()
+   ],
__METHOD__
);
if ( $result ) {
-   $this->assoc_page_id = (integer)$result->assoc_page_id;
-   $this->parent_page_id = $result->parent_page_id;
+   $this->assoc_page_id = 
(integer)$result->cst_assoc_page_id;
+   $this->parent_page_id = $result->cst_parent_page_id;
if ( !is_null( $this->parent_page_id ) ) {
$this->parent_page_id = 
(integer)$this->parent_page_id;
}
-   $this->comment_title = $result->comment_title;
+   $this->comment_title = $result->cst_comment_title;
$this->loaded = true;
}
}
@@ -405,7 +411,9 @@
$this->num_replies = $dbr->selectRowCount(
'cs_comment_data',
'*',
-   [ 'parent_page_id' => $this->getId() ],
+   [
+   'cst_parent_page_id' => $this->getId()
+   ],
__METHOD__
);
}
@@ -449,15 +457,17 @@
$dbr = wfGetDB( DB_SLAVE );
$result = $dbr->selectRow(
'cs_votes',
-   [ 'vote' ],
[
-   'page_id' => $this->getId(),
-   'user_id' => $user->getId()
+   'cst_v_vote'
+   ],
+   [
+   'cst_v_page_id' => $this->getId(),
+   'cst_v_user_id' => $user->getId()
],
__METHOD__
);
if ( $result ) {
-   $vote = (integer)$result->vote;
+   $vote = (integer)$result->cst_v_vote;
if ( $vote > 0 ) {
return 1;
}
@@ -478,8 +488,8 @@
'cs_votes',
'*',
[
-   'page_id' => $this->getId(),
-  

[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Prefixed column names so as not to conflict with columns in ...

2017-09-23 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/379968 )

Change subject: Prefixed column names so as not to conflict with columns in 
other tables.
..

Prefixed column names so as not to conflict with columns in other tables.

Change-Id: I32267fb69d6979386178ea6e9cad1f71ef65432a
---
M includes/Comment.php
M includes/CommentStreamsAllComments.php
M includes/CommentStreamsHooks.php
A sql/updateFieldNames.sql
4 files changed, 101 insertions(+), 57 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/68/379968/1

diff --git a/includes/Comment.php b/includes/Comment.php
index 4f6de3d..504a2d9 100644
--- a/includes/Comment.php
+++ b/includes/Comment.php
@@ -140,10 +140,10 @@
$result = $dbw->insert(
'cs_comment_data',
[
-   'page_id' => $wikipage->getId(),
-   'assoc_page_id' => $assoc_page_id,
-   'parent_page_id' => $parent_page_id,
-   'comment_title' => $comment_title
+   'cst_page_id' => $wikipage->getId(),
+   'cst_assoc_page_id' => $assoc_page_id,
+   'cst_parent_page_id' => $parent_page_id,
+   'cst_comment_title' => $comment_title
],
__METHOD__
);
@@ -182,17 +182,23 @@
$dbr = wfGetDB( DB_SLAVE );
$result = $dbr->selectRow(
'cs_comment_data',
-   [ 'assoc_page_id', 'parent_page_id', 'comment_title' ],
-   [ 'page_id' => $this->getId() ],
+   [
+   'cst_assoc_page_id',
+   'cst_parent_page_id',
+   'cst_comment_title'
+   ],
+   [
+   'cst_page_id' => $this->getId()
+   ],
__METHOD__
);
if ( $result ) {
-   $this->assoc_page_id = (integer)$result->assoc_page_id;
-   $this->parent_page_id = $result->parent_page_id;
+   $this->assoc_page_id = 
(integer)$result->cst_assoc_page_id;
+   $this->parent_page_id = $result->cst_parent_page_id;
if ( !is_null( $this->parent_page_id ) ) {
$this->parent_page_id = 
(integer)$this->parent_page_id;
}
-   $this->comment_title = $result->comment_title;
+   $this->comment_title = $result->cst_comment_title;
$this->loaded = true;
}
}
@@ -405,7 +411,9 @@
$this->num_replies = $dbr->selectRowCount(
'cs_comment_data',
'*',
-   [ 'parent_page_id' => $this->getId() ],
+   [
+   'cst_parent_page_id' => $this->getId()
+   ],
__METHOD__
);
}
@@ -449,15 +457,17 @@
$dbr = wfGetDB( DB_SLAVE );
$result = $dbr->selectRow(
'cs_votes',
-   [ 'vote' ],
[
-   'page_id' => $this->getId(),
-   'user_id' => $user->getId()
+   'cst_v_vote'
+   ],
+   [
+   'cst_v_page_id' => $this->getId(),
+   'cst_v_user_id' => $user->getId()
],
__METHOD__
);
if ( $result ) {
-   $vote = (integer)$result->vote;
+   $vote = (integer)$result->cst_v_vote;
if ( $vote > 0 ) {
return 1;
}
@@ -478,8 +488,8 @@
'cs_votes',
'*',
[
-   'page_id' => $this->getId(),
-   'vote' => 1
+   'cst_v_page_id' => $this->getId(),
+   'cst_v_vote' => 1
],
__METHOD__
);
@@ -497,8 +507,8 @@
'cs_votes',
'*',
 

[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Improve handling of invalid associated page ids.

2017-09-22 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/379780 )

Change subject: Improve handling of invalid associated page ids.
..


Improve handling of invalid associated page ids.

Fix Special:AllComments query. Fix moderator edit permission bug.

Change-Id: I9307edee53f8e53d5229dec4964a74ad34b4f1e2
---
M includes/Comment.php
M includes/CommentStreamsAllComments.php
M includes/CommentStreamsHooks.php
3 files changed, 31 insertions(+), 25 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/includes/Comment.php b/includes/Comment.php
index 2a99b0a..4f6de3d 100644
--- a/includes/Comment.php
+++ b/includes/Comment.php
@@ -695,9 +695,6 @@
 * @return boolean true if successful
 */
public function update( $comment_title, $wikitext, $user ) {
-   if ( !$this->wikipage->getTitle()->userCan( 'cs-comment' ) ) {
-   return false;
-   }
if ( is_null( $comment_title ) && is_null( $this->getParentId() 
) ) {
return false;
}
diff --git a/includes/CommentStreamsAllComments.php 
b/includes/CommentStreamsAllComments.php
index 8ed5827..594399d 100644
--- a/includes/CommentStreamsAllComments.php
+++ b/includes/CommentStreamsAllComments.php
@@ -76,26 +76,27 @@
$pagename = 
$comment->getWikiPage()->getTitle()->getPrefixedText() ;
$associatedpageid = 
$comment->getAssociatedId();
$associatedpage = WikiPage::newFromId( 
$associatedpageid );
+   $associatedpagename = '';
if ( !is_null( $associatedpage ) ) {
$associatedpagename =
-   
$associatedpage->getTitle()->getPrefixedText();
-   $author = 
$comment->getUser()->getName();
-   $lasteditor =
-   User::newFromId( 
$wikipage->getRevision()->getUser() )->getName();
-   if ( $lasteditor === $author ) {
-   $lasteditor = '';
-   }
-   $wikitext .= '|-' . PHP_EOL;
-   $wikitext .= '|[[' . $pagename 
. ']]' . PHP_EOL;
-   $wikitext .= '|[[' . 
$associatedpagename . ']]' . PHP_EOL;
-   $wikitext .= '|' . 
$comment->getCommentTitle() . PHP_EOL;
-   $wikitext .= '|' . 
$comment->getWikiText() . PHP_EOL;
-   $wikitext .= '|' . $author . 
PHP_EOL;
-   $wikitext .= '|' . $lasteditor 
. PHP_EOL;
-   $wikitext .= '|' . 
$comment->getCreationDate() . PHP_EOL;
-   $wikitext .= '|' . 
$comment->getModificationDate() . PHP_EOL;
-   $index ++;
+   '[[' . 
$associatedpage->getTitle()->getPrefixedText() . ']]';
}
+   $author = 
$comment->getUser()->getName();
+   $lasteditor =
+   User::newFromId( 
$wikipage->getRevision()->getUser() )->getName();
+   if ( $lasteditor === $author ) {
+   $lasteditor = '';
+   }
+   $wikitext .= '|-' . PHP_EOL;
+   $wikitext .= '|[[' . $pagename . ']]' . 
PHP_EOL;
+   $wikitext .= '|' . $associatedpagename 
. PHP_EOL;
+   $wikitext .= '|' . 
$comment->getCommentTitle() . PHP_EOL;
+   $wikitext .= '|' . 
$comment->getWikiText() . PHP_EOL;
+   $wikitext .= '|' . $author . PHP_EOL;
+   $wikitext .= '|' . $lasteditor . 
PHP_EOL;
+   $wikitext .= '|' . 
$comment->getCreationDate() . PHP_EOL;
+   $wikitext .= '|' . 
$comment->getModificationDate() . PHP_EOL;
+   $index ++;
}

[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Improve handling of invalid associated page ids.

2017-09-22 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/379780 )

Change subject: Improve handling of invalid associated page ids.
..

Improve handling of invalid associated page ids.

Change-Id: I9307edee53f8e53d5229dec4964a74ad34b4f1e2
---
M includes/CommentStreamsAllComments.php
M includes/CommentStreamsHooks.php
2 files changed, 22 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/80/379780/1

diff --git a/includes/CommentStreamsAllComments.php 
b/includes/CommentStreamsAllComments.php
index 8ed5827..c0d59fb 100644
--- a/includes/CommentStreamsAllComments.php
+++ b/includes/CommentStreamsAllComments.php
@@ -76,26 +76,27 @@
$pagename = 
$comment->getWikiPage()->getTitle()->getPrefixedText() ;
$associatedpageid = 
$comment->getAssociatedId();
$associatedpage = WikiPage::newFromId( 
$associatedpageid );
+   $associatedpagename = '';
if ( !is_null( $associatedpage ) ) {
$associatedpagename =
-   
$associatedpage->getTitle()->getPrefixedText();
-   $author = 
$comment->getUser()->getName();
-   $lasteditor =
-   User::newFromId( 
$wikipage->getRevision()->getUser() )->getName();
-   if ( $lasteditor === $author ) {
-   $lasteditor = '';
-   }
-   $wikitext .= '|-' . PHP_EOL;
-   $wikitext .= '|[[' . $pagename 
. ']]' . PHP_EOL;
-   $wikitext .= '|[[' . 
$associatedpagename . ']]' . PHP_EOL;
-   $wikitext .= '|' . 
$comment->getCommentTitle() . PHP_EOL;
-   $wikitext .= '|' . 
$comment->getWikiText() . PHP_EOL;
-   $wikitext .= '|' . $author . 
PHP_EOL;
-   $wikitext .= '|' . $lasteditor 
. PHP_EOL;
-   $wikitext .= '|' . 
$comment->getCreationDate() . PHP_EOL;
-   $wikitext .= '|' . 
$comment->getModificationDate() . PHP_EOL;
-   $index ++;
+   '[[' . 
$associatedpage->getTitle()->getPrefixedText() . ']]';
}
+   $author = 
$comment->getUser()->getName();
+   $lasteditor =
+   User::newFromId( 
$wikipage->getRevision()->getUser() )->getName();
+   if ( $lasteditor === $author ) {
+   $lasteditor = '';
+   }
+   $wikitext .= '|-' . PHP_EOL;
+   $wikitext .= '|[[' . $pagename . ']]' . 
PHP_EOL;
+   $wikitext .= '|' . $associatedpagename 
. PHP_EOL;
+   $wikitext .= '|' . 
$comment->getCommentTitle() . PHP_EOL;
+   $wikitext .= '|' . 
$comment->getWikiText() . PHP_EOL;
+   $wikitext .= '|' . $author . PHP_EOL;
+   $wikitext .= '|' . $lasteditor . 
PHP_EOL;
+   $wikitext .= '|' . 
$comment->getCreationDate() . PHP_EOL;
+   $wikitext .= '|' . 
$comment->getModificationDate() . PHP_EOL;
+   $index ++;
}
} else {
$more = true;
diff --git a/includes/CommentStreamsHooks.php b/includes/CommentStreamsHooks.php
index 40ebff6..b0a9d0b 100644
--- a/includes/CommentStreamsHooks.php
+++ b/includes/CommentStreamsHooks.php
@@ -278,7 +278,10 @@
SearchResult $result, array $terms, SpecialSearch $page ) {
$comment = Comment::newFromWikiPage( WikiPage::factory( $title 
) );
if ( !is_null( $comment ) ) {
-   $title = Title::newFromId( $comment->getAssociatedId() 
);
+   $t = Title::newFromId( $comment->getAssociatedId() );

[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Allow anonymous comments.

2017-09-21 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/376912 )

Change subject: Allow anonymous comments.
..


Allow anonymous comments.

T167447
T175657
T175656
T175659

Change-Id: Ia9df3191a06543b5ae3b704e181241ec63e85ac1
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/ApiCSDeleteComment.php
M includes/ApiCSEditComment.php
M includes/ApiCSPostComment.php
M includes/Comment.php
M includes/CommentStreams.php
M includes/CommentStreamsAllComments.php
M includes/CommentStreamsHooks.php
M resources/CommentStreams.css
M resources/CommentStreams.js
M sql/commentData.sql
M sql/votes.sql
M sql/watch.sql
15 files changed, 154 insertions(+), 51 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/extension.json b/extension.json
index 7dfc9a8..15e1660 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CommentStreams",
-   "version": "3.9.1",
+   "version": "3.10",
"author": [
"[http://www.mediawiki.org/wiki/User:Jji Jason Ji]",
"[http://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
@@ -83,7 +83,9 @@
"commentstreams-buttontooltip-submit",
"commentstreams-buttontooltip-cancel",
"commentstreams-dialog-delete-message",
+   "commentstreams-dialog-anonymous-message",
"commentstreams-dialog-buttontext-ok",
+   "commentstreams-dialog-buttontext-cancel",
"commentstreams-dialog-buttontext-yes",
"commentstreams-dialog-buttontext-no",
"commentstreams-urldialog-instructions",
diff --git a/i18n/en.json b/i18n/en.json
index d6cff7d..aedf7ad 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -7,6 +7,7 @@
},
"commentstreams-desc": "Allows commenting on wiki pages",
"commentstreams-error-prohibitedaction": "Action $1 is not allowed on 
comment pages.",
+   "commentstreams-author-anonymous": "anonymous",
"apihelp-csQueryComment-description": "Return the title, user, creation 
timestamp, and wikitext of a comment. Either pageid or title must be provided.",
"apihelp-csQueryComment-summary": "Return the title, user, creation 
timestamp, and wikitext of a comment. Either pageid or title must be provided.",
"apihelp-csQueryComment-param-pageid": "page ID of the page which holds 
the comment to query",
@@ -94,7 +95,9 @@
"commentstreams-buttontooltip-submit": "submit",
"commentstreams-buttontooltip-cancel": "cancel",
"commentstreams-dialog-delete-message": "Are you sure you want to 
delete this comment?",
+   "commentstreams-dialog-anonymous-message": "You are not logged in. If 
you proceed to save this comment, your IP address will be recorded, and you 
will not be able to edit or delete this comment.",
"commentstreams-dialog-buttontext-ok": "OK",
+   "commentstreams-dialog-buttontext-cancel": "Cancel",
"commentstreams-dialog-buttontext-yes": "Yes",
"commentstreams-dialog-buttontext-no": "No",
"commentstreams-urldialog-instructions": "Copy and paste the URL below 
to share a permalink to this comment. Press escape to dismiss this dialog.",
@@ -119,6 +122,8 @@
"group-csmoderator": "Moderators (CommentStreams)",
"group-csmoderator-member": "{{GENDER:$1|moderator (CommentStreams)}}",
"grouppage-csmoderator": "{{ns:project}}:Moderators (CommentStreams)",
+   "right-cs-comment": "Post, edit, and delete user's own comments",
+   "action-cs-comment": "post, edit, or delete comments",
"right-cs-moderator-edit": "Edit comments by any user",
"action-cs-moderator-edit": "edit comments by other users",
"right-cs-moderator-delete": "Delete comments by any user",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index d824cf4..88d5c78 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -5,8 +5,9 @@
"Jason Ji"
]
},
-   "commentstreams-desc": 
"{{desc|name=CommentStreams|url=http://gestalt.mitre.org/gestaltd/index.php/CommentStreams}};,
+   "commentstreams-desc": 
"{{desc|name=CommentStreams|url=https://www.mediawiki.org/wiki/Extension:CommentStreams}};,
"commentstreams-error-prohibitedaction": "Error message.",
+   "commentstreams-author-anonymous": "The name displayed for anonymous 
comment authors",
"apihelp-csQueryComment-description": 
"{{doc-apihelp-description|csQueryComment}}",
"apihelp-csQueryComment-summary": 
"{{doc-apihelp-summary|csQueryComment}}",
"apihelp-csQueryComment-param-pageid": 
"{{doc-apihelp-param|csQueryComment|pageid}}",
@@ -94,7 +95,9 @@
  

[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Fix syntax errors in several function definitions

2017-09-21 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/377849 )

Change subject: Fix syntax errors in several function definitions
..


Fix syntax errors in several function definitions

Three functions in CommentStreams.js were defined in a way
that caused syntax errors in IE, resulting in misbehavior.

Change-Id: Iff80dd34088cdf3f015e13354f4a9a869ee6a5a1
---
M extension.json
M resources/CommentStreams.js
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/extension.json b/extension.json
index 7df4da3..7dfc9a8 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CommentStreams",
-   "version": "3.9",
+   "version": "3.9.1",
"author": [
"[http://www.mediawiki.org/wiki/User:Jji Jason Ji]",
"[http://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
diff --git a/resources/CommentStreams.js b/resources/CommentStreams.js
index bd2fb3d..736be51 100644
--- a/resources/CommentStreams.js
+++ b/resources/CommentStreams.js
@@ -460,7 +460,7 @@
} );
return deleteButton;
},
-   createPermalinkButton( pageid ) {
+   createPermalinkButton: function( pageid ) {
var self = this;
var id = 'cs-comment-' + pageid;
var permalinkButton = $( '' )
@@ -484,7 +484,7 @@
permalinkButton.append( permalinkimage );
return permalinkButton;
},
-   createWatchButton( commentData ) {
+   createWatchButton: function( commentData ) {
var self = this;
var watchButton = $( '' )
.addClass( 'cs-button' )
@@ -511,7 +511,7 @@
watchButton.append( watchimage );
return watchButton;
},
-   createVotingButtons( commentData ) {
+   createVotingButtons: function( commentData ) {
var self = this;
 
var upButton;

-- 
To view, visit https://gerrit.wikimedia.org/r/377849
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iff80dd34088cdf3f015e13354f4a9a869ee6a5a1
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Matthew-a-thompson 
Gerrit-Reviewer: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CreateUserPage[master]: Corrected user page creation to use wikitext instead of text.

2017-09-21 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/378086 )

Change subject: Corrected user page creation to use wikitext instead of text.
..


Corrected user page creation to use wikitext instead of text.

Change-Id: I048fa563cde69a0306b18156891a7c32296b178a
---
M extension.json
M includes/CreateUserPageHooks.php
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/extension.json b/extension.json
index 02848c2..14921e9 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CreateUserPage",
-   "version": "1.1",
+   "version": "1.1.1",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
],
diff --git a/includes/CreateUserPageHooks.php b/includes/CreateUserPageHooks.php
index 565d6a2..acaf6ec 100755
--- a/includes/CreateUserPageHooks.php
+++ b/includes/CreateUserPageHooks.php
@@ -28,7 +28,7 @@
$title = Title::newFromText( 'User:' . $user->mName );
if ( !is_null( $title ) && !$title->exists() ) {
$page = new WikiPage( $title );
-   $pageContent = new TextContent( 
$GLOBALS['wgCreateUserPage_PageContent'] );
+   $pageContent = new WikitextContent( 
$GLOBALS['wgCreateUserPage_PageContent'] );
$page->doEditContent( $pageContent, 'create user page', 
EDIT_NEW);
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/378086
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I048fa563cde69a0306b18156891a7c32296b178a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CreateUserPage
Gerrit-Branch: master
Gerrit-Owner: Kji 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/me...

2017-09-09 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/377035 )

Change subject: Merge branch 'master' of 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams
..

Merge branch 'master' of 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams

Change-Id: I6d073713d4548b33836f3cb83c00a6b8a2e3937b
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/35/377035/1


-- 
To view, visit https://gerrit.wikimedia.org/r/377035
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d073713d4548b33836f3cb83c00a6b8a2e3937b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Allow anonymous comments.

2017-09-09 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/376912 )

Change subject: Allow anonymous comments.
..

Allow anonymous comments.

T167447

Change-Id: Ia9df3191a06543b5ae3b704e181241ec63e85ac1
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/ApiCSPostComment.php
M includes/Comment.php
M includes/CommentStreams.php
M resources/CommentStreams.css
M resources/CommentStreams.js
8 files changed, 35 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/12/376912/1

diff --git a/extension.json b/extension.json
index 7df4da3..b0638c7 100644
--- a/extension.json
+++ b/extension.json
@@ -148,6 +148,7 @@
"callback" : "CommentStreamsHooks::onRegistration",
"config": {
"CommentStreamsNamespaceIndex": 844,
+   "CommentStreamsAllowAnonymousComments" : false,
"CommentStreamsAllowedNamespaces" : null,
"CommentStreamsEnableTalk": false,
"CommentStreamsNewestStreamsOnTop": true,
diff --git a/i18n/en.json b/i18n/en.json
index d6cff7d..4a4e38b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -7,6 +7,7 @@
},
"commentstreams-desc": "Allows commenting on wiki pages",
"commentstreams-error-prohibitedaction": "Action $1 is not allowed on 
comment pages.",
+   "commentstreams-author-anonymous": "anonymous",
"apihelp-csQueryComment-description": "Return the title, user, creation 
timestamp, and wikitext of a comment. Either pageid or title must be provided.",
"apihelp-csQueryComment-summary": "Return the title, user, creation 
timestamp, and wikitext of a comment. Either pageid or title must be provided.",
"apihelp-csQueryComment-param-pageid": "page ID of the page which holds 
the comment to query",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index d824cf4..9fb7a65 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -7,6 +7,7 @@
},
"commentstreams-desc": 
"{{desc|name=CommentStreams|url=http://gestalt.mitre.org/gestaltd/index.php/CommentStreams}};,
"commentstreams-error-prohibitedaction": "Error message.",
+   "commentstreams-author-anonymous": "The name displayed for anonymous 
comment authors",
"apihelp-csQueryComment-description": 
"{{doc-apihelp-description|csQueryComment}}",
"apihelp-csQueryComment-summary": 
"{{doc-apihelp-summary|csQueryComment}}",
"apihelp-csQueryComment-param-pageid": 
"{{doc-apihelp-param|csQueryComment|pageid}}",
diff --git a/includes/ApiCSPostComment.php b/includes/ApiCSPostComment.php
index e191e57..724db2a 100644
--- a/includes/ApiCSPostComment.php
+++ b/includes/ApiCSPostComment.php
@@ -35,6 +35,13 @@
 * execute the API request
 */
public function execute() {
+   if ( $this->getUser()->isAnon() ) {
+   if ( 
!$GLOBALS['wgCommentStreamsAllowAnonymousComments'] ) {
+   $this->dieCustomUsageMessage(
+   
'commentstreams-api-error-post-permissions' );
+   }
+   }
+
if ( !in_array( 'edit', $this->getUser()->getRights() ) ||
$this->getUser()->isBlocked() ) {
$this->dieCustomUsageMessage(
diff --git a/includes/Comment.php b/includes/Comment.php
index 84bf186..fa2d48d 100644
--- a/includes/Comment.php
+++ b/includes/Comment.php
@@ -114,6 +114,9 @@
$index = wfRandomString();
$title = Title::newFromText( (string)$index, 
NS_COMMENTSTREAMS );
if ( !$title->isDeletedQuick() && !$title->exists() ) {
+   if ( !$title->userCan( 'edit' ) ) {
+   return null;
+   }
$wikipage = new WikiPage( $title );
$status = $wikipage->doEditContent( $content, 
'',
EDIT_NEW | EDIT_SUPPRESS_RC , false, 
$user, null );
@@ -692,6 +695,9 @@
 * @return boolean true if successful
 */
public function update( $comment_title, $wikitext, $user ) {
+   if ( !$this->wikipage->getTitle()->userCan( 'edit' ) ) {
+   return false;
+   }
if ( is_null( $comment_title ) && is_null( $this->getParentId() 
) ) {
return false;
}
@@ -849,6 +855,14 @@
 * @return string display name for user
 */
public static function getDisplayNameFromUser( $user, $linked = true ) {
+   if ( $user->isAnon() ) {
+   $html = Html::openElement( 'span', [
+   'class' => 'cs-comment-author-anonymous'
+   

[MediaWiki-commits] [Gerrit] mediawiki...EmailAuthorization[master]: Adds request/approve account special pages and hooks.

2017-08-28 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/366780 )

Change subject: Adds request/approve account special pages and hooks.
..


Adds request/approve account special pages and hooks.

T173378
Change-Id: I97c2c995eb0eeea760824468d3b4453f6e7ccb09
---
M extension.json
M i18n/en.json
M i18n/qqq.json
A includes/EchoEAPresentationModel.php
R includes/EmailAuthorization.alias.php
A includes/EmailAuthorizationApprove.php
M includes/EmailAuthorizationConfig.php
M includes/EmailAuthorizationHooks.php
A includes/EmailAuthorizationRequest.php
R sql/EmailAuth.sql
A sql/EmailRequest.sql
11 files changed, 768 insertions(+), 17 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/extension.json b/extension.json
index 0f991aa..4c72bc2 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Email Authorization",
-   "version": "1.2",
+   "version": "1.3",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
],
@@ -9,7 +9,9 @@
"license-name": "MIT",
"type": "other",
"SpecialPages": {
-   "EmailAuthorizationConfig": "EmailAuthorizationConfig"
+   "EmailAuthorizationConfig": "EmailAuthorizationConfig",
+   "EmailAuthorizationRequest": "EmailAuthorizationRequest",
+   "EmailAuthorizationApprove": "EmailAuthorizationApprove"
},
"MessagesDirs": {
"EmailAuthorization": [
@@ -17,7 +19,7 @@
]
},
"ExtensionMessagesFiles": {
-   "EmailAuthorizationAlias": 
"includes/EmailAuthorizationConfig.alias.php"
+   "EmailAuthorizationAlias": 
"includes/EmailAuthorization.alias.php"
},
"ResourceModules": {
"ext.EmailAuthorization": {
@@ -37,13 +39,22 @@
"AutoloadClasses": {
"EmailAuthorization": "includes/EmailAuthorization.php",
"EmailAuthorizationHooks": 
"includes/EmailAuthorizationHooks.php",
-   "EmailAuthorizationConfig": 
"includes/EmailAuthorizationConfig.php"
+   "EmailAuthorizationConfig": 
"includes/EmailAuthorizationConfig.php",
+   "EmailAuthorizationRequest": 
"includes/EmailAuthorizationRequest.php",
+   "EmailAuthorizationApprove": 
"includes/EmailAuthorizationApprove.php",
+   "EchoEAPresentationModel": 
"includes/EchoEAPresentationModel.php"
},
"Hooks": {
"PluggableAuthUserAuthorization": [ 
"EmailAuthorizationHooks::authorize" ],
"LoadExtensionSchemaUpdates": [
"EmailAuthorizationHooks::loadExtensionSchemaUpdates"
-   ]
+   ],
+   "BeforeCreateEchoEvent": 
"EmailAuthorizationHooks::onBeforeCreateEchoEvent"
+   },
+   "callback": "EmailAuthorizationHooks::onRegistration",
+   "config": {
+   "EmailAuthorization_EnableRequests": false,
+   "EmailAuthorization_RequestFields": []
},
"manifest_version": 1
 }
diff --git a/i18n/en.json b/i18n/en.json
index 3535d27..1e58e35 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -5,7 +5,7 @@
]
},
"emailauthorization-desc": "Authorize users by email address",
-   "emailauthorizationconfig": "Configure Email Authorization",
+   "emailauthorizationconfig": "Email Authorization Dashboard",
"emailauthorization-config-instructions": "To add or revoke all email 
addresses in a domain use ''@domain'', where ''domain'' is the email domain. 
This will not affect other email addresses explicitly added in that domain.",
"emailauthorization-config-authorized": "''$1'' is authorized.",
"emailauthorization-config-notauthorized": "''$1'' is not authorized.",
@@ -15,7 +15,7 @@
"emailauthorization-config-noauthfound": "No authorized email addresses 
or domains found.",
"emailauthorization-config-nousersfound": "No users found.",
"emailauthorization-config-invalidemail": "''$1'' is not a valid email 
address or domain.",
-   "emailauthorization-config-label-email": "Email",
+   "emailauthorization-config-label-email": "Email Address",
"emailauthorization-config-label-username": "Username",
"emailauthorization-config-label-realname": "Real Name",
"emailauthorization-config-label-userpage": "User Page",
@@ -34,6 +34,29 @@
"emailauthorization-config-button-showauth": "Show authorized email 
addresses and domains",
"emailauthorization-config-button-showall": "Show all wiki users",
"right-emailauthorizationconfig": "Configure user authorization by 
email address",
-   "action-emailauthorizationconfig": "configure email authorization"
-
+   

[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Encode url properly

2017-08-20 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/372760 )

Change subject: Encode url properly
..


Encode url properly

Bug: T173627
Change-Id: I165bbc3f56394fd135d21c982695cfb21ba37b8c
---
M PluggableAuthHooks.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/PluggableAuthHooks.php b/PluggableAuthHooks.php
index 325dc6f..f98ba72 100644
--- a/PluggableAuthHooks.php
+++ b/PluggableAuthHooks.php
@@ -157,7 +157,7 @@
$oldTitle = $title;
$title = Title::newFromText( "UserLogin", NS_SPECIAL );
$out->redirect( $title->getFullURL( [
-   'returnto' => $oldTitle,
+   'returnto' => urlencode( $oldTitle ),
'returntoquery' => $request->getRawQueryString()
] ) );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/372760
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I165bbc3f56394fd135d21c982695cfb21ba37b8c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Remove ResourceModules ext.PluggableAuthAutoLogin

2017-08-10 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/371200 )

Change subject: Remove ResourceModules ext.PluggableAuthAutoLogin
..


Remove ResourceModules ext.PluggableAuthAutoLogin

Follow up I3eff5988c95738ef6de5fd8404ad3becba09b0c8

Change-Id: Ide1ecab060c2cc2b147454a7a12aecb55c3dcb3d
---
M extension.json
1 file changed, 0 insertions(+), 16 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/extension.json b/extension.json
index 1e9c2bd..02088f1 100644
--- a/extension.json
+++ b/extension.json
@@ -26,22 +26,6 @@
"PluggableAuthContinueAuthenticationRequest": 
"PluggableAuthContinueAuthenticationRequest.php",
"PluggableAuthLogin": "PluggableAuthLogin.php"
},
-   "ResourceModules": {
-   "ext.PluggableAuthAutoLogin" : {
-   "scripts": [
-   "ext.PluggableAuthAutoLogin.js"
-   ],
-   "position": "top",
-   "targets": [
-   "desktop",
-   "mobile"
-   ]
-   }
-   },
-   "ResourceFileModulePaths": {
-   "localBasePath": "",
-   "remoteExtPath": "PluggableAuth"
-   },
"callback": "PluggableAuthHooks::onRegistration",
"Hooks": {
"TitleReadWhitelist": 
"PluggableAuthHooks::onTitleReadWhitelist",

-- 
To view, visit https://gerrit.wikimedia.org/r/371200
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ide1ecab060c2cc2b147454a7a12aecb55c3dcb3d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: MarkAHershberger 
Gerrit-Reviewer: Umherirrender 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Add earlier hook to avoid JS redirect

2017-08-07 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/369585 )

Change subject: Add earlier hook to avoid JS redirect
..


Add earlier hook to avoid JS redirect

Note that we have to pass in $title by ref because we will replace the object.

Change-Id: I3eff5988c95738ef6de5fd8404ad3becba09b0c8
---
M PluggableAuthHooks.php
D ext.PluggableAuthAutoLogin.js
M extension.json
3 files changed, 28 insertions(+), 78 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/PluggableAuthHooks.php b/PluggableAuthHooks.php
index a82d024..325dc6f 100644
--- a/PluggableAuthHooks.php
+++ b/PluggableAuthHooks.php
@@ -120,24 +120,22 @@
}
 
/**
-* Implements BeforePageDisplay hook.
-* See https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay
-* Adds auto login JavaScript module if all of the following are true:
-* - auto login is enabled
-* - no user is already logged in
-* - the current page is not a PluggableAuth login special page (which 
would
-*   cause an infinite loop)
-* - if the wiki requires login to read, the current page is 
whitelisted (in
-*   other words, users than cannot login to a wiki that requires login 
to
-*   read will still be able to read whitelisted pages, since those 
pages
-*   will not trigger auto login).
+* Grab the page request early
+* See https://www.mediawiki.org/wiki/Manual:Hooks/BeforeInitialize
+* Redirects ASAP to login
+* @param Title &$title being used for request
+* @param null $article unused
+* @param OutputPage $out object
+* @param User $user current user
+* @param WebRequest $request why we're here
+* @param MediaWiki $mw object
 *
-* @since 2.0
-*
-* @param OutputPage &$out output page obj
-* @param Skin &$skin will be used to generate the page
+* Note that $title has to be passed by ref so we can replace it.
 */
-   public static function autoLoginInit( &$out, &$skin ) {
+   public static function doBeforeInitialize(
+   Title &$title, $article, OutputPage $out, User $user,
+   WebRequest $request, MediaWiki $mw
+   ) {
if ( !$GLOBALS['wgPluggableAuth_EnableAutoLogin'] ) {
return;
}
@@ -148,14 +146,20 @@
return;
}
$loginSpecialPages = 
ExtensionRegistry::getInstance()->getAttribute(
-   'PluggableAuthLoginSpecialPages' );
-   $title = $out->getTitle();
+   'PluggableAuthLoginSpecialPages'
+   );
foreach ( $loginSpecialPages as $page ) {
if ( $title->isSpecial( $page ) ) {
return;
}
}
-   $out->addModules( 'ext.PluggableAuthAutoLogin' );
+
+   $oldTitle = $title;
+   $title = Title::newFromText( "UserLogin", NS_SPECIAL );
+   $out->redirect( $title->getFullURL( [
+   'returnto' => $oldTitle,
+   'returntoquery' => $request->getRawQueryString()
+   ] ) );
}
 
/**
diff --git a/ext.PluggableAuthAutoLogin.js b/ext.PluggableAuthAutoLogin.js
deleted file mode 100644
index 864f816..000
--- a/ext.PluggableAuthAutoLogin.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2016 The MITRE Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-( function ( mw ) {
-   mw.loader.using( [ 'mediawiki.Uri', 'mediawiki.Title' ], function () {
-   var pageName = mw.config.get( 'wgPageName' );
-   var 

[MediaWiki-commits] [Gerrit] mediawiki...OpenIDConnect[master]: Updated composer.json to get library from git master.

2017-08-06 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370372 )

Change subject: Updated composer.json to get library from git master.
..


Updated composer.json to get library from git master.

Change-Id: I5a88d718fae96e5b374866677ecb919a067abe96
---
M composer.json
1 file changed, 9 insertions(+), 3 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/composer.json b/composer.json
index 8b10580..4696a9f 100644
--- a/composer.json
+++ b/composer.json
@@ -1,9 +1,6 @@
 {
"name": "mediawiki/OpenIDConnect",
"description": "Provides authentication using OpenID Connect in 
conjunction with PluggableAuth",
-   "require": {
-   "jumbojett/openid-connect-php": "*"
-   },
"license": "MIT",
"authors": [
{
@@ -11,6 +8,15 @@
"email": "cical...@mitre.org"
}
],
+   "repositories": [
+   {
+   "url": 
"https://github.com/jumbojett/OpenID-Connect-PHP.git;,
+   "type": "git"
+   }
+   ],
+   "require": {
+   "jumbojett/openid-connect-php": "master-dev"
+   },
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"jakub-onderka/php-console-highlighter": "0.3.2"

-- 
To view, visit https://gerrit.wikimedia.org/r/370372
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5a88d718fae96e5b374866677ecb919a067abe96
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenIDConnect
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...OpenIDConnect[master]: Updated composer.json to get library from git master.

2017-08-06 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370372 )

Change subject: Updated composer.json to get library from git master.
..

Updated composer.json to get library from git master.

Change-Id: I5a88d718fae96e5b374866677ecb919a067abe96
---
M composer.json
1 file changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenIDConnect 
refs/changes/72/370372/1

diff --git a/composer.json b/composer.json
index 8b10580..4696a9f 100644
--- a/composer.json
+++ b/composer.json
@@ -1,9 +1,6 @@
 {
"name": "mediawiki/OpenIDConnect",
"description": "Provides authentication using OpenID Connect in 
conjunction with PluggableAuth",
-   "require": {
-   "jumbojett/openid-connect-php": "*"
-   },
"license": "MIT",
"authors": [
{
@@ -11,6 +8,15 @@
"email": "cical...@mitre.org"
}
],
+   "repositories": [
+   {
+   "url": 
"https://github.com/jumbojett/OpenID-Connect-PHP.git;,
+   "type": "git"
+   }
+   ],
+   "require": {
+   "jumbojett/openid-connect-php": "master-dev"
+   },
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"jakub-onderka/php-console-highlighter": "0.3.2"

-- 
To view, visit https://gerrit.wikimedia.org/r/370372
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a88d718fae96e5b374866677ecb919a067abe96
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenIDConnect
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CreateUserPage[master]: Fixed MW 1.29 compatibility.

2017-08-02 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/369667 )

Change subject: Fixed MW 1.29 compatibility.
..


Fixed MW 1.29 compatibility.

Replaced call to WikiPage::doEdit(), which was removed in 1.29, with a call to 
WikiPage::doEditContent().

This should retain backwards compatibility to 1.27 since 
WikiPage::doEditContent() exists in 1.27 and 1.28 but this has not been tested.

Change-Id: Ie738f0c0abcd87d583917284afaf4f52ecd953bd
---
M extension.json
M includes/CreateUserPageHooks.php
2 files changed, 3 insertions(+), 4 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/extension.json b/extension.json
index 4cb4a59..02848c2 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CreateUserPage",
-   "version": "1.0",
+   "version": "1.1",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
],
diff --git a/includes/CreateUserPageHooks.php b/includes/CreateUserPageHooks.php
index d29a223..565d6a2 100755
--- a/includes/CreateUserPageHooks.php
+++ b/includes/CreateUserPageHooks.php
@@ -28,9 +28,8 @@
$title = Title::newFromText( 'User:' . $user->mName );
if ( !is_null( $title ) && !$title->exists() ) {
$page = new WikiPage( $title );
-   $page->doEdit( $GLOBALS['wgCreateUserPage_PageContent'],
-   'create user page', EDIT_NEW);
+   $pageContent = new TextContent( 
$GLOBALS['wgCreateUserPage_PageContent'] );
+   $page->doEditContent( $pageContent, 'create user page', 
EDIT_NEW);
}
-   return true;
}
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/369667
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie738f0c0abcd87d583917284afaf4f52ecd953bd
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CreateUserPage
Gerrit-Branch: master
Gerrit-Owner: Kji 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Conform to coding conventions

2017-08-02 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/369584 )

Change subject: Conform to coding conventions
..


Conform to coding conventions

* Address CodeSniffer issues.
* Add .dir-locals.el for emacs users.
* Introduce personal pref for long lines in argument lists
* Hooks don't need to return true any more.  Doing so makes
  CodeSniffer go bonkers w/o a comment.
* When passing in objects pass by ref isn't needed.

Change-Id: Iad94d077418078bb9d714606ff328b338a30b5cf
---
A .dir-locals.el
M PluggableAuthHooks.php
2 files changed, 125 insertions(+), 36 deletions(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.dir-locals.el b/.dir-locals.el
new file mode 100644
index 000..2280495
--- /dev/null
+++ b/.dir-locals.el
@@ -0,0 +1,88 @@
+((nil . ((mode . flycheck)
+(mode . company)
+(mode . edep)
+(mode . subword)
+(tab-width . 4)
+(c-basic-offset . 4)
+(indent-tabs-mode . t)
+(eval . (progn (when (fboundp 'delete-trailing-whitespace)
+ (delete-trailing-whitespace))
+ (tabify (point-min) 
(point-max
+(c-hanging-braces-alist
+ (defun-open after)
+ (block-open after)
+ (defun-close))
+(c-offsets-alist . (
+(access-label . -)
+(annotation-top-cont . 
0)
+(annotation-var-cont . 
+)
+(arglist-close . 
php-lineup-arglist-close)
+(arglist-cont-nonempty 
first
+   
php-lineup-cascaded-calls
+   
c-lineup-arglist)
+(arglist-intro . 
php-lineup-arglist-intro)
+(block-close . 0)
+(block-open . 0)
+(brace-entry-open . 0)
+(brace-list-close . 0)
+(brace-list-entry . 0)
+(brace-list-intro . +)
+(brace-list-open . 0)
+(c . 
c-lineup-C-comments)
+(case-label . 0)
+(catch-clause . 0)
+(class-close . 0)
+(comment-intro . 0)
+(composition-close . 0)
+(composition-open . 0)
+(cpp-define-intro 
c-lineup-cpp-define +)
+(cpp-macro . [0])
+(cpp-macro-cont . +)
+(defun-block-intro . +)
+(defun-close . 0)
+(defun-open . 0)
+(do-while-closure . 0)
+(else-clause . 0)
+(extern-lang-close . 0)
+(extern-lang-open . 0)
+(friend . 0)
+(func-decl-cont . +)
+(inclass . +)
+(incomposition . +)
+(inexpr-class . +)
+(inexpr-statement . +)
+(inextern-lang . +)
+(inher-cont . 
c-lineup-multi-inher)
+(inher-intro . +)
+

[MediaWiki-commits] [Gerrit] mediawiki...EmailAuthorization[master]: WIP: Adding request/approve account special pages.

2017-07-20 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/366780 )

Change subject: WIP: Adding request/approve account special pages.
..

WIP: Adding request/approve account special pages.

Change-Id: I97c2c995eb0eeea760824468d3b4453f6e7ccb09
---
M extension.json
M i18n/en.json
M i18n/qqq.json
A includes/EmailAuthorization.alias.php
M includes/EmailAuthorizationConfig.php
M includes/EmailAuthorizationHooks.php
A includes/EmailAuthorizationRequest.php
A sql/EmailAuth.sql
A sql/EmailRequest.sql
9 files changed, 285 insertions(+), 15 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EmailAuthorization 
refs/changes/80/366780/1

diff --git a/extension.json b/extension.json
index 0f991aa..c4d04f2 100644
--- a/extension.json
+++ b/extension.json
@@ -9,7 +9,8 @@
"license-name": "MIT",
"type": "other",
"SpecialPages": {
-   "EmailAuthorizationConfig": "EmailAuthorizationConfig"
+   "EmailAuthorizationConfig": "EmailAuthorizationConfig",
+   "EmailAuthorizationRequest": "EmailAuthorizationRequest"
},
"MessagesDirs": {
"EmailAuthorization": [
@@ -17,7 +18,7 @@
]
},
"ExtensionMessagesFiles": {
-   "EmailAuthorizationAlias": 
"includes/EmailAuthorizationConfig.alias.php"
+   "EmailAuthorizationAlias": 
"includes/EmailAuthorization.alias.php"
},
"ResourceModules": {
"ext.EmailAuthorization": {
@@ -37,7 +38,8 @@
"AutoloadClasses": {
"EmailAuthorization": "includes/EmailAuthorization.php",
"EmailAuthorizationHooks": 
"includes/EmailAuthorizationHooks.php",
-   "EmailAuthorizationConfig": 
"includes/EmailAuthorizationConfig.php"
+   "EmailAuthorizationConfig": 
"includes/EmailAuthorizationConfig.php",
+   "EmailAuthorizationRequest": 
"includes/EmailAuthorizationRequest.php"
},
"Hooks": {
"PluggableAuthUserAuthorization": [ 
"EmailAuthorizationHooks::authorize" ],
@@ -45,5 +47,9 @@
"EmailAuthorizationHooks::loadExtensionSchemaUpdates"
]
},
+   "config": {
+   "EmailAuthorizationEnableRequests": false,
+   "EmailAuthorizationRequestFields": null
+   },
"manifest_version": 1
 }
diff --git a/i18n/en.json b/i18n/en.json
index 3535d27..ce2102f 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -15,7 +15,7 @@
"emailauthorization-config-noauthfound": "No authorized email addresses 
or domains found.",
"emailauthorization-config-nousersfound": "No users found.",
"emailauthorization-config-invalidemail": "''$1'' is not a valid email 
address or domain.",
-   "emailauthorization-config-label-email": "Email",
+   "emailauthorization-config-label-email": "Email Address",
"emailauthorization-config-label-username": "Username",
"emailauthorization-config-label-realname": "Real Name",
"emailauthorization-config-label-userpage": "User Page",
@@ -34,6 +34,9 @@
"emailauthorization-config-button-showauth": "Show authorized email 
addresses and domains",
"emailauthorization-config-button-showall": "Show all wiki users",
"right-emailauthorizationconfig": "Configure user authorization by 
email address",
-   "action-emailauthorizationconfig": "configure email authorization"
-
+   "action-emailauthorizationconfig": "configure email authorization",
+   "emailauthorizationrequest": "Request an Account",
+   "emailauthorization-request-instructions": "Fill in fields and submit 
to request an account.",
+   "emailauthorization-request-label-email": "Email Address",
+   "emailauthorization-request-button-submit": "Submit"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 2ea7d30..52531dd 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -32,9 +32,13 @@
"emailauthorization-config-button-previous": "Button 
text\n{{Identical|Previous}}",
"emailauthorization-config-button-search": "Button 
text\n{{Identical|Search}}",
"emailauthorization-config-button-add": "Button 
text\n{{Identical|Add}}",
-   "emailauthorization-config-button-revoke": "Button 
text\n{{Identical|Revoke}}",
+   "emailauthorization-config-button-revoke": "Button text",
"emailauthorization-config-button-showauth": "Button text",
"emailauthorization-config-button-showall": "Button text",
"right-emailauthorizationconfig": 
"{{doc-right|emailauthorizationconfig}}",
-   "action-emailauthorizationconfig": 
"{{doc-action|emailauthorizationconfig}}"
+   "action-emailauthorizationconfig": 
"{{doc-action|emailauthorizationconfig}}",
+   "emailauthorizationrequest": "Special page name",
+   "emailauthorization-request-instructions": 

[MediaWiki-commits] [Gerrit] mediawiki...SimpleSAMLphp[master]: Update user with groups from SAML attributes.

2017-07-11 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/361676 )

Change subject: Update user with groups from SAML attributes.
..


Update user with groups from SAML attributes.

* This is inspired by Extension:SimpleSamlAuth by Jorn de Jong.
* Implementing PluggableAuthPopulateGroups Hook (needs v5.1 of PluggableAuth) 
to provision the groups
* Mapping configurable in LocalSettings.php: `$wgSimpleSAMLphp_GroupMap = 
array( 'mw group' => array( 'saml attrib' => array('value1', 'value2', ...)))`

Change-Id: I0e7c28b1dfa5dbfb8153af07ce3a0d6cb70507ae
---
M SimpleSAMLphp.class.php
M extension.json
2 files changed, 41 insertions(+), 6 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/SimpleSAMLphp.class.php b/SimpleSAMLphp.class.php
index 2b87420..ede0fcf 100644
--- a/SimpleSAMLphp.class.php
+++ b/SimpleSAMLphp.class.php
@@ -37,7 +37,7 @@
public function authenticate( &$id, &$username, &$realname, &$email,
&$errorMessage ) {
 
-   $saml = $this->getSAMLClient();
+   $saml = self::getSAMLClient();
try {
$saml->requireAuth();
} catch ( Exception $e ) {
@@ -120,7 +120,7 @@
 * @param User &$user
 */
public function deauthenticate( User &$user ) {
-   $saml = $this->getSAMLClient();
+   $saml = self::getSAMLClient();
$returnto = null;
if ( array_key_exists( 'returnto', $_REQUEST ) ) {
$title = Title::newFromText( $_REQUEST['returnto'] );
@@ -144,7 +144,39 @@
// intentionally left blank
}
 
-   private function getSAMLClient() {
+   /**
+* @since 4.1
+* Update MediaWiki group membership of the authenticated user (given 
as object).
+* Override function of parent class to use groups from SAML attributes.
+* Credits to Extension:SimpleSamlAuth by Jorn de Jong
+* @param User &$user
+*/
+   public static function populateGroups( User $user ) {
+   $saml = self::getSAMLClient();
+   $attributes = $saml->getAttributes();
+
+   if ( is_array( $GLOBALS['wgSimpleSAMLphp_GroupMap'] ) ) {
+   # group map: [mediawiki group][saml attribute][saml 
attribute value]
+   foreach ( $GLOBALS['wgSimpleSAMLphp_GroupMap'] as 
$group => $rules ) {
+   foreach ( $rules as $attrName => $needles ) {
+   if ( !isset( $attributes[$attrName] ) ) 
{
+   continue;
+   }
+   foreach ( $needles as $needle ) {
+   if ( in_array( $needle, 
$attributes[$attrName] ) ) {
+   $user->addGroup( $group 
);
+   } else {
+   $user->removeGroup( 
$group );
+   }
+   }
+   }
+   }
+   } else {
+   wfDebug( 'SimpleSAMLphp: $wgSimpleSAMLphp_GroupMap is 
not an array' );
+   }
+   }
+
+   private static function getSAMLClient() {
require_once rtrim( $GLOBALS['wgSimpleSAMLphp_InstallDir'],
DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR . 'lib' .
DIRECTORY_SEPARATOR . '_autoload.php';
@@ -152,4 +184,3 @@
$GLOBALS['wgSimpleSAMLphp_AuthSourceId'] );
}
 }
-
diff --git a/extension.json b/extension.json
index e7b1923..9c04f15 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "SimpleSAMLphp",
-   "version": "4.0",
+   "version": "4.1",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
],
@@ -9,7 +9,7 @@
"type": "other",
"requires": {
"extensions": {
-   "PluggableAuth": ">= 4.0"
+   "PluggableAuth": ">= 5.1"
}
},
"MessagesDirs": {
@@ -20,7 +20,11 @@
"AutoloadClasses": {
"SimpleSAMLphp": "SimpleSAMLphp.class.php"
},
+   "Hooks": {
+   "PluggableAuthPopulateGroups": [ 
"SimpleSAMLphp::populateGroups" ]
+   },
"config": {
+   "SimpleSAMLphp_GroupMap": null,
"PluggableAuth_Class": "SimpleSAMLphp"
},
"manifest_version": 1

-- 
To view, visit https://gerrit.wikimedia.org/r/361676
To unsubscribe, visit 

[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Populate a user's groups from authentication provider's data.

2017-07-11 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/361677 )

Change subject: Populate a user's groups from authentication provider's data.
..


Populate a user's groups from authentication provider's data.

* Created a hook PluggableAuthPopulateGroups in class PluggableAuth
* Since this is a hook it does not forcing a breaking change
* Is called from PluggableAuthLogin::authenticate() just before authorization.

Change-Id: I73678e838b0c661132a1f6f20e4b49d4c2a809bc
---
M PluggableAuthLogin.php
M extension.json
2 files changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  Poikilotherm: Looks good to me, but someone else must approve
  jenkins-bot: Checked



diff --git a/PluggableAuthLogin.php b/PluggableAuthLogin.php
index 096f998..054c636 100644
--- a/PluggableAuthLogin.php
+++ b/PluggableAuthLogin.php
@@ -59,6 +59,7 @@
$user->loadFromId();
wfDebug( 'Authenticated existing user: 
' . $user->mName );
}
+   Hooks::run( 'PluggableAuthPopulateGroups', [ 
$user ] );
$authorized = true;
Hooks::run( 'PluggableAuthUserAuthorization', [ 
$user, &$authorized ] );
if ( $authorized ) {
diff --git a/extension.json b/extension.json
index d88bb33..abd41de 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "PluggableAuth",
-   "version": "5.0",
+   "version": "5.1",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
],

-- 
To view, visit https://gerrit.wikimedia.org/r/361677
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I73678e838b0c661132a1f6f20e4b49d4c2a809bc
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Poikilotherm 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: MarkAHershberger 
Gerrit-Reviewer: Poikilotherm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...LdapGroups[master]: Support for PluggableAuth 5.1.

2017-07-08 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364035 )

Change subject: Support for PluggableAuth 5.1.
..

Support for PluggableAuth 5.1.

Change-Id: Ic42c763b85b2d16b947d1021cb4401d12e0d8fa4
---
M extension.json
M src/LdapGroups.php
2 files changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LdapGroups 
refs/changes/35/364035/2

diff --git a/extension.json b/extension.json
index 8ba5c22..35db3f0 100644
--- a/extension.json
+++ b/extension.json
@@ -30,6 +30,9 @@
"ConfigRegistry": {
"LdapGroups": "LdapGroups\\LdapGroups::makeConfig"
},
+   "Hooks": {
+   "PluggableAuthPopulateGroups": [ "LdapGroups::populateGroups" ]
+   },
"config": {
"_prefix": "LdapGroups",
"IniFile": "",
diff --git a/src/LdapGroups.php b/src/LdapGroups.php
index d676539..cb5c148 100644
--- a/src/LdapGroups.php
+++ b/src/LdapGroups.php
@@ -235,12 +235,12 @@
}
 
// This hook is probably not the right place.
-   static public function loadUser( $user, $email ) {
+   static public function populateGroups( $user ) {
$config
= ConfigFactory::getDefaultInstance()->makeConfig( 
'LdapGroups' );
$here = self::newFromIniFile( $config->get("IniFile") );
 
-   $here->fetchLDAPData( $user, $email );
+   $here->fetchLDAPData( $user );
 
// Make sure user is in the right groups;
$here->mapGroups( $user );

-- 
To view, visit https://gerrit.wikimedia.org/r/364035
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic42c763b85b2d16b947d1021cb4401d12e0d8fa4
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/LdapGroups
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Replace editmyprivateinfo with wgPluggableAuth_EnableLocalPr...

2017-07-08 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/364026 )

Change subject: Replace editmyprivateinfo with 
wgPluggableAuth_EnableLocalProperties
..


Replace editmyprivateinfo with wgPluggableAuth_EnableLocalProperties

T170036
Change-Id: I8ca9dc4fefc2efbd59391cd0d12ea68c40102677
---
M PluggableAuthLogin.php
M PluggableAuthPrimaryAuthenticationProvider.php
M extension.json
3 files changed, 15 insertions(+), 7 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/PluggableAuthLogin.php b/PluggableAuthLogin.php
index 1ab86bb..096f998 100644
--- a/PluggableAuthLogin.php
+++ b/PluggableAuthLogin.php
@@ -91,6 +91,10 @@
}
$returnToUrl = $authManager->getAuthenticationSessionData(
self::RETURNTOURL_SESSION_KEY );
-   $this->getOutput()->redirect( $returnToUrl );
+   if ( is_null( $returnToUrl) || count( $returnToUrl ) === 0 ) {
+   wfDebug( 'ERROR: return to URL is null or empty' );
+   } else {
+   $this->getOutput()->redirect( $returnToUrl );
+   }
}
 }
diff --git a/PluggableAuthPrimaryAuthenticationProvider.php 
b/PluggableAuthPrimaryAuthenticationProvider.php
index 97f72f9..e14ca95 100644
--- a/PluggableAuthPrimaryAuthenticationProvider.php
+++ b/PluggableAuthPrimaryAuthenticationProvider.php
@@ -82,6 +82,10 @@
return AuthenticationResponse::newPass( $username );
}
 
+   public function providerAllowsPropertyChange( $property ) {
+   return $GLOBALS['wgPluggableAuth_EnableLocalProperties'];
+   }
+
private function updateUserRealNameAndEmail( $user, $force = false ) {
$realname = $this->manager->getAuthenticationSessionData(
PluggableAuthLogin::REALNAME_SESSION_KEY );
@@ -92,12 +96,11 @@
$this->manager->removeAuthenticationSessionData(
PluggableAuthLogin::EMAIL_SESSION_KEY );
if ( $user->mRealName != $realname || $user->mEmail != $email ) 
{
-   $rights = $user->getRights();
-   if ( in_array( 'editmyprivateinfo', $rights ) && 
!$force) {
-   wfDebug( 'User has editmyprivateinfo right.' );
+   if ( $GLOBALS['wgPluggableAuth_EnableLocalProperties'] 
&& !$force ) {
+   wfDebug( 'Local properties enabled.' );
wfDebug( 'Did not save updated real name and 
email address.' );
} else {
-   wfDebug( 'User does not have editmyprivateinfo 
right or has just been created.' );
+   wfDebug( 'Local properties disabled or has just 
been created.' );
$user->mRealName = $realname;
if ( $email && Sanitizer::validateEmail( $email 
) ) {
$user->mEmail = $email;
diff --git a/extension.json b/extension.json
index e593e35..d88bb33 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "PluggableAuth",
-   "version": "4.2",
+   "version": "5.0",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
],
@@ -63,7 +63,8 @@
],
"config": {
"PluggableAuth_EnableAutoLogin": false,
-   "PluggableAuth_EnableLocalLogin": false
+   "PluggableAuth_EnableLocalLogin": false,
+   "PluggableAuth_EnableLocalProperties": false
},
"manifest_version": 1
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/364026
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8ca9dc4fefc2efbd59391cd0d12ea68c40102677
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Replace editmyprivateinfo with wgPluggableAuth_EnableLocalPr...

2017-07-08 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364026 )

Change subject: Replace editmyprivateinfo with 
wgPluggableAuth_EnableLocalProperties
..

Replace editmyprivateinfo with wgPluggableAuth_EnableLocalProperties

Change-Id: I8ca9dc4fefc2efbd59391cd0d12ea68c40102677
---
M PluggableAuthLogin.php
M PluggableAuthPrimaryAuthenticationProvider.php
M extension.json
3 files changed, 15 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PluggableAuth 
refs/changes/26/364026/1

diff --git a/PluggableAuthLogin.php b/PluggableAuthLogin.php
index 1ab86bb..096f998 100644
--- a/PluggableAuthLogin.php
+++ b/PluggableAuthLogin.php
@@ -91,6 +91,10 @@
}
$returnToUrl = $authManager->getAuthenticationSessionData(
self::RETURNTOURL_SESSION_KEY );
-   $this->getOutput()->redirect( $returnToUrl );
+   if ( is_null( $returnToUrl) || count( $returnToUrl ) === 0 ) {
+   wfDebug( 'ERROR: return to URL is null or empty' );
+   } else {
+   $this->getOutput()->redirect( $returnToUrl );
+   }
}
 }
diff --git a/PluggableAuthPrimaryAuthenticationProvider.php 
b/PluggableAuthPrimaryAuthenticationProvider.php
index 97f72f9..ac24ad1 100644
--- a/PluggableAuthPrimaryAuthenticationProvider.php
+++ b/PluggableAuthPrimaryAuthenticationProvider.php
@@ -82,6 +82,10 @@
return AuthenticationResponse::newPass( $username );
}
 
+   public function providerAllowsPropertyChange( $property ) {
+   return $GLOBALS['wgPluggableAuth_EnableLocalProperties'];
+   }
+
private function updateUserRealNameAndEmail( $user, $force = false ) {
$realname = $this->manager->getAuthenticationSessionData(
PluggableAuthLogin::REALNAME_SESSION_KEY );
@@ -93,11 +97,11 @@
PluggableAuthLogin::EMAIL_SESSION_KEY );
if ( $user->mRealName != $realname || $user->mEmail != $email ) 
{
$rights = $user->getRights();
-   if ( in_array( 'editmyprivateinfo', $rights ) && 
!$force) {
-   wfDebug( 'User has editmyprivateinfo right.' );
+   if ( $GLOBALS['wgPluggableAuth_EnableLocalProperties'] 
&& !$force ) {
+   wfDebug( 'Local properties enabled.' );
wfDebug( 'Did not save updated real name and 
email address.' );
} else {
-   wfDebug( 'User does not have editmyprivateinfo 
right or has just been created.' );
+   wfDebug( 'Local properties disabled or has just 
been created.' );
$user->mRealName = $realname;
if ( $email && Sanitizer::validateEmail( $email 
) ) {
$user->mEmail = $email;
diff --git a/extension.json b/extension.json
index e593e35..d88bb33 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "PluggableAuth",
-   "version": "4.2",
+   "version": "5.0",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
],
@@ -63,7 +63,8 @@
],
"config": {
"PluggableAuth_EnableAutoLogin": false,
-   "PluggableAuth_EnableLocalLogin": false
+   "PluggableAuth_EnableLocalLogin": false,
+   "PluggableAuth_EnableLocalProperties": false
},
"manifest_version": 1
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/364026
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ca9dc4fefc2efbd59391cd0d12ea68c40102677
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...ansible-wikifarm[master]: Added delete scripts

2017-07-07 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/364004 )

Change subject: Added delete scripts
..


Added delete scripts

Change-Id: Ibdd1da62c09f4118cf78b94d86e6b1864983c213
---
A delete_wiki.yml
A roles/delete_wiki_on_db_host/tasks/main.yml
A roles/delete_wiki_on_mw_host/tasks/main.yml
3 files changed, 33 insertions(+), 0 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/delete_wiki.yml b/delete_wiki.yml
new file mode 100644
index 000..264ef89
--- /dev/null
+++ b/delete_wiki.yml
@@ -0,0 +1,13 @@
+- name: Delete a wiki - DB tasks
+
+  hosts: "{{ DB_HOST | default(MW_HOST) }}"
+
+  roles:
+- delete_wiki_on_db_host
+
+- name: Delete a wiki - MediaWiki tasks
+
+  hosts: "{{ MW_HOST }}"
+
+  roles:
+- delete_wiki_on_mw_host
diff --git a/roles/delete_wiki_on_db_host/tasks/main.yml 
b/roles/delete_wiki_on_db_host/tasks/main.yml
new file mode 100644
index 000..47bb519
--- /dev/null
+++ b/roles/delete_wiki_on_db_host/tasks/main.yml
@@ -0,0 +1,6 @@
+- name: delete wiki schema
+  mysql_db:
+name={{ WIKI_NAME }}
+login_user=root
+login_password={{ MYSQL_ROOT_PASSWORD }}
+state=absent
diff --git a/roles/delete_wiki_on_mw_host/tasks/main.yml 
b/roles/delete_wiki_on_mw_host/tasks/main.yml
new file mode 100644
index 000..c6a54f2
--- /dev/null
+++ b/roles/delete_wiki_on_mw_host/tasks/main.yml
@@ -0,0 +1,14 @@
+- name: delete wiki Apache configuration file
+  file:
+path={{ APACHE_INSTANCE_DIRECTORY }}/{{ WIKI_NAME }}.conf
+state=absent
+
+- name: restart Apache
+  service:
+name=httpd
+state=restarted
+
+- name: delete instance directory
+  file:
+path={{ MW_INSTANCE_DIRECTORY }}/{{ WIKI_NAME }}
+state=absent

-- 
To view, visit https://gerrit.wikimedia.org/r/364004
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibdd1da62c09f4118cf78b94d86e6b1864983c213
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/ansible-wikifarm
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...ansible-wikifarm[master]: Added delete scripts

2017-07-07 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364004 )

Change subject: Added delete scripts
..

Added delete scripts

Change-Id: Ibdd1da62c09f4118cf78b94d86e6b1864983c213
---
A delete_wiki.yml
A roles/delete_wiki_on_db_host/tasks/main.yml
A roles/delete_wiki_on_mw_host/tasks/main.yml
3 files changed, 33 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/ansible-wikifarm 
refs/changes/04/364004/1

diff --git a/delete_wiki.yml b/delete_wiki.yml
new file mode 100644
index 000..264ef89
--- /dev/null
+++ b/delete_wiki.yml
@@ -0,0 +1,13 @@
+- name: Delete a wiki - DB tasks
+
+  hosts: "{{ DB_HOST | default(MW_HOST) }}"
+
+  roles:
+- delete_wiki_on_db_host
+
+- name: Delete a wiki - MediaWiki tasks
+
+  hosts: "{{ MW_HOST }}"
+
+  roles:
+- delete_wiki_on_mw_host
diff --git a/roles/delete_wiki_on_db_host/tasks/main.yml 
b/roles/delete_wiki_on_db_host/tasks/main.yml
new file mode 100644
index 000..47bb519
--- /dev/null
+++ b/roles/delete_wiki_on_db_host/tasks/main.yml
@@ -0,0 +1,6 @@
+- name: delete wiki schema
+  mysql_db:
+name={{ WIKI_NAME }}
+login_user=root
+login_password={{ MYSQL_ROOT_PASSWORD }}
+state=absent
diff --git a/roles/delete_wiki_on_mw_host/tasks/main.yml 
b/roles/delete_wiki_on_mw_host/tasks/main.yml
new file mode 100644
index 000..c6a54f2
--- /dev/null
+++ b/roles/delete_wiki_on_mw_host/tasks/main.yml
@@ -0,0 +1,14 @@
+- name: delete wiki Apache configuration file
+  file:
+path={{ APACHE_INSTANCE_DIRECTORY }}/{{ WIKI_NAME }}.conf
+state=absent
+
+- name: restart Apache
+  service:
+name=httpd
+state=restarted
+
+- name: delete instance directory
+  file:
+path={{ MW_INSTANCE_DIRECTORY }}/{{ WIKI_NAME }}
+state=absent

-- 
To view, visit https://gerrit.wikimedia.org/r/364004
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibdd1da62c09f4118cf78b94d86e6b1864983c213
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/ansible-wikifarm
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...ansible-wikifarm[master]: Fix bug in clone when changing wiki name

2017-07-07 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363829 )

Change subject: Fix bug in clone when changing wiki name
..


Fix bug in clone when changing wiki name

Change-Id: Ibbfe3c74bd5e386f7e990d846972076142fa3ba3
---
M clone_wiki_push.yml
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/clone_wiki_push.yml b/clone_wiki_push.yml
index c713d38..aee468b 100644
--- a/clone_wiki_push.yml
+++ b/clone_wiki_push.yml
@@ -55,7 +55,7 @@
 dest={{ CLONE_DIRECTORY }}
 
 - name: archive destination wiki instance directory
-  shell: tar cfj {{ CLONE_DIRECTORY }}/{{ TO_WIKI_NAME | 
default(FROM_WIKI_NAME) }}-{{ TO_MW_HOST }}.tar.bz2 -C {{ MW_INSTANCE_DIRECTORY 
}} {{ FROM_WIKI_NAME }}
+  shell: tar cfj {{ CLONE_DIRECTORY }}/{{ TO_WIKI_NAME | 
default(FROM_WIKI_NAME) }}-{{ TO_MW_HOST }}.tar.bz2 -C {{ MW_INSTANCE_DIRECTORY 
}} {{ TO_WIKI_NAME | default(FROM_WIKI_NAME) }}
 
 - name: remove destination wiki instance directory
   file:

-- 
To view, visit https://gerrit.wikimedia.org/r/363829
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibbfe3c74bd5e386f7e990d846972076142fa3ba3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/tools/ansible-wikifarm
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...ansible-wikifarm[master]: Fix bug in clone when changing wiki name

2017-07-07 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363829 )

Change subject: Fix bug in clone when changing wiki name
..

Fix bug in clone when changing wiki name

Change-Id: Ibbfe3c74bd5e386f7e990d846972076142fa3ba3
---
M clone_wiki_push.yml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/ansible-wikifarm 
refs/changes/29/363829/2

diff --git a/clone_wiki_push.yml b/clone_wiki_push.yml
index c713d38..aee468b 100644
--- a/clone_wiki_push.yml
+++ b/clone_wiki_push.yml
@@ -55,7 +55,7 @@
 dest={{ CLONE_DIRECTORY }}
 
 - name: archive destination wiki instance directory
-  shell: tar cfj {{ CLONE_DIRECTORY }}/{{ TO_WIKI_NAME | 
default(FROM_WIKI_NAME) }}-{{ TO_MW_HOST }}.tar.bz2 -C {{ MW_INSTANCE_DIRECTORY 
}} {{ FROM_WIKI_NAME }}
+  shell: tar cfj {{ CLONE_DIRECTORY }}/{{ TO_WIKI_NAME | 
default(FROM_WIKI_NAME) }}-{{ TO_MW_HOST }}.tar.bz2 -C {{ MW_INSTANCE_DIRECTORY 
}} {{ TO_WIKI_NAME | default(FROM_WIKI_NAME) }}
 
 - name: remove destination wiki instance directory
   file:

-- 
To view, visit https://gerrit.wikimedia.org/r/363829
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibbfe3c74bd5e386f7e990d846972076142fa3ba3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/tools/ansible-wikifarm
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Fix auto login bug for closed wikis/link without page title.

2017-07-05 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363388 )

Change subject: Fix auto login bug for closed wikis/link without page title.
..


Fix auto login bug for closed wikis/link without page title.

Change-Id: Ie72659b2037cd1525b465e6eea7e8d3f3a4a469a
---
M ext.PluggableAuthAutoLogin.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/ext.PluggableAuthAutoLogin.js b/ext.PluggableAuthAutoLogin.js
index 990c78f..864f816 100644
--- a/ext.PluggableAuthAutoLogin.js
+++ b/ext.PluggableAuthAutoLogin.js
@@ -35,7 +35,7 @@
var re = new RegExp( articlePath );
var path = uri.path;
var matches = path.match( re );
-   if ( matches.length > 1 ) {
+   if ( matches && matches.length > 1 ) {
pageName = matches[1];
} else {
pageName = mw.config.get( 
'wgMainPageName' );

-- 
To view, visit https://gerrit.wikimedia.org/r/363388
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie72659b2037cd1525b465e6eea7e8d3f3a4a469a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PluggableAuth[master]: Fix auto login bug for closed wikis/link without page title.

2017-07-05 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363388 )

Change subject: Fix auto login bug for closed wikis/link without page title.
..

Fix auto login bug for closed wikis/link without page title.

Change-Id: Ie72659b2037cd1525b465e6eea7e8d3f3a4a469a
---
M ext.PluggableAuthAutoLogin.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PluggableAuth 
refs/changes/88/363388/2

diff --git a/ext.PluggableAuthAutoLogin.js b/ext.PluggableAuthAutoLogin.js
index 990c78f..864f816 100644
--- a/ext.PluggableAuthAutoLogin.js
+++ b/ext.PluggableAuthAutoLogin.js
@@ -35,7 +35,7 @@
var re = new RegExp( articlePath );
var path = uri.path;
var matches = path.match( re );
-   if ( matches.length > 1 ) {
+   if ( matches && matches.length > 1 ) {
pageName = matches[1];
} else {
pageName = mw.config.get( 
'wgMainPageName' );

-- 
To view, visit https://gerrit.wikimedia.org/r/363388
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie72659b2037cd1525b465e6eea7e8d3f3a4a469a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Bug fixes: deletion of comments with replies and notifications

2017-06-23 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/361077 )

Change subject: Bug fixes: deletion of comments with replies and notifications
..


Bug fixes: deletion of comments with replies and notifications

Change-Id: I0eb57c61fef6acc8a3f0c434dac2fbc20fc3600a
---
M extension.json
M includes/ApiCSDeleteComment.php
M includes/ApiCSPostComment.php
M includes/Comment.php
M includes/EchoCSPresentationModel.php
5 files changed, 7 insertions(+), 5 deletions(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index 4416d20..7df4da3 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CommentStreams",
-   "version": "3.8",
+   "version": "3.9",
"author": [
"[http://www.mediawiki.org/wiki/User:Jji Jason Ji]",
"[http://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
diff --git a/includes/ApiCSDeleteComment.php b/includes/ApiCSDeleteComment.php
index 0943912..460038c 100644
--- a/includes/ApiCSDeleteComment.php
+++ b/includes/ApiCSDeleteComment.php
@@ -43,7 +43,8 @@
}
 
if ( $this->getUser()->getId() ===
-   
$this->comment->getWikiPage()->getOldestRevision()->getUser() ) {
+   
$this->comment->getWikiPage()->getOldestRevision()->getUser() &&
+   $this->comment->getNumReplies() === 0 ) {
$action = 'edit'; // need edit but not delete to delete 
a comment
} else {
$action = 'cs-moderator-delete';
diff --git a/includes/ApiCSPostComment.php b/includes/ApiCSPostComment.php
index e95df31..e191e57 100644
--- a/includes/ApiCSPostComment.php
+++ b/includes/ApiCSPostComment.php
@@ -170,7 +170,8 @@
}
 
$extra = [
-   'comment' => $comment->getId(),
+   'comment_id' => $comment->getId(),
+   'parent_id' => $comment->getParentId(),
'comment_author_username' => $comment->getUsername(),
'comment_author_display_name' => 
$comment->getUserDisplayNameUnlinked(),
'comment_title' => $comment_title,
diff --git a/includes/Comment.php b/includes/Comment.php
index 4dfa05f..84bf186 100644
--- a/includes/Comment.php
+++ b/includes/Comment.php
@@ -945,7 +945,7 @@
 * @return array array mapping user id to User object
 */
public static function locateUsersWatchingComment( $event ) {
-   $id = $event->getExtraParam( 'comment' );
+   $id = $event->getExtraParam( 'parent_id' );
$wikipage = WikiPage::newFromId( $id );
if ( !is_null( $wikipage ) ) {
$comment = Comment::newFromWikiPage( $wikipage );
diff --git a/includes/EchoCSPresentationModel.php 
b/includes/EchoCSPresentationModel.php
index 66d0b71..c95657c 100644
--- a/includes/EchoCSPresentationModel.php
+++ b/includes/EchoCSPresentationModel.php
@@ -37,7 +37,7 @@
 *['url' => (string) url, 'label' => (string) link 
text (non-escaped)]
 */
public function getPrimaryLink() {
-   $id = $this->event->getExtraParam( 'comment' );
+   $id = $this->event->getExtraParam( 'comment_id' );
return [
'url' => $this->event->getTitle()->getFullURL() . 
'#cs-comment-' . $id,
'label' => $this->msg( 
"notification-link-label-{$this->type}" )

-- 
To view, visit https://gerrit.wikimedia.org/r/361077
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0eb57c61fef6acc8a3f0c434dac2fbc20fc3600a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Bug fixes: deletion of comments with replies and notifications

2017-06-23 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/361077 )

Change subject: Bug fixes: deletion of comments with replies and notifications
..

Bug fixes: deletion of comments with replies and notifications

Change-Id: I0eb57c61fef6acc8a3f0c434dac2fbc20fc3600a
---
M extension.json
M includes/ApiCSDeleteComment.php
M includes/ApiCSPostComment.php
M includes/Comment.php
M includes/EchoCSPresentationModel.php
5 files changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/77/361077/1

diff --git a/extension.json b/extension.json
index 4416d20..7df4da3 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CommentStreams",
-   "version": "3.8",
+   "version": "3.9",
"author": [
"[http://www.mediawiki.org/wiki/User:Jji Jason Ji]",
"[http://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
diff --git a/includes/ApiCSDeleteComment.php b/includes/ApiCSDeleteComment.php
index 0943912..460038c 100644
--- a/includes/ApiCSDeleteComment.php
+++ b/includes/ApiCSDeleteComment.php
@@ -43,7 +43,8 @@
}
 
if ( $this->getUser()->getId() ===
-   
$this->comment->getWikiPage()->getOldestRevision()->getUser() ) {
+   
$this->comment->getWikiPage()->getOldestRevision()->getUser() &&
+   $this->comment->getNumReplies() === 0 ) {
$action = 'edit'; // need edit but not delete to delete 
a comment
} else {
$action = 'cs-moderator-delete';
diff --git a/includes/ApiCSPostComment.php b/includes/ApiCSPostComment.php
index e95df31..e191e57 100644
--- a/includes/ApiCSPostComment.php
+++ b/includes/ApiCSPostComment.php
@@ -170,7 +170,8 @@
}
 
$extra = [
-   'comment' => $comment->getId(),
+   'comment_id' => $comment->getId(),
+   'parent_id' => $comment->getParentId(),
'comment_author_username' => $comment->getUsername(),
'comment_author_display_name' => 
$comment->getUserDisplayNameUnlinked(),
'comment_title' => $comment_title,
diff --git a/includes/Comment.php b/includes/Comment.php
index 4dfa05f..84bf186 100644
--- a/includes/Comment.php
+++ b/includes/Comment.php
@@ -945,7 +945,7 @@
 * @return array array mapping user id to User object
 */
public static function locateUsersWatchingComment( $event ) {
-   $id = $event->getExtraParam( 'comment' );
+   $id = $event->getExtraParam( 'parent_id' );
$wikipage = WikiPage::newFromId( $id );
if ( !is_null( $wikipage ) ) {
$comment = Comment::newFromWikiPage( $wikipage );
diff --git a/includes/EchoCSPresentationModel.php 
b/includes/EchoCSPresentationModel.php
index 66d0b71..c95657c 100644
--- a/includes/EchoCSPresentationModel.php
+++ b/includes/EchoCSPresentationModel.php
@@ -37,7 +37,7 @@
 *['url' => (string) url, 'label' => (string) link 
text (non-escaped)]
 */
public function getPrimaryLink() {
-   $id = $this->event->getExtraParam( 'comment' );
+   $id = $this->event->getExtraParam( 'comment_id' );
return [
'url' => $this->event->getTitle()->getFullURL() . 
'#cs-comment-' . $id,
'label' => $this->msg( 
"notification-link-label-{$this->type}" )

-- 
To view, visit https://gerrit.wikimedia.org/r/361077
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0eb57c61fef6acc8a3f0c434dac2fbc20fc3600a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Bump version number

2017-06-22 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/361019 )

Change subject: Bump version number
..


Bump version number

Change-Id: Ie40066c09056fdbe919c173896cae1d823bca44a
---
M extension.json
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/extension.json b/extension.json
index 952af51..4416d20 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CommentStreams",
-   "version": "3.7",
+   "version": "3.8",
"author": [
"[http://www.mediawiki.org/wiki/User:Jji Jason Ji]",
"[http://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"

-- 
To view, visit https://gerrit.wikimedia.org/r/361019
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie40066c09056fdbe919c173896cae1d823bca44a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Bump version number

2017-06-22 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/361019 )

Change subject: Bump version number
..

Bump version number

Change-Id: Ie40066c09056fdbe919c173896cae1d823bca44a
---
M extension.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/19/361019/2

diff --git a/extension.json b/extension.json
index 952af51..4416d20 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CommentStreams",
-   "version": "3.7",
+   "version": "3.8",
"author": [
"[http://www.mediawiki.org/wiki/User:Jji Jason Ji]",
"[http://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"

-- 
To view, visit https://gerrit.wikimedia.org/r/361019
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie40066c09056fdbe919c173896cae1d823bca44a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Reworked notifications; added comment watchlist

2017-06-22 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/361015 )

Change subject: Reworked notifications; added comment watchlist
..


Reworked notifications; added comment watchlist

Change-Id: Icd47395011677af7fd7c4f0e479dcf1a8b89b948
---
M extension.json
M i18n/en.json
M i18n/qqq.json
R images/CREDITS
M images/cancel.png
M images/comment_add.png
M images/comment_delete.png
M images/comment_edit.png
M images/comment_moderator_delete.png
M images/comment_moderator_edit.png
M images/comment_reply.png
A images/notwatching.png
M images/submit.png
A images/watching.png
D images/watchlist_active.png
D images/watchlist_inactive.png
M includes/ApiCSEditComment.php
M includes/ApiCSPostComment.php
A includes/ApiCSUnwatch.php
A includes/ApiCSWatch.php
M includes/Comment.php
M includes/CommentStreams.php
M includes/CommentStreamsHooks.php
D includes/EchoCSFormatter.php
R includes/EchoCSPresentationModel.php
D includes/EchoCSWatchedPresentationModel.php
M resources/CommentStreams.css
M resources/CommentStreams.js
M resources/CommentStreamsQuerier.js
A sql/watch.sql
30 files changed, 568 insertions(+), 326 deletions(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index 51d0326..952af51 100644
--- a/extension.json
+++ b/extension.json
@@ -39,6 +39,7 @@
"mobile"
],
"messages": [
+   "commentstreams-api-error-notloggedin",
"commentstreams-api-error-commentnotfound",
"commentstreams-api-error-notacomment",
"commentstreams-api-error-missingcommenttitle",
@@ -58,6 +59,12 @@
"commentstreams-api-error-vote-notloggedin",
"commentstreams-api-error-vote-novoteonreply",
"commentstreams-api-error-vote",
+   "commentstreams-api-error-watch-notloggedin",
+   "commentstreams-api-error-watch-nowatchreply",
+   "commentstreams-api-error-watch",
+   "commentstreams-api-error-unwatch-notloggedin",
+   
"commentstreams-api-error-unwatch-nounwatchreply",
+   "commentstreams-api-error-unwatch",

"commentstreams-validation-error-nocommenttitle",
"commentstreams-validation-error-nocommenttext",
"commentstreams-buttontooltip-add",
@@ -71,6 +78,8 @@
"commentstreams-buttontooltip-expand",
"commentstreams-buttontooltip-upvote",
"commentstreams-buttontooltip-downvote",
+   "commentstreams-buttontooltip-watch",
+   "commentstreams-buttontooltip-unwatch",
"commentstreams-buttontooltip-submit",
"commentstreams-buttontooltip-cancel",
"commentstreams-dialog-delete-message",
@@ -109,10 +118,9 @@
"ApiCSEditComment": "includes/ApiCSEditComment.php",
"ApiCSDeleteComment": "includes/ApiCSDeleteComment.php",
"ApiCSVote": "includes/ApiCSVote.php",
-   "EchoCSFormatter": "includes/EchoCSFormatter.php",
-   "EchoCSReplyPresentationModel": 
"includes/EchoCSReplyPresentationModel.php",
-   "EchoCSWatchedPresentationModel":
-   "includes/EchoCSWatchedPresentationModel.php",
+   "ApiCSWatch": "includes/ApiCSWatch.php",
+   "ApiCSUnwatch": "includes/ApiCSUnwatch.php",
+   "EchoCSPresentationModel": 
"includes/EchoCSPresentationModel.php",
"CommentStreamsAllComments": 
"includes/CommentStreamsAllComments.php"
},
"APIModules": {
@@ -120,7 +128,9 @@
"csQueryComment": "ApiCSQueryComment",
"csEditComment": "ApiCSEditComment",
"csDeleteComment": "ApiCSDeleteComment",
-   "csVote": "ApiCSVote"
+   "csVote": "ApiCSVote",
+   "csWatch": "ApiCSWatch",
+   "csUnwatch": "ApiCSUnwatch"
},
"Hooks": {
"LoadExtensionSchemaUpdates": 
"CommentStreamsHooks::addCommentTableToDatabase",
diff --git a/i18n/en.json b/i18n/en.json
index 4765c8b..d6cff7d 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -27,8 +27,8 @@
"apihelp-csPostComment-param-parentid": "page ID of parent comment if 
this is a reply.",
"apihelp-csEditComment-description": "Edit an existing comment. Either 
pageid or title must be provided.",

[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Reworked notifications; added comment watchlist

2017-06-22 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/361015 )

Change subject: Reworked notifications; added comment watchlist
..

Reworked notifications; added comment watchlist

Change-Id: Icd47395011677af7fd7c4f0e479dcf1a8b89b948
---
M extension.json
M i18n/en.json
M i18n/qqq.json
R images/CREDITS
R images/notwatching.png
R images/watching.png
M includes/ApiCSEditComment.php
M includes/ApiCSPostComment.php
A includes/ApiCSUnwatch.php
A includes/ApiCSWatch.php
M includes/Comment.php
M includes/CommentStreams.php
M includes/CommentStreamsHooks.php
D includes/EchoCSFormatter.php
R includes/EchoCSPresentationModel.php
D includes/EchoCSWatchedPresentationModel.php
M resources/CommentStreams.css
M resources/CommentStreams.js
M resources/CommentStreamsQuerier.js
A sql/watch.sql
20 files changed, 570 insertions(+), 325 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/15/361015/1

diff --git a/extension.json b/extension.json
index 51d0326..800ecb2 100644
--- a/extension.json
+++ b/extension.json
@@ -39,6 +39,7 @@
"mobile"
],
"messages": [
+   "commentstreams-api-error-notloggedin",
"commentstreams-api-error-commentnotfound",
"commentstreams-api-error-notacomment",
"commentstreams-api-error-missingcommenttitle",
@@ -58,6 +59,12 @@
"commentstreams-api-error-vote-notloggedin",
"commentstreams-api-error-vote-novoteonreply",
"commentstreams-api-error-vote",
+   "commentstreams-api-error-watch-notloggedin",
+   "commentstreams-api-error-watch-nowatchreply",
+   "commentstreams-api-error-watch",
+   "commentstreams-api-error-unwatch-notloggedin",
+   
"commentstreams-api-error-unwatch-nounwatchreply",
+   "commentstreams-api-error-unwatch",

"commentstreams-validation-error-nocommenttitle",
"commentstreams-validation-error-nocommenttext",
"commentstreams-buttontooltip-add",
@@ -71,6 +78,8 @@
"commentstreams-buttontooltip-expand",
"commentstreams-buttontooltip-upvote",
"commentstreams-buttontooltip-downvote",
+   "commentstreams-buttontooltip-watch",
+   "commentstreams-buttontooltip-unwatch",
"commentstreams-buttontooltip-submit",
"commentstreams-buttontooltip-cancel",
"commentstreams-dialog-delete-message",
@@ -109,10 +118,10 @@
"ApiCSEditComment": "includes/ApiCSEditComment.php",
"ApiCSDeleteComment": "includes/ApiCSDeleteComment.php",
"ApiCSVote": "includes/ApiCSVote.php",
+   "ApiCSWatch": "includes/ApiCSWatch.php",
+   "ApiCSUnwatch": "includes/ApiCSUnwatch.php",
"EchoCSFormatter": "includes/EchoCSFormatter.php",
-   "EchoCSReplyPresentationModel": 
"includes/EchoCSReplyPresentationModel.php",
-   "EchoCSWatchedPresentationModel":
-   "includes/EchoCSWatchedPresentationModel.php",
+   "EchoCSPresentationModel": 
"includes/EchoCSPresentationModel.php",
"CommentStreamsAllComments": 
"includes/CommentStreamsAllComments.php"
},
"APIModules": {
@@ -120,7 +129,9 @@
"csQueryComment": "ApiCSQueryComment",
"csEditComment": "ApiCSEditComment",
"csDeleteComment": "ApiCSDeleteComment",
-   "csVote": "ApiCSVote"
+   "csVote": "ApiCSVote",
+   "csWatch": "ApiCSWatch",
+   "csUnwatch": "ApiCSUnwatch"
},
"Hooks": {
"LoadExtensionSchemaUpdates": 
"CommentStreamsHooks::addCommentTableToDatabase",
diff --git a/i18n/en.json b/i18n/en.json
index 4765c8b..d6cff7d 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -27,8 +27,8 @@
"apihelp-csPostComment-param-parentid": "page ID of parent comment if 
this is a reply.",
"apihelp-csEditComment-description": "Edit an existing comment. Either 
pageid or title must be provided.",
"apihelp-csEditComment-summary": "Edit an existing comment. Either 
pageid or title must be provided.",
-   "apihelp-csEditComment-param-pageid": "page ID of the page which holds 
the comment to query",
-   

[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: User interface update.

2017-06-21 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/360658 )

Change subject: User interface update.
..


User interface update.

Change-Id: Ia141287f0705ef6450f0c80110554b199e6708e0
---
M extension.json
M i18n/en.json
M i18n/qqq.json
A images/cancel.png
A images/collapse.png
A images/comment_add.png
A images/comment_delete.png
A images/comment_edit.png
A images/comment_moderator_delete.png
A images/comment_moderator_edit.png
A images/comment_reply.png
A images/expand.png
M images/link.png
A images/submit.png
A images/watchlist_active.png
A images/watchlist_inactive.png
M resources/CommentStreams.css
M resources/CommentStreams.js
18 files changed, 246 insertions(+), 120 deletions(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index feb9bbf..51d0326 100644
--- a/extension.json
+++ b/extension.json
@@ -60,14 +60,19 @@
"commentstreams-api-error-vote",

"commentstreams-validation-error-nocommenttitle",
"commentstreams-validation-error-nocommenttext",
-   "commentstreams-buttontext-add",
-   "commentstreams-buttontext-reply",
-   "commentstreams-buttontext-edit",
-   "commentstreams-buttontext-delete",
-   "commentstreams-buttontext-collapse",
-   "commentstreams-buttontext-expand",
-   "commentstreams-buttontext-submit",
-   "commentstreams-buttontext-cancel",
+   "commentstreams-buttontooltip-add",
+   "commentstreams-buttontooltip-reply",
+   "commentstreams-buttontooltip-edit",
+   "commentstreams-buttontooltip-moderator-edit",
+   "commentstreams-buttontooltip-delete",
+   "commentstreams-buttontooltip-moderator-delete",
+   "commentstreams-buttontooltip-permalink",
+   "commentstreams-buttontooltip-collapse",
+   "commentstreams-buttontooltip-expand",
+   "commentstreams-buttontooltip-upvote",
+   "commentstreams-buttontooltip-downvote",
+   "commentstreams-buttontooltip-submit",
+   "commentstreams-buttontooltip-cancel",
"commentstreams-dialog-delete-message",
"commentstreams-dialog-buttontext-ok",
"commentstreams-dialog-buttontext-yes",
diff --git a/i18n/en.json b/i18n/en.json
index 98070bb..4765c8b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -59,14 +59,19 @@
"commentstreams-api-error-vote": "Error voting on comment.",
"commentstreams-validation-error-nocommenttitle": "You must enter a 
comment title.",
"commentstreams-validation-error-nocommenttext": "You must enter 
comment text.",
-   "commentstreams-buttontext-add": "ADD A COMMENT",
-   "commentstreams-buttontext-reply": "REPLY",
-   "commentstreams-buttontext-edit": "EDIT",
-   "commentstreams-buttontext-delete": "DELETE",
-   "commentstreams-buttontext-collapse": "COLLAPSE",
-   "commentstreams-buttontext-expand": "EXPAND",
-   "commentstreams-buttontext-submit": "SUBMIT",
-   "commentstreams-buttontext-cancel": "CANCEL",
+   "commentstreams-buttontooltip-add": "add a comment",
+   "commentstreams-buttontooltip-reply": "reply",
+   "commentstreams-buttontooltip-edit": "edit",
+   "commentstreams-buttontooltip-moderator-edit": "moderator edit",
+   "commentstreams-buttontooltip-delete": "delete",
+   "commentstreams-buttontooltip-moderator-delete": "moderator delete",
+   "commentstreams-buttontooltip-permalink": "permalink",
+   "commentstreams-buttontooltip-collapse": "collapse",
+   "commentstreams-buttontooltip-expand": "expand",
+   "commentstreams-buttontooltip-upvote": "up vote",
+   "commentstreams-buttontooltip-downvote": "down vote",
+   "commentstreams-buttontooltip-submit": "submit",
+   "commentstreams-buttontooltip-cancel": "cancel",
"commentstreams-dialog-delete-message": "Are you sure you want to 
delete this comment?",
"commentstreams-dialog-buttontext-ok": "OK",
"commentstreams-dialog-buttontext-yes": "Yes",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 7f95426..bcfafb9 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -59,14 +59,19 @@
"commentstreams-api-error-vote": "Error message.",

[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: User interface update.

2017-06-21 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/360658 )

Change subject: User interface update.
..

User interface update.

Change-Id: Ia141287f0705ef6450f0c80110554b199e6708e0
---
M extension.json
M i18n/en.json
M i18n/qqq.json
A images/cancel.png
A images/collapse.png
A images/comment_add.png
A images/comment_delete.png
A images/comment_edit.png
A images/comment_moderator_delete.png
A images/comment_moderator_edit.png
A images/comment_reply.png
A images/expand.png
M images/link.png
A images/submit.png
A images/watchlist_active.png
A images/watchlist_inactive.png
M resources/CommentStreams.css
M resources/CommentStreams.js
18 files changed, 247 insertions(+), 120 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/58/360658/1

diff --git a/extension.json b/extension.json
index feb9bbf..51d0326 100644
--- a/extension.json
+++ b/extension.json
@@ -60,14 +60,19 @@
"commentstreams-api-error-vote",

"commentstreams-validation-error-nocommenttitle",
"commentstreams-validation-error-nocommenttext",
-   "commentstreams-buttontext-add",
-   "commentstreams-buttontext-reply",
-   "commentstreams-buttontext-edit",
-   "commentstreams-buttontext-delete",
-   "commentstreams-buttontext-collapse",
-   "commentstreams-buttontext-expand",
-   "commentstreams-buttontext-submit",
-   "commentstreams-buttontext-cancel",
+   "commentstreams-buttontooltip-add",
+   "commentstreams-buttontooltip-reply",
+   "commentstreams-buttontooltip-edit",
+   "commentstreams-buttontooltip-moderator-edit",
+   "commentstreams-buttontooltip-delete",
+   "commentstreams-buttontooltip-moderator-delete",
+   "commentstreams-buttontooltip-permalink",
+   "commentstreams-buttontooltip-collapse",
+   "commentstreams-buttontooltip-expand",
+   "commentstreams-buttontooltip-upvote",
+   "commentstreams-buttontooltip-downvote",
+   "commentstreams-buttontooltip-submit",
+   "commentstreams-buttontooltip-cancel",
"commentstreams-dialog-delete-message",
"commentstreams-dialog-buttontext-ok",
"commentstreams-dialog-buttontext-yes",
diff --git a/i18n/en.json b/i18n/en.json
index 98070bb..4765c8b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -59,14 +59,19 @@
"commentstreams-api-error-vote": "Error voting on comment.",
"commentstreams-validation-error-nocommenttitle": "You must enter a 
comment title.",
"commentstreams-validation-error-nocommenttext": "You must enter 
comment text.",
-   "commentstreams-buttontext-add": "ADD A COMMENT",
-   "commentstreams-buttontext-reply": "REPLY",
-   "commentstreams-buttontext-edit": "EDIT",
-   "commentstreams-buttontext-delete": "DELETE",
-   "commentstreams-buttontext-collapse": "COLLAPSE",
-   "commentstreams-buttontext-expand": "EXPAND",
-   "commentstreams-buttontext-submit": "SUBMIT",
-   "commentstreams-buttontext-cancel": "CANCEL",
+   "commentstreams-buttontooltip-add": "add a comment",
+   "commentstreams-buttontooltip-reply": "reply",
+   "commentstreams-buttontooltip-edit": "edit",
+   "commentstreams-buttontooltip-moderator-edit": "moderator edit",
+   "commentstreams-buttontooltip-delete": "delete",
+   "commentstreams-buttontooltip-moderator-delete": "moderator delete",
+   "commentstreams-buttontooltip-permalink": "permalink",
+   "commentstreams-buttontooltip-collapse": "collapse",
+   "commentstreams-buttontooltip-expand": "expand",
+   "commentstreams-buttontooltip-upvote": "up vote",
+   "commentstreams-buttontooltip-downvote": "down vote",
+   "commentstreams-buttontooltip-submit": "submit",
+   "commentstreams-buttontooltip-cancel": "cancel",
"commentstreams-dialog-delete-message": "Are you sure you want to 
delete this comment?",
"commentstreams-dialog-buttontext-ok": "OK",
"commentstreams-dialog-buttontext-yes": "Yes",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 7f95426..bcfafb9 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -59,14 +59,19 @@
"commentstreams-api-error-vote": "Error message.",

[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Get avatar from SocialProfile extension if it is installed

2017-06-20 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/360580 )

Change subject: Get avatar from SocialProfile extension if it is installed
..


Get avatar from SocialProfile extension if it is installed

T167550

Change-Id: I94dfadc909fa79abd81ca59332113c5082df5dd9
---
M includes/Comment.php
1 file changed, 13 insertions(+), 1 deletion(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Comment.php b/includes/Comment.php
index 4ccc31c..0b41fee 100644
--- a/includes/Comment.php
+++ b/includes/Comment.php
@@ -47,6 +47,9 @@
// User user object for the author of this comment
private $user = null;
 
+   // Avatar for author of this comment
+   private $avatar = null;
+
// MWTimestamp the earliest revision date for this comment
private $creation_timestamp = null;
 
@@ -324,7 +327,16 @@
 * @return string the URL of the avatar of the author of this comment
 */
public function getAvatar() {
-   return self::getAvatarFromUser( $this->getUser() );
+   if ( is_null( $this->avatar ) ) {
+   if ( class_exists( 'wAvatar' ) ) { // from 
Extension:SocialProfile
+   $avatar = new wAvatar( 
$this->getUser()->getId(), 'l' );
+   $this->avatar = $GLOBALS['wgUploadPath'] . 
'/avatars/' .
+   $avatar->getAvatarImage();
+   } else {
+   $this->avatar = self::getAvatarFromUser( 
$this->getUser() );
+   }
+   }
+   return $this->avatar;
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/360580
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I94dfadc909fa79abd81ca59332113c5082df5dd9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Get avatar from SocialProfile extension if it is installed

2017-06-20 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/360580 )

Change subject: Get avatar from SocialProfile extension if it is installed
..

Get avatar from SocialProfile extension if it is installed

T167550

Change-Id: I94dfadc909fa79abd81ca59332113c5082df5dd9
---
M includes/Comment.php
1 file changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/80/360580/1

diff --git a/includes/Comment.php b/includes/Comment.php
index 4ccc31c..0b41fee 100644
--- a/includes/Comment.php
+++ b/includes/Comment.php
@@ -47,6 +47,9 @@
// User user object for the author of this comment
private $user = null;
 
+   // Avatar for author of this comment
+   private $avatar = null;
+
// MWTimestamp the earliest revision date for this comment
private $creation_timestamp = null;
 
@@ -324,7 +327,16 @@
 * @return string the URL of the avatar of the author of this comment
 */
public function getAvatar() {
-   return self::getAvatarFromUser( $this->getUser() );
+   if ( is_null( $this->avatar ) ) {
+   if ( class_exists( 'wAvatar' ) ) { // from 
Extension:SocialProfile
+   $avatar = new wAvatar( 
$this->getUser()->getId(), 'l' );
+   $this->avatar = $GLOBALS['wgUploadPath'] . 
'/avatars/' .
+   $avatar->getAvatarImage();
+   } else {
+   $this->avatar = self::getAvatarFromUser( 
$this->getUser() );
+   }
+   }
+   return $this->avatar;
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/360580
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94dfadc909fa79abd81ca59332113c5082df5dd9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...EmailAuthorization[master]: Table formatting

2017-06-20 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/360400 )

Change subject: Table formatting
..


Table formatting

Change-Id: Ib3822784e3f5ced3de0e4af9ce3f00b5096998ba
---
M resources/EmailAuthorization.css
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/EmailAuthorization.css b/resources/EmailAuthorization.css
index 293b380..be1e704 100644
--- a/resources/EmailAuthorization.css
+++ b/resources/EmailAuthorization.css
@@ -10,6 +10,10 @@
width: 100%;
 }
 
+.emailauth-wikitable th {
+   text-align: center;
+}
+
 .emailauth-navigationtable {
width: 100%;
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/360400
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib3822784e3f5ced3de0e4af9ce3f00b5096998ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EmailAuthorization
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Table formatting

2017-06-20 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/360398 )

Change subject: Table formatting
..


Table formatting

Change-Id: Ibc50ec50a32c5e34774af9cba0dc3cd0a5eef7ad
---
M includes/CommentStreamsAllComments.php
M resources/CommentStreamsAllComments.css
2 files changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/CommentStreamsAllComments.php 
b/includes/CommentStreamsAllComments.php
index a1cfa52..9631842 100644
--- a/includes/CommentStreamsAllComments.php
+++ b/includes/CommentStreamsAllComments.php
@@ -76,13 +76,17 @@
$associatedpageid = $comment->getAssociatedId();
$associatedpagename =
WikiPage::newFromId( $associatedpageid 
)->getTitle()->getPrefixedText();
+   $author = $comment->getUser()->getName();
$lasteditor = User::newFromId( 
$wikipage->getRevision()->getUser() )->getName();
+   if ( $lasteditor === $author ) {
+   $lasteditor = '';
+   }
$wikitext .= '|-' . PHP_EOL;
$wikitext .= '|[[' . $pagename . ']]' . PHP_EOL;
$wikitext .= '|[[' . $associatedpagename . ']]' 
. PHP_EOL;
$wikitext .= '|' . $comment->getCommentTitle() 
. PHP_EOL;
$wikitext .= '|' . $comment->getWikiText() . 
PHP_EOL;
-   $wikitext .= '|' . 
$comment->getUser()->getName() . PHP_EOL;
+   $wikitext .= '|' . $author . PHP_EOL;
$wikitext .= '|' . $lasteditor . PHP_EOL;
$wikitext .= '|' . $comment->getCreationDate() 
. PHP_EOL;
$wikitext .= '|' . 
$comment->getModificationDate() . PHP_EOL;
diff --git a/resources/CommentStreamsAllComments.css 
b/resources/CommentStreamsAllComments.css
index d1c905e..e39ea4b 100644
--- a/resources/CommentStreamsAllComments.css
+++ b/resources/CommentStreamsAllComments.css
@@ -10,6 +10,10 @@
width: 100%;
 }
 
+.csall-wikitable th {
+   text-align: center;
+}
+
 .csall-navigationtable {
width: 100%;
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/360398
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc50ec50a32c5e34774af9cba0dc3cd0a5eef7ad
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...EmailAuthorization[master]: Table formatting

2017-06-20 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/360400 )

Change subject: Table formatting
..

Table formatting

Change-Id: Ib3822784e3f5ced3de0e4af9ce3f00b5096998ba
---
M resources/EmailAuthorization.css
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EmailAuthorization 
refs/changes/00/360400/1

diff --git a/resources/EmailAuthorization.css b/resources/EmailAuthorization.css
index 293b380..be1e704 100644
--- a/resources/EmailAuthorization.css
+++ b/resources/EmailAuthorization.css
@@ -10,6 +10,10 @@
width: 100%;
 }
 
+.emailauth-wikitable th {
+   text-align: center;
+}
+
 .emailauth-navigationtable {
width: 100%;
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/360400
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3822784e3f5ced3de0e4af9ce3f00b5096998ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EmailAuthorization
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Table formatting

2017-06-20 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/360398 )

Change subject: Table formatting
..

Table formatting

Change-Id: Ibc50ec50a32c5e34774af9cba0dc3cd0a5eef7ad
---
M includes/CommentStreamsAllComments.php
M resources/CommentStreamsAllComments.css
2 files changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/98/360398/1

diff --git a/includes/CommentStreamsAllComments.php 
b/includes/CommentStreamsAllComments.php
index a1cfa52..9631842 100644
--- a/includes/CommentStreamsAllComments.php
+++ b/includes/CommentStreamsAllComments.php
@@ -76,13 +76,17 @@
$associatedpageid = $comment->getAssociatedId();
$associatedpagename =
WikiPage::newFromId( $associatedpageid 
)->getTitle()->getPrefixedText();
+   $author = $comment->getUser()->getName();
$lasteditor = User::newFromId( 
$wikipage->getRevision()->getUser() )->getName();
+   if ( $lasteditor === $author ) {
+   $lasteditor = '';
+   }
$wikitext .= '|-' . PHP_EOL;
$wikitext .= '|[[' . $pagename . ']]' . PHP_EOL;
$wikitext .= '|[[' . $associatedpagename . ']]' 
. PHP_EOL;
$wikitext .= '|' . $comment->getCommentTitle() 
. PHP_EOL;
$wikitext .= '|' . $comment->getWikiText() . 
PHP_EOL;
-   $wikitext .= '|' . 
$comment->getUser()->getName() . PHP_EOL;
+   $wikitext .= '|' . $author . PHP_EOL;
$wikitext .= '|' . $lasteditor . PHP_EOL;
$wikitext .= '|' . $comment->getCreationDate() 
. PHP_EOL;
$wikitext .= '|' . 
$comment->getModificationDate() . PHP_EOL;
diff --git a/resources/CommentStreamsAllComments.css 
b/resources/CommentStreamsAllComments.css
index d1c905e..e39ea4b 100644
--- a/resources/CommentStreamsAllComments.css
+++ b/resources/CommentStreamsAllComments.css
@@ -10,6 +10,10 @@
width: 100%;
 }
 
+.csall-wikitable th {
+   text-align: center;
+}
+
 .csall-navigationtable {
width: 100%;
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/360398
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc50ec50a32c5e34774af9cba0dc3cd0a5eef7ad
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Fixed error in extension.json

2017-06-20 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/360392 )

Change subject: Fixed error in extension.json
..


Fixed error in extension.json

Change-Id: I7b0ec045c972e134b4942214ac6cdc69ed1f7178
---
M extension.json
1 file changed, 1 insertion(+), 3 deletions(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index 0c9c0e0..feb9bbf 100644
--- a/extension.json
+++ b/extension.json
@@ -79,9 +79,7 @@
"commentstreams-title-field-placeholder",
"commentstreams-body-field-placeholder"
]
-   }
-   },
-   "ResourceModules": {
+   },
"ext.CommentStreamsAllComments": {
"styles": [
"CommentStreamsAllComments.css"

-- 
To view, visit https://gerrit.wikimedia.org/r/360392
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7b0ec045c972e134b4942214ac6cdc69ed1f7178
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Fixed error in extension.json

2017-06-20 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/360392 )

Change subject: Fixed error in extension.json
..

Fixed error in extension.json

Change-Id: I7b0ec045c972e134b4942214ac6cdc69ed1f7178
---
M extension.json
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/92/360392/1

diff --git a/extension.json b/extension.json
index 0c9c0e0..feb9bbf 100644
--- a/extension.json
+++ b/extension.json
@@ -79,9 +79,7 @@
"commentstreams-title-field-placeholder",
"commentstreams-body-field-placeholder"
]
-   }
-   },
-   "ResourceModules": {
+   },
"ext.CommentStreamsAllComments": {
"styles": [
"CommentStreamsAllComments.css"

-- 
To view, visit https://gerrit.wikimedia.org/r/360392
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b0ec045c972e134b4942214ac6cdc69ed1f7178
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Fixed missing subtitle on comment pages.

2017-06-20 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/360387 )

Change subject: Fixed missing subtitle on comment pages.
..


Fixed missing subtitle on comment pages.

Change-Id: Id04e52c1745d6d0f7a8b63d2242ceae61847
---
M includes/CommentStreamsHooks.php
1 file changed, 4 insertions(+), 5 deletions(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/CommentStreamsHooks.php b/includes/CommentStreamsHooks.php
index 4e23e49..a7ef085 100644
--- a/includes/CommentStreamsHooks.php
+++ b/includes/CommentStreamsHooks.php
@@ -76,12 +76,11 @@
return true;
}
$action = $wiki->getAction();
-   switch ( $action ) {
-   case 'info':
-   case 'history':
-   case 'view':
+   if ( $action === 'info' || $action === 'history' ) {
return true;
-   default:
+   }
+
+   if ( $action !== 'view' ) {
$message =
wfMessage( 
'commentstreams-error-prohibitedaction', $action )->text();
$output->addHTML( '' . $message . 
'' );

-- 
To view, visit https://gerrit.wikimedia.org/r/360387
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id04e52c1745d6d0f7a8b63d2242ceae61847
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Fixed missing subtitle on comment pages.

2017-06-20 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/360387 )

Change subject: Fixed missing subtitle on comment pages.
..

Fixed missing subtitle on comment pages.

Change-Id: Id04e52c1745d6d0f7a8b63d2242ceae61847
---
M includes/CommentStreamsHooks.php
1 file changed, 4 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/87/360387/1

diff --git a/includes/CommentStreamsHooks.php b/includes/CommentStreamsHooks.php
index 4e23e49..a7ef085 100644
--- a/includes/CommentStreamsHooks.php
+++ b/includes/CommentStreamsHooks.php
@@ -76,12 +76,11 @@
return true;
}
$action = $wiki->getAction();
-   switch ( $action ) {
-   case 'info':
-   case 'history':
-   case 'view':
+   if ( $action === 'info' || $action === 'history' ) {
return true;
-   default:
+   }
+
+   if ( $action !== 'view' ) {
$message =
wfMessage( 
'commentstreams-error-prohibitedaction', $action )->text();
$output->addHTML( '' . $message . 
'' );

-- 
To view, visit https://gerrit.wikimedia.org/r/360387
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id04e52c1745d6d0f7a8b63d2242ceae61847
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Added Special:AllComments

2017-06-20 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/360379 )

Change subject: Added Special:AllComments
..


Added Special:AllComments

T167464
Change-Id: Ie10988e3420420a3aea548760d548ff272071969
---
M extension.json
M i18n/en.json
M i18n/qqq.json
A includes/CommentStreamsAllComments.alias.php
A includes/CommentStreamsAllComments.php
A resources/CommentStreamsAllComments.css
6 files changed, 273 insertions(+), 4 deletions(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index 3f81f06..0c9c0e0 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CommentStreams",
-   "version": "3.6",
+   "version": "3.7",
"author": [
"[http://www.mediawiki.org/wiki/User:Jji Jason Ji]",
"[http://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]"
@@ -9,10 +9,16 @@
"descriptionmsg": "commentstreams-desc",
"manifest_version": 1,
"type": "parserhook",
+   "SpecialPages": {
+   "CommentStreamsAllComments": "CommentStreamsAllComments"
+   },
"MessagesDirs": {
"CommentStreams": [
"i18n"
]
+   },
+   "ExtensionMessagesFiles": {
+   "CommentStreamsAlias": 
"includes/CommentStreamsAllComments.alias.php"
},
"ResourceModules": {
"ext.CommentStreams": {
@@ -75,6 +81,17 @@
]
}
},
+   "ResourceModules": {
+   "ext.CommentStreamsAllComments": {
+   "styles": [
+   "CommentStreamsAllComments.css"
+   ],
+   "targets": [
+   "desktop",
+   "mobile"
+   ]
+   }
+   },
"ResourceFileModulePaths": {
"localBasePath": "resources",
"remoteExtPath": "CommentStreams/resources"
@@ -92,7 +109,8 @@
"EchoCSFormatter": "includes/EchoCSFormatter.php",
"EchoCSReplyPresentationModel": 
"includes/EchoCSReplyPresentationModel.php",
"EchoCSWatchedPresentationModel":
-   "includes/EchoCSWatchedPresentationModel.php"
+   "includes/EchoCSWatchedPresentationModel.php",
+   "CommentStreamsAllComments": 
"includes/CommentStreamsAllComments.php"
},
"APIModules": {
"csPostComment": "ApiCSPostComment",
diff --git a/i18n/en.json b/i18n/en.json
index 7372da8..98070bb 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -106,5 +106,16 @@
"logentry-commentstreams-comment-delete": "$1 {{GENDER:$2|deleted}} 
comment $3",
"logentry-commentstreams-comment-moderator-delete": "$1 
{{GENDER:$2|(moderator) deleted}} comment $3",
"logentry-commentstreams-reply-delete": "$1 {{GENDER:$2|deleted}} reply 
$3",
-   "logentry-commentstreams-reply-moderator-delete": "$1 
{{GENDER:$2|(moderator) deleted}} reply $3"
+   "logentry-commentstreams-reply-moderator-delete": "$1 
{{GENDER:$2|(moderator) deleted}} reply $3",
+   "commentstreamsallcomments": "All Comments",
+   "commentstreams-allcomments-label-page": "Comment Page",
+   "commentstreams-allcomments-label-associatedpage": "Associated Page",
+   "commentstreams-allcomments-label-commenttitle": "Comment Title",
+   "commentstreams-allcomments-label-wikitext": "Comment",
+   "commentstreams-allcomments-label-author": "Author",
+   "commentstreams-allcomments-label-created": "Created",
+   "commentstreams-allcomments-label-lasteditor": "Last Editor",
+   "commentstreams-allcomments-label-lastedited": "Last Edited",
+   "commentstreams-allcomments-button-next": "Next",
+   "commentstreams-allcomments-button-previous": "Previous"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b10351b..7f95426 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -106,5 +106,16 @@
"logentry-commentstreams-comment-delete": "The template of the log 
entry message",
"logentry-commentstreams-comment-moderator-delete": "The template of 
the log entry message",
"logentry-commentstreams-reply-delete": "The template of the log entry 
message",
-   "logentry-commentstreams-reply-moderator-delete": "The template of the 
log entry message"
+   "logentry-commentstreams-reply-moderator-delete": "The template of the 
log entry message",
+   "commentstreamsallcomments": "Special page title",
+   "commentstreams-allcomments-label-page": "Table column label",
+   "commentstreams-allcomments-label-associatedpage": "Table column label",
+   "commentstreams-allcomments-label-commenttitle": "Table column label",
+   

[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Added Special:AllComments

2017-06-20 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/360379 )

Change subject: Added Special:AllComments
..

Added Special:AllComments

T167464
Change-Id: Ie10988e3420420a3aea548760d548ff272071969
---
M extension.json
M i18n/en.json
M i18n/qqq.json
A includes/CommentStreamsAllComments.alias.php
A includes/CommentStreamsAllComments.php
A resources/CommentStreamsAllComments.css
6 files changed, 273 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommentStreams 
refs/changes/79/360379/1

diff --git a/extension.json b/extension.json
index 3f81f06..3f65ef6 100644
--- a/extension.json
+++ b/extension.json
@@ -9,10 +9,16 @@
"descriptionmsg": "commentstreams-desc",
"manifest_version": 1,
"type": "parserhook",
+   "SpecialPages": {
+   "CommentStreamsAllComments": "CommentStreamsAllComments"
+   },
"MessagesDirs": {
"CommentStreams": [
"i18n"
]
+   },
+   "ExtensionMessagesFiles": {
+   "CommentStreamsAlias": 
"includes/CommentStreamsAllComments.alias.php"
},
"ResourceModules": {
"ext.CommentStreams": {
@@ -75,6 +81,17 @@
]
}
},
+   "ResourceModules": {
+   "ext.CommentStreamsAllComments": {
+   "styles": [
+   "CommentStreamsAllComments.css"
+   ],
+   "targets": [
+   "desktop",
+   "mobile"
+   ]
+   }
+   },
"ResourceFileModulePaths": {
"localBasePath": "resources",
"remoteExtPath": "CommentStreams/resources"
@@ -92,7 +109,8 @@
"EchoCSFormatter": "includes/EchoCSFormatter.php",
"EchoCSReplyPresentationModel": 
"includes/EchoCSReplyPresentationModel.php",
"EchoCSWatchedPresentationModel":
-   "includes/EchoCSWatchedPresentationModel.php"
+   "includes/EchoCSWatchedPresentationModel.php",
+   "CommentStreamsAllComments": 
"includes/CommentStreamsAllComments.php"
},
"APIModules": {
"csPostComment": "ApiCSPostComment",
diff --git a/i18n/en.json b/i18n/en.json
index 7372da8..98070bb 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -106,5 +106,16 @@
"logentry-commentstreams-comment-delete": "$1 {{GENDER:$2|deleted}} 
comment $3",
"logentry-commentstreams-comment-moderator-delete": "$1 
{{GENDER:$2|(moderator) deleted}} comment $3",
"logentry-commentstreams-reply-delete": "$1 {{GENDER:$2|deleted}} reply 
$3",
-   "logentry-commentstreams-reply-moderator-delete": "$1 
{{GENDER:$2|(moderator) deleted}} reply $3"
+   "logentry-commentstreams-reply-moderator-delete": "$1 
{{GENDER:$2|(moderator) deleted}} reply $3",
+   "commentstreamsallcomments": "All Comments",
+   "commentstreams-allcomments-label-page": "Comment Page",
+   "commentstreams-allcomments-label-associatedpage": "Associated Page",
+   "commentstreams-allcomments-label-commenttitle": "Comment Title",
+   "commentstreams-allcomments-label-wikitext": "Comment",
+   "commentstreams-allcomments-label-author": "Author",
+   "commentstreams-allcomments-label-created": "Created",
+   "commentstreams-allcomments-label-lasteditor": "Last Editor",
+   "commentstreams-allcomments-label-lastedited": "Last Edited",
+   "commentstreams-allcomments-button-next": "Next",
+   "commentstreams-allcomments-button-previous": "Previous"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b10351b..7f95426 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -106,5 +106,16 @@
"logentry-commentstreams-comment-delete": "The template of the log 
entry message",
"logentry-commentstreams-comment-moderator-delete": "The template of 
the log entry message",
"logentry-commentstreams-reply-delete": "The template of the log entry 
message",
-   "logentry-commentstreams-reply-moderator-delete": "The template of the 
log entry message"
+   "logentry-commentstreams-reply-moderator-delete": "The template of the 
log entry message",
+   "commentstreamsallcomments": "Special page title",
+   "commentstreams-allcomments-label-page": "Table column label",
+   "commentstreams-allcomments-label-associatedpage": "Table column label",
+   "commentstreams-allcomments-label-commenttitle": "Table column label",
+   "commentstreams-allcomments-label-wikitext": "Table column label",
+   "commentstreams-allcomments-label-author": "Table column label",
+   "commentstreams-allcomments-label-created": "Table column label",
+   

[MediaWiki-commits] [Gerrit] mediawiki...CommentStreams[master]: Remove comment actions from RecentChanges and add to special...

2017-06-19 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/360163 )

Change subject: Remove comment actions from RecentChanges and add to special 
log.
..


Remove comment actions from RecentChanges and add to special log.

T167448
Change-Id: Ia234353cd4db8c55f4af37b27725e33cdddc44e4
---
M i18n/en.json
M i18n/qqq.json
M includes/ApiCSBase.php
M includes/ApiCSDeleteComment.php
M includes/ApiCSEditComment.php
M includes/ApiCSPostComment.php
M includes/ApiCSQueryComment.php
M includes/ApiCSVote.php
M includes/Comment.php
M includes/CommentStreamsHooks.php
10 files changed, 126 insertions(+), 36 deletions(-)

Approvals:
  Cicalese: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index db2f7bc..7372da8 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -94,5 +94,17 @@
"right-cs-moderator-edit": "Edit comments by any user",
"action-cs-moderator-edit": "edit comments by other users",
"right-cs-moderator-delete": "Delete comments by any user",
-   "action-cs-moderator-delete": "delete comments by other users"
+   "action-cs-moderator-delete": "delete comments by other users",
+   "log-name-commentstreams": "CommentStreams log",
+   "log-description-commentstreams": "These events track when 
CommentStreams events happen.",
+   "logentry-commentstreams-comment-create": "$1 {{GENDER:$2|created}} 
comment $3",
+   "logentry-commentstreams-reply-create": "$1 {{GENDER:$2|created}} reply 
$3",
+   "logentry-commentstreams-comment-edit": "$1 {{GENDER:$2|edited}} 
comment $3",
+   "logentry-commentstreams-comment-moderator-edit": "$1 
{{GENDER:$2|(moderator) edited}} comment $3",
+   "logentry-commentstreams-reply-edit": "$1 {{GENDER:$2|edited}} reply 
$3",
+   "logentry-commentstreams-reply-moderator-edit": "$1 
{{GENDER:$2|(moderator) edited}} reply $3",
+   "logentry-commentstreams-comment-delete": "$1 {{GENDER:$2|deleted}} 
comment $3",
+   "logentry-commentstreams-comment-moderator-delete": "$1 
{{GENDER:$2|(moderator) deleted}} comment $3",
+   "logentry-commentstreams-reply-delete": "$1 {{GENDER:$2|deleted}} reply 
$3",
+   "logentry-commentstreams-reply-moderator-delete": "$1 
{{GENDER:$2|(moderator) deleted}} reply $3"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index fc8ce87..b10351b 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -94,5 +94,17 @@
"right-cs-moderator-edit": "{{doc-right|csedit}}",
"action-cs-moderator-edit": "{{doc-action|csedit}}",
"right-cs-moderator-delete": "{{doc-right|csdelete}}",
-   "action-cs-moderator-delete": "{{doc-action|csdelete}}"
+   "action-cs-moderator-delete": "{{doc-action|csdelete}}",
+   "log-name-commentstreams": "The Special:Log log name that appears in 
the drop-down on the Special:Log page",
+   "log-description-commentstreams": "The Special:Log description that 
appears on the Special:Log page when you filter logs on this specific log name",
+   "logentry-commentstreams-comment-create": "The template of the log 
entry message",
+   "logentry-commentstreams-reply-create": "The template of the log entry 
message",
+   "logentry-commentstreams-comment-edit": "The template of the log entry 
message",
+   "logentry-commentstreams-comment-moderator-edit": "The template of the 
log entry message",
+   "logentry-commentstreams-reply-edit": "The template of the log entry 
message",
+   "logentry-commentstreams-reply-moderator-edit": "The template of the 
log entry message",
+   "logentry-commentstreams-comment-delete": "The template of the log 
entry message",
+   "logentry-commentstreams-comment-moderator-delete": "The template of 
the log entry message",
+   "logentry-commentstreams-reply-delete": "The template of the log entry 
message",
+   "logentry-commentstreams-reply-moderator-delete": "The template of the 
log entry message"
 }
diff --git a/includes/ApiCSBase.php b/includes/ApiCSBase.php
index 3923be9..78ac2e2 100644
--- a/includes/ApiCSBase.php
+++ b/includes/ApiCSBase.php
@@ -21,9 +21,10 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-class ApiCSBase extends ApiBase {
+abstract class ApiCSBase extends ApiBase {
 
private $edit;
+   protected $comment;
 
/**
 * @param ApiMain $main main module
@@ -42,11 +43,11 @@
$params = $this->extractRequestParams();
$wikipage = $this->getTitleOrPageId( $params,
$this->edit ? 'frommasterdb' : 'fromdb' );
-   $comment = Comment::newFromWikiPage( $wikipage );
-   if ( is_null( $comment ) ) {
+   $this->comment = Comment::newFromWikiPage( $wikipage );
+   if ( is_null( $this->comment ) ) {
$this->dieCustomUsageMessage( 
'commentstreams-api-error-notacomment' );
}
-   

  1   2   3   4   >