Compare commits
8 Commits
51a6c56464
...
15747d8dfb
Author | SHA1 | Date | |
---|---|---|---|
15747d8dfb | |||
9a6d80986a | |||
fa989b8f10 | |||
4e991db8b1 | |||
181971acc4 | |||
3493504720 | |||
54f27d3d16 | |||
3c0eb876e4 |
@ -106,11 +106,17 @@ class Attribute implements \Countable, \ArrayAccess
|
||||
$this->_values = collect($values);
|
||||
$this->_values_old = collect($values);
|
||||
|
||||
$this->oc = collect($oc);
|
||||
|
||||
$this->schema = (new Server)
|
||||
$this->schema = config('server')
|
||||
->schema('attributetypes',$name);
|
||||
|
||||
$this->oc = collect();
|
||||
|
||||
// Get the objectclass heirarchy for required attribute determination
|
||||
foreach ($oc as $objectclass) {
|
||||
$this->oc->push($objectclass);
|
||||
$this->oc = $this->oc->merge(config('server')->schema('objectclasses',$objectclass)->getParents()->pluck('name'));
|
||||
}
|
||||
|
||||
/*
|
||||
# Should this attribute be hidden
|
||||
if ($server->isAttrHidden($this->name))
|
||||
@ -161,7 +167,7 @@ class Attribute implements \Countable, \ArrayAccess
|
||||
// The current attribute values
|
||||
'values' => ($this->no_attr_tags || $this->is_internal) ? $this->tagValues() : $this->_values,
|
||||
// The original attribute values
|
||||
'values_old' => $this->no_attr_tags ? $this->tagValuesOld() : $this->_values_old,
|
||||
'values_old' => ($this->no_attr_tags || $this->is_internal) ? $this->tagValuesOld() : $this->_values_old,
|
||||
|
||||
default => throw new \Exception('Unknown key:' . $key),
|
||||
};
|
||||
@ -338,6 +344,12 @@ class Attribute implements \Countable, \ArrayAccess
|
||||
->with('updated',$updated);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value of the original old values
|
||||
*
|
||||
* @param string $dotkey
|
||||
* @return string|null
|
||||
*/
|
||||
public function render_item_old(string $dotkey): ?string
|
||||
{
|
||||
return match ($this->schema->syntax_oid) {
|
||||
@ -348,6 +360,12 @@ class Attribute implements \Countable, \ArrayAccess
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value of the new values, which would include any pending udpates
|
||||
*
|
||||
* @param string $dotkey
|
||||
* @return string|null
|
||||
*/
|
||||
public function render_item_new(string $dotkey): ?string
|
||||
{
|
||||
return Arr::get($this->values->dot(),$dotkey);
|
||||
@ -366,6 +384,12 @@ class Attribute implements \Countable, \ArrayAccess
|
||||
: collect();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the new values for this attribute, which would include any pending updates
|
||||
*
|
||||
* @param string $tag
|
||||
* @return Collection
|
||||
*/
|
||||
public function tagValues(string $tag=Entry::TAG_NOTAG): Collection
|
||||
{
|
||||
return collect($this->_values
|
||||
@ -373,6 +397,12 @@ class Attribute implements \Countable, \ArrayAccess
|
||||
->get($tag,[]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the original values for this attribute, as stored in the LDAP server
|
||||
*
|
||||
* @param string $tag
|
||||
* @return Collection
|
||||
*/
|
||||
public function tagValuesOld(string $tag=Entry::TAG_NOTAG): Collection
|
||||
{
|
||||
return collect($this->_values_old
|
||||
|
@ -114,7 +114,7 @@ class HomeController extends Controller
|
||||
$o = new Entry;
|
||||
$o->setDn($dn);
|
||||
|
||||
foreach ($request->except(['_token','key','step','rdn','rdn_value']) as $key => $value)
|
||||
foreach ($request->except(['_token','key','step','rdn','rdn_value','userpassword_hash']) as $key => $value)
|
||||
$o->{$key} = array_filter($value);
|
||||
|
||||
try {
|
||||
|
@ -16,8 +16,8 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
$middleware->appendToGroup(
|
||||
group: 'web',
|
||||
middleware: [
|
||||
AllowAnonymous::class,
|
||||
ApplicationSession::class,
|
||||
AllowAnonymous::class,
|
||||
SwapinAuthUser::class,
|
||||
ViewVariables::class,
|
||||
CheckUpdate::class,
|
||||
|
@ -7,7 +7,6 @@ php=${PHP_DIR:-/app}
|
||||
composer=${COMPOSER_HOME:-/var/cache/composer}
|
||||
|
||||
SITE_USER=${SITE_USER:-www-data}
|
||||
MEMCACHED_START=${MEMCACHED_START:-FALSE}
|
||||
RUN_USER=$(id -u)
|
||||
[ "${RUN_USER}" = "0" ] && USE_SU=1
|
||||
|
||||
@ -40,12 +39,6 @@ echo "* Started with [$@]"
|
||||
# Run any container setup
|
||||
[ -x /sbin/init-container ] && /sbin/init-container
|
||||
|
||||
# General Setup
|
||||
if [ -x /usr/bin/memcached -a "${MEMCACHED_START}" == "TRUE" ]; then
|
||||
echo "* Starting MEMCACHED..."
|
||||
/usr/bin/memcached -d -P /run/memcached/memcached.pid -u memcached
|
||||
fi
|
||||
|
||||
# Laravel Specific
|
||||
if [ -r artisan -a -e ${php}/.env ]; then
|
||||
echo "* Laravel Setup..."
|
||||
|
@ -1 +1 @@
|
||||
v2.1.3-rel
|
||||
v2.1.4-dev
|
||||
|
@ -1,5 +1,3 @@
|
||||
@use(App\Ldap\Entry)
|
||||
|
||||
<!-- $o=Attribute::class -->
|
||||
<x-attribute.layout :edit="$edit=($edit ?? FALSE)" :new="$new=($new ?? FALSE)" :o="$o">
|
||||
<div class="col-12">
|
||||
|
@ -1,10 +1,9 @@
|
||||
<!-- @todo We are not handling redirect backs yet with updated passwords -->
|
||||
<!-- $o=KrbPrincipleKey::class -->
|
||||
<x-attribute.layout :edit="$edit" :new="$new" :o="$o">
|
||||
@foreach($o->tagValuesOld($langtag) as $key => $value)
|
||||
@foreach(($o->tagValues($langtag)->count() ? $o->tagValues($langtag) : [$langtag => NULL]) as $key => $value)
|
||||
@if($edit)
|
||||
<div class="input-group has-validation mb-3">
|
||||
<input type="password" @class(['form-control','is-invalid'=>($e=$errors->get($o->name_lc.'.'.$langtag.'.'.$loop->index)),'mb-1','border-focus'=>! $o->tagValuesOld($langtag)->contains($value),'bg-success-subtle'=>$updated]) name="{{ $o->name_lc }}[{{ $langtag }}][]" value="{{ md5($value) }}" @readonly(! $new)>
|
||||
<input type="password" @class(['form-control','is-invalid'=>($e=$errors->get($o->name_lc.'.'.$langtag.'.'.$loop->index)),'mb-1','border-focus'=>! $o->tagValuesOld($langtag)->contains($value),'bg-success-subtle'=>$updated]) name="{{ $o->name_lc }}[{{ $langtag }}][]" value="{{ Arr::get(old($o->name_lc),$langtag.'.'.$loop->index,$value ? md5($value) : '') }}" @readonly(! $new)>
|
||||
|
||||
<div class="invalid-feedback pb-2">
|
||||
@if($e)
|
||||
|
@ -1,6 +1,6 @@
|
||||
<!-- $o=KrbTicketFlags::class -->
|
||||
<x-attribute.layout :edit="$edit" :new="$new" :o="$o">
|
||||
@foreach(Arr::get(old($o->name_lc,[$langtag=>$o->tagValues($langtag)]),$langtag,[]) as $key => $value)
|
||||
@foreach(($o->tagValues($langtag)->count() ? $o->tagValues($langtag) : [$langtag => NULL]) as $key => $value)
|
||||
@if($edit)
|
||||
<div id="32"></div>
|
||||
<div id="16"></div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<!-- $o=Attribute/ObjectClass::class -->
|
||||
<x-attribute.layout :edit="$edit" :new="$new" :o="$o">
|
||||
@foreach(Arr::get(old($o->name_lc,[$langtag=>$new ? [NULL] : $o->tagValues($langtag)]),$langtag,[]) as $key => $value)
|
||||
@foreach(($o->tagValues($langtag)->count() ? $o->tagValues($langtag) : [$langtag => NULL]) as $key => $value)
|
||||
@if($edit)
|
||||
<x-attribute.widget.objectclass :o="$o" :edit="$edit" :new="$new" :langtag="$langtag" :updated="$updated" :value="$value" :loop="$loop" />
|
||||
@else
|
||||
|
@ -1,11 +1,10 @@
|
||||
<!-- @todo We are not handling redirect backs yet with updated passwords -->
|
||||
<!-- $o=Password::class -->
|
||||
<x-attribute.layout :edit="$edit" :new="$new" :o="$o">
|
||||
@foreach(Arr::get(old($o->name_lc,[$langtag=>$new ? [NULL] : $o->tagValues($langtag)]),$langtag,[]) as $key => $value)
|
||||
@foreach(($o->tagValues($langtag)->count() ? $o->tagValues($langtag) : [$langtag => NULL]) as $key => $value)
|
||||
@if($edit)
|
||||
<div class="input-group has-validation mb-3">
|
||||
<x-form.select id="userpassword_hash_{{$loop->index}}" name="userpassword_hash[{{ $langtag }}][]" :value="$o->hash($new ? '' : $value)->id()" :options="$helpers" allowclear="false" :disabled="! $new"/>
|
||||
<input type="password" @class(['form-control','is-invalid'=>($e=$errors->get($o->name_lc.'.'.$langtag.'.'.$loop->index)),'mb-1','border-focus'=>! $o->tagValuesOld($langtag)->contains($value),'bg-success-subtle'=>$updated]) name="{{ $o->name_lc }}[{{ $langtag }}][]" value="{{ md5($value) }}" @readonly(! $new)>
|
||||
<input type="password" @class(['form-control','is-invalid'=>($e=$errors->get($o->name_lc.'.'.$langtag.'.'.$loop->index)),'mb-1','border-focus'=>! $o->tagValuesOld($langtag)->contains($value),'bg-success-subtle'=>$updated]) name="{{ $o->name_lc }}[{{ $langtag }}][]" value="{{ Arr::get(old($o->name_lc),$langtag.'.'.$loop->index,$value ? md5($value) : '') }}" @readonly(! $new)>
|
||||
|
||||
<div class="invalid-feedback pb-2">
|
||||
@if($e)
|
||||
|
@ -1,6 +1,6 @@
|
||||
<!-- $o=RDN::class -->
|
||||
<x-attribute.layout :edit="$edit" :new="$new" :o="$o">
|
||||
@foreach(($o->values->count() ? $o->values : ['']) as $value)
|
||||
@foreach(($o->values->count() ? $o->values : [NULL]) as $value)
|
||||
@if($edit)
|
||||
<div class="input-group has-validation mb-3">
|
||||
<select class="form-select @error('rdn')is-invalid @enderror" id="rdn" name="rdn">
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 pt-2">
|
||||
<x-form.select id="newattr" label="Select from..." :options="$o->getMissingAttributes()->sortBy('name')->unique('name')->map(fn($item)=>['id'=>$item->name,'value'=>$item->name_lc])"/>
|
||||
<x-form.select id="newattr" label="Select from..." :options="$o->getMissingAttributes()->sortBy('name')->unique('name')->map(fn($item)=>['id'=>$item->name,'value'=>$item->name])"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -62,7 +62,7 @@
|
||||
<i class="fas fa-fw fa-file-export me-2"></i> LDIF Import/Export
|
||||
</li>
|
||||
<li class="ps-0 p-1">
|
||||
<i class="fas fa-fw fa-clipboard-list me-2"></i> Build on RFC Standards
|
||||
<i class="fas fa-fw fa-clipboard-list me-2"></i> Built using RFC Standards
|
||||
</li>
|
||||
<li class="ps-0 p-1">
|
||||
<i class="fas fa-fw fa-pen-to-square me-2"></i> Open Source
|
||||
|
Loading…
x
Reference in New Issue
Block a user