Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncAD
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
江博文
syncAD
Commits
22c2894b
Commit
22c2894b
authored
Jan 27, 2022
by
jiangbowen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test conn
parent
b12dbe09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
24 deletions
+21
-24
LdapController.php
app/Http/Controllers/LdapController.php
+21
-24
No files found.
app/Http/Controllers/LdapController.php
View file @
22c2894b
...
@@ -51,7 +51,7 @@ class LdapController extends Controller
...
@@ -51,7 +51,7 @@ class LdapController extends Controller
$data
=
[
$data
=
[
'operation_type'
=>
'dept'
,
'operation_type'
=>
'dept'
,
'operation'
=>
'edit'
,
'operation'
=>
'edit'
,
'data'
=>
[
'产品技术中心/测试部'
=>
'产品技术中心/测试部
2
'
]
'data'
=>
[
'产品技术中心/测试部'
=>
'产品技术中心/测试部
3
'
]
];
];
// var_dump($data);
// var_dump($data);
if
(
$data
[
'operation_type'
]
==
'emp'
)
{
if
(
$data
[
'operation_type'
]
==
'emp'
)
{
...
@@ -195,29 +195,26 @@ class LdapController extends Controller
...
@@ -195,29 +195,26 @@ class LdapController extends Controller
if
(
empty
(
$data
))
return
;
if
(
empty
(
$data
))
return
;
foreach
(
$data
as
$key
=>
$value
)
{
foreach
(
$data
as
$key
=>
$value
)
{
if
(
$key
===
$value
)
continue
;
if
(
$key
===
$value
)
continue
;
$handleData
[]
=
$value
;
$depts
=
explode
(
'/'
,
$key
);
//ɾ��֮ǰ��bu
$hou_depts
=
explode
(
'/'
,
$value
);
$depts
=
array_reverse
(
$depts
);
// $depts=explode('/',$key);
$hou_depts
=
array_reverse
(
$hou_depts
);
// $hou_depts = explode('/',$value);
foreach
(
$depts
as
$k
=>
$v
)
{
// $depts=array_reverse($depts);
$ous
[]
=
"ou=
{
$v
}
"
;
// $hou_depts=array_reverse($hou_depts);
}
// foreach ($depts as $k => $v) {
foreach
(
$hou_depts
as
$k
=>
$v
)
{
// $ous[] = "ou={$v}";
$hou_ous
[]
=
"ou=
{
$v
}
"
;
// }
}
$ou_str
=
implode
(
','
,
$ous
);
var_export
(
$depts
[
0
]);
// foreach ($hou_depts as $k => $v) {
$result
=
$this
->
provider
->
search
()
->
ous
()
->
find
(
$depts
[
0
]);
// $hou_ous[] = "ou={$v}";
var_export
(
$result
);
die
;
// }
$result
->
setDn
(
"
$ou_str
,ou=IT发展部,ou=Users_hoto,dc=hoto,dc=test"
);
// $ou_str = implode(',',$ous);
// var_dump($result);die;
// $result=$this->provider->search()->ous()->find($depts[0]);
if
(
$result
->
exists
)
{
// $result->setDn("$ou_str,ou=department,dc=test,dc=com");
$result
->
rename
(
"ou="
.
$hou_depts
[
0
]);
// var_dump($result);die;
}
// if ($result->exists) {
// $result->rename("ou=".$hou_depts[0]);
// }
}
}
$this
->
saveDept
(
$handleData
);
//
$this->saveDept($handleData);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment