mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-04-27 14:54:53 +02:00
Add hint whether settings may work
Fixes https://github.com/nextcloud/user_saml/issues/14
This commit is contained in:
parent
53b182990c
commit
1160b2c874
16
js/admin.js
16
js/admin.js
|
@ -70,6 +70,22 @@ $(function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#user-saml').change(function() {
|
||||||
|
// Checks on each request whether the settings make sense or not
|
||||||
|
$.ajax({
|
||||||
|
url: OC.generateUrl('/apps/user_saml/saml/metadata'),
|
||||||
|
type: 'GET'
|
||||||
|
}).fail(function (e) {
|
||||||
|
if(e.status === 500) {
|
||||||
|
$('#user-saml-settings-complete').addClass('hidden');
|
||||||
|
$('#user-saml-settings-incomplete').removeClass('hidden');
|
||||||
|
}
|
||||||
|
}).success(function (e) {
|
||||||
|
$('#user-saml-settings-complete').removeClass('hidden');
|
||||||
|
$('#user-saml-settings-incomplete').addClass('hidden');
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
$('#user-saml-settings .toggle').on('click', function() {
|
$('#user-saml-settings .toggle').on('click', function() {
|
||||||
var el = $(this),
|
var el = $(this),
|
||||||
nextSibling = el.parent().next(),
|
nextSibling = el.parent().next(),
|
||||||
|
|
|
@ -80,7 +80,7 @@ style('user_saml', 'admin');
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('user_saml.SAML.getMetadata')) ?>" class="button"><?php p($l->t('Download metadata XML')) ?></a>
|
<a href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('user_saml.SAML.getMetadata')) ?>" class="button"><?php p($l->t('Download metadata XML')) ?></a>
|
||||||
<!-- FIXME: Add test settings -->
|
<span class="warning hidden" id="user-saml-settings-incomplete"><?php p($l->t('Metadata invalid')) ?></span>
|
||||||
<a class="button"><?php p($l->t('Test settings')) ?></a>
|
<span class="success hidden" id="user-saml-settings-complete"><?php p($l->t('Metadata valid')) ?></span>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in a new issue