diff --git a/resources/views/components/attribute/password.blade.php b/resources/views/components/attribute/password.blade.php
index 895dc168..943f4b6b 100644
--- a/resources/views/components/attribute/password.blade.php
+++ b/resources/views/components/attribute/password.blade.php
@@ -23,7 +23,7 @@
-
+
diff --git a/resources/views/frames/dn.blade.php b/resources/views/frames/dn.blade.php
index 0140ace0..c0c6949c 100644
--- a/resources/views/frames/dn.blade.php
+++ b/resources/views/frames/dn.blade.php
@@ -113,42 +113,6 @@
-
- @if($up=$o->getObject('userpassword'))
-
-
- @endif
@endsection
@section('page-scripts')
@@ -254,7 +218,7 @@
that = $('#entry_export');
$.ajax({
- type: 'GET',
+ method: 'GET',
url: '{{ url('entry/export') }}/'+dn,
cache: false,
beforeSend: function() {
@@ -276,68 +240,30 @@
})
break;
+ case 'entry-userpassword-check':
+ $.ajax({
+ method: 'GET',
+ url: '{{ url('modal/userpassword-check') }}/'+dn,
+ dataType: 'html',
+ cache: false,
+ beforeSend: function() {
+ that.empty().append('');
+ },
+ success: function(data) {
+ that.empty().html(data);
+ },
+ error: function(e) {
+ if (e.status !== 412)
+ alert('That didnt work? Please try again....');
+ },
+ })
+ break;
+
default:
console.log('No action for button:'+$(item.relatedTarget).attr('id'));
}
});
- @if($up)
- $('button[id=userpassword_check-submit]').on('click',function(item) {
- var that = $(this);
-
- var passwords = $('#userpassword_check-modal')
- .find('input[name^="password["')
- .map((key,item)=>item.value);
-
- if (passwords.length === 0) return false;
-
- $.ajax({
- type: 'POST',
- beforeSend: function() {
- // Disable submit, add spinning icon
- that.prop('disabled',true);
- that.find('i').removeClass('d-none');
- },
- complete: function() {
- that.prop('disabled',false);
- that.find('i').addClass('d-none');
- },
- success: function(data) {
- data.forEach(function(item,key) {
- var i = $('#userpassword_check-modal')
- .find('input[name="password['+key+']')
- .siblings('i');
-
- var feedback = $('#userpassword_check-modal')
- .find('input[name="password['+key+']')
- .siblings('div.invalid-feedback');
-
- if (item === 'OK') {
- i.removeClass('text-danger').addClass('text-success').removeClass('fa-lock').addClass('fa-lock-open');
- if (feedback.is(':visible'))
- feedback.hide();
- } else {
- i.removeClass('text-success').addClass('text-danger').removeClass('fa-lock-open').addClass('fa-lock');
- if (! feedback.is(':visible'))
- feedback.show();
- }
- })
- },
- error: function(e) {
- if (e.status !== 412)
- alert('That didnt work? Please try again....');
- },
- url: '{{ url('entry/password/check') }}',
- data: {
- dn: dn,
- password: Array.from(passwords),
- },
- dataType: 'json',
- cache: false
- })
- });
- @endif
-
@if(old())
editmode();
@endif
diff --git a/resources/views/modals/entry-export.blade.php b/resources/views/modals/entry-export.blade.php
index ac507950..5c0eab5b 100644
--- a/resources/views/modals/entry-export.blade.php
+++ b/resources/views/modals/entry-export.blade.php
@@ -10,10 +10,10 @@
-
\ No newline at end of file
diff --git a/routes/web.php b/routes/web.php
index 8498ca0f..02b66e68 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -55,5 +55,6 @@ Route::controller(HomeController::class)->group(function() {
Route::view('modal/delete/{dn}','modals.entry-delete');
Route::view('modal/export/{dn}','modals.entry-export');
+ Route::view('modal/userpassword-check/{dn}','modals.entry-userpassword-check');
});
});
\ No newline at end of file