2020-08-20 12:33:13 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
2020-09-13 11:30:04 +00:00
|
|
|
use Illuminate\Support\Facades\Crypt;
|
2020-08-20 12:33:13 +00:00
|
|
|
|
2020-08-23 02:30:18 +00:00
|
|
|
use App\Classes\LDAP\Server;
|
2020-08-22 12:26:06 +00:00
|
|
|
|
2020-08-20 12:33:13 +00:00
|
|
|
class HomeController extends Controller
|
|
|
|
{
|
2020-08-22 12:26:06 +00:00
|
|
|
public function home() {
|
2020-08-23 02:30:18 +00:00
|
|
|
$o = new Server;
|
2020-08-22 12:26:06 +00:00
|
|
|
|
|
|
|
return view('home')
|
2020-09-13 11:30:04 +00:00
|
|
|
->with('server',config('ldap.connections.default.name'))
|
|
|
|
->with('bases',$o->getBaseDN()->transform(function($item) {
|
|
|
|
return [
|
|
|
|
'title'=>$item,
|
|
|
|
'item'=>Crypt::encryptString($item),
|
|
|
|
'lazy'=>TRUE,
|
|
|
|
'icon'=>'fa-fw fas fa-sitemap',
|
|
|
|
'tooltip'=>$item,
|
|
|
|
];
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function render(Request $request) {
|
|
|
|
$dn = Crypt::decryptString($request->post('key'));
|
|
|
|
|
|
|
|
return view('widgets.dn')
|
|
|
|
->with('dn',$dn)
|
|
|
|
->with('leaf',(new Server())->fetch($dn));
|
2020-08-22 12:26:06 +00:00
|
|
|
}
|
2020-08-20 12:33:13 +00:00
|
|
|
}
|