function imce_working_directory in IMCE 6
Same name and namespace in other branches
- 6.2 inc/imce.page.inc \imce_working_directory()
- 7 inc/imce.page.inc \imce_working_directory()
Return an avaliable directory for the profile.
1 call to imce_working_directory()
- imce_initiate_profile in inc/
page.inc - Initiate and return configuration profile for the $user.
File
- inc/
page.inc, line 746
Code
function imce_working_directory($imce) {
//check GET.
if (isset($_GET['dir'])) {
if ($info = imce_directory_info($_GET['dir'], $imce)) {
if (imce_check_directory($_GET['dir'])) {
$_SESSION['imce_directory'] = rawurlencode($info['name']);
}
else {
$info = FALSE;
}
}
else {
imce_inaccessible_directory($_GET['dir']);
}
return $info;
}
//check session
if (isset($_SESSION['imce_directory'])) {
$dirname = rawurldecode($_SESSION['imce_directory']);
if ($info = imce_directory_info($dirname, $imce)) {
if (imce_check_directory($dirname)) {
return $info;
}
}
}
//or the whole list.
foreach ($imce['directories'] as $dirname => $info) {
if (imce_check_directory($dirname)) {
$_SESSION['imce_directory'] = rawurlencode($dirname);
return $info;
}
}
return FALSE;
}