/[Grep]/lib/Grep/Dispatcher.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /lib/Grep/Dispatcher.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 107 - (show annotations)
Tue Mar 6 23:00:32 2007 UTC (17 years, 1 month ago) by dpavlin
File size: 826 byte(s)
show list of sources on home page if user is logged in
1 package Grep::Dispatcher;
2
3 use strict;
4 use warnings;
5
6 use Jifty::Dispatcher -base;
7
8 use Data::Dump qw/dump/;
9
10 before '*' => run {
11 my $top = Jifty->web->navigation;
12 my $user = Jifty->web->current_user->user_object;
13
14 # Jifty->log->debug("current_user = ", dump( $user ));
15
16 if ( $user and $user->id ) {
17 $top->child( 'Search' => url => '/search' );
18 $top->child( 'Add feed' => url => '/add' );
19 $top->child( 'Fetch new results' => url => '/fetch' );
20 my $acc = $top->child( 'Logout' => url => '/logout' );
21 $acc->child( 'Change password' => url => '/chgpasswd' );
22
23 } else {
24 my $acc = $top->child( 'Login' => url => '/login' );
25 $acc->child( 'Lost password?' => url => '/passwordreminder' );
26 $acc->child( 'Signup' => url => '/signup' );
27
28 }
29
30 };
31
32 on '/' => run {
33 show '/user' if Jifty->web->current_user->id;
34 };
35
36 1;

  ViewVC Help
Powered by ViewVC 1.1.26