Skip to content

Commit cd8d248

Browse files
committed
Bugfix: Email cannot be edited during webtrees registration without authorization provider, if "Keep email address synchronized" option is activated, fixes #17
1 parent 9d2326f commit cd8d248

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

resources/views/register-page.phtml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ $oauth2_client = $module_service->findByName(OAuth2Client::activeModuleName());
3434
$edit_user_name = true;
3535
$edit_real_name = true;
3636

37+
//Check if registration with authorization provider is requested
38+
$provider_authorization = isset($provider_name) ? true : false;
39+
3740
//Check whether email is allowed to be edited
38-
$edit_email = !$oauth2_client->getPreference(OAuth2Client::PREF_SYNC_PROVIDER_EMAIL);
41+
$edit_email = (!$provider_authorization OR !$oauth2_client->getPreference(OAuth2Client::PREF_SYNC_PROVIDER_EMAIL));
3942

4043
//Check whether a webtress password is allowed to be used
4144
$edit_password = $oauth2_client->getPreference(OAuth2Client::PREF_USE_WEBTREES_PASSWORD);
4245

43-
$provider_authorization = isset($provider_name) ? true : false;
44-
4546
if ($provider_authorization) {
4647
$provider_name = $provider_authorization ? Session::get(OAuth2Client::activeModuleName() . 'provider_name') : '';
4748
$provider = (new AuthorizationProviderFactory())::make($provider_name, '');

0 commit comments

Comments
 (0)