Skip to content

Commit

Permalink
added current user profile at /profile
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatov committed Jul 14, 2011
1 parent 532e425 commit 6ef6ea2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@ object ProfileStuff extends Loc[ProfileLoc] {
case RewriteRequest(ParsePath("profile" :: username :: Nil, _, _, _), _, _)
if (User.superUser_? && !User.find(By(User.userName, username)).isEmpty) =>
(RewriteResponse("profile" :: Nil, Map("username" -> username)), ProfileLoc())
case RewriteRequest(ParsePath("profile" :: Nil, _, _, _), _, _) if (!User.loggedIn_?) =>
(RewriteResponse("" :: Nil), ProfileLoc())
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import net.liftweb.http.js.{JsCmds, JsCmd}
* @author Sergey Ignatov
*/
class ProfileOps {
object username extends RequestVar[String](S.param("username") openOr "")
object username extends RequestVar[String](S.param("username") openOr (User.currentUser.map(_.userName.is) openOr ""))

lazy val profile = new Profile(model.vend.rootPackage)

Expand Down

0 comments on commit 6ef6ea2

Please sign in to comment.