Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
7893d179
Commit
7893d179
authored
Dec 17, 2018
by
Côme Chilliet
Browse files
🚑
fix(setup) Fix PHP errors and problems in Web setup
issue
#5938
parent
9ac2dda8
Changes
1
Hide whitespace changes
Inline
Side-by-side
setup/class_setupStepMigrate.inc
View file @
7893d179
...
...
@@ -185,7 +185,7 @@ class setupStepMigrate extends setupStep
/* Entries needing migration */
var
$orgUnits_toMigrate
=
array
();
var
$accounts
T
oMigrate
=
array
();
var
$accounts
_t
oMigrate
=
array
();
var
$outsideUsers_toMigrate
=
array
();
var
$outsideGroups_toMigrate
=
array
();
...
...
@@ -528,8 +528,8 @@ class setupStepMigrate extends setupStep
/* Remember old list of invisible users, to be able to set
* the 'html checked' status for the checkboxes again
*/
$old
=
$this
->
accounts
T
oMigrate
;
$this
->
accounts
T
oMigrate
=
array
();
$old
=
$this
->
accounts
_t
oMigrate
;
$this
->
accounts
_t
oMigrate
=
array
();
/* Get all invisible users */
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
...
...
@@ -556,7 +556,7 @@ class setupStepMigrate extends setupStep
if
(
isset
(
$old
[
base64_encode
(
$attrs
[
'dn'
])]))
{
$attrs
[
'checked'
]
=
$old
[
base64_encode
(
$attrs
[
'dn'
])][
'checked'
];
}
$this
->
accounts
T
oMigrate
[
base64_encode
(
$attrs
[
'dn'
])]
=
$attrs
;
$this
->
accounts
_t
oMigrate
[
base64_encode
(
$attrs
[
'dn'
])]
=
$attrs
;
}
}
...
...
@@ -565,7 +565,7 @@ class setupStepMigrate extends setupStep
_
(
'LDAP query failed'
),
_
(
'Possibly the "root object" is missing.'
)
);
}
elseif
(
count
(
$this
->
accounts
T
oMigrate
)
==
0
)
{
}
elseif
(
count
(
$this
->
accounts
_t
oMigrate
)
==
0
)
{
/* No invisible */
return
''
;
}
else
{
...
...
@@ -573,7 +573,7 @@ class setupStepMigrate extends setupStep
"<div style='color:#F0A500'>"
.
_
(
"Warning"
)
.
"</div>"
,
sprintf
(
_
(
'Found %s user(s) that will not be visible in FusionDirectory or which are incomplete.'
),
count
(
$this
->
accounts
T
oMigrate
)
count
(
$this
->
accounts
_t
oMigrate
)
)
.
$checkobj
->
submit
()
);
}
...
...
@@ -581,12 +581,24 @@ class setupStepMigrate extends setupStep
function
check_accounts_migrate
(
&
$checkobj
)
{
$this
->
check_multipleGeneric_migrate
(
$checkobj
,
array
(
'title'
=>
_
(
'User migration'
)));
$this
->
check_multipleGeneric_migrate
(
$checkobj
,
array
(
'title'
=>
_
(
'User migration'
),
'outside'
=>
FALSE
,
)
);
}
function
check_accounts_migrate_refresh
(
&
$checkobj
)
{
return
$this
->
check_multipleGeneric_migrate_refresh
(
$checkobj
,
array
(
'title'
=>
_
(
'User migration'
)));
return
$this
->
check_multipleGeneric_migrate_refresh
(
$checkobj
,
array
(
'title'
=>
_
(
'User migration'
),
'outside'
=>
FALSE
,
)
);
}
function
check_accounts_migrate_confirm
(
&
$checkobj
,
$only_ldif
=
FALSE
)
...
...
@@ -710,8 +722,12 @@ class setupStepMigrate extends setupStep
$users
=
array
();
$ldap
->
search
(
'(objectClass=inetOrgPerson)'
,
array
(
'uid'
,
'dn'
));
while
(
$user_attrs
=
$ldap
->
fetch
())
{
$users
[
$user_attrs
[
'dn'
]]
=
$user_attrs
[
'uid'
][
0
];
$rusers
[
$user_attrs
[
'uid'
][
0
]]
=
$user_attrs
[
'dn'
];
if
(
isset
(
$user_attrs
[
'uid'
][
0
]))
{
$users
[
$user_attrs
[
'dn'
]]
=
$user_attrs
[
'uid'
][
0
];
$rusers
[
$user_attrs
[
'uid'
][
0
]]
=
$user_attrs
[
'dn'
];
}
else
{
$users
[
$user_attrs
[
'dn'
]]
=
$user_attrs
[
'dn'
];
}
}
$groups
=
array
();
$ldap
->
search
(
'(objectClass=posixGroup)'
,
array
(
'cn'
,
'dn'
));
...
...
@@ -1021,7 +1037,7 @@ class setupStepMigrate extends setupStep
'title'
=>
_
(
'Move users into configured user tree'
),
'outside'
=>
TRUE
,
'ous'
=>
$config
->
departments
,
'destination'
=>
$_POST
[
'destination'
],
'destination'
=>
(
isset
(
$_POST
[
'destination'
]
)
?
$_POST
[
'destination'
]
:
''
)
,
)
);
}
...
...
@@ -1035,7 +1051,7 @@ class setupStepMigrate extends setupStep
'title'
=>
_
(
'Move users into configured user tree'
),
'outside'
=>
TRUE
,
'ous'
=>
$config
->
departments
,
'destination'
=>
$_POST
[
'destination'
],
'destination'
=>
(
isset
(
$_POST
[
'destination'
]
)
?
$_POST
[
'destination'
]
:
''
)
,
)
);
}
...
...
@@ -1140,7 +1156,7 @@ class setupStepMigrate extends setupStep
'title'
=>
_
(
'Move groups into configured groups tree'
),
'outside'
=>
TRUE
,
'ous'
=>
$config
->
departments
,
'destination'
=>
$_POST
[
'destination'
],
'destination'
=>
(
isset
(
$_POST
[
'destination'
]
)
?
$_POST
[
'destination'
]
:
''
)
,
)
);
}
...
...
@@ -1154,7 +1170,7 @@ class setupStepMigrate extends setupStep
'title'
=>
_
(
'Move groups into configured groups tree'
),
'outside'
=>
TRUE
,
'ous'
=>
$config
->
departments
,
'destination'
=>
$_POST
[
'destination'
],
'destination'
=>
(
isset
(
$_POST
[
'destination'
]
)
?
$_POST
[
'destination'
]
:
''
)
,
)
);
}
...
...
@@ -1242,12 +1258,24 @@ class setupStepMigrate extends setupStep
function
check_orgUnits_migrate
(
&
$checkobj
)
{
$this
->
check_multipleGeneric_migrate
(
$checkobj
,
array
(
'title'
=>
_
(
'Department migration'
)));
$this
->
check_multipleGeneric_migrate
(
$checkobj
,
array
(
'title'
=>
_
(
'Department migration'
),
'outside'
=>
FALSE
,
)
);
}
function
check_orgUnits_migrate_refresh
(
&
$checkobj
)
{
return
$this
->
check_multipleGeneric_migrate_refresh
(
$checkobj
,
array
(
'title'
=>
_
(
'Department migration'
)));
return
$this
->
check_multipleGeneric_migrate_refresh
(
$checkobj
,
array
(
'title'
=>
_
(
'Department migration'
),
'outside'
=>
FALSE
,
)
);
}
function
check_orgUnits_migrate_confirm
(
&
$checkobj
,
$only_ldif
)
...
...
Write
Preview
Supports
Markdown
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