Fix showing DN icon for RootDSE, fix readme git clone

This commit is contained in:
Deon George 2021-03-02 22:19:00 +11:00
parent 851010d6d5
commit 48131c1b4e
4 changed files with 10 additions and 4 deletions

View File

@ -57,7 +57,7 @@ In summary, for the time being, expect `master` to be buggy and broken, and I'll
#### Installation #### Installation
1. Checkout the code from github 1. Checkout the code from github
```bash ```bash
git checkout https://github.com/leenooks/phpLDAPadmin.git git clone https://github.com/leenooks/phpLDAPadmin.git
``` ```
1. Install composer dependencies. 1. Install composer dependencies.

View File

@ -34,8 +34,10 @@ class HomeController extends Controller
public function info() public function info()
{ {
$root = (new Entry)->rootDSE();
try { try {
$attrs = collect((new Entry)->rootDSE()->getAttributes()) $attrs = collect($root->getAttributes())
->transform(function($item,$key) { ->transform(function($item,$key) {
foreach ($item as $k=>$v) { foreach ($item as $k=>$v) {
if (preg_match('/[0-9]+\.[0-9]+\.[0-9]+/',$v)) { if (preg_match('/[0-9]+\.[0-9]+\.[0-9]+/',$v)) {
@ -59,6 +61,7 @@ class HomeController extends Controller
return view('widgets.dn') return view('widgets.dn')
->with('dn',__('Server Info')) ->with('dn',__('Server Info'))
->with('leaf',$root)
->with('attributes',$this->sortAttrs($attrs)); ->with('attributes',$this->sortAttrs($attrs));
} }
@ -68,7 +71,7 @@ class HomeController extends Controller
return view('widgets.dn') return view('widgets.dn')
->with('dn',$dn) ->with('dn',$dn)
->with('leaf',$x=(new Server())->fetch($dn)) ->with('leaf',$x=(new Server)->fetch($dn))
->with('attributes',$x ? $this->sortAttrs(collect($x->getAttributes())) : []); ->with('attributes',$x ? $this->sortAttrs(collect($x->getAttributes())) : []);
} }

View File

@ -102,6 +102,9 @@ class Entry extends Model
elseif (in_array('server',$objectclasses)) elseif (in_array('server',$objectclasses))
return 'fas fa-server'; return 'fas fa-server';
elseif (in_array('openldaprootdse',$objectclasses))
return 'fas fa-info';
// Default // Default
return 'fa-fw fas fa-cog'; return 'fa-fw fas fa-cog';
} }

View File

@ -7,7 +7,7 @@
{{ $leaf->entryuuid[0] ?? '' }} {{ $leaf->entryuuid[0] ?? '' }}
@endsection @endsection
@section('page_icon') @section('page_icon')
{{ $leaf->icon() }} {{ $leaf->icon() ?? 'fas fa-info' }}
@endsection @endsection
@section('main-content') @section('main-content')