--- lib/A3C/View.pm 2008/03/30 15:02:55 40 +++ lib/A3C/View.pm 2008/04/01 19:44:31 57 @@ -22,7 +22,7 @@ filter => '(objectClass=hrEduOrg)', sizelimit => 10, ); - while ( my $entry = $ldap->next ) { + while ( my $entry = $ldap->current_search->shift_entry ) { #warn $entry->dump; ul { foreach my $attr ( $entry->attributes ) { @@ -36,3 +36,55 @@ } }; +template '/search-users' => page { + + my $action = new_action( + class => 'SearchUser', + moniker => 'search-users' + ); + + form { + render_action( $action => [ 'uid_contains', 'cn_contains' ] ); + form_submit( label => _('Find someone') ); + }; + +# warn dump( $action->result->content ); + + if ( my $search = $action->result->content('search') ) { + div { sprintf(_('Found %d results'), $search->count ) } + ol { + while (my $user = $search->next) { + li { + span { $user->cn } + tt { $user->uid } + } + } + } + } + +}; + +template '/sync' => page { + + my $action = new_action( + class => 'SyncOrganization', + moniker => 'sync-organization' + ); + + form { + render_action( $action => [ 'cn' ] ); + 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 . '>' } + } + } + } + } + +};