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

Diff of /lib/A3C/View.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 207 by dpavlin, Sun Jun 15 22:03:02 2008 UTC revision 208 by dpavlin, Thu Jun 19 21:24:26 2008 UTC
# Line 80  template '/' => page { Line 80  template '/' => page {
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') }
# Line 138  template 'people' => page { Line 115  template 'people' => page {
115    
116  };  };
117    
 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 . '>' }  
                                 }  
                         }  
                 }  
         }  
   
 };  
   
118  # mount other views  # mount other views
119  use A3C::View::Organization;  use A3C::View::Organization;
120    
# Line 175  alias A3C::View::Organization under '/or Line 125  alias A3C::View::Organization under '/or
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;  use A3C::View::Strix;
132  alias A3C::View::Strix under '/strix';  alias A3C::View::Strix under '/strix';
133    

Legend:
Removed from v.207  
changed lines
  Added in v.208

  ViewVC Help
Powered by ViewVC 1.1.26