Aug 14, 2015; 11:50
Alex Betz
authorization system
I am using a very simple but effective authorization system to check
whether a user is authorize to get certain data. This works in principle.
However rather than just aborting the request I would like to send a json
so that I can present a warning to the user, otherwise a legitimate user
whose session has expired doesn't get any warning. This is predominantly
used to authorize ajax calls.
The problem is, whatever I do the string is not returned. I was hoping that
the handle tag would solve this, but it doesn't.
<?LassoScript
session_start('authorization', -expires = 60, -secure)
if(session_result('authorization') != 'load') => {
session_addVar('maintenance', 'auth_level')
var(auth_level::integer = 0)
}
if( $auth_level == 0 ) => {
handle => {
'{ sucess: false}'
}
abort
}
?>
Any help appreciated
Thanks
Alex
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Aug 15, 2015; 03:41
Steve Piercy - Website Builder
Re: authorization system