Browse Source

! Should allow admins to disable OpenID for new users but prevent breaking existing logins. (fixes #847) Note: my testing on this has been fairly limited. But it doesn't seem to break anything.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 11 years ago
parent
commit
4a6233cf19

+ 1 - 1
Sources/ManageRegistration.php

@@ -281,7 +281,7 @@ function ModifyRegistrationSettings($return_config = false)
 
 	$config_vars = array(
 			array('select', 'registration_method', array($txt['setting_registration_standard'], $txt['setting_registration_activate'], $txt['setting_registration_approval'], $txt['setting_registration_disabled'])),
-			array('check', 'enableOpenID'),
+			array('select', 'enableOpenID', array(0 => $txt['enableOpenID_disabled'], 1 => $txt['enableOpenID_enabled'], 2 => $txt['enableOpenID_enabled_login'])),
 			array('check', 'notify_new_registration'),
 			array('check', 'send_welcomeEmail'),
 		'',

+ 1 - 1
Sources/Profile.php

@@ -236,7 +236,7 @@ function ModifyProfile($post_errors = array())
 					'file' => 'Profile-Modify.php',
 					'function' => 'authentication',
 					'icon' => 'openid.png',
-					'enabled' => !empty($modSettings['enableOpenID']) || !empty($cur_profile['openid_uri']),
+					'enabled' => !empty($modSettings['enableOpenID']) && ($modSettings['enableOpenID'] == 1 || !empty($cur_profile['openid_uri'])),
 					'sc' => 'post',
 					'token' => 'profile-au%u',
 					'hidden' => empty($modSettings['enableOpenID']) && empty($cur_profile['openid_uri']),

+ 2 - 2
Themes/default/Register.template.php

@@ -116,7 +116,7 @@ function template_registration_form()
 					</dl>';
 
 	// If OpenID is enabled, give the user a choice between password and OpenID.
-	if (!empty($modSettings['enableOpenID']))
+	if (!empty($modSettings['enableOpenID']) && $modSettings['enableOpenID'] != 2)
 	{
 		echo '
 					<dl class="register_form" id="authentication_group">
@@ -158,7 +158,7 @@ function template_registration_form()
 					</dl>';
 
 	// If OpenID is enabled, give the user a choice between password and OpenID.
-	if (!empty($modSettings['enableOpenID']))
+	if (!empty($modSettings['enableOpenID']) && $modSettings['enableOpenID'] != 2)
 	{
 		echo '
 

+ 3 - 0
Themes/default/languages/Login.english.php

@@ -79,6 +79,9 @@ $txt['approval_after_registration'] = 'Thank you for registering. The admin must
 $txt['admin_settings_desc'] = 'Here you can change a variety of settings related to registration of new members.';
 
 $txt['setting_enableOpenID'] = 'Allow users to register using OpenID';
+$txt['enableOpenID_disabled'] = 'No, disable all OpenID use';
+$txt['enableOpenID_enabled'] = 'Enable OpenID for registrations and logins';
+$txt['enableOpenID_enabled_login'] = 'Enable OpenID only for existing users, but not new registrations';
 
 $txt['setting_registration_method'] = 'Method of registration employed for new members';
 $txt['setting_registration_disabled'] = 'Registration Disabled';