9 |
|
|
10 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
11 |
|
|
12 |
|
private template 'menu' => sub { |
13 |
|
div { |
14 |
|
attr { id => "navigation" }; |
15 |
|
Jifty->web->navigation->render_as_classical_menu; |
16 |
|
}; |
17 |
|
}; |
18 |
|
|
19 |
|
|
20 |
template '/' => page { |
template '/' => page { |
21 |
|
|
22 |
h1 { _('Statistics') } |
h1 { _('Statistics') } |
80 |
}; |
}; |
81 |
|
|
82 |
|
|
|
template 'ldap' => page { |
|
|
h1 { _('LDAP data about Schools in system') }; |
|
|
my $ldap = A3C::LDAP->new; |
|
|
div { |
|
|
$ldap->search( |
|
|
base => 'dc=skole,dc=hr', |
|
|
filter => '(objectClass=hrEduOrg)', |
|
|
sizelimit => 10, |
|
|
); |
|
|
while ( my $entry = $ldap->current_search->shift_entry ) { |
|
|
#warn $entry->dump; |
|
|
ul { |
|
|
foreach my $attr ( $entry->attributes ) { |
|
|
li { |
|
|
tt { $attr } |
|
|
span { dump( $entry->get_value( $attr ) ) } |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
|
|
|
83 |
template 'people' => page { |
template 'people' => page { |
84 |
|
|
85 |
h1 { _('Find people') } |
h1 { _('Find people') } |
94 |
|
|
95 |
form { |
form { |
96 |
render_action( $action => [ 'uid_contains', 'cn_contains' ] ); |
render_action( $action => [ 'uid_contains', 'cn_contains' ] ); |
97 |
form_submit( label => _('Find someone') ); |
form_submit( label => _('Search') ); |
98 |
}; |
}; |
99 |
|
|
100 |
# warn dump( $action->result->content ); |
# warn dump( $action->result->content ); |
101 |
|
|
102 |
if ( my $search = $action->result->content('search') ) { |
if ( my $search = $action->result->content('search') ) { |
103 |
div { sprintf(_('Found %d results'), $search->count ) } |
div { _('Found %1 results', $search->count ) } |
104 |
ol { |
table { |
105 |
while (my $user = $search->next) { |
while (my $user = $search->next) { |
106 |
li { |
row { |
107 |
span { $user->cn } |
cell { $user->cn } |
108 |
tt { $user->uid } |
cell { tt { $user->uid } } |
109 |
} |
cell { tt { $user->hrEduPersonUniqueID } } |
110 |
} |
cell { $user->hrEduPersonHomeOrg } |
|
} |
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
template 'sync' => page { |
|
|
|
|
|
h1 { _('Sync school from LDAP') } |
|
|
|
|
|
my $action = new_action( |
|
|
class => 'SyncOrganization', |
|
|
moniker => 'sync-organization' |
|
|
); |
|
|
|
|
|
form { |
|
|
render_action( $action => [ 'org_uid' ] ); |
|
|
form_submit( label => _('Sync Organization') ); |
|
|
}; |
|
|
|
|
|
if ( my $users = $action->result->content('synced-users') ) { |
|
|
ol { |
|
|
while (my $user = $users->next) { |
|
|
li { |
|
|
span { $user->cn } |
|
|
tt { { class is 'email' } '<' . $user->mail . '>' } |
|
111 |
} |
} |
112 |
} |
} |
113 |
} |
} |
125 |
object_type => 'hrEduOrg', |
object_type => 'hrEduOrg', |
126 |
}; |
}; |
127 |
|
|
128 |
|
use A3C::View::LDAP; |
129 |
|
alias A3C::View::LDAP under '/ldap'; |
130 |
|
|
131 |
|
use A3C::View::Strix; |
132 |
|
alias A3C::View::Strix under '/strix'; |
133 |
|
|
134 |
1; |
1; |