Ported the schema browser
This commit is contained in:
@@ -34,4 +34,31 @@ class APIController extends Controller
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function schema_view(Request $request)
|
||||
{
|
||||
$server = new Server;
|
||||
|
||||
switch($request->type) {
|
||||
case 'objectclasses':
|
||||
return view('frames.schema.objectclasses')
|
||||
->with('objectclasses',$server->schema('objectclasses')->sortBy(function($item) { return strtolower($item->name); }));
|
||||
|
||||
case 'attributetypes':
|
||||
return view('frames.schema.attributetypes')
|
||||
->with('server',$server)
|
||||
->with('attributetypes',$server->schema('attributetypes')->sortBy(function($item) { return strtolower($item->name); }));
|
||||
|
||||
case 'ldapsyntaxes':
|
||||
return view('frames.schema.ldapsyntaxes')
|
||||
->with('ldapsyntaxes',$server->schema('ldapsyntaxes')->sortBy(function($item) { return strtolower($item->description); }));
|
||||
|
||||
case 'matchingrules':
|
||||
return view('frames.schema.matchingrules')
|
||||
->with('matchingrules',$server->schema('matchingrules')->sortBy(function($item) { return strtolower($item->name); }));
|
||||
|
||||
default:
|
||||
abort(404);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use LdapRecord\Models\ModelNotFoundException;
|
||||
use LdapRecord\Query\ObjectNotFoundException;
|
||||
|
||||
use App\Ldap\Entry;
|
||||
use App\Classes\LDAP\Server;
|
||||
@@ -49,7 +49,7 @@ class HomeController extends Controller
|
||||
* LDAP Server INFO
|
||||
*
|
||||
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
|
||||
* @throws ModelNotFoundException
|
||||
* @throws ObjectNotFoundException
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
@@ -74,7 +74,7 @@ class HomeController extends Controller
|
||||
});
|
||||
|
||||
// @todo If we cant get server info, we should probably show a nice error dialog
|
||||
} catch (ModelNotFoundException $e) {
|
||||
} catch (ObjectNotFoundException $e) {
|
||||
$attrs = collect();
|
||||
}
|
||||
|
||||
@@ -98,6 +98,11 @@ class HomeController extends Controller
|
||||
->with('dn',$dn);
|
||||
}
|
||||
|
||||
public function schema_frame()
|
||||
{
|
||||
return view('frames.schema');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the attributes
|
||||
*
|
||||
|
Reference in New Issue
Block a user