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

Show secret url access on my views page to avoid misleading 'only you can see this view' message


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent ffb060c5
...@@ -91,6 +91,7 @@ $string['loggedinlower'] = 'logged in users'; ...@@ -91,6 +91,7 @@ $string['loggedinlower'] = 'logged in users';
$string['publiclower'] = 'public'; $string['publiclower'] = 'public';
$string['everyoneingroup'] = 'Everyone in Group'; $string['everyoneingroup'] = 'Everyone in Group';
$string['token'] = 'Secret URL'; $string['token'] = 'Secret URL';
$string['peoplewiththesecreturl'] = 'People with the Secret URL';
// view user // view user
$string['inviteusertojoingroup'] = 'Invite this user to join a group'; $string['inviteusertojoingroup'] = 'Invite this user to join a group';
......
...@@ -2028,6 +2028,8 @@ class View { ...@@ -2028,6 +2028,8 @@ class View {
INNER JOIN {group} g ON g.id = vg.group AND g.deleted = 0 INNER JOIN {group} g ON g.id = vg.group AND g.deleted = 0
UNION SELECT view, \'user\' AS accesstype, NULL AS grouptype, NULL AS role, usr AS id, \'\' AS name, startdate, stopdate UNION SELECT view, \'user\' AS accesstype, NULL AS grouptype, NULL AS role, usr AS id, \'\' AS name, startdate, stopdate
FROM {view_access_usr} vu FROM {view_access_usr} vu
UNION SELECT view, \'secreturl\' AS accesstype, NULL AS grouptype, NULL AS role, 0 AS id, \'\' AS name, startdate, stopdate
FROM {view_access_token} vt
UNION SELECT view, accesstype, NULL AS grouptype, NULL AS role, 0 AS id, \'\' AS name, startdate, stopdate UNION SELECT view, accesstype, NULL AS grouptype, NULL AS role, 0 AS id, \'\' AS name, startdate, stopdate
FROM {view_access} va FROM {view_access} va
) AS a ) AS a
...@@ -2092,7 +2094,7 @@ class View { ...@@ -2092,7 +2094,7 @@ class View {
if ($accessgroups) { if ($accessgroups) {
foreach ($accessgroups as $access) { foreach ($accessgroups as $access) {
$data[$index[$access->view]]['accessgroups'][] = array( $data[$index[$access->view]]['accessgroups'][] = array(
'accesstype' => $access->accesstype, // friends, group, loggedin, public, tutorsgroup, user 'accesstype' => $access->accesstype, // friends, group, loggedin, public, tutorsgroup, user, secreturl
'role' => $access->role, 'role' => $access->role,
'roledisplay' => $access->role ? get_string($access->role, 'grouptype.' . $access->grouptype) : null, 'roledisplay' => $access->role ? get_string($access->role, 'grouptype.' . $access->grouptype) : null,
'id' => $access->id, 'id' => $access->id,
......
...@@ -61,6 +61,8 @@ ...@@ -61,6 +61,8 @@
<a href="{$WWWROOT}group/view.php?id={$accessgroup.id}">{$accessgroup.name|escape}</a>{if $accessgroup.role} ({$accessgroup.roledisplay}){/if} <a href="{$WWWROOT}group/view.php?id={$accessgroup.id}">{$accessgroup.name|escape}</a>{if $accessgroup.role} ({$accessgroup.roledisplay}){/if}
{elseif $accessgroup.accesstype == 'user'} {elseif $accessgroup.accesstype == 'user'}
<a href="{$WWWROOT}user/view.php?id={$accessgroup.id}">{$accessgroup.id|display_name|escape}</a> <a href="{$WWWROOT}user/view.php?id={$accessgroup.id}">{$accessgroup.id|display_name|escape}</a>
{elseif $accessgroup.accesstype == 'secreturl'}
{str tag="peoplewiththesecreturl" section="view"}
{/if}{/strip}{if !$.foreach.artefacts.last}, {/if} {/if}{/strip}{if !$.foreach.artefacts.last}, {/if}
{/foreach} {/foreach}
{if $view.template}<br>{str tag=thisviewmaybecopied section=view}{/if} {if $view.template}<br>{str tag=thisviewmaybecopied section=view}{/if}
......
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