[MediaWiki-commits] [Gerrit] (Bug 50710)Compatibility File::thumbName File::publish - change (mediawiki...NSFileRepo)

2013-07-03 Thread Jpond (Code Review)
Jpond has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71952


Change subject: (Bug 50710)Compatibility File::thumbName  File::publish
..

(Bug 50710)Compatibility File::thumbName  File::publish

Bug: 50710

File.php was changed for parameters on thumbName and publish in Change-Id:
I33932ac0e0294dc13332dce9d4ab00a75d9cdcba

This fix removes the strict error message by adding params to NSOldLocalFile

Strict Standards: Declaration of NSOldLocalFile::publish() should be compatible
with File::thumbName($params, $flags = 0)
Strict Standards: Declaration of NSOldLocalFile::thumbName() should be
compatible with File::thumbName($params, $flags = 0)

Change-Id: Id59d3a4213f058afc4e37006eb508f1b4d45ccf1
---
M NSFileRepo_body.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/NSFileRepo 
refs/changes/52/71952/1

diff --git a/NSFileRepo_body.php b/NSFileRepo_body.php
index fa8d836..6596848 100644
--- a/NSFileRepo_body.php
+++ b/NSFileRepo_body.php
@@ -361,14 +361,14 @@
return 'archive/' . $this-getHashPath() . 
urlencode( $this-getFileNameStripped( 
$this-getArchiveName() ) );
}
-   function publish( $srcPath, $flags = 0 ) {
-   return NSLocalFile::publish( $srcPath, $flags );
+   function publish( $srcPath, $flags = 0, array $options = array() ) {
+   return NSLocalFile::publish( $srcPath, $flags, $options );
}
function getThumbUrl( $suffix = false ) {
return NSLocalFile::getThumbUrl( $suffix );
}
-   function thumbName( $params ) {
-   return NSLocalFile::thumbName( $params );
+   function thumbName( $params, $flags = 0 ) {
+   return NSLocalFile::thumbName( $params, $flags );
}
function getThumbPath( $suffix = false ) {
return NSLocalFile::getThumbPath( $suffix );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id59d3a4213f058afc4e37006eb508f1b4d45ccf1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/NSFileRepo
Gerrit-Branch: master
Gerrit-Owner: Jpond jack.p...@psitex.com

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


[MediaWiki-commits] [Gerrit] Special:OpenIDDashboard still using wgOpenIDClientAndProvide... - change (mediawiki...OpenID)

2013-07-03 Thread Jpond (Code Review)
Jpond has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71961


Change subject: Special:OpenIDDashboard still using 
wgOpenIDClientAndProviderMode Bug: 50712
..

Special:OpenIDDashboard still using wgOpenIDClientAndProviderMode
Bug: 50712

$wgOpenIDClientOnly was used until version 3.11, then changed to
$wgOpenIDConsumerAndAlsoProvider.

Change-Id: Idbb74e27e3dfc20b554b940be1dfcb1079701c33
Special:OpenIDDashboard was still using $wgOpenIDClientOnly.
---
M SpecialOpenIDDashboard.body.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenID 
refs/changes/61/71961/1

diff --git a/SpecialOpenIDDashboard.body.php b/SpecialOpenIDDashboard.body.php
index 4fcb7fd..1295c3b 100644
--- a/SpecialOpenIDDashboard.body.php
+++ b/SpecialOpenIDDashboard.body.php
@@ -94,7 +94,7 @@
$out  = $this-show( 'OpenID ' . wfMessage( 
'version-software-version' )-text(), MEDIAWIKI_OPENID_VERSION );
$out .= $this-show( 'MediaWiki ' . wfMessage( 
'version-software-version' )-text(), SpecialVersion::getVersion() );
$out .= $this-show( '$wgOpenIDLoginOnly', $wgOpenIDLoginOnly );
-   $out .= $this-show( '$wgOpenIDConsumerAndAlsoProvider', 
$wgOpenIDClientAndProviderMode );
+   $out .= $this-show( '$wgOpenIDConsumerAndAlsoProvider', 
$wgOpenIDConsumerAndAlsoProvider );
$out .= $this-show( '$wgOpenIDAllowServingOpenIDUserAccounts', 
$wgOpenIDAllowServingOpenIDUserAccounts );
$out .= $this-show( '$wgOpenIDTrustEmailAddress', 
$wgOpenIDTrustEmailAddress );
$out .= $this-show( '$wgOpenIDAllowExistingAccountSelection', 
$wgOpenIDAllowExistingAccountSelection );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idbb74e27e3dfc20b554b940be1dfcb1079701c33
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenID
Gerrit-Branch: master
Gerrit-Owner: Jpond jack.p...@psitex.com

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


[MediaWiki-commits] [Gerrit] (bug 50430) Generates null array errors in strict php mode f... - change (mediawiki...OpenID)

2013-06-30 Thread Jpond (Code Review)
Jpond has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71256


Change subject: (bug 50430) Generates null array errors in strict php mode for 
fullname and email
..

(bug 50430) Generates null array errors in strict php mode for fullname and 
email

Fixed by adding function getFullAXUserName that returns the first and last 
name, or first name, or last name (depending on what is available).

Also fixed the array key for contact email which would have caused programs

Change-Id: Ie10c630a1a2029d66450cc26c08a5fb9d009a030
---
M SpecialOpenIDLogin.body.php
1 file changed, 24 insertions(+), 9 deletions(-)


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

diff --git a/SpecialOpenIDLogin.body.php b/SpecialOpenIDLogin.body.php
index 3c6cd4a..267005b 100644
--- a/SpecialOpenIDLogin.body.php
+++ b/SpecialOpenIDLogin.body.php
@@ -333,9 +333,9 @@
$fullname = $sreg['fullname'];
}
 
-   if ( array_key_exists( 
'http://axschema.org/namePerson/first', $ax )
-   || array_key_exists( 
'http://axschema.org/namePerson/last', $ax ) ) {
-   $fullname = 
$ax['http://axschema.org/namePerson/first'][0] .   . 
$ax['http://axschema.org/namePerson/last'][0];
+   $xSetRealName = $this-getFullAXUserName( $ax );
+   if (!is_null($xSetRealName) ) {
+   $fullname = $xSetRealName;
}
 
if ( $fullname  $this-userNameOK( $fullname 
) ) {
@@ -656,7 +656,7 @@
if ( array_key_exists( 'email', $sreg ) ) {
$email = $sreg['email'];
}
-   if ( array_key_exists ( 
'http://axschema.org/contact/email', $ax ) ) {
+   if ( array_key_exists ( 0, 
$ax['http://axschema.org/contact/email']) ) {
$email = 
$ax['http://axschema.org/contact/email'][0];
}
if ( $email ) {
@@ -686,10 +686,9 @@
$user-setRealName( $sreg['fullname'] );
}
 
-   if ( array_key_exists( 
'http://axschema.org/namePerson/first', $ax )
-   || array_key_exists( 
'http://axschema.org/namePerson/last', $ax ) ) {
-
-   $user-setRealName( 
$ax['http://axschema.org/namePerson/first'][0] .   . 
$ax['http://axschema.org/namePerson/last'][0] );
+   $xSetRealName = $this-getFullAXUserName( $ax );
+   if (!is_null($xSetRealName) ) {
+   $user-setRealName($xSetRealName);
}
 
}
@@ -896,7 +895,7 @@
 
# return the part before the @ in the e-mail address;
# look at AX, then SREG.
-   if ( array_key_exists ( 'http://axschema.org/contact/email', 
$ax ) ) {
+   if ( array_key_exists ( 0, 
$ax['http://axschema.org/contact/email']) ) {
$addr = explode( @, 
$ax['http://axschema.org/contact/email'][0] );
if ( $addr ) {
return $addr[0];
@@ -1006,6 +1005,22 @@
!in_array( $name, $wgReservedUsernames ) );
}
 
+   /**
+* Get the partial or full user name from the ax array (if exists)
+* @param $ax
+* @return mixed|null|string
+*/
+   function getFullAXUserName( $ax ) {
+   $xSetRealName = ;
+   if ( array_key_exists( 
0,$ax['http://axschema.org/namePerson/first']) ) {
+   $xSetRealName = 
$ax['http://axschema.org/namePerson/first'][0];
+   }
+   if ( array_key_exists( 
0,$ax['http://axschema.org/namePerson/last']) ) {
+   $xSetRealName = strlen($xSetRealName) ? $xSetRealName. 
 .$ax['http://axschema.org/namePerson/last'][0] : 
$ax['http://axschema.org/namePerson/last'][0];
+   }
+   return (strlen($xSetRealName) ? $xSetRealNameS : null);
+   }
+
# Session stuff
# -
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie10c630a1a2029d66450cc26c08a5fb9d009a030
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenID
Gerrit-Branch: master
Gerrit-Owner: Jpond jack.p...@psitex.com

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


[MediaWiki-commits] [Gerrit] (bug 50430) Generates null array errors strict php mode for ... - change (mediawiki...OpenID)

2013-06-30 Thread Jpond (Code Review)
Jpond has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71258


Change subject: (bug 50430) Generates null array errors strict php mode for 
fullname and email
..

(bug 50430) Generates null array errors strict php mode for fullname and email

Fixed by adding function getFullAXUserName that returns:
* First and last name, or
* First name, or
* last name (depending on what is available).

Also fixed the array key for contact email which would have caused programs
Update was a typo

Change-Id: I75d3705e96dd312b2c96b51269fd88b3d0c1f362

modified:   SpecialOpenIDLogin.body.php

Fixed typo on line 1021, $xSetRealNames - $xSetRealName

Change-Id: I32c1fc7b1a8d0dbef27d15c96f5063e4342f795e
---
M SpecialOpenIDLogin.body.php
1 file changed, 24 insertions(+), 9 deletions(-)


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

diff --git a/SpecialOpenIDLogin.body.php b/SpecialOpenIDLogin.body.php
index 3c6cd4a..71cd9e5 100644
--- a/SpecialOpenIDLogin.body.php
+++ b/SpecialOpenIDLogin.body.php
@@ -333,9 +333,9 @@
$fullname = $sreg['fullname'];
}
 
-   if ( array_key_exists( 
'http://axschema.org/namePerson/first', $ax )
-   || array_key_exists( 
'http://axschema.org/namePerson/last', $ax ) ) {
-   $fullname = 
$ax['http://axschema.org/namePerson/first'][0] .   . 
$ax['http://axschema.org/namePerson/last'][0];
+   $xSetRealName = $this-getFullAXUserName( $ax );
+   if (!is_null($xSetRealName) ) {
+   $fullname = $xSetRealName;
}
 
if ( $fullname  $this-userNameOK( $fullname 
) ) {
@@ -656,7 +656,7 @@
if ( array_key_exists( 'email', $sreg ) ) {
$email = $sreg['email'];
}
-   if ( array_key_exists ( 
'http://axschema.org/contact/email', $ax ) ) {
+   if ( array_key_exists ( 0, 
$ax['http://axschema.org/contact/email']) ) {
$email = 
$ax['http://axschema.org/contact/email'][0];
}
if ( $email ) {
@@ -686,10 +686,9 @@
$user-setRealName( $sreg['fullname'] );
}
 
-   if ( array_key_exists( 
'http://axschema.org/namePerson/first', $ax )
-   || array_key_exists( 
'http://axschema.org/namePerson/last', $ax ) ) {
-
-   $user-setRealName( 
$ax['http://axschema.org/namePerson/first'][0] .   . 
$ax['http://axschema.org/namePerson/last'][0] );
+   $xSetRealName = $this-getFullAXUserName( $ax );
+   if (!is_null($xSetRealName) ) {
+   $user-setRealName($xSetRealName);
}
 
}
@@ -896,7 +895,7 @@
 
# return the part before the @ in the e-mail address;
# look at AX, then SREG.
-   if ( array_key_exists ( 'http://axschema.org/contact/email', 
$ax ) ) {
+   if ( array_key_exists ( 0, 
$ax['http://axschema.org/contact/email']) ) {
$addr = explode( @, 
$ax['http://axschema.org/contact/email'][0] );
if ( $addr ) {
return $addr[0];
@@ -1006,6 +1005,22 @@
!in_array( $name, $wgReservedUsernames ) );
}
 
+   /**
+* Get the partial or full user name from the ax array (if exists)
+* @param $ax
+* @return mixed|null|string
+*/
+   function getFullAXUserName( $ax ) {
+   $xSetRealName = ;
+   if ( array_key_exists( 
0,$ax['http://axschema.org/namePerson/first']) ) {
+   $xSetRealName = 
$ax['http://axschema.org/namePerson/first'][0];
+   }
+   if ( array_key_exists( 
0,$ax['http://axschema.org/namePerson/last']) ) {
+   $xSetRealName = strlen($xSetRealName) ? $xSetRealName. 
 .$ax['http://axschema.org/namePerson/last'][0] : 
$ax['http://axschema.org/namePerson/last'][0];
+   }
+   return (strlen($xSetRealName) ? $xSetRealName : null);
+   }
+
# Session stuff
# -
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I32c1fc7b1a8d0dbef27d15c96f5063e4342f795e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenID
Gerrit-Branch: master
Gerrit-Owner: Jpond jack.p...@psitex.com


[MediaWiki-commits] [Gerrit] Generates null array errors strict php mode for fullname and... - change (mediawiki...OpenID)

2013-06-30 Thread Jpond (Code Review)
Jpond has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71295


Change subject: Generates null array errors strict php mode for fullname and 
email
..

Generates null array errors strict php mode for fullname and email

Bug: 50430
Fixed by adding function getFullAXUserName that returns:
* First and last name, or
* First name, or
* last name (depending on what is available).
Also fixed the array key for contact email which would have caused
programs
Changes made for code review by Parent5446
Line 337: Spaces added inside parentheses. Also, used !== null rather than 
is_null.
Line 659: Used isset instead of array_key_exists
Line 898: Used isset instead of array_key_exists
Line 1015: Used isset instead of array_key_exists
Line 1019: Broke into if/else

Change-Id: Ifa94dcd97b68cf09bab8478f5116753d6d258a5b
---
M SpecialOpenIDLogin.body.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenID 
refs/changes/95/71295/1

diff --git a/SpecialOpenIDLogin.body.php b/SpecialOpenIDLogin.body.php
index 71cd9e5..41d2d09 100644
--- a/SpecialOpenIDLogin.body.php
+++ b/SpecialOpenIDLogin.body.php
@@ -895,7 +895,7 @@
 
# return the part before the @ in the e-mail address;
# look at AX, then SREG.
-   if ( array_key_exists ( 0, 
$ax['http://axschema.org/contact/email']) ) {
+   if ( isset ( $ax['http://axschema.org/contact/email'][0] ) ) {
$addr = explode( @, 
$ax['http://axschema.org/contact/email'][0] );
if ( $addr ) {
return $addr[0];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa94dcd97b68cf09bab8478f5116753d6d258a5b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenID
Gerrit-Branch: master
Gerrit-Owner: Jpond jack.p...@psitex.com

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


[MediaWiki-commits] [Gerrit] mend - change (mediawiki...OpenID)

2013-06-30 Thread Jpond (Code Review)
Jpond has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71296


Change subject: mend
..

mend

Change-Id: I9f6feaf421a1335bd4fe7a3a6857d86e67ed4f6c
---
D README
D skin/icons/WMFLabs_large.png
2 files changed, 0 insertions(+), 409 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenID 
refs/changes/96/71296/1

diff --git a/README b/README
deleted file mode 100644
index 54183cf..000
--- a/README
+++ /dev/null
@@ -1,409 +0,0 @@
-MediaWiki OpenID extension README.OpenID-mediawiki-extension file
-version 3.30 20130505
-
-Homepage and manual 
-http://www.mediawiki.org/wiki/Extension:OpenID
-
-This is the README file for the OpenID extension for MediaWiki software. The
-extension is only useful if you've got a MediaWiki installation; it can only be
-installed by the administrator of the site.
-
-The extension lets users log in with an OpenID (http://www.openid.net/) instead
-of a username and password. An OpenID is a special URL that people can use to
-log in to a Web site. The extension also lets users who have an account on the
-wiki log in to other OpenID-aware Web sites with their wiki user page as their
-OpenID.
-
-Typical uses:
-
-* Single-signon between multiple affiliated wikis and other sites.
-* Single-signon across the Internet. Many, many sites now support OpenID,
-  including big names like Yahoo!, Google, and AOL. Allowing users to login
-  with OpenID means one less step for them to contribute to your wiki.
-* Distributed reputation. Logging into a new wiki with the same username as you
-  have on another wiki doesn't prove that they're the same person. Logging in
-  with your OpenID from the old wiki does. Using OpenID can help build a
-  distributed reputation across the wiki world.
-
-The software supports OpenID 2.0 and '''requires''' the openidenabled.com 2.2.2
-libraries. Users of previous versions should see [[#Upgrade]] for more
-information.
-
-This extension has been in use for years on several large wikis without known
-security problems. However, no software is completely bug-free or secure, and
-there's no guarantee that this software will work as advertised. See [[#Bugs]]
-section below for info on how to report problems.
-
-== License ==
-
-Copyright 2006,2007 Internet Brands (http://www.internetbrands.com/)
-Copyright 2008 Evan Prodromou (http://vinismo.com/en/User:Evan)
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-== Authors ==
-
-Evan Prodromou e...@vinismo.com
-Patches for YADIS support and FileStore storage by Jonathan Daugherty
-cyg...@janrain.com.
-Thomas Gries
-
-== Pre-requisites ==
-
-Always use latest MediaWiki and latest OpenID versions.
-
-This software has been tested with all versions MediaWiki 1.19 rev. 88135
-until MediaWiki 1.22alpha.
-
-The software depends on the PHP library for OpenID
-https://github.com/openid/php-openid
-
-Information: the original homepage for the library was
-http://www.openidenabled.com/php-openid/ but this page not maintained any more.
-
-This software requires PHP being installed with gmp, mcrypt, curl, openssl, xml
-and certain other extensions. See 
http://www.mediawiki.org/wiki/Extension:OpenID
-for details.
-
-/* FIXME: */
-Note that some versions of MediaWiki overwrite the PHP library path in
-LocalSettings.php. Perhaps you may need to add the path to your PHP library
-directory to the $path variable, like /usr/share/php or 
/usr/local/share/php.
-
-== Installation ==
-
-Note that the software currently depends on having all its code in the OpenID
-sub-directory; naming it OpenID-Test or newextension1 or whatever
-won't work.
-
-In your MediaWiki LocalSettings.php, add the following line some place towards
-the bottom of the file:
-
-   require_once( $IP/extensions/OpenID/OpenID.php );
-
-Run update.php script in in your MediaWiki maintenance folder to conditionally 
-create a new table in MediaWiki database as required by the OpenID extension:
-
-   cd $IP/maintenance
-   php update.php
-
-Theoretically it should work out of the box, but you'll almost definitely want
-to set the trust root and access controls (see Configuration below).
-
-== Upgrade from OpenID versions before 3.x ==
-
-'''This is an incompatible upgrade to the previous version of the MediaWiki

[MediaWiki-commits] [Gerrit] Generates null array errors strict php mode for fullname and... - change (mediawiki...OpenID)

2013-06-30 Thread Jpond (Code Review)
Jpond has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71292


Change subject: Generates null array errors strict php mode for fullname and 
email
..

Generates null array errors strict php mode for fullname and email

Bug: 50430

Fixed by adding function getFullAXUserName that returns:
* First and last name, or
* First name, or
* last name (depending on what is available).

Also fixed the array key for contact email which would have caused
programs

Changes made for code review by Parent5446

Line 337: Spaces added inside parentheses. Also, used !== null rather than 
is_null.

Line 659: Used isset instead of array_key_exists

Line 1015: Used isset instead of array_key_exists

Line 1019: Broke into if/else

Change-Id: I1527a0d601f6aa6ba2117e1a9ab8f86cbdb7b82e
---
M SpecialOpenIDLogin.body.php
1 file changed, 28 insertions(+), 9 deletions(-)


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

diff --git a/SpecialOpenIDLogin.body.php b/SpecialOpenIDLogin.body.php
index 3c6cd4a..fb41526 100644
--- a/SpecialOpenIDLogin.body.php
+++ b/SpecialOpenIDLogin.body.php
@@ -333,9 +333,9 @@
$fullname = $sreg['fullname'];
}
 
-   if ( array_key_exists( 
'http://axschema.org/namePerson/first', $ax )
-   || array_key_exists( 
'http://axschema.org/namePerson/last', $ax ) ) {
-   $fullname = 
$ax['http://axschema.org/namePerson/first'][0] .   . 
$ax['http://axschema.org/namePerson/last'][0];
+   $xSetRealName = $this-getFullAXUserName( $ax );
+   if ( xSetRealName !== null) {
+   $fullname = $xSetRealName;
}
 
if ( $fullname  $this-userNameOK( $fullname 
) ) {
@@ -656,7 +656,7 @@
if ( array_key_exists( 'email', $sreg ) ) {
$email = $sreg['email'];
}
-   if ( array_key_exists ( 
'http://axschema.org/contact/email', $ax ) ) {
+   if ( isset( $ax['http://axschema.org/contact/email'][0] 
) ) {
$email = 
$ax['http://axschema.org/contact/email'][0];
}
if ( $email ) {
@@ -686,10 +686,9 @@
$user-setRealName( $sreg['fullname'] );
}
 
-   if ( array_key_exists( 
'http://axschema.org/namePerson/first', $ax )
-   || array_key_exists( 
'http://axschema.org/namePerson/last', $ax ) ) {
-
-   $user-setRealName( 
$ax['http://axschema.org/namePerson/first'][0] .   . 
$ax['http://axschema.org/namePerson/last'][0] );
+   $xSetRealName = $this-getFullAXUserName( $ax );
+   if (!is_null($xSetRealName) ) {
+   $user-setRealName($xSetRealName);
}
 
}
@@ -896,7 +895,7 @@
 
# return the part before the @ in the e-mail address;
# look at AX, then SREG.
-   if ( array_key_exists ( 'http://axschema.org/contact/email', 
$ax ) ) {
+   if ( array_key_exists ( 0, 
$ax['http://axschema.org/contact/email']) ) {
$addr = explode( @, 
$ax['http://axschema.org/contact/email'][0] );
if ( $addr ) {
return $addr[0];
@@ -1006,6 +1005,26 @@
!in_array( $name, $wgReservedUsernames ) );
}
 
+   /**
+* Get the partial or full user name from the ax array (if exists)
+* @param $ax
+* @return mixed|null|string
+*/
+   function getFullAXUserName( $ax ) {
+   $xSetRealName = ;
+   if ( isset( $ax['http://axschema.org/namePerson/first'][0] ) ) {
+   $xSetRealName = 
$ax['http://axschema.org/namePerson/first'][0];
+   }
+   if ( isset( $ax['http://axschema.org/namePerson/last'][0] ) ) {
+   if ( strlen($xSetRealName) ) {
+   $xSetRealName .=   . 
$ax['http://axschema.org/namePerson/last'][0];
+   } else {
+   $xSetRealName = 
$ax['http://axschema.org/namePerson/last'][0];
+   }
+   }
+   return (strlen($xSetRealName) ? $xSetRealName : null);
+   }
+
# Session stuff
# -
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: 

[MediaWiki-commits] [Gerrit] Generates null array errors strict php mode for fullname and... - change (mediawiki...OpenID)

2013-06-30 Thread Jpond (Code Review)
Jpond has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71310


Change subject: Generates null array errors strict php mode for fullname and 
email
..

Generates null array errors strict php mode for fullname and email

Fixed by adding function getFullAXUserName that returns:
* First and last name, or
* First name, or
* last name (depending on what is available).

Also fixed the array key for contact email which would have caused
programs

Bug: 50430

Changes made for code review by Parent5446
Line 337: Spaces added inside parentheses. Also, used !== null rather than 
is_null.
Line 659: Used isset instead of array_key_exists
Line 898: Used isset instead of array_key_exists
Line 1015: Used isset instead of array_key_exists
Line 1019: Broke into if/else

Change-Id: I56ea35d0cc2806372a3507e2f2d6681b522a490b
---
M SpecialOpenIDLogin.body.php
1 file changed, 28 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenID 
refs/changes/10/71310/1

diff --git a/SpecialOpenIDLogin.body.php b/SpecialOpenIDLogin.body.php
index 3c6cd4a..3a91f23 100644
--- a/SpecialOpenIDLogin.body.php
+++ b/SpecialOpenIDLogin.body.php
@@ -333,9 +333,9 @@
$fullname = $sreg['fullname'];
}
 
-   if ( array_key_exists( 
'http://axschema.org/namePerson/first', $ax )
-   || array_key_exists( 
'http://axschema.org/namePerson/last', $ax ) ) {
-   $fullname = 
$ax['http://axschema.org/namePerson/first'][0] .   . 
$ax['http://axschema.org/namePerson/last'][0];
+   $xSetRealName = $this-getFullAXUserName( $ax );
+   if ( xSetRealName !== null) {
+   $fullname = $xSetRealName;
}
 
if ( $fullname  $this-userNameOK( $fullname 
) ) {
@@ -656,7 +656,7 @@
if ( array_key_exists( 'email', $sreg ) ) {
$email = $sreg['email'];
}
-   if ( array_key_exists ( 
'http://axschema.org/contact/email', $ax ) ) {
+   if ( isset( $ax['http://axschema.org/contact/email'][0] 
) ) {
$email = 
$ax['http://axschema.org/contact/email'][0];
}
if ( $email ) {
@@ -686,10 +686,9 @@
$user-setRealName( $sreg['fullname'] );
}
 
-   if ( array_key_exists( 
'http://axschema.org/namePerson/first', $ax )
-   || array_key_exists( 
'http://axschema.org/namePerson/last', $ax ) ) {
-
-   $user-setRealName( 
$ax['http://axschema.org/namePerson/first'][0] .   . 
$ax['http://axschema.org/namePerson/last'][0] );
+   $xSetRealName = $this-getFullAXUserName( $ax );
+   if (!is_null($xSetRealName) ) {
+   $user-setRealName($xSetRealName);
}
 
}
@@ -896,7 +895,7 @@
 
# return the part before the @ in the e-mail address;
# look at AX, then SREG.
-   if ( array_key_exists ( 'http://axschema.org/contact/email', 
$ax ) ) {
+   if ( isset ( $ax['http://axschema.org/contact/email'][0] ) ) {
$addr = explode( @, 
$ax['http://axschema.org/contact/email'][0] );
if ( $addr ) {
return $addr[0];
@@ -1006,6 +1005,26 @@
!in_array( $name, $wgReservedUsernames ) );
}
 
+   /**
+* Get the partial or full user name from the ax array (if exists)
+* @param $ax
+* @return mixed|null|string
+*/
+   function getFullAXUserName( $ax ) {
+   $xSetRealName = ;
+   if ( isset( $ax['http://axschema.org/namePerson/first'][0] ) ) {
+   $xSetRealName = 
$ax['http://axschema.org/namePerson/first'][0];
+   }
+   if ( isset( $ax['http://axschema.org/namePerson/last'][0] ) ) {
+   if ( strlen($xSetRealName) ) {
+   $xSetRealName .=   . 
$ax['http://axschema.org/namePerson/last'][0];
+   } else {
+   $xSetRealName = 
$ax['http://axschema.org/namePerson/last'][0];
+   }
+   }
+   return (strlen($xSetRealName) ? $xSetRealName : null);
+   }
+
# Session stuff
# -
 

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

Gerrit-MessageType: 

[MediaWiki-commits] [Gerrit] (bug 45364)Fixed Moving/Rename, synched for Repo Upgrades - change (mediawiki...NSFileRepo)

2013-03-01 Thread Jpond (Code Review)
Jpond has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/51393


Change subject: (bug 45364)Fixed Moving/Rename, synched for Repo Upgrades
..

(bug 45364)Fixed Moving/Rename, synched for Repo Upgrades

This is a major update to incorporate several evolved changes to the core 
FileRepo modules into the extension and to bring the extension up to current 
coding and core standards.  Specifically:

* [https://bugzilla.wikimedia.org/show_bug.cgi?id=45364 Bug Fix for 45364] - 
Fixed Move/Relocate issue and cleared result array for Title
* Synchronized with changes made to the core FileRepo classes and methods.  It 
now reflects fixes and upgrades as of 2013-2-27
* Updated for Documentation (doxygen)
* Cleared result array for userCan hook (NSFileRepolockdownUserCan) since Title 
now takes anything in that array to be an affirmative (user can)

Should be backwards compatible, but only tested with HEAD, 1.19 and 1.20

Bug: 45364
Change-Id: I00fad8394ac8fe6061d4b81250c0ae7a42e2b419
---
M NSFileRepo.php
M NSFileRepo_body.php
M README
3 files changed, 251 insertions(+), 194 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/NSFileRepo 
refs/changes/93/51393/1

diff --git a/NSFileRepo.php b/NSFileRepo.php
index 485a35a..2ae0833 100644
--- a/NSFileRepo.php
+++ b/NSFileRepo.php
@@ -96,8 +96,10 @@
} elseif( function_exists( 'lockdownUserPermissionsErrors' ) ) {
if( $title-getNamespace() == NS_FILE ) {
$ntitle = Title::newFromText( $title-mDbkeyform );
-   return ( $ntitle-getNamespace()  100 ) ?
-   true : lockdownUserPermissionsErrors( $ntitle, 
$user, $action, $result );
+   $ret_val = ( $ntitle-getNamespace()  100 ) ?
+   true : lockdownUserPermissionsErrors( 
$ntitle, $user, $action, $result );
+   $result = null;
+   return $ret_val;
}
}
return true;
diff --git a/NSFileRepo_body.php b/NSFileRepo_body.php
index 66369c2..fa8d836 100644
--- a/NSFileRepo_body.php
+++ b/NSFileRepo_body.php
@@ -58,6 +58,44 @@
function getRel() {
return $this-getHashPath() . $this-getFileNameStripped( 
$this-getName() );
}
+   /**
+* Get the path, relative to the thumbnail zone root, of the
+* thumbnail directory or a particular file if $suffix is specified
+*
+* @param $suffix bool|string if not false, the name of a thumbnail file
+*
+* @return string
+*/
+   function getThumbRel( $suffix = false ) {
+   $path = $this-getRel();
+   if ( $suffix !== false ) {
+/* This is the part that changed from LocalFile */
+   $path .= '/' . $this-getFileNameStripped( $suffix );
+/* End of changes */
+   }
+   return $path;
+   }
+
+   /**
+* Get the path of an archived file relative to the public zone root
+*
+* @param $suffix bool|string if not false, the name of an archived 
thumbnail file
+*
+* @return string
+*/
+   function getArchiveRel( $suffix = false ) {
+   $path = 'archive/' . $this-getHashPath();
+   if ( $suffix === false ) {
+   $path = substr( $path, 0, -1 );
+   } else {
+/* This is the part that changed from LocalFile */
+   $path .= '/' . $this-getFileNameStripped( $suffix );
+/* End of changes */
+   }
+   return $path;
+   }
+
+
 
/**
 * Get urlencoded relative path of the file
@@ -67,7 +105,13 @@
rawurlencode( $this-getFileNameStripped( 
$this-getName() ) );
}
 
-   /** Get the URL of the thumbnail directory, or a particular file if 
$suffix is specified */
+   /**
+* Get the URL of the thumbnail directory, or a particular file if 
$suffix is specified
+*
+* @param $suffix bool|string if not false, the name of a thumbnail file
+*
+* @return string path
+*/
function getThumbUrl( $suffix = false ) {
$path = $this-repo-getZoneUrl('thumb') . '/' . 
$this-getUrlRel();
if ( $suffix !== false ) {
@@ -77,246 +121,202 @@
}
 
 
-   /** Return the file name of a thumbnail with the specified parameters */
-   function thumbName( $params ) {
+   public function thumbName( $params, $flags = 0 ) {
+   $name = ( $this-repo  !( $flags  self::THUMB_FULL_NAME ) )
+/* This is the part that changed from LocalFile */
+   ? $this-repo-nameForThumb( 
$this-getFileNameStripped( $this-getName() ) )
+   : $this-getFileNameStripped( $this-getName() );
+/* End of changes */
+   

[MediaWiki-commits] [Gerrit] (bug 45364)Fixed Moving/Rename, synched for Repo Upgrades - change (mediawiki...NSFileRepo)

2013-03-01 Thread Jpond (Code Review)
Jpond has submitted this change and it was merged.

Change subject: (bug 45364)Fixed Moving/Rename, synched for Repo Upgrades
..


(bug 45364)Fixed Moving/Rename, synched for Repo Upgrades

This is a major update to incorporate several evolved changes to the core 
FileRepo modules into the extension and to bring the extension up to current 
coding and core standards.  Specifically:

* [https://bugzilla.wikimedia.org/show_bug.cgi?id=45364 Bug Fix for 45364] - 
Fixed Move/Relocate issue and cleared result array for Title
* Synchronized with changes made to the core FileRepo classes and methods.  It 
now reflects fixes and upgrades as of 2013-2-27
* Updated for Documentation (doxygen)
* Cleared result array for userCan hook (NSFileRepolockdownUserCan) since Title 
now takes anything in that array to be an affirmative (user can)
* Updated Version #

Should be backwards compatible, but only tested with HEAD, 1.19 and 1.20

Bug: 45364
Change-Id: I00fad8394ac8fe6061d4b81250c0ae7a42e2b419
---
M NSFileRepo.php
M NSFileRepo_body.php
M README
3 files changed, 254 insertions(+), 197 deletions(-)

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



diff --git a/NSFileRepo.php b/NSFileRepo.php
index 485a35a..32816f4 100644
--- a/NSFileRepo.php
+++ b/NSFileRepo.php
@@ -11,9 +11,9 @@
  * @url http://www.mediawiki.org/wiki/Manual:Extension:NSFileRepo
  * @licence GNU General Public Licence 2.0 or later
  *
- * Version 1.5 - Bug 37652 -Fixes for Extension:Lockdown dependency changes
+ * Version 1.5 - (bug 45364)Fixed Moving/Rename, synched for Repo Upgrades
  *
- * Version 1.4 - Several thumbnail fixes and updates for FileRepo enhancements
+ * Version 1.4 - Bug 37652 Several thumbnail fixes and updates for FileRepo 
enhancements
  *
  * Version 1.3 - Allows namespace protected files to be whitelisted
  *
@@ -41,7 +41,7 @@
'path' = __FILE__,
'name' = 'NSFileRepo',
'author' = 'Jack D. Pond',
-   'version' = '1.4',
+   'version' = '1.5',
'url' = 'https://www.mediawiki.org/wiki/Extension:NSFileRepo',
'descriptionmsg' = 'nsfilerepo-desc'
 );
@@ -96,8 +96,10 @@
} elseif( function_exists( 'lockdownUserPermissionsErrors' ) ) {
if( $title-getNamespace() == NS_FILE ) {
$ntitle = Title::newFromText( $title-mDbkeyform );
-   return ( $ntitle-getNamespace()  100 ) ?
-   true : lockdownUserPermissionsErrors( $ntitle, 
$user, $action, $result );
+   $ret_val = ( $ntitle-getNamespace()  100 ) ?
+   true : lockdownUserPermissionsErrors( 
$ntitle, $user, $action, $result );
+   $result = null;
+   return $ret_val;
}
}
return true;
diff --git a/NSFileRepo_body.php b/NSFileRepo_body.php
index 66369c2..fa8d836 100644
--- a/NSFileRepo_body.php
+++ b/NSFileRepo_body.php
@@ -58,6 +58,44 @@
function getRel() {
return $this-getHashPath() . $this-getFileNameStripped( 
$this-getName() );
}
+   /**
+* Get the path, relative to the thumbnail zone root, of the
+* thumbnail directory or a particular file if $suffix is specified
+*
+* @param $suffix bool|string if not false, the name of a thumbnail file
+*
+* @return string
+*/
+   function getThumbRel( $suffix = false ) {
+   $path = $this-getRel();
+   if ( $suffix !== false ) {
+/* This is the part that changed from LocalFile */
+   $path .= '/' . $this-getFileNameStripped( $suffix );
+/* End of changes */
+   }
+   return $path;
+   }
+
+   /**
+* Get the path of an archived file relative to the public zone root
+*
+* @param $suffix bool|string if not false, the name of an archived 
thumbnail file
+*
+* @return string
+*/
+   function getArchiveRel( $suffix = false ) {
+   $path = 'archive/' . $this-getHashPath();
+   if ( $suffix === false ) {
+   $path = substr( $path, 0, -1 );
+   } else {
+/* This is the part that changed from LocalFile */
+   $path .= '/' . $this-getFileNameStripped( $suffix );
+/* End of changes */
+   }
+   return $path;
+   }
+
+
 
/**
 * Get urlencoded relative path of the file
@@ -67,7 +105,13 @@
rawurlencode( $this-getFileNameStripped( 
$this-getName() ) );
}
 
-   /** Get the URL of the thumbnail directory, or a particular file if 
$suffix is specified */
+   /**
+* Get the URL of the thumbnail directory, or a particular file if 
$suffix is specified
+*
+* @param $suffix bool|string if not false, the name of a thumbnail file
+