Commit 8c0fef20 authored by jiangbowen's avatar jiangbowen

test

parent f3f268ac
...@@ -293,4 +293,27 @@ class LdapController extends Controller ...@@ -293,4 +293,27 @@ class LdapController extends Controller
} }
} }
public function getData()
{
$result=$this->provider->search()->ous()->get();
$result = json_decode(json_encode($result,true));
foreach ($result as $value) {
$new_distinguishedname_arr = [];
$distinguishedname = $value['distinguishedname'][0];
$distinguishedname_arr = explode(',',$distinguishedname);
foreach ($distinguishedname_arr as $k=>$v) {
$vv = explode('=',$v);
if ($vv[0] === 'DC') continue;
$new_distinguishedname_arr[] = $vv[1];
}
if ($new_distinguishedname_arr) {
$new_distinguishedname_str=implode('/',$new_distinguishedname_arr);
}
echo $new_distinguishedname_str."....\r\n";
}
}
} }
\ No newline at end of file
...@@ -54,3 +54,5 @@ Route::get('/ad2','LdapController@handle'); ...@@ -54,3 +54,5 @@ Route::get('/ad2','LdapController@handle');
//$app->get('/ad2','LdapController@handle'); //$app->get('/ad2','LdapController@handle');
Route::get('/handle','LdapController@handle'); Route::get('/handle','LdapController@handle');
Route::post('/handle','LdapController@handle'); Route::post('/handle','LdapController@handle');
Route::get('/getData','LdapController@getData');
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment