[MediaWiki-commits] [Gerrit] renamed $wgOpenIDClientOnly; moved most important parameters... - change (mediawiki...OpenID)

2013-04-02 Thread Wikinaut (Code Review)
Wikinaut has uploaded a new change for review.

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


Change subject: renamed $wgOpenIDClientOnly; moved most important parameters to 
top of OpenID.php
..

renamed $wgOpenIDClientOnly; moved most important parameters to top of 
OpenID.php

version 3.12 20130402

renamed $wgOpenIDClientOnly to $wgOpenIDClientAndAlsoProvider and
changed the logic accordingly

moved most important parameters to top of OpenID.php

Change-Id: If6e00410ff09d9e35a36bf1416731033bef12f5a
---
M CHANGES
M OpenID.hooks.php
M OpenID.php
M SpecialOpenIDDashboard.body.php
M SpecialOpenIDIdentifier.body.php
M SpecialOpenIDServer.body.php
M SpecialOpenIDXRDS.body.php
7 files changed, 45 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenID 
refs/changes/44/57044/7

diff --git a/CHANGES b/CHANGES
index c12bd87..497e475 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
 CHANGES
 ===
 
+3.12  20130402  breaking change renamed $wgOpenIDClientOnly to 
$wgOpenIDClientAndAlsoProvider
+and inverting its logic accordingly
 3.11  20130401  code cosmetics
 3.10  20130318  renamed $wgOpenIDOnly to $wgOpenIDLoginOnly
 3.09  20130318  hotfix typo $wgOpenIDOnlyClient vs. $wgOpenIDClientOnly
