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') } |
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 |
|
|
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 |
|
|