Commit 82282314 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Ignore logged in user when creating admin public folder on demand (bug 3130)

parent d83a6fa9
......@@ -1133,19 +1133,13 @@ class ArtefactTypeFolder extends ArtefactTypeFileBase {
AND a.institution = 'mahara'
AND a.parent IS NULL", array($name, 'folder'));
if (!$folderid) {
global $USER;
if ($USER->get('admin')) {
$description = get_string_from_language(get_config('lang'),
'adminpublicdirdescription', 'admin');
$data = (object) array('title' => $name,
'description' => $description,
'institution' => 'mahara');
$f = new ArtefactTypeFolder(0, $data);
$f->commit();
$folderid = $f->get('id');
} else {
return false;
}
$description = get_string_from_language(get_config('lang'), 'adminpublicdirdescription', 'admin');
$data = (object) array('title' => $name,
'description' => $description,
'institution' => 'mahara');
$f = new ArtefactTypeFolder(0, $data);
$f->commit();
$folderid = $f->get('id');
}
return $folderid;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment