1 |
package A3C::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 |
warn "## ", Jifty->web->request->path; |
12 |
Jifty->web->tangent(url => '/ldaplogin') |
13 |
if ( ! Jifty->web->current_user->id && Jifty->web->request->path !~ m{^/(?:ldaplogin|__jifty)} ); |
14 |
|
15 |
my $top = Jifty->web->navigation; |
16 |
my $user = Jifty->web->current_user->user_object; |
17 |
|
18 |
# Jifty->log->debug("current_user = ", dump( $user )); |
19 |
|
20 |
$top->child( _('People') => url => '/people' ); |
21 |
my $o = $top->child( _('Organizations') => url => '/organizations' ); |
22 |
$o->child( _('New') => url => '/organizations/new' ); |
23 |
|
24 |
$top->child( _('Sync') => url => '/sync' ); |
25 |
$top->child( _('LDAP') => url => '/ldap' ); |
26 |
|
27 |
# $top->child( 'Prefs' => url => '/prefs' ) if Jifty->web->current_user->id; |
28 |
|
29 |
}; |
30 |
|
31 |
1; |