Thanks
Emmanuel
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Hi David
1) I was trying to override ProtoUser default behaviour so a user that
logs in is redirected to a specific page (rather than to the homepage)
How should I go about doing that ? Should I override the login
method ?
2) I was wondering, if I am outside the scope of an HTTP request
shouldn't .set() throw an error instead of failing silently ?
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> Hi,
>
> I'd like to dynamically redirect the user post-authentication to their
> originally sought URL (using Lift 2.2). I've used some ideas from this
> thread and from an old thread:
I think the proto user code (at least in 2.3) does this by default?
I know we implemented our own, but have now removed it...
/Jeppe
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> It used to but it broke. There was a thread discussing how to fix it.
Hmm seems fixed now, works for me at least....
/Jeppe
}) openOr {
> Hi Jeppe
>
>>> I think the proto user code (at least in 2.3) does this by default?
> I've just been playing around trying to work out what you meant by 'by
> default'.
>
> I got it to work by adding net.liftweb.protouser.loginFirst as a LocParam:
>
> Menu(Loc("Save", List("save") -> false, "Save", User.loginFirst)),
>
> Is that how you do it?
Yes. But I don't have the need to display the menu items before login
which, as you found out, doesn't work here (unless you manually create
the links)
/Jeppe
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
> In my case, I want to allow users to browse my site, and at any time log in,
> at which point they do the password dance and then should be taken back to
> the page they where at beforehand, but now the page is rendered in 'logged
> in' mode. I'm not sure how to achieve this - right now logging in redirects
> my users to their personal home page.
I see. I'm not sure how to accomplish this, but my gut feeling is to
keep the access control in the sitemap and change the default sitemap
rendering....
Not sure how involved it would be to create your own Menu snippet that
renders the sitemap even if you don't have access to the Locs (and if
the information is readily available)
/Jeppe
/Jeppe
On Thu, Apr 28, 2011 at 11:26 AM, Matthew Pocock
<turingate...@gmail.com> wrote:
> Oh, I think I got the two mixed up somehow. I'm interested in having control
> over the redirecting, particularly in getting back to the page where the
> login was initiated from.
This should work out the box if you use SiteMap and ProtoUser.
You may not be able to render the menu items using the standard
snippets, but try to, without signing in, manually go to a URL that is
only visible to authorized users. This should take you to login and,
upon successful login, back to the requested page. At least this works
for me and I don't remember doing anything fancy.....
/Jeppe
Yeah, I think there's some confusion here....
/Jeppe
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Ahh ok. Makes sense. I don't think this is supported ootb, see recent
threads an RBAC in Lift.
For now you can create a LoggedIn snippet which will render it's body
if you're logged in and return NodeSeq.Empty if your'e not. Wrap all
your editing content with this snippet and you should be good to go
:-)
/Jeppe
> In my case I'm not putting some URLs behind passwords and having othersAhh ok. Makes sense. I don't think this is supported ootb, see recent
> public. All pages are visible to all users, but you can log in and then you
> may be allowed to edit some of the pages. If you aren't logged in (or logged
> in without privileges), then the editing UI isn't in the page you are
> looking at. If you are, then there are ajax forms and comet and things that
> manage editing.
> M
threads an RBAC in Lift.
For now you can create a LoggedIn snippet which will render it's body
if you're logged in and return NodeSeq.Empty if your'e not. Wrap all
your editing content with this snippet and you should be good to go
:-)
/Jeppe
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Ok , sorry for being dense. Should have followed the discussion more closely :-)
How about creating your own Ajax link with a function that does the
same thing as the loginFirst LocParam:
def loginFirst = If(
loggedIn_? _,
() => {
import net.liftweb.http.{RedirectWithState, RedirectState}
val uri = S.uriAndQueryString
RedirectWithState(
loginPageURL,
RedirectState( ()=>{loginRedirect.set(uri)})
)
}
)
Capture current location, redirect to login page, upon successful
redirect, set the loginRedirect session var....
/Jeppe