provide examples for using access tokens in urls
This commit is contained in:
parent
d6d94d9427
commit
f3aff45042
@ -776,15 +776,20 @@ class Settings extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$desc = t('Use this form to create temporary access identifiers to share things with non-members. These identities may be used in Access Control Lists and visitors may login using these credentials to access the private content.');
|
$desc = t('Use this form to create temporary access identifiers to share things with non-members. These identities may be used in Access Control Lists and visitors may login using these credentials to access the private content.');
|
||||||
|
|
||||||
|
$desc2 = t('You may also provide <em>dropbox</em> style access links to friends and associates by adding the Login Password to any specific site URL as shown. Examples:');
|
||||||
|
|
||||||
$tpl = get_markup_template("settings_tokens.tpl");
|
$tpl = get_markup_template("settings_tokens.tpl");
|
||||||
$o .= replace_macros($tpl, array(
|
$o .= replace_macros($tpl, array(
|
||||||
'$form_security_token' => get_form_security_token("settings_tokens"),
|
'$form_security_token' => get_form_security_token("settings_tokens"),
|
||||||
'$title' => t('Guest Access Tokens'),
|
'$title' => t('Guest Access Tokens'),
|
||||||
'$desc' => $desc,
|
'$desc' => $desc,
|
||||||
|
'$desc2' => $desc2,
|
||||||
'$tokens' => $t,
|
'$tokens' => $t,
|
||||||
'$atoken' => $atoken,
|
'$atoken' => $atoken,
|
||||||
'$name' => array('name', t('Login Name'), (($atoken) ? $atoken['atoken_name'] : ''),''),
|
'$url1' => z_root() . '/channel/' . $channel['channel_address'],
|
||||||
'$token'=> array('token', t('Login Password'),(($atoken) ? $atoken['atoken_token'] : autoname(8)), ''),
|
'$url2' => z_root() . '/photos/' . $channel['channel_address'],
|
||||||
|
'$name' => array('name', t('Login Name') . ' <span class="required">*</span>', (($atoken) ? $atoken['atoken_name'] : ''),''),
|
||||||
|
'$token'=> array('token', t('Login Password') . ' <span class="required">*</span>',(($atoken) ? $atoken['atoken_token'] : autoname(8)), ''),
|
||||||
'$expires'=> array('expires', t('Expires (yyyy-mm-dd)'), (($atoken['atoken_expires'] && $atoken['atoken_expires'] != NULL_DATE) ? datetime_convert('UTC',date_default_timezone_get(),$atoken['atoken_expires']) : ''), ''),
|
'$expires'=> array('expires', t('Expires (yyyy-mm-dd)'), (($atoken['atoken_expires'] && $atoken['atoken_expires'] != NULL_DATE) ? datetime_convert('UTC',date_default_timezone_get(),$atoken['atoken_expires']) : ''), ''),
|
||||||
'$submit' => t('Submit')
|
'$submit' => t('Submit')
|
||||||
));
|
));
|
||||||
|
@ -5,6 +5,9 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('form').areYouSure({'addRemoveFieldsMarksDirty':true, 'message': aStr['leavethispage'] }); // Warn user about unsaved settings
|
$('form').areYouSure({'addRemoveFieldsMarksDirty':true, 'message': aStr['leavethispage'] }); // Warn user about unsaved settings
|
||||||
|
|
||||||
|
$('.token-mirror').html($('#id_token').val());
|
||||||
|
$('#id_token').keyup( function() { $('.token-mirror').html($('#id_token').val()); });
|
||||||
|
|
||||||
$("#id_permissions_role").change(function() {
|
$("#id_permissions_role").change(function() {
|
||||||
var role = $("#id_permissions_role").val();
|
var role = $("#id_permissions_role").val();
|
||||||
if(role == 'custom')
|
if(role == 'custom')
|
||||||
|
@ -2046,4 +2046,10 @@ dl.bb-dl > dd > li {
|
|||||||
}
|
}
|
||||||
.atoken-text {
|
.atoken-text {
|
||||||
margin: 5px 10px 5px 10px;
|
margin: 5px 10px 5px 10px;
|
||||||
|
}
|
||||||
|
.atoken-example {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
.zat-example {
|
||||||
|
color: red;
|
||||||
}
|
}
|
@ -4,6 +4,10 @@
|
|||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="atoken-text descriptive-text">{{$desc}}</div>
|
<div class="atoken-text descriptive-text">{{$desc}}</div>
|
||||||
|
<div class="atoken-text descriptive-text">{{$desc2}}</div>
|
||||||
|
<div class="atoken-example">{{$url1}}<span class="zat-example">&f=&zat=<span class="token-mirror"></span></span></div>
|
||||||
|
<div class="atoken-example">{{$url2}}<span class="zat-example">&f=&zat=<span class="token-mirror"></span></span></div>
|
||||||
|
<br />
|
||||||
<form action="settings/tokens" id="settings-account-form" method="post" autocomplete="off" >
|
<form action="settings/tokens" id="settings-account-form" method="post" autocomplete="off" >
|
||||||
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
|
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
|
||||||
{{if $atoken}}<input type="hidden" name="atoken_id" value="{{$atoken.atoken_id}}" />{{/if}}
|
{{if $atoken}}<input type="hidden" name="atoken_id" value="{{$atoken.atoken_id}}" />{{/if}}
|
||||||
|
Reference in New Issue
Block a user