/[A3C]/lib/A3C/View/LDAP.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

Annotation of /lib/A3C/View/LDAP.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 209 - (hide annotations)
Thu Jun 19 21:43:35 2008 UTC (15 years, 11 months ago) by dpavlin
File size: 1145 byte(s)
put back LDAP view from A3C::View
1 dpavlin 209 package A3C::View::LDAP;
2    
3     =head1 NAME
4    
5     A3C::View::LDAP
6    
7     =head1 DESCRIPTION
8    
9     Provide LDAP interface
10    
11     =cut
12    
13     use strict;
14     use warnings;
15    
16     use Jifty::View::Declare -base;
17     use Data::Dump qw/dump/;
18    
19     template 'sync' => page {
20    
21     h1 { _('Sync school from LDAP') }
22    
23     my $action = new_action(
24     class => 'SyncOrganization',
25     moniker => 'sync-organization'
26     );
27    
28     form {
29     render_action( $action => [ 'org_uid' ] );
30     form_submit( label => _('Sync Organization') );
31     };
32    
33     if ( my $users = $action->result->content('synced-users') ) {
34     ol {
35     while (my $user = $users->next) {
36     li {
37     span { $user->cn }
38     tt { { class is 'email' } '<' . $user->mail . '>' }
39     }
40     }
41     }
42     }
43    
44     };
45    
46    
47     template 'dump' => page {
48     h1 { _('LDAP data about Schools in system') };
49     my $ldap = A3C::LDAP->new;
50     div {
51     $ldap->search(
52     base => 'dc=skole,dc=hr',
53     filter => '(objectClass=hrEduOrg)',
54     sizelimit => 10,
55     );
56     while ( my $entry = $ldap->current_search->shift_entry ) {
57     #warn $entry->dump;
58     ul {
59     foreach my $attr ( $entry->attributes ) {
60     li {
61     tt { $attr }
62     span { dump( $entry->get_value( $attr ) ) }
63     }
64     }
65     }
66     }
67     }
68     };
69    
70    
71    

  ViewVC Help
Powered by ViewVC 1.1.26