diff --git a/OpenID.hooks.php b/OpenID.hooks.php
index 43bf548..aafa5be 100644
--- a/OpenID.hooks.php
+++ b/OpenID.hooks.php
@@ -18,7 +18,7 @@
 
 class OpenIDHooks {
public static function onSpecialPage_initList( $list ) {
-   global $wgOpenIDLoginOnly, $wgOpenIDClientOnly, 
$wgSpecialPageGroups, $wgOpenIDSmallLogoUrl;
+   global $wgOpenIDLoginOnly, $wgOpenIDClientAndAlsoProvider, 
$wgSpecialPageGroups, $wgOpenIDSmallLogoUrl;
 
$wgOpenIDSmallLogoUrl = self::getOpenIDSmallLogoUrl();
 
@@ -33,7 +33,7 @@
# Special pages are added at global scope;
# remove server-related ones if client-only flag is set
$addList = array( 'Login', 'Convert', 'Dashboard', 'Identifier' 
);
-   if ( !$wgOpenIDClientOnly ) {
+   if ( $wgOpenIDClientAndAlsoProvider ) {
$addList[] = 'Server';
$addList[] = 'XRDS';
}
@@ -263,9 +263,9 @@
 */
public static function onGetPreferences( $user, $preferences ) {
global $wgOpenIDShowUrlOnUserPage, $wgHiddenPrefs,
-   $wgAuth, $wgUser, $wgLang, $wgOpenIDClientOnly;
+   $wgAuth, $wgUser, $wgLang, 
$wgOpenIDClientAndAlsoProvider;
 
-   if ( !$wgOpenIDClientOnly ) {
+   if ( $wgOpenIDClientAndAlsoProvider ) {
 
switch ( $wgOpenIDShowUrlOnUserPage ) {
 
@@ -337,7 +337,7 @@
'type' = 'hidden',
);
 
-   if ( !$wgOpenIDClientOnly ) {
+   if ( $wgOpenIDClientAndAlsoProvider ) {
 
$preferences['openid-your-openid'] =
array(
diff --git a/OpenID.php b/OpenID.php
index 875b428..8487f75 100644
--- a/OpenID.php
+++ b/OpenID.php
@@ -29,7 +29,7 @@
exit( 1 );
 }
 
-define( 'MEDIAWIKI_OPENID_VERSION', '3.11 20130401' );
+define( 'MEDIAWIKI_OPENID_VERSION', '3.12 20130402' );
 
 $path = dirname( __FILE__ );
 set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . 
get_include_path() );
@@ -37,8 +37,31 @@
 # CONFIGURATION VARIABLES
 
 /**
- * Whether to hide the Login with OpenID link link; set to true if you 
already
- * have this link in your skin.
+ * Only allow login with OpenID.
+ * Default: true
+ */
+$wgOpenIDLoginOnly = true;
+
+/**
+ * If true, user accounts on this wiki can be used as OpenIDs on other
+ * sites. This is called OpenID Provider (or OpenID Server) mode.
+ *
+ * @deprecated $wgOpenIDClientOnly since E:OpenID v3.12. Use 
$wgOpenIDClientAndAlsoProvider with inverted logic instead
+ */
+$wgOpenIDClientAndAlsoProvider = true;
+
+/**
+ * If true, users can use their OpenID identity provided by this site A
+ * as OpenID for logins to other sites B
+ * even when users logged in on site A with OpenID.
+ *
+ * Some users might want to do that for vanity purposes or whatever.
+ */
+$wgOpenIDAllowServingOpenIDUserAccounts = true;
+
+/**
+ * Whether to hide the Login with OpenID link link:
+ * set to true if you already have this link in your skin.
  */
 $wgOpenIDHideOpenIDLoginLink = false;
 
@@ -49,8 +72,8 @@
 $wgOpenIDSmallLogoUrl = false;
 
 /**
- * Whether to show the OpenID identity URL on a user's home page. Possible
- * values are 'always', 'never' (default), or 'user'.
+ * Whether to show the OpenID identity URL on a user's home page.
+ * Possible values are 'always', 'never' (default), or 'user'.
  * 'user' lets the user decide in their preferences.
  */
 $wgOpenIDShowUrlOnUserPage = 'user';
@@ -188,38 +211,12 @@
  */
 

[MediaWiki-commits] [Gerrit] renamed $wgOpenIDClientOnly; moved most important parameters... - change (mediawiki...OpenID)

2013-04-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: renamed $wgOpenIDClientOnly; moved most important parameters to 
top of OpenID.php
..


renamed $wgOpenIDClientOnly; moved most important parameters to top of 
OpenID.php

version 3.12 20130402

renamed $wgOpenIDClientOnly to $wgOpenIDClientAndAlsoProvider and
changed the logic accordingly

moved most important parameters to top of OpenID.php

Change-Id: If6e00410ff09d9e35a36bf1416731033bef12f5a
---
M CHANGES
M OpenID.hooks.php
M OpenID.php
M SpecialOpenIDDashboard.body.php
M SpecialOpenIDIdentifier.body.php
M SpecialOpenIDServer.body.php
M SpecialOpenIDXRDS.body.php
7 files changed, 45 insertions(+), 46 deletions(-)

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



diff --git a/CHANGES b/CHANGES
index c12bd87..497e475 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
 CHANGES
 ===
 
+3.12  20130402  breaking change renamed $wgOpenIDClientOnly to 
$wgOpenIDClientAndAlsoProvider
+and inverting its logic accordingly
 3.11  20130401  code cosmetics
 3.10  20130318  renamed $wgOpenIDOnly to $wgOpenIDLoginOnly
 3.09  20130318  hotfix typo $wgOpenIDOnlyClient vs. $wgOpenIDClientOnly
diff --git a/OpenID.hooks.php b/OpenID.hooks.php
index 43bf548..aafa5be 100644
--- a/OpenID.hooks.php
+++ b/OpenID.hooks.php
@@ -18,7 +18,7 @@
 
 class OpenIDHooks {
public static function onSpecialPage_initList( $list ) {
-   global $wgOpenIDLoginOnly, $wgOpenIDClientOnly, 
$wgSpecialPageGroups, $wgOpenIDSmallLogoUrl;
+   global $wgOpenIDLoginOnly, $wgOpenIDClientAndAlsoProvider, 
$wgSpecialPageGroups, $wgOpenIDSmallLogoUrl;
 
$wgOpenIDSmallLogoUrl = self::getOpenIDSmallLogoUrl();
 
@@ -33,7 +33,7 @@
# Special pages are added at global scope;
# remove server-related ones if client-only flag is set
$addList = array( 'Login', 'Convert', 'Dashboard', 'Identifier' 
);
-   if ( !$wgOpenIDClientOnly ) {
+   if ( $wgOpenIDClientAndAlsoProvider ) {
$addList[] = 'Server';
$addList[] = 'XRDS';
}
@@ -263,9 +263,9 @@
 */
public static function onGetPreferences( $user, $preferences ) {
global $wgOpenIDShowUrlOnUserPage, $wgHiddenPrefs,
-   $wgAuth, $wgUser, $wgLang, $wgOpenIDClientOnly;
+   $wgAuth, $wgUser, $wgLang, 
$wgOpenIDClientAndAlsoProvider;
 
-   if ( !$wgOpenIDClientOnly ) {
+   if ( $wgOpenIDClientAndAlsoProvider ) {
 
switch ( $wgOpenIDShowUrlOnUserPage ) {
 
@@ -337,7 +337,7 @@
'type' = 'hidden',
);
 
-   if ( !$wgOpenIDClientOnly ) {
+   if ( $wgOpenIDClientAndAlsoProvider ) {
 
$preferences['openid-your-openid'] =
array(
diff --git a/OpenID.php b/OpenID.php
index 875b428..8487f75 100644
--- a/OpenID.php
+++ b/OpenID.php
@@ -29,7 +29,7 @@
exit( 1 );
 }
 
-define( 'MEDIAWIKI_OPENID_VERSION', '3.11 20130401' );
+define( 'MEDIAWIKI_OPENID_VERSION', '3.12 20130402' );
 
 $path = dirname( __FILE__ );
 set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . 
get_include_path() );
@@ -37,8 +37,31 @@
 # CONFIGURATION VARIABLES
 
 /**
- * Whether to hide the Login with OpenID link link; set to true if you 
already
- * have this link in your skin.
+ * Only allow login with OpenID.
+ * Default: true
+ */
+$wgOpenIDLoginOnly = true;
+
+/**
+ * If true, user accounts on this wiki can be used as OpenIDs on other
+ * sites. This is called OpenID Provider (or OpenID Server) mode.
+ *
+ * @deprecated $wgOpenIDClientOnly since E:OpenID v3.12. Use 
$wgOpenIDClientAndAlsoProvider with inverted logic instead
+ */
+$wgOpenIDClientAndAlsoProvider = true;
+
+/**
+ * If true, users can use their OpenID identity provided by this site A
+ * as OpenID for logins to other sites B
+ * even when users logged in on site A with OpenID.
+ *
+ * Some users might want to do that for vanity purposes or whatever.
+ */
+$wgOpenIDAllowServingOpenIDUserAccounts = true;
+
+/**
+ * Whether to hide the Login with OpenID link link:
+ * set to true if you already have this link in your skin.
  */
 $wgOpenIDHideOpenIDLoginLink = false;
 
@@ -49,8 +72,8 @@
 $wgOpenIDSmallLogoUrl = false;
 
 /**
- * Whether to show the OpenID identity URL on a user's home page. Possible
- * values are 'always', 'never' (default), or 'user'.
+ * Whether to show the OpenID identity URL on a user's home page.
+ * Possible values are 'always', 'never' (default), or 'user'.
  * 'user' lets the user decide in their preferences.
  */
 $wgOpenIDShowUrlOnUserPage = 'user';
@@ -188,38 +211,12 @@
  */
 $wgOpenIDCookieExpiration = 365 * 24 * 60 *