Commit 3704d4a7 authored by Richard Mansfield's avatar Richard Mansfield Committed by Gerrit Code Review
Browse files

Merge "Fix secret url link on access page (bug #823789)"

parents 088b278d 82cd0c3f
......@@ -163,7 +163,7 @@ $string['deleteviewconfirm'] = 'Do you really want to delete this page? It canno
$string['deleteviewconfirmnote'] = '<strong>NOTE:</strong> All your files and journal entries that you linked in this page will still be available.<br/>However, any feedback placed on this page as well as text entered directly into text boxes will be deleted.';
$string['editaccesspagedescription3'] = 'By default, only you can see your Collections and Pages. You can share pages with others by adding access rules below. You may set multiple items to have identical settings by choosing them from the checkboxes. Once you are done, scroll down and click Save to continue.';
$string['editsecreturlsintable'] = '<b>Secret URLs</b> can not be set on this page as they must be done individually. To set Secret URLs, please return to the <a href="%sview/share.php">list of Collections and Pages</a>.';
$string['editsecreturlsintable'] = '<b>Secret URLs</b> can not be set on this page as they must be done individually. To set Secret URLs, please return to the <a href="%s">list of Collections and Pages</a>.';
$string['editaccessinvalidviewset'] = 'Attempt to edit access on an invalid set of pages and collections';
$string['overridingstartstopdate'] = 'Overriding Start/Stop Dates';
......
{include file="header.tpl"}
<p>{str tag=editaccesspagedescription3 section=view}</p>
<p>{str tag=editsecreturlsintable section=view args=$wwwroot}</p>
<p>{str tag=editsecreturlsintable section=view args=$shareurl}</p>
{$form|safe}
{include file="footer.tpl"}
......@@ -465,24 +465,26 @@ function editaccess_validate(Pieform $form, $values) {
}
}
function editaccess_cancel_submit() {
global $institution, $group;
if (!empty($institution)) {
if ($institution == 'mahara') {
$redirecturl = '/admin/site/shareviews.php';
} else {
$redirecturl = '/view/institutionshare.php';
}
}
else if (!empty($group)) {
$redirecturl = '/group/shareviews.php?group=' . $group;
if (!empty($institution)) {
if ($institution == 'mahara') {
$shareurl = 'admin/site/shareviews.php';
}
else {
$redirecturl = '/view/share.php';
$shareurl = 'view/institutionshare.php';
}
redirect($redirecturl);
}
else if (!empty($group)) {
$shareurl = 'group/shareviews.php?group=' . $group;
}
else {
$shareurl = 'view/share.php';
}
$shareurl = get_config('wwwroot') . $shareurl;
function editaccess_cancel_submit() {
global $shareurl;
redirect($shareurl);
}
function editaccess_submit(Pieform $form, $values) {
global $SESSION, $institution, $collections, $views, $view;
......@@ -597,5 +599,5 @@ $smarty = smarty(
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('form', $form);
$smarty->assign('wwwroot', $CFG->wwwroot);
$smarty->assign('shareurl', $shareurl);
$smarty->display('view/access.tpl');
Markdown is supported
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