Add option to rename link on login page

This commit is contained in:
Omar Ramos 2020-09-30 21:15:03 -07:00 committed by GitHub
parent 8b6cecd863
commit cfe1eaadcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -16,7 +16,9 @@ class Plugin extends Base
$this->route->addRoute('/oauth/callback', 'OAuthController', 'handler', 'OAuth2');
$this->template->hook->attach('template:auth:login-form:after', 'OAuth2:auth/login');
$this->template->hook->attach('template:auth:login-form:after', 'OAuth2:auth/login', [
'oauth2_custom_login_text' => $this->configModel->get('oauth2_custom_login_text'),
]);
$this->template->hook->attach('template:config:integrations', 'OAuth2:config/integration');
$this->template->hook->attach('template:user:external', 'OAuth2:user/external');
$this->template->hook->attach('template:user:authentication:form', 'OAuth2:user/authentication');

View File

@ -1,5 +1,9 @@
<ul class="no-bullet">
<li>
<?= $this->url->icon('lock', t('OAuth2 login'), 'OAuthController', 'handler', array('plugin' => 'OAuth2')) ?>
<?php if (!empty($oauth2_custom_login_text)): ?>
<?= $this->url->icon('lock', t($oauth2_custom_login_text), 'OAuthController', 'handler', array('plugin' => 'OAuth2')) ?>
<?php else: ?>
<?= $this->url->icon('lock', t('OAuth2 login'), 'OAuthController', 'handler', array('plugin' => 'OAuth2')) ?>
<?php endif; ?>
</li>
</ul>

View File

@ -48,6 +48,10 @@
<?= $this->form->text('oauth2_key_group_filter', $values) ?>
<p class="form-help"><?= t('Use a comma to enter multiple useable groups: group1,group2') ?></p>
<?= $this->form->label(t('Custom Login Text'), 'oauth2_custom_login_text') ?>
<?= $this->form->text('oauth2_custom_login_text', $values) ?>
<p class="form-help"><?= t('Enter the text you would prefer to see rather than the default "OAuth2 login".') ?></p>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>