Compare commits

...

5 Commits

Author SHA1 Message Date
460e4762d8 Revert version to 2.1.0-dev
All checks were successful
Create Docker Image / Test Application (x86_64) (push) Successful in 30s
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 1m24s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 4m33s
Create Docker Image / Final Docker Image Manifest (push) Successful in 8s
2025-04-06 22:50:46 +10:00
f41b484dc4 More ldap configuration settings for demo ldap environment.
Should help when working on #10, #89, #287.
2025-04-06 22:50:46 +10:00
855d7ae75c Move entry-edit javascript out of architect theme 2025-04-06 22:50:46 +10:00
ffa8cdc826 Fix User Password Check now that we have attribute tags 2025-04-06 22:50:46 +10:00
8f39603f9f Improved determination of attribute object being dirty, improved detection of blank input and processing
All checks were successful
Create Docker Image / Test Application (x86_64) (push) Successful in 30s
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 1m36s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 4m34s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s
2025-04-06 19:33:04 +10:00
13 changed files with 75 additions and 32 deletions

View File

@ -253,10 +253,9 @@ class Attribute implements \Countable, \ArrayAccess
*/
public function isDirty(): bool
{
return (($a=$this->values_old->dot())->keys()->count() !== ($b=$this->values->dot())->keys()->count())
|| ($a->values()->count() !== $b->values()->count())
|| ($a->keys()->diff($b->keys())->count() !== 0)
|| ($a->values()->diff($b->values())->count() !== 0);
return (($a=$this->values_old->dot()->filter())->keys()->count() !== ($b=$this->values->dot()->filter())->keys()->count())
|| ($a->count() !== $b->count())
|| ($a->diff($b)->count() !== 0);
}
/**

View File

@ -236,7 +236,7 @@ class HomeController extends Controller
$password = $o->getObject('userpassword');
$result = collect();
foreach ($password as $key => $value) {
foreach ($password->values->dot() as $key => $value) {
$hash = $password->hash($value);
$compare = Arr::get($request->password,$key);
//Log::debug(sprintf('comparing [%s] with [%s] type [%s]',$value,$compare,$hash::id()),['object'=>$hash]);
@ -349,7 +349,7 @@ class HomeController extends Controller
return Redirect::to('/')
->withInput()
->with('updated',collect($dirty)->map(fn($key,$item)=>$o->getObject($item)));
->with('updated',collect($dirty)->map(fn($item,$key)=>$o->getObject(collect(explode(';',$key))->first())));
}
/**
@ -376,7 +376,7 @@ class HomeController extends Controller
// If we are rendering a DN, rebuild our object
$o = config('server')->fetch($key['dn']);
foreach (collect(old())->except(['key','step','_token','userpassword_hash']) as $attr => $value)
foreach (collect(old())->except(['key','dn','step','_token','userpassword_hash']) as $attr => $value)
$o->{$attr} = $value;
return match ($key['cmd']) {

View File

@ -1 +1 @@
v2.0.3-rel
v2.1.0-dev

View File

@ -17,19 +17,4 @@
@yield('page_actions')
</div>
</div>
</div>
@section('page-scripts')
<script type="text/javascript">
$(document).ready(function() {
$('button[id=entry-edit]').on('click',function(item) {
item.preventDefault();
if ($(this).hasClass('btn-dark'))
return;
editmode();
});
});
</script>
@append
</div>

View File

@ -5,7 +5,7 @@
<p>{{ __('Entry updated') }}</p>
<ul style="list-style-type: square;">
@foreach (session()->pull('updated') as $key => $o)
<li><abbr title="{{ $o->description }}">{{ $o->name }}</abbr>: {{ $o->values->map(fn($item,$key)=>$o->render_item_new($key))->join(',') }}</li>
<li><abbr title="{{ $o->description }}">{{ $o->name }}</abbr>: {{ $o->values->dot()->filter()->join(',') }}</li>
@endforeach
</ul>
</div>

View File

@ -210,6 +210,15 @@
}
$(document).ready(function() {
$('button[id=entry-edit]').on('click',function(item) {
item.preventDefault();
if ($(this).hasClass('btn-dark'))
return;
editmode();
});
$('#newattr').on('change',function(item) {
$.ajax({
type: 'POST',

View File

@ -7,12 +7,12 @@
<div class="modal-body">
<table class="table table-bordered p-1">
@foreach(($up=$o->getObject('userpassword'))->values as $key => $value)
@foreach(($up=$o->getObject('userpassword'))->values->dot() as $dotkey => $value)
<tr>
<th>Check</th>
<td>{{ $up->render_item_old($key) }}</td>
<td>{{ $up->render_item_old($dotkey) }}</td>
<td>
<input type="password" style="width: 90%" name="password[{{$key}}]"> <i class="fas fa-fw fa-lock"></i>
<input type="password" style="width: 90%" name="password[{{ $dotkey }}]"> <i class="fas fa-fw fa-lock"></i>
<div class="invalid-feedback pb-2">
@lang('Invalid Password')
</div>

View File

@ -50,8 +50,12 @@
{{ $dotkey }}
</th>
<td>{{ (($r=$oo->render_item_old($dotkey)) !== NULL) ? $r : '['.strtoupper(__('New Value')).']' }}</td>
<td>{{ (($r=$oo->render_item_new($dotkey)) !== NULL) ? $r : '['.strtoupper(__('Deleted')).']' }}<input type="hidden" name="{{ $key }}[{{ collect(explode('.',$dotkey))->first() }}][]" value="{{ Arr::get($oo,$dotkey) }}"></td>
@if((! Arr::get($oo->values_old->dot(),$dotkey)) && (! Arr::get($oo->values->dot(),$dotkey)))
<td colspan="2" class="text-center">@lang('Ignoring blank value')</td>
@else
<td>{{ (($r=$oo->render_item_old($dotkey)) !== NULL) ? $r : '['.strtoupper(__('New Value')).']' }}</td>
<td>{{ (($r=$oo->render_item_new($dotkey)) !== NULL) ? $r : '['.strtoupper(__('Deleted')).']' }}<input type="hidden" name="{{ $key }}[{{ collect(explode('.',$dotkey))->first() }}][]" value="{{ Arr::get($oo,$dotkey) }}"></td>
@endif
@endforeach
</tr>
@endforeach

View File

@ -1,7 +1,6 @@
dn: cn=tech_staff,dc=example.com
cn: tech_staff
labeleduri: ldap:///ou=People,o=Simpsons?uid?one?(&(sn=Simpson)(|(uidNumber
=1000)(uidNumber=1001)))
labeleduri: ldap:///dc=example.com?uid?one?(|(cn=kerberos)(uidNumber=*))
objectclass: nisMailAlias
objectclass: labeledURIObject

View File

@ -0,0 +1,7 @@
dn: olcDatabase={0}config,cn=config
changetype: modify
add: olcRootPW
olcRootPW:: c2VjcmV0
add: olcRootDN
olcRootDN: cn=config

View File

@ -0,0 +1,25 @@
dn: olcDatabase={3}mdb,cn=config
changetype: modify
add: olcDbMaxSize
olcDbMaxSize: 1073741824
dn: olcDatabase={4}mdb,cn=config
changetype: modify
add: olcDbMaxSize
olcDbMaxSize: 1073741824
dn: olcDatabase={5}mdb,cn=config
changetype: modify
add: olcDbMaxSize
olcDbMaxSize: 1073741824
dn: olcDatabase={6}mdb,cn=config
changetype: modify
add: olcDbMaxSize
olcDbMaxSize: 1073741824
dn: olcDatabase={7}mdb,cn=config
changetype: modify
add: olcDbMaxSize
olcDbMaxSize: 1073741824

View File

@ -0,0 +1,4 @@
dn: olcDatabase={4}mdb,cn=config
changetype: modify
add: olcSizeLimit
olcSizeLimit: 2000

View File

@ -0,0 +1,11 @@
dn: olcOverlay=dynlist,olcDatabase={4}mdb,cn=config
changetype: add
objectClass: olcOverlayConfig
objectClass: olcDynListConfig
olcOverlay: dynlist
olcDynListAttrSet: nisMailAlias labeledURI
#olcDynListAttrSet: groupOfURLs memberURL memberOf
#olcDynListAttrSet: groupOfURLs memberURL member+dgMemberOf
#olcDynListAttrSet: groupOfURLs memberURL member
#olcDynListAttrSet: groupOfURLs memberURL member
#olcDynListAttrSet: groupOfURLs labeledURI member