Skip to content

Commit 3ccb1c9

Browse files
committed
Updated register page
1 parent 6b75b3a commit 3ccb1c9

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

resources/views/register-page.phtml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use Fisharebest\Webtrees\View;
1313
use Jefferson49\Webtrees\Internationalization\MoreI18N;
1414
use Jefferson49\Webtrees\Module\OAuth2Client\Factories\AuthorizationProviderFactory;
1515
use Jefferson49\Webtrees\Module\OAuth2Client\OAuth2Client;
16-
use Jefferson49\Webtrees\Module\OAuth2Client\Provider\AbstractAuthorizationProvider;
1716

1817
/**
1918
* @var string $captcha
@@ -28,15 +27,19 @@ use Jefferson49\Webtrees\Module\OAuth2Client\Provider\AbstractAuthorizationProvi
2827
* @var string $random_password
2928
*/
3029

31-
$edit_user_name = true;
32-
$edit_real_name = true;
33-
$edit_email = false;
34-
$edit_password = false;
3530

36-
//Check whether webtress password is used in parallel and can be edited
3731
$module_service = new ModuleService();
3832
$oauth2_client = $module_service->findByName(OAuth2Client::activeModuleName());
3933

34+
$edit_user_name = true;
35+
$edit_real_name = true;
36+
37+
//Check whether email is allowed to be edited
38+
$edit_email = !$oauth2_client->getPreference(OAuth2Client::PREF_SYNC_PROVIDER_EMAIL);
39+
40+
//Check whether a webtress password is allowed to be used
41+
$edit_password = $oauth2_client->getPreference(OAuth2Client::PREF_USE_WEBTREES_PASSWORD);
42+
4043
$provider_authorization = isset($provider_name) ? true : false;
4144

4245
if ($provider_authorization) {
@@ -61,7 +64,7 @@ if ($provider_authorization) {
6164

6265
<?php if ($provider_authorization) : ?>
6366
<div class="h4">
64-
<?= I18N::translate('Register with') . ' ' . $provider->getSignInButtonLabel() . ' - ' . I18N::translate('User account data from authorization provider cannot be changed') ?>
67+
<?= I18N::translate('Request account with') . ' ' . $provider->getSignInButtonLabel() . ' - ' . I18N::translate('Changing some of the received user data from %s might be disabled by the administrator', $provider->getSignInButtonLabel()) ?>
6568
</div>
6669

6770
<?php if (!$edit_user_name) : ?>

0 commit comments

Comments
 (0)