Add Google authentication

This commit is contained in:
Frédéric Guillot
2014-05-03 22:24:03 -04:00
parent 9531e439cd
commit 560a12f0bd
96 changed files with 7751 additions and 11 deletions

View File

@@ -14,6 +14,12 @@
<?= Helper\form_label(t('Username'), 'username') ?>
<?= Helper\form_text('username', $values, $errors, array('required', $values['is_ldap_user'] == 1 ? 'readonly' : '')) ?><br/>
<?= Helper\form_label(t('Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors) ?><br/>
<?= Helper\form_label(t('Email'), 'email') ?>
<?= Helper\form_email('email', $values, $errors) ?><br/>
<?php if ($values['is_ldap_user'] == 0): ?>
<?= Helper\form_label(t('Current password for the user "%s"', Helper\get_username()), 'current_password') ?>
@@ -31,7 +37,17 @@
<?= Helper\form_select('default_project_id', $projects, $values, $errors) ?><br/>
<?php if (Helper\is_admin()): ?>
<?= Helper\form_checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?>
<?= Helper\form_checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?><br/>
<?php endif ?>
<?php if (GOOGLE_AUTH && Helper\is_current_user($values['id'])): ?>
<div class="form-row">
<?php if (empty($values['google_id'])): ?>
<a href="?controller=user&amp;action=google"><?= t('Link my Google Account') ?></a>
<?php else: ?>
<a href="?controller=user&amp;action=unlinkGoogle"><?= t('Unlink my Google Account') ?></a>
<?php endif ?>
<div>
<?php endif ?>
<div class="form-actions">