protected function createDataDirectory(&$submissionVars, $formVars)
{
// did the user have option of Elgg creating the data directory
if ($formVars['dataroot']['type'] != 'combo') {
return TRUE;
}
// did the user select the option
if ($submissionVars['dataroot'] != 'dataroot-checkbox') {
return TRUE;
}
$dir = sanitise_filepath($submissionVars['path']) . 'data';
if (file_exists($dir) || mkdir($dir, 0700)) {
$submissionVars['dataroot'] = $dir;
if (!file_exists("{$dir}/.htaccess")) {
$htaccess = "Order Deny,Allow\nDeny from All\n";
if (!file_put_contents("{$dir}/.htaccess", $htaccess)) {
return FALSE;
}
}
return TRUE;
}
return FALSE;
}