Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/user_saml.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-07-05 22:53:52 +0300
committerBjoern Schiessle <bjoern@schiessle.org>2018-08-03 13:42:08 +0300
commit8c3a4b83e4ec7153222e7307aa12323a2d2b0eed (patch)
treea0d372ce137b28fcdb00ddd30bb902ce587d46fc /templates
parentd908675b74b5ea5d19285d1ebd04370ca3f8079f (diff)
Add global settings that are valid for all identity providers
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'templates')
-rw-r--r--templates/admin.php47
1 files changed, 32 insertions, 15 deletions
diff --git a/templates/admin.php b/templates/admin.php
index dcb44238..54110d4c 100644
--- a/templates/admin.php
+++ b/templates/admin.php
@@ -24,35 +24,51 @@ style('user_saml', 'admin');
?>
</div>
- <ul class="account-list">
+ <div id="user-saml-choose-type" class="hidden">
+ <?php p($l->t('Please choose whether you want to authenticate using the SAML provider built-in in Nextcloud or whether you want to authenticate against an environment variable.')) ?>
+ <br/>
+ <button id="user-saml-choose-saml"><?php p($l->t('Use built-in SAML authentication')) ?></button>
+ <button id="user-saml-choose-env"><?php p($l->t('Use environment variable')) ?></button>
+ </div>
+
+ <div id="user-saml-save-indicator" class="msg success inlineblock" style="display: none;"><?php p($l->t('Saved')); ?></div>
+
+ <div id="user-saml-global" class="hidden">
+ <h3><?php p($l->t('Global settings')) ?></h3>
+ <?php foreach($_['general'] as $key => $attribute): ?>
+ <?php if($attribute['type'] === 'checkbox' && $attribute['global']): ?>
+ <p>
+ <input type="checkbox" data-key="<?php p($key)?>" id="user-saml-general-<?php p($key)?>" name="<?php p($key)?>" value="<?php p(\OC::$server->getConfig()->getAppValue('user_saml', 'general-'.$key, '0')) ?>">
+ <label for="user-saml-general-<?php p($key)?>"><?php p($attribute['text']) ?></label><br/>
+ </p>
+ <?php elseif($attribute['type'] === 'line' && $attribute['global']): ?>
+ <p>
+ <input data-key="<?php p($key)?>" name="<?php p($key) ?>" value="<?php p(\OC::$server->getConfig()->getAppValue('user_saml', 'general-'.$key, '')) ?>" type="text" <?php if(isset($attribute['required']) && $attribute['required'] === true): ?>class="required"<?php endif;?> placeholder="<?php p($attribute['text']) ?>"/>
+ </p>
+ <?php endif; ?>
+ <?php endforeach; ?>
+ </div>
+
+ <ul class="account-list hidden">
<?php foreach ($_['providers'] as $id => $name) { ?>
<li data-id="<?php p($id); ?>" class="<?php if ((string)$id === '1') { p('active'); } ?>">
<a href="#"><?php p($name); ?></a>
</li>
<?php } ?>
- <li class="add-provider"><a href="#" class="button"><span class="icon-add"></span> <?php p($l->t('Add another provider')); ?></a></li>
+ <li class="add-provider"><a href="#" class="button"><span class="icon-add"></span> <?php p($l->t('Add identity provider')); ?></a></li>
</ul>
- <div id="user-saml-save-indicator" class="msg success inlineblock" style="display: none;"><?php p($l->t('Saved')); ?></div>
-
- <div id="user-saml-settings">
- <div id="user-saml-choose-type">
- <?php p($l->t('Please choose whether you want to authenticate using the SAML provider built-in in Nextcloud or whether you want to authenticate against an environment variable.')) ?>
- <br/>
- <button id="user-saml-choose-saml"><?php p($l->t('Use built-in SAML authentication')) ?></button>
- <button id="user-saml-choose-env"><?php p($l->t('Use environment variable')) ?></button>
- </div>
-
+ <div id="user-saml-settings" class="hidden">
- <div id="user-saml-general">
+ <div id="user-saml-general" class="hidden">
<h3><?php p($l->t('General')) ?></h3>
<?php foreach($_['general'] as $key => $attribute): ?>
- <?php if($attribute['type'] === 'checkbox'): ?>
+ <?php if($attribute['type'] === 'checkbox' && !$attribute['global']): ?>
<p>
<input type="checkbox" data-key="<?php p($key)?>" id="user-saml-general-<?php p($key)?>" name="<?php p($key)?>" value="<?php p(\OC::$server->getConfig()->getAppValue('user_saml', 'general-'.$key, '0')) ?>">
<label for="user-saml-general-<?php p($key)?>"><?php p($attribute['text']) ?></label><br/>
</p>
- <?php elseif($attribute['type'] === 'line'): ?>
+ <?php elseif($attribute['type'] === 'line' && !$attribute['global']): ?>
<p>
<input data-key="<?php p($key)?>" name="<?php p($key) ?>" value="<?php p(\OC::$server->getConfig()->getAppValue('user_saml', 'general-'.$key, '')) ?>" type="text" <?php if(isset($attribute['required']) && $attribute['required'] === true): ?>class="required"<?php endif;?> placeholder="<?php p($attribute['text']) ?>"/>
</p>
@@ -142,6 +158,7 @@ style('user_saml', 'admin');
</div>
</div>
+ <a data-js="remove-idp" class="button"><?php p($l->t('Remove identity provider')); ?></button>
<a href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('user_saml.SAML.getMetadata')) ?>" class="button"><?php p($l->t('Download metadata XML')) ?></a>
<span class="warning hidden" id="user-saml-settings-incomplete"><?php p($l->t('Metadata invalid')) ?></span>
<span class="success hidden" id="user-saml-settings-complete"><?php p($l->t('Metadata valid')) ?></span>