|
|
|
@ -1518,19 +1518,21 @@ function create_unexisting_directory( |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!is_dir($base_work_dir.$systemFolderName)) { |
|
|
|
|
mkdir( |
|
|
|
|
$result = mkdir( |
|
|
|
|
$base_work_dir.$systemFolderName, |
|
|
|
|
api_get_permissions_for_new_directories(), |
|
|
|
|
true |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if ($result) { |
|
|
|
|
|
|
|
|
|
// Check if pathname already exists inside document table |
|
|
|
|
$tbl_document = Database::get_course_table(TABLE_DOCUMENT); |
|
|
|
|
$sql = "SELECT id, path FROM $tbl_document |
|
|
|
|
WHERE |
|
|
|
|
c_id = $course_id AND |
|
|
|
|
( |
|
|
|
|
path = '".$systemFolderName."' |
|
|
|
|
path = '" . $systemFolderName . "' |
|
|
|
|
) |
|
|
|
|
"; |
|
|
|
|
|
|
|
|
@ -1584,15 +1586,15 @@ function create_unexisting_directory( |
|
|
|
|
$session_id |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$documentData = DocumentManager::get_document_data_by_id( |
|
|
|
|
$document_id, |
|
|
|
|
$_course['code'], |
|
|
|
|
false, |
|
|
|
|
$session_id |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
return $documentData; |
|
|
|
|
} else { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$document = Database::fetch_array($rs); |
|
|
|
@ -1608,10 +1610,10 @@ function create_unexisting_directory( |
|
|
|
|
|
|
|
|
|
return $documentData; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|