|
|
|
|
@ -14,6 +14,7 @@ sub index ( $c ) { |
|
|
|
|
# INPUT: |
|
|
|
|
# uid | A user id |
|
|
|
|
# bid | A blog id belonging to the user |
|
|
|
|
# url | A URL to return to when the admin logs out of the user account |
|
|
|
|
# |
|
|
|
|
# When given a uid, become that user and go to the user's dashboard. |
|
|
|
|
# |
|
|
|
|
@ -21,10 +22,11 @@ sub index ( $c ) { |
|
|
|
|
# and go to the blog's dashboard. |
|
|
|
|
# |
|
|
|
|
sub do_admin_become ( $c ) { |
|
|
|
|
my ( $uid, $bid ) = ( $c->param('uid'), $c->param('bid') ); |
|
|
|
|
my ( $uid, $bid, $url ) = ( $c->param('uid'), $c->param('bid'), $c->param('url') ); |
|
|
|
|
|
|
|
|
|
$c->session->{oid} = $c->stash->{person}->id; |
|
|
|
|
$c->session->{uid} = $uid; |
|
|
|
|
$c->session->{url} = $url if $url; |
|
|
|
|
|
|
|
|
|
# If we have a blog id, then redirect to that blog's dashboard. |
|
|
|
|
# Otherwise, the normal dashboard.. |
|
|
|
|
|