Compare commits
2 Commits
2b365ef258
...
302f3f2f4e
Author | SHA1 | Date | |
---|---|---|---|
302f3f2f4e | |||
ab7bd88303 |
@ -29,7 +29,7 @@ class HomeController extends Controller
|
|||||||
{
|
{
|
||||||
private const LOGKEY = 'CHc';
|
private const LOGKEY = 'CHc';
|
||||||
|
|
||||||
private const INTERNAL_POST = ['_auto_value','_key','_rdn','_rdn_value','_step','_template','_token','_userpassword_hash'];
|
private const INTERNAL_POST = ['_auto_value','_key','_rdn','_rdn_new','_rdn_value','_step','_template','_token','_userpassword_hash'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new object in the LDAP server
|
* Create a new object in the LDAP server
|
||||||
@ -206,7 +206,7 @@ class HomeController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Redirect::to('/')
|
return Redirect::to('/')
|
||||||
->with('success',[sprintf('%s: %s',__('Deleted'),$dn)]);
|
->with('success',sprintf('%s: %s',__('Deleted'),$dn));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function entry_export(Request $request,string $id): \Illuminate\View\View
|
public function entry_export(Request $request,string $id): \Illuminate\View\View
|
||||||
@ -298,7 +298,7 @@ class HomeController extends Controller
|
|||||||
$request->get('_userpassword_hash'));
|
$request->get('_userpassword_hash'));
|
||||||
|
|
||||||
if (! $o->getDirty())
|
if (! $o->getDirty())
|
||||||
return back()
|
return Redirect::back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('note',__('No attributes changed'));
|
->with('note',__('No attributes changed'));
|
||||||
|
|
||||||
@ -310,17 +310,17 @@ class HomeController extends Controller
|
|||||||
public function entry_rename(Request $request): \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
public function entry_rename(Request $request): \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||||
{
|
{
|
||||||
$from_dn = Crypt::decryptString($request->post('dn'));
|
$from_dn = Crypt::decryptString($request->post('dn'));
|
||||||
Log::info(sprintf('%s:Renaming [%s] to [%s]',self::LOGKEY,$from_dn,$request->post('new_rdn')));
|
Log::info(sprintf('%s:Renaming [%s] to [%s]',self::LOGKEY,$from_dn,$request->post('_rdn_new')));
|
||||||
|
|
||||||
$o = config('server')->fetch($from_dn);
|
$o = config('server')->fetch($from_dn);
|
||||||
|
|
||||||
if (! $o)
|
if (! $o)
|
||||||
return back()
|
return Redirect::back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('note',__('DN doesnt exist'));
|
->with('note',__('DN doesnt exist'));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$o->rename($request->post('new_rdn'));
|
$o->rename($request->post('_rdn_new'));
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return Redirect::to('/')
|
return Redirect::to('/')
|
||||||
@ -328,7 +328,8 @@ class HomeController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Redirect::to('/')
|
return Redirect::to('/')
|
||||||
->with('success',[__('Entry renamed')]);
|
->withInput(['_key'=>Crypt::encryptString('*dn|'.$o->getDN())])
|
||||||
|
->with('success',sprintf('%s: %s',__('Entry renamed'),$from_dn));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -350,7 +351,7 @@ class HomeController extends Controller
|
|||||||
$o->{$key} = array_filter($value);
|
$o->{$key} = array_filter($value);
|
||||||
|
|
||||||
if (! $dirty=$o->getDirty())
|
if (! $dirty=$o->getDirty())
|
||||||
return back()
|
return Redirect::back()
|
||||||
->withInput()
|
->withInput()
|
||||||
->with('note',__('No attributes changed'));
|
->with('note',__('No attributes changed'));
|
||||||
|
|
||||||
@ -529,8 +530,8 @@ class HomeController extends Controller
|
|||||||
// Setup
|
// Setup
|
||||||
$cmd = NULL;
|
$cmd = NULL;
|
||||||
$dn = NULL;
|
$dn = NULL;
|
||||||
$key = $request->get('_key',old('_key'))
|
$key = ($x=$request->get('_key',old('_key')))
|
||||||
? Crypt::decryptString($request->get('_key',old('_key')))
|
? Crypt::decryptString($x)
|
||||||
: NULL;
|
: NULL;
|
||||||
|
|
||||||
// Determine if our key has a command
|
// Determine if our key has a command
|
||||||
@ -542,9 +543,9 @@ class HomeController extends Controller
|
|||||||
$dn = ($m[2] !== '_NOP') ? $m[2] : NULL;
|
$dn = ($m[2] !== '_NOP') ? $m[2] : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif (old('dn',$request->get('_key'))) {
|
} elseif ($x=old('dn',$request->get('_key'))) {
|
||||||
$cmd = 'dn';
|
$cmd = 'dn';
|
||||||
$dn = Crypt::decryptString(old('dn',$request->get('_key')));
|
$dn = Crypt::decryptString($x);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['cmd'=>$cmd,'dn'=>$dn];
|
return ['cmd'=>$cmd,'dn'=>$dn];
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
@if(session()->has('success'))
|
@if(session()->has('success'))
|
||||||
<div class="alert alert-success">
|
<div class="alert alert-success p-2">
|
||||||
<h4 class="alert-heading"><i class="fas fa-fw fa-thumbs-up"></i> Success!</h4>
|
<p class="m-0"><i class="fas fa-fw fa-thumbs-up"></i> {{ session()->pull('success') }}</p>
|
||||||
<hr>
|
|
||||||
<ul class="square">
|
|
||||||
@foreach(session()->get('success') as $item)
|
|
||||||
<li>{{ $item }}</li>
|
|
||||||
@endforeach
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
@ -52,9 +52,10 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
<x-success/>
|
||||||
|
<x-updated/>
|
||||||
<x-note/>
|
<x-note/>
|
||||||
<x-error/>
|
<x-error/>
|
||||||
<x-updated/>
|
|
||||||
<x-failed/>
|
<x-failed/>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<label for="rdn" class="form-label">@lang('New RDN')</label>
|
<label for="rdn" class="form-label">@lang('New RDN')</label>
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<input type="text" id="rdn" name="new_rdn" class="form-control w-25" placeholder="{{ $rdn=collect(explode(',',$x))->first() }}" value="{{ $rdn }}">
|
<input type="text" id="rdn" name="_rdn_new" class="form-control w-25" placeholder="{{ $rdn=collect(explode(',',$x))->first() }}" value="{{ $rdn }}">
|
||||||
<span class="input-group-text" id="label">{{ collect(explode(',',$x))->skip(1)->join(',') }}</span>
|
<span class="input-group-text" id="label">{{ collect(explode(',',$x))->skip(1)->join(',') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user