mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-05-03 09:33:46 +02:00
add reset button
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
parent
3f5fd1cdac
commit
5c07cc8f4e
|
@ -53,4 +53,8 @@
|
||||||
#user-saml .account-list li.active a {
|
#user-saml .account-list li.active a {
|
||||||
border-bottom: 1px solid #333;
|
border-bottom: 1px solid #333;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#user-saml-reset-settings {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
15
js/admin.js
15
js/admin.js
|
@ -41,6 +41,16 @@
|
||||||
OCP.AppConfig.setValue('user_saml', 'type', 'saml', {success: function() {location.reload();}});
|
OCP.AppConfig.setValue('user_saml', 'type', 'saml', {success: function() {location.reload();}});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
resetSettings: function() {
|
||||||
|
if (OC.PasswordConfirmation.requiresPasswordConfirmation()) {
|
||||||
|
OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.resetSettings, this));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
OCP.AppConfig.setValue('user_saml', 'type', '', {success: function() {location.reload();}});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
getConfigIdentifier: function() {
|
getConfigIdentifier: function() {
|
||||||
if (this.currentConfig === '1') {
|
if (this.currentConfig === '1') {
|
||||||
return '';
|
return '';
|
||||||
|
@ -155,6 +165,11 @@ $(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#user-saml-reset-settings').click(function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
OCA.User_SAML.Admin.resetSettings();
|
||||||
|
});
|
||||||
|
|
||||||
var switchProvider = function(providerId) {
|
var switchProvider = function(providerId) {
|
||||||
$('.account-list li').removeClass('active');
|
$('.account-list li').removeClass('active');
|
||||||
$('.account-list li[data-id="' + providerId + '"]').addClass('active');
|
$('.account-list li[data-id="' + providerId + '"]').addClass('active');
|
||||||
|
|
|
@ -166,6 +166,10 @@ style('user_saml', 'admin');
|
||||||
href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('user_saml.SAML.getMetadata', ['idp' => $_['providers'][0]['id']])) ?>" class="button">
|
href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('user_saml.SAML.getMetadata', ['idp' => $_['providers'][0]['id']])) ?>" class="button">
|
||||||
<?php p($l->t('Download metadata XML')) ?>
|
<?php p($l->t('Download metadata XML')) ?>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<button id="user-saml-reset-settings"><?php p($l->t('Reset settings')) ?></button>
|
||||||
|
|
||||||
|
|
||||||
<span class="warning hidden" id="user-saml-settings-incomplete"><?php p($l->t('Metadata invalid')) ?></span>
|
<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>
|
<span class="success hidden" id="user-saml-settings-complete"><?php p($l->t('Metadata valid')) ?></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue