summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-29 23:59:58 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-29 23:59:58 -0500
commit9b9d823f30f7f7744f412df8ca4c52d7be3c9977 (patch)
tree50a21284bf17246206c102153ff60a890888d4f2 /app/Template
parent04d8c6532c441c4ba4699020374ffab85685082d (diff)
Move Gitlab and Github authentication to external plugins
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/auth/index.php13
-rw-r--r--app/Template/config/integrations.php12
-rw-r--r--app/Template/user/authentication.php6
-rw-r--r--app/Template/user/create_remote.php9
-rw-r--r--app/Template/user/external.php34
5 files changed, 2 insertions, 72 deletions
diff --git a/app/Template/auth/index.php b/app/Template/auth/index.php
index 99444d37..41441e69 100644
--- a/app/Template/auth/index.php
+++ b/app/Template/auth/index.php
@@ -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> \ No newline at end of file
diff --git a/app/Template/config/integrations.php b/app/Template/config/integrations.php
index ef490cdf..ced051f7 100644
--- a/app/Template/config/integrations.php
+++ b/app/Template/config/integrations.php
@@ -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"/>&nbsp;<?= 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"/>&nbsp;<?= t('Gravatar') ?></h3>
<div class="listing">
<?= $this->form->checkbox('integration_gravatar', t('Enable Gravatar images'), 1, $values['integration_gravatar'] == 1) ?>
diff --git a/app/Template/user/authentication.php b/app/Template/user/authentication.php
index 1f2d2a69..0c08f3fb 100644
--- a/app/Template/user/authentication.php
+++ b/app/Template/user/authentication.php
@@ -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) ?>
diff --git a/app/Template/user/create_remote.php b/app/Template/user/create_remote.php
index 1cc560cd..7399a010 100644
--- a/app/Template/user/create_remote.php
+++ b/app/Template/user/create_remote.php
@@ -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">
diff --git a/app/Template/user/external.php b/app/Template/user/external.php
index 8c9a0259..22c25af2 100644
--- a/app/Template/user/external.php
+++ b/app/Template/user/external.php
@@ -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"/>&nbsp;<?= 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 ?>