def generate_signed_link(user, viewname, args=None, kwargs=None):
 if hasattr(user, 'is_authenticated'):
  if (not user.is_authenticated()):
   raise RuntimeError('Need an authenticated user to sign a link.')
  user_id = user.id
 else:
  user_id = user
 path = reverse(viewname, args=args, kwargs=kwargs)
 item = ('%s|%s|%s' % (options.get('system.url-prefix'), path, base36_encode(user_id)))
 signature = ':'.join(get_signer().sign(item).rsplit(':', 2)[1:])
 return ('%s?_=%s:%s' % (absolute_uri(path), base36_encode(user_id), signature))

def generate_signed_link ( user , viewname , args = None , kwargs = None ) : if hasattr ( user , 'is_authenticated' ) : if ( not user . is_authenticated ( ) ) : raise RuntimeError ( 'Need an authenticated user to sign a link.' ) user_id = user . id else : user_id = user path = reverse ( viewname , args = args , kwargs = kwargs ) item = ( '%s|%s|%s' % ( options . get ( 'system.url-prefix' ) , path , base36_encode ( user_id ) ) ) signature = ':' . join ( get_signer ( ) . sign ( item ) . rsplit ( ':' , 2 ) [ 1 : ] ) return ( '%s?_=%s:%s' % ( absolute_uri ( path ) , base36_encode ( user_id ) , signature ) )
this returns an absolute url where the given user is signed in for the given viewname with args and kwargs .