Move Gitlab and Github authentication to external plugins
This commit is contained in:
@@ -39,17 +39,4 @@
|
||||
<?php endif ?>
|
||||
|
||||
<?= $this->hook->render('template:auth:login-form:after') ?>
|
||||
|
||||
<?php if (GITHUB_AUTH || GITLAB_AUTH): ?>
|
||||
<ul class="no-bullet">
|
||||
<?php if (GITHUB_AUTH): ?>
|
||||
<li><?= $this->url->link(t('Login with my Github Account'), 'oauth', 'github') ?></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (GITLAB_AUTH): ?>
|
||||
<li><?= $this->url->link(t('Login with my Gitlab Account'), 'oauth', 'gitlab') ?></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
@@ -6,18 +6,6 @@
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->hook->render('template:config:integrations', array('values' => $values)) ?>
|
||||
|
||||
<h3><i class="fa fa-github"></i> <?= t('Github Authentication') ?></h3>
|
||||
<div class="listing">
|
||||
<input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('oauth', 'github', array(), false, '', true) ?>"/><br/>
|
||||
<p class="form-help"><?= $this->url->doc(t('Help on Github authentication'), 'github-authentication') ?></p>
|
||||
</div>
|
||||
|
||||
<h3><img src="<?= $this->url->dir() ?>assets/img/gitlab-icon.png"/> <?= t('Gitlab Authentication') ?></h3>
|
||||
<div class="listing">
|
||||
<input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('oauth', 'gitlab', array(), false, '', true) ?>"/><br/>
|
||||
<p class="form-help"><?= $this->url->doc(t('Help on Gitlab authentication'), 'gitlab-authentication') ?></p>
|
||||
</div>
|
||||
|
||||
<h3><img src="<?= $this->url->dir() ?>assets/img/gravatar-icon.png"/> <?= t('Gravatar') ?></h3>
|
||||
<div class="listing">
|
||||
<?= $this->form->checkbox('integration_gravatar', t('Enable Gravatar images'), 1, $values['integration_gravatar'] == 1) ?>
|
||||
|
||||
@@ -10,12 +10,6 @@
|
||||
|
||||
<?= $this->hook->render('template:user:authentication:form', array('values' => $values, 'errors' => $errors, 'user' => $user)) ?>
|
||||
|
||||
<?= $this->form->label(t('Github Id'), 'github_id') ?>
|
||||
<?= $this->form->text('github_id', $values, $errors) ?>
|
||||
|
||||
<?= $this->form->label(t('Gitlab Id'), 'gitlab_id') ?>
|
||||
<?= $this->form->text('gitlab_id', $values, $errors) ?>
|
||||
|
||||
<?= $this->form->checkbox('is_ldap_user', t('Remote user'), 1, isset($values['is_ldap_user']) && $values['is_ldap_user'] == 1) ?>
|
||||
<?= $this->form->checkbox('disable_login_form', t('Disallow login form'), 1, isset($values['disable_login_form']) && $values['disable_login_form'] == 1) ?>
|
||||
|
||||
|
||||
@@ -20,14 +20,7 @@
|
||||
<?= $this->form->label(t('Email'), 'email') ?>
|
||||
<?= $this->form->email('email', $values, $errors) ?>
|
||||
|
||||
<?= $this->form->label(t('Google Id'), 'google_id') ?>
|
||||
<?= $this->form->text('google_id', $values, $errors) ?>
|
||||
|
||||
<?= $this->form->label(t('Github Id'), 'github_id') ?>
|
||||
<?= $this->form->text('github_id', $values, $errors) ?>
|
||||
|
||||
<?= $this->form->label(t('Gitlab Id'), 'gitlab_id') ?>
|
||||
<?= $this->form->text('gitlab_id', $values, $errors) ?>
|
||||
<?= $this->hook->render('template:user:create-remote:form', array('values' => $values, 'errors' => $errors)) ?>
|
||||
</div>
|
||||
|
||||
<div class="form-column">
|
||||
|
||||
@@ -4,39 +4,7 @@
|
||||
|
||||
<?php $html = $this->hook->render('template:user:external', array('user' => $user)) ?>
|
||||
|
||||
<?php if (GITHUB_AUTH): ?>
|
||||
<h3><i class="fa fa-github"></i> <?= t('Github Account') ?></h3>
|
||||
|
||||
<p class="listing">
|
||||
<?php if ($this->user->isCurrentUser($user['id'])): ?>
|
||||
<?php if (empty($user['github_id'])): ?>
|
||||
<?= $this->url->link(t('Link my Github Account'), 'oauth', 'github', array(), true) ?>
|
||||
<?php else: ?>
|
||||
<?= $this->url->link(t('Unlink my Github Account'), 'oauth', 'unlink', array('backend' => 'Github'), true) ?>
|
||||
<?php endif ?>
|
||||
<?php else: ?>
|
||||
<?= empty($user['github_id']) ? t('No account linked.') : t('Account linked.') ?>
|
||||
<?php endif ?>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (GITLAB_AUTH): ?>
|
||||
<h3><img src="<?= $this->url->dir() ?>assets/img/gitlab-icon.png"/> <?= t('Gitlab Account') ?></h3>
|
||||
|
||||
<p class="listing">
|
||||
<?php if ($this->user->isCurrentUser($user['id'])): ?>
|
||||
<?php if (empty($user['gitlab_id'])): ?>
|
||||
<?= $this->url->link(t('Link my Gitlab Account'), 'oauth', 'gitlab', array(), true) ?>
|
||||
<?php else: ?>
|
||||
<?= $this->url->link(t('Unlink my Gitlab Account'), 'oauth', 'unlink', array('backend' => 'Gitlab'), true) ?>
|
||||
<?php endif ?>
|
||||
<?php else: ?>
|
||||
<?= empty($user['gitlab_id']) ? t('No account linked.') : t('Account linked.') ?>
|
||||
<?php endif ?>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (empty($html) && ! GITHUB_AUTH && ! GITLAB_AUTH): ?>
|
||||
<?php if (empty($html)): ?>
|
||||
<p class="alert"><?= t('No external authentication enabled.') ?></p>
|
||||
<?php else: ?>
|
||||
<?= $html ?>
|
||||
|
||||
Reference in New Issue
Block a user