Changeset 861 for LATMOS-Accounts-Web
- Timestamp:
- 12/02/11 11:42:17 (13 years ago)
- Location:
- LATMOS-Accounts-Web
- Files:
-
- 56 added
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts-Web/Changes
r94 r861 1 1 This file documents the revision history for Perl extension LATMOS::Accounts::Web. 2 2 3 2.0.0 4 - add support of nethost/netzone object 5 6 - add a "My" page in user page listing object they own 7 8 - add icons to quickly identify user's account status in list (temporary, 9 expired, unexported) 10 11 - add a department page in group page with a realistic view of the current 12 people in the department. The section appear only when group have 13 sutype=dpmt 14 15 - add link to objects when attributes have reference 16 3 17 0.01 2009-05-12 03:23:51 4 18 - initial revision, generated by Catalyst -
LATMOS-Accounts-Web/MANIFEST
r757 r861 1 1 Changes 2 MANIFEST 3 MANIFEST.skip 2 4 Makefile.PL 3 5 README 4 6 etc/httpd/latmos-accounts-web.conf 5 7 etc/init.d/latmos-accounts-web 6 inc/Module/AutoInstall.pm7 inc/Module/Install/AutoInstall.pm8 inc/Module/Install/Base.pm9 inc/Module/Install/Can.pm10 inc/Module/Install/Catalyst.pm11 inc/Module/Install/Fetch.pm12 inc/Module/Install/Include.pm13 inc/Module/Install/Makefile.pm14 inc/Module/Install/Metadata.pm15 inc/Module/Install/Scripts.pm16 inc/Module/Install/Win32.pm17 inc/Module/Install/WriteAll.pm18 inc/Module/Install.pm19 8 latmos-accounts-web.spec.in 20 9 latmos_accounts_web.yml.in 21 10 lib/Catalyst/Authentication/Credential/La.pm 11 lib/LATMOS/Accounts/Web/Controller/About.pm 22 12 lib/LATMOS/Accounts/Web/Controller/Ajax.pm 23 13 lib/LATMOS/Accounts/Web/Controller/Aliases.pm 24 14 lib/LATMOS/Accounts/Web/Controller/Create.pm 25 15 lib/LATMOS/Accounts/Web/Controller/Groups.pm 26 lib/LATMOS/Accounts/Web/Controller/MassEdit.pm 16 lib/LATMOS/Accounts/Web/Controller/NetHosts.pm 17 lib/LATMOS/Accounts/Web/Controller/NetZones.pm 27 18 lib/LATMOS/Accounts/Web/Controller/Root.pm 28 19 lib/LATMOS/Accounts/Web/Controller/Sites.pm … … 36 27 lib/LATMOS/Accounts/Web.pm 37 28 root/favicon.ico 29 root/html/about/index.tt 38 30 root/html/ajax/attrvalues.tt 39 31 root/html/ajax/check_new_name.tt 40 32 root/html/ajax/check_ug_validity.tt 41 33 root/html/ajax/cracklib.tt 34 root/html/ajax/displayattr.tt 42 35 root/html/ajax/objattrexist.tt 43 36 root/html/ajax/objexist.tt 44 37 root/html/ajax/rawattr.tt 38 root/html/ajax/select_freeip_select.tt 45 39 root/html/aliases/index.tt 46 root/html/create/group.tt 47 root/html/create/user.tt 40 root/html/create/default.tt 48 41 root/html/default.tt 49 42 root/html/departments/default.tt … … 51 44 root/html/departments/menu.tt 52 45 root/html/groups/default.tt 46 root/html/groups/dpmt.tt 53 47 root/html/groups/index.tt 54 48 root/html/groups/menu.tt … … 61 55 root/html/login.tt 62 56 root/html/logout.tt 63 root/html/massedit/index.tt 57 root/html/nethosts/default.tt 58 root/html/nethosts/index.tt 59 root/html/nethosts/menu.tt 60 root/html/netzones/default.tt 61 root/html/netzones/index.tt 62 root/html/netzones/menu.tt 64 63 root/html/no_object.tt 65 64 root/html/sites/default.tt … … 75 74 root/html/users/mail.tt 76 75 root/html/users/menu.tt 76 root/html/users/my.tt 77 77 root/html/users/passwd.tt 78 root/static/icons/add.png 79 root/static/icons/appointment-new.png 80 root/static/icons/appointment-soon.png 78 81 root/static/icons/arrow-right.png 82 root/static/icons/avatar-default.png 83 root/static/icons/changes-prevent.png 79 84 root/static/icons/dialog-cancel.png 85 root/static/icons/dialog-password.png 86 root/static/icons/document-save-as.png 87 root/static/icons/document-save.png 88 root/static/icons/emblem-urgent.png 89 root/static/icons/icon_edit.png 90 root/static/icons/expired.png 91 root/static/icons/gnome-session-logout.png 92 root/static/icons/gnome-stock-mail-snd.png 93 root/static/icons/gtk-about.png 94 root/static/icons/gtk-cancel.png 95 root/static/icons/gtk-close.png 96 root/static/icons/gtk-delete.png 97 root/static/icons/gtk-go-back-ltr.png 98 root/static/icons/gtk-go-back-rtl.png 99 root/static/icons/gtk-goto-first-ltr.png 100 root/static/icons/gtk-goto-first-rtl.png 101 root/static/icons/gtk-home.png 102 root/static/icons/gtk-jump-to-rtl.png 103 root/static/icons/locked.png 104 root/static/icons/mail_forward.png 105 root/static/icons/network-workgroup.png 106 root/static/icons/preferences-desktop-wallpaper.png 107 root/static/icons/stock_smiley-22.png 108 root/static/icons/system-config-users.png 109 root/static/icons/system-users.png 80 110 root/static/icons/user-group-delete.png 81 111 root/static/icons/user-group-new.png 82 112 root/static/icons/user-group-properties.png 113 root/static/icons/user-info.png 114 root/static/icons/user-invisible.png 83 115 root/static/icons/user-properties.png 116 root/static/icons/video-display.png 84 117 root/static/icons/view-calendar-day.png 118 root/static/icons/view-media-artist.png 119 root/static/icons/xfce-internet.png 85 120 root/static/images/btn_120x50_built.png 86 121 root/static/images/btn_120x50_built_shadow.png … … 98 133 root/static/images/mail-mark-important.png 99 134 root/static/images/process-stop.png 100 root/static/images/view-media-artist.png101 135 root/static/images/view-pim-contacts.png 102 136 root/static/js/CalendarPopup.js … … 114 148 t/02pod.t 115 149 t/03podcoverage.t 150 t/controller_About.t 116 151 t/controller_Ajax.t 117 152 t/controller_Aliases.t … … 119 154 t/controller_Groups.t 120 155 t/controller_MassEdit.t 156 t/controller_NetHost.t 121 157 t/controller_Sites.t 122 158 t/controller_Users.t -
LATMOS-Accounts-Web/Makefile.PL
r552 r861 4 4 all_from 'lib/LATMOS/Accounts/Web.pm'; 5 5 6 requires 'Catalyst' => '5.7015';6 #requires 'Catalyst' => '5.7015'; 7 7 requires 'Catalyst::Plugin::ConfigLoader'; 8 8 requires 'Catalyst::Plugin::Static::Simple'; … … 20 20 21 21 install_script glob('script/*.pl'); 22 auto_install; 23 WriteAll; 22 #auto_install; 23 WriteMakefile( 24 macro => { 25 DESTRPMDIR => '$(shell pwd)', 26 }, 27 ); 24 28 25 29 package MY; … … 27 31 sub postamble { 28 32 <<EOF; 29 .PHONY .= svnmanifest33 # .PHONY .= svnmanifest 30 34 31 35 svnmanifest: … … 39 43 40 44 rpm: \$(DISTVNAME).tar.gz latmos-accounts-web.spec 41 \tmkdir ./noarch || :45 \tmkdir \$(DESTRPMDIR)/noarch || : 42 46 \trpmbuild -ba --clean\\ 43 47 \t --define "_sourcedir `pwd`" \\ 44 48 \t --define "_specdir `pwd`" \\ 45 \t --define "_srcrpmdir `pwd`" \\ 46 \t --define "_rpmdir `pwd`" \\ 49 \t --define "_srcrpmdir \$(DESTRPMDIR)" \\ 50 \t --define "_rpmdir \$(DESTRPMDIR)" \\ 51 \t latmos-accounts-web.spec 52 53 svnrpm: \$(DISTVNAME).tar.gz latmos-accounts-web.spec 54 \tmkdir \$(DESTRPMDIR)/noarch || : 55 \trpmbuild -ba --clean\\ 56 \t --define "_sourcedir `pwd`" \\ 57 \t --define "_specdir `pwd`" \\ 58 \t --define "_srcrpmdir \$(DESTRPMDIR)" \\ 59 \t --define "_rpmdir \$(DESTRPMDIR)" \\ 60 \t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\ 47 61 \t latmos-accounts-web.spec 48 62 -
LATMOS-Accounts-Web/latmos-accounts-web.spec.in
r737 r861 2 2 %define name latmos-accounts-web 3 3 %define version @VERSION@ 4 %define release %mkrel 14 %define release %mkrel %{?svnrelease:0.%{svnrelease}}%{?!svnrelease:1} 5 5 6 6 Name: %{name} … … 81 81 fi 82 82 83 %triggerpostun -- latmos-accounts 84 /sbin/service %name restart 85 83 86 %files 84 87 %defattr(-,root,root) -
LATMOS-Accounts-Web/latmos_accounts_web.yml.in
r97 r861 1 1 --- 2 2 name: LATMOS::Accounts::Web 3 # config: /etc/latmos-accounts/latmos-accounts.ini 4 # company: COMPANY NAME -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web.pm
r860 r861 24 24 /; 25 25 26 our $VERSION = ' 0.0.11';26 our $VERSION = '2.0.0'; 27 27 28 28 # Configure the application. 29 # 30 # Note that settings in LATMOS::Accounts::Web.yml (or other external 31 # configuration file that you set up manually) take precedence 32 # over this when using ConfigLoader. Thus configuration 33 # details given here can function as a default configuration, 34 # with a external configuration file acting as an override for 35 # local deployment. 29 30 my $config_file = '/etc/latmos-accounts/latmos-accounts-web.yml'; 31 if (-r $config_file ) { 32 __PACKAGE__->config( 'Plugin::ConfigLoader' => { 33 file => $config_file 34 } 35 ); 36 } 36 37 37 38 # http://stackoverflow.com/questions/1664816/is-there-a-way-to-force-c-urifor-in-catalyst-to-generate-a-uri-that-begins-wit -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller.pm
r718 r861 25 25 26 26 if (!$c->user_exists) { 27 if ($c->req->path ne 'login') { 28 $c->forward('/login'); 27 # No need to login for About section 28 if ($c->namespace ne 'about') { 29 if ($c->req->path ne 'login') { 30 $c->forward('/login'); 31 } 32 return; 29 33 } 30 34 } else { 31 $c->model('Accounts')->db->connect($c->user->{username}, 35 $c->model('Accounts')->db->connect( 36 $c->user->{username}, 32 37 $c->user->{password}); 33 38 } 34 35 my $menu = '';36 my @menus = (37 [ 'users' => 'Utilisateurs' ],38 ($c->model('Accounts')->db->check_acl('user', '@CREATE', 'w')39 ? [ 'create/user' => 'Nouvel Util.' ]40 : ()),41 [ 'groups' => 'Groupes' ],42 ($c->model('Accounts')->db->check_acl('group', '@CREATE', 'w')43 ? [ 'create/group' => 'Nouveau Groupe' ]44 : ()),45 [ 'sites' => 'Sites' ],46 [ 'aliases' => 'Alias Mail' ],47 );48 foreach(@menus) {49 $menu .= sprintf(50 q{<a href="%s"><span%s>%s</span></a>},51 $c->uri_for('/' . $_->[0]),52 ($c->req->path =~ m:^$_->[0]: ? ' id="actif"' : ''),53 $_->[1],54 );55 56 }57 $c->stash->{mainmenu} = $menu;58 39 } 59 40 -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Ajax.pm
r755 r861 45 45 } 46 46 47 sub displayattr : Local { 48 my ($self, $c, $otype) = @_; 49 my $attribute = $c->model('Accounts')->db->attribute($otype, 50 $c->req->param('attr')) or return; 51 $c->stash->{value} = $attribute->display($c->req->param('id')); 52 } 53 47 54 sub attrvalues : Local { 48 55 my ($self, $c, $otype, $attr) = @_; … … 63 70 64 71 $c->stash->{'exists'} = join(', ', $obj->get_attributes($c->req->param('attr') || 65 'displayName') ) if($obj);72 'displayName') || $obj->id) if($obj); 66 73 } 67 74 … … 88 95 my ($self, $c, $otype, $attr) = @_; 89 96 my $base = $c->model('Accounts')->db; 90 my $val = $c->req->param('val'); 97 my $attribute = $base->attribute($otype, $attr) or return; 98 my $val = $attribute->input($c->req->param('val')); 91 99 my @obj = $val ? $base->search_objects($otype, "$attr=$val") : (); 92 100 … … 125 133 } 126 134 135 sub select_freeip_select : Local { 136 my ($self, $c) = @_; 137 138 } 139 140 sub goto : Local { 141 my ($self, $c) = @_; 142 143 $c->res->redirect( 144 $c->uri_for('/' . $c->req->param('otype') . 's', $c->req->param('goto'), 145 $c->req->param('subform')) 146 ); 147 $c->stash->{template} = 'no_object.tt'; 148 } 149 150 127 151 sub end : Private { 128 152 my ( $self, $c ) = @_; -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Aliases.pm
r641 r861 29 29 my @name = $c->req->param('name'); 30 30 my @forward = $c->req->param('forward'); 31 $c->stash->{page}{title} = "Gestion des alias"; 31 32 foreach my $idx (0 .. scalar(@name) - 1) { 32 33 -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Create.pm
r765 r861 5 5 use base 'LATMOS::Accounts::Web::Controller'; 6 6 use LATMOS::Accounts::Utils; 7 use LATMOS::Accounts::Log; 7 8 8 9 =head1 NAME … … 29 30 } 30 31 31 sub user : Local { 32 my ( $self, $c ) = @_; 33 32 sub default : LocalPath { 33 my ($self, $c, undef, $otype ) = @_; 34 34 my $base = $c->model('Accounts')->db; 35 $c->stash->{form} = $c->model('AttrForms', undef, 'user', $base); 36 for ($c->req->param('step') || '') { 37 /^1$/ and do { 38 $c->stash->{step} = 2; 39 my $acc = $c->model('Accounts')->accounts; 40 foreach ($acc->Parameters('_defattr_')) { 41 if (/^user\.(.*)/) { 42 $c->req->params->{$1} ||= $acc->val('_defattr_', $_); 43 } 44 } 45 $c->req->params->{exported} = 1; 46 if (! $c->req->params->{id}) { 47 for (1) { 48 my $login; 49 if ($c->req->param('sn')) { 50 $login = lc(to_ascii($c->req->param('sn'))); 51 length($login) > 10 and $login = substr($login, 0, 8); 52 $base->get_object('user', $login) or do { 53 $c->req->params->{id} = $login; 54 last; 55 }; 56 if ($c->req->param('givenName')) { 57 length($login) > 8 and $login = substr($login, 0, 8); 58 $login .= substr(lc(to_ascii($c->req->param('givenName'))), 0, 1); 59 $base->get_object('user', $login) or do { 60 $c->req->params->{id} = $login; 61 last; 62 }; 63 } 64 } 65 } 66 67 my $mailid = $c->req->params->{givenName} && $c->req->params->{sn} 68 ? sprintf('%s.%s', 69 to_ascii(lc($c->req->params->{givenName})), 70 to_ascii(lc($c->req->params->{sn})),) 71 : undef; 72 73 if ($mailid && 74 $base->is_supported_object('aliases') && 75 ! $base->get_object('aliases', $mailid)) { 76 if ($base->get_field_name('user', 'mail', 'write')) { 77 if ($base->{defattr}{'user.maildomain'}) { 78 $c->req->params->{mail} ||= sprintf('%s@%s', 79 $mailid, 80 $base->{defattr}{'user.maildomain'}); 81 } 82 } 83 if ($base->get_field_name('user', 'aliases', 'write')) { 84 $c->req->params->{aliases} ||= $mailid; 85 } 86 warn $base->get_field_name('user', 'revaliases', 'write'); 87 if ($base->get_field_name('user', 'revaliases', 'write')) { 88 $c->req->params->{revaliases} ||= $mailid; 89 } 90 } 91 } 92 last; 93 }; 94 /^2$/ and do { 95 $c->stash->{step} = 2; 96 $c->req->params->{id} or return; 97 $base->get_object('user', $c->req->params->{id}) and do { 98 $c->stash->{idexists} = 1; 99 return; 100 }; 101 $base->create_c_object('user', $c->req->params->{id}, 102 %{ $c->req->params }, 103 exported => $c->req->param('exported') ? 1 : 0, 104 ) or return; 105 $base->commit; 106 $c->res->redirect($c->uri_for('/users', $c->req->params->{id})); 107 last; 108 }; 35 my ($step) = $c->req->param('step'); 36 my $form = $c->model('AttrForms', undef, $otype, $base); 37 my ($status, $info); 38 $c->stash->{page}{title} = "Ajouter un objet / $otype"; 39 if ($step) { 40 $info = $c->session->{ochelper}; 109 41 } 42 if ($info->{name}{ask}) { 43 $info->{name}{content} = $c->req->param('_name'); 44 } 45 foreach my $attr (@{$info->{ask} || []}) { 46 $info->{contents}{$attr} = $c->req->param($form->attr_field_name($attr)); 47 } 48 my $ochelper = $base->ochelper($otype); 49 ($status, $info) = $ochelper->step($info); 50 51 if ($status eq 'CREATED') { 52 $base->commit; 53 $c->res->redirect($c->uri_for('/' . $otype . 's', 54 $info->{name}{content})); 55 } elsif ($status eq 'ERROR') { 56 # On error, restart the process 57 $c->stash->{page}{error} = 58 'Erreur lors de la création de l\'objet: ' . 59 LATMOS::Accounts::Log::lastmessage(LA_ERR); 60 foreach my $attr (@{$info->{ask} || []}) { 61 $c->req->params->{$form->attr_field_name($attr)} = $info->{contents}{$attr}; 62 } 63 $info->{step} = 0; # reset 64 ($status, $info) = $ochelper->step($info); 65 } else { 66 foreach my $attr (@{$info->{ask} || []}) { 67 $c->req->params->{$form->attr_field_name($attr)} = $info->{contents}{$attr}; 68 } 69 } 70 $c->stash->{form} = $form; 71 $c->stash->{ochelper} = $info; 72 $c->session->{ochelper} = $info; 110 73 } 111 74 112 sub group : Local {113 my ( $self, $c ) = @_;114 115 my $base = $c->model('Accounts')->db;116 $c->stash->{form} = $c->model('AttrForms', undef, 'group', $base);117 if (!exists($c->req->params->{id})) {118 $c->req->params->{exported} = 1;119 }120 121 if ($c->req->params->{id}) {122 $base->get_object('group', $c->req->params->{id}) and do {123 $c->stash->{idexists} = 1;124 return;125 };126 $base->create_c_object('group', $c->req->params->{id},127 %{ $c->req->params },128 exported => $c->req->param('exported') ? 1 : 0,129 ) or return;130 $base->commit;131 $c->res->redirect($c->uri_for('/groups', $c->req->params->{id}));132 }133 }134 75 135 76 =head1 AUTHOR -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Groups.pm
r718 r861 27 27 $c->stash->{ofilter} = $c->model('AttrFilter', 'group'); 28 28 $c->stash->{groupslist} = [ map { $_->id } @{ $c->stash->{objectslist} } ]; 29 $c->stash->{page}{title} = "Liste des groupes"; 29 30 30 31 } … … 35 36 my $base = $c->model('Accounts')->db; 36 37 38 $c->stash->{page}{title} = "Groupe :: $groupname"; 37 39 $c->stash->{groupname} = $groupname; 38 40 $c->stash->{group} = $base->get_object('group', $groupname) or do { … … 65 67 last; 66 68 }; 69 /^dpmt$/ and do { 70 $c->stash->{template} = 'groups/dpmt.tt'; 71 my @filter = (); 72 push(@filter, 'active=*') if (!$c->req->param('inactive')); 73 push(@filter, 'mail=*') if ($c->req->param('mail')); 74 push(@filter, 'company=' . $c->req->param('company')) if 75 ($c->req->param('company')); 76 $c->stash->{dpmt} = $groupname; 77 $c->stash->{odpmt} = $c->stash->{group}; 78 $c->stash->{user} = [ $base->search_objects('user', 79 'department=' . $c->stash->{dpmt}, 80 @filter, 81 ) ]; 82 foreach my $u ($base->search_objects('user', 83 'memberOf=' . $c->stash->{dpmt}, 84 @filter, 85 )) { 86 push(@{$c->{stash}->{guser}}, $u) 87 unless(grep { $u eq $_ } @{$c->stash->{user}}); 88 } 89 last; 90 }; 67 91 68 92 $c->stash->{form} = $c->model('AttrForms', 'group' . $c->stash->{subform}, $c->stash->{group}); -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Sites.pm
r718 r861 27 27 $c->stash->{ofilter} = $c->model('AttrFilter', 'site'); 28 28 $c->stash->{siteslist} = [ map { $_->id } @{ $c->stash->{objectslist} } ]; 29 $c->stash->{page}{title} = "Liste des sites"; 29 30 } 30 31 … … 34 35 my $base = $c->model('Accounts')->db; 35 36 37 $c->stash->{page}{title} = "Site :: $sitename"; 36 38 $c->stash->{sitename} = $sitename; 37 39 $c->stash->{site} = $base->get_object('site', $sitename) or do { -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Users.pm
r759 r861 43 43 $c->stash->{initials} = [ sort keys %initials ]; 44 44 } 45 $c->stash->{page}{title} = 'Listes des utilisateurs (' . scalar(@{ 46 $c->stash->{objectslist} }) . ')'; 45 47 $c->stash->{userslist} = \@userlist; 46 48 } … … 51 53 my $base = $c->model('Accounts')->db; 52 54 55 $c->stash->{page}{title} = "Utilisateur :: $username"; 53 56 $c->stash->{username} = $username; 54 57 $c->stash->{user} = $base->get_object('user', $username) or do { … … 57 60 }; 58 61 $c->stash->{subform} = $subform || ''; 62 $c->stash->{page}{title} = "Utilisateur :: $username"; 59 63 60 64 for ($subform || '') { … … 155 159 last; 156 160 }; 161 /^my$/ and do { 162 $c->stash->{db} = $base; 163 $c->stash->{template} = 'users/my.tt'; 164 }; 157 165 /^dump$/ and do { 158 166 $c->stash->{db} = $base; -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/Accounts.pm
r791 r861 56 56 } 57 57 58 sub object_navigate { 59 my ($self, $otype, $id, @filter) = @_; 60 61 my @list = $self->db->search_objects($otype, @filter); 62 63 my $i = 0; 64 for($i = 0; $i <= $#list; $i++) { 65 $list[$i] eq $id and last; 66 } 67 68 my %ptr = (); 69 $ptr{oprev} = $list[$i-1] if ($i > 0); 70 $ptr{'onext'} = $list[$i+1] if ($i < $#list); 71 $ptr{ofirst} = $list[0] if ($i > 1); 72 $ptr{'olast'} = $list[$#list] if ($i < $#list -1); 73 $ptr{list} = \@list; 74 75 return \%ptr; 76 } 77 58 78 # Such function must not be here, but in LATMOS::Accounts 59 79 # But code does not allow this at time -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrFilter.pm
r638 r861 19 19 group => [ qw(cn description gidNumber sutype) ], 20 20 site => [ qw(l) ], 21 nethost => [ qw(name cname otherName ip macaddr owner serialNumber) ], 22 netzone => [ qw(net group type site) ], 21 23 }; 22 24 -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrForms.pm
r804 r861 4 4 use warnings; 5 5 use base 'Catalyst::Model'; 6 use LATMOS::Accounts::Log; 6 7 7 8 =head1 NAME … … 39 40 sutype => [ 'Structure admin.', 'select-N:sutype' ], 40 41 exported => [ 'Propagé', 'label' ], 42 unexported => [ 'Caché' ], 41 43 locked => [ 'Vérouillé', 'checkbox:l' ], 42 44 isMainAddress => [ 'Adresse principale', 'checkbox' ], … … 54 56 contratType => [ 'Type de contrat', 'select-N:group/sutype=contrattype' ], 55 57 managerContact => [ 'Contact' ], 58 owner => [ 'Propriétaire' ], 59 description => [ 'Description' ], 60 name => [ 'Nom' ], 61 net => [ "Réseau" ], 62 macaddr => [ "Adresse Ethernet" ], 63 noDynamic => [ "Pas d'adressage dyn." ], 64 cname => [ "Alias (CName)" ], 65 type => [ "Type" ], 66 netExclude => [ "Réseau exclus" ], 67 output => [ "Sortie" ], 68 template => [ "ModÚle" ], 69 outputD => [ "Sortie" ], 70 templateD => [ "ModÚle" ], 71 group => [ "Groupe" ], 72 allow_dyn => [ "DHCP dynamique" ], 73 ipCount => [ "Nb d'IP" ], 74 freeIPCount => [ "Nb d'IP libres" ], 75 dnsRevision => [ "Révision DNS" ], 76 lastUpdate => [ "DerniÚre mise à jour "], 77 otherName => [ "Autres noms (A)" ], 78 'reverse' => [ "Forcer le reverse à " ], 79 dynFrom => [ 'Sans Ip depuis' ], 80 siteNick => [ 'Acronyme' ], 81 serialNumber => [ 'N° de série' ], 82 snNative => [ 'Nom d\'origine' ], 83 givenNameNative => [ 'Prénom d\'origine' ], 84 wWWHomePage => [ 'Site Web' ], 85 halReference => [ 'Référence HAL' ], 56 86 }; 57 87 … … 64 94 mail initials nickname 65 95 locked 66 exported67 96 create 68 97 date … … 76 105 ) ], 77 106 }, 78 userstatu s=> {79 name => 'Statu s',107 userstatut => { 108 name => 'Statut', 80 109 attrs => [ qw( 81 110 company … … 87 116 ) ], 88 117 }, 118 usermy => { 119 name => 'My', 120 attrs => [ qw( 121 snNative 122 givenNameNative 123 wWWHomePage 124 halReference 125 ) ], 126 }, 89 127 site => { 90 128 name => 'Site', 91 129 attrs => [ qw( 92 130 description 131 siteNick 93 132 streetAddress 94 133 postOfficeBox … … 115 154 site 116 155 co 117 exported156 unexported 118 157 description 119 158 ) ], … … 124 163 gidNumber description 125 164 managedBy 126 sutype exported165 sutype 127 166 create 128 167 date 168 ) ], 169 }, 170 nethost => { 171 name => 'Ordinateur', 172 attrs => [ qw( 173 name 174 description 175 serialNumber 176 owner 177 ip 178 macaddr 179 noDynamic 180 cname 181 otherName 182 reverse 183 create 184 date 185 unexported 186 ) ], 187 }, 188 netzone => { 189 name => 'Zone réseau', 190 attrs => [ qw( 191 name 192 description 193 type 194 net 195 netExclude 196 outputD 197 templateD 198 site 199 allow_dyn 200 dynFrom 201 domain 202 ipCount 203 freeIPCount 204 create 205 date 206 dnsRevision 207 lastUpdate 208 unexported 129 209 ) ], 130 210 }, … … 179 259 my ($self, $for) = @_; 180 260 grep { $_ } 181 grep { $self->base->check_acl($self->{object} || $self->otype, $_, 'r') } 182 grep { $self->base->get_field_name($self->otype, $_, $for || 'a') } 261 grep { $self->base->attribute($self->otype, $_) } 183 262 @{ $forms->{$self->{form}}->{attrs} }; 184 263 } … … 196 275 my ($self, $attr) = @_; 197 276 return $self->{c}->req->param($attr) || 198 ($self->{object} ? $self->{object}->get_c_field($attr) : '') 199 } 200 201 sub attr_field { 202 my ($self, $attr, $type) = @_; 203 my $modallow = $self->base->check_acl($self->{object} 204 ? ($self->{object}, $attr, 'w') 205 : ($self->otype, '@CREATE', 'w')); 206 $type ||= $attrs->{$attr}[1] || ''; 207 if (!($self->base->get_field_name($self->otype, $attr, 'w') && $modallow)) { 208 $type = 'label'; 209 } 210 # exception: gidNumber is used also in group, but we don't want 211 # group list here, really the number ! 212 $type = $modallow ? 'text-U:6' : 'label' if ($self->{otype} eq 'group' && $attr eq 'gidNumber'); 213 $type ||= 'text'; 214 215 my $htmlname = $self->escape(($self->{object} 277 ($self->{object} ? $self->{object}->get_attributes($attr) : '') 278 } 279 280 sub attr_field_name { 281 my ($self, $attr) = @_; 282 return ($self->{object} 216 283 ? $self->{object}->id . '_' 217 284 : '' 218 285 ) . $attr 219 ); 220 for ($type) { 221 /^textarea$/ and return sprintf( 222 '<textarea id="%s" name="%s" cols="40">%s</textarea>', 223 $self->escape($htmlname), 224 $self->escape($htmlname), 225 $self->escape($self->attr_raw_value($attr) || ''), 226 ); 227 /^label$/ and do { 228 my $field = $self->escape( 229 $self->attr_raw_value($attr) 230 ); 231 $field =~ s/\n/<br>/g; 232 return $field . sprintf('<input type="hidden" name="%s" value="%s">', 233 $self->escape($htmlname), ($self->attr_raw_value($attr) || '')); 234 }; 235 /^date$/ and do { 236 my ($date, $time) = split(/ /, $self->attr_raw_value($attr) || ''); 237 if ($date && $date =~ /^(\d+)-(\d+)-(\d+)$/) { 238 $date = "$3/$2/$1"; 239 } 240 my $html = "\n" . q{<SCRIPT LANGUAGE="JavaScript" ID="js13"> 241 var cal13 = new CalendarPopup(); 242 </SCRIPT>} . "\n"; 243 $html .= sprintf( 244 '<input type="text" id="%s" name="%s" value="%s" size="12">', 245 $self->escape($htmlname), 246 $self->escape($htmlname), 247 $self->escape($date) 248 ); 249 $html .= q{<DIV ID="testdiv1" STYLE="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"></DIV>}; 250 $html .= qq| 251 <A HREF="#" 252 onClick="cal13.select(document.forms[0].$htmlname,'${htmlname}_anc','dd/MM/yyyy');return false;" 253 TITLE="cal13.select(document.forms[0].$htmlname,'${htmlname}_anc','dd/MM/yyyy');return false;" 254 NAME="${htmlname}_anc" ID="${htmlname}_anc"> 255 <img src="| . $self->{c}->uri_for(qw(/static icons view-calendar-day.png)) 256 . qq{" style="ref"></A> 257 } . "\n"; 258 return $html; 259 }; 260 /^checkbox(?::(\w+))?$/ and do { 261 my $options = $1 || ''; 262 my $text = sprintf('<input type="checkbox" name="%s"%s>', 263 $self->escape($htmlname), 264 $self->attr_raw_value($attr) ? ' checked="yes"' : '' 265 ); 266 $text .= sprintf('<input type="hidden" name="%s">', 267 $self->escape($htmlname)); 268 if ($options =~ /l/) { 269 $text .= $self->attr_raw_value($attr) 270 ? ' ' . $self->attr_raw_value($attr) 271 : ''; 272 } 273 return $text; 274 }; 275 /^select(-\w+)?:([^:\/]+)(?:\/([^:]+))?(?::(.*))?/ and do { 276 my $options = $1 || ''; 277 my $otype = $2; 278 my $filter = $3; 279 my $keyfield = $4; 280 my $observe_keyfield = $keyfield || 'displayName'; 281 my $select = sprintf('<select id="%s" name="%s">', 282 $self->escape($htmlname), 283 $self->escape($htmlname)) . "\n"; 284 $select .= '<option value="">--</option>' . "\n" if ($options =~ /N/); 285 my $value = $self->attr_raw_value($attr) || ''; 286 my $initial_observed = ''; 287 foreach my $id (sort $filter 288 ? $self->base->search_objects($otype, $filter) 289 : $self->base->list_objects($otype)) { 290 my $val = $id; 291 if ($keyfield) { 292 my $obj = $self->base->get_object($otype, $id) or next; 293 $val = $obj->get_c_field($keyfield); 294 } 295 $select .= sprintf( 296 ' <option value="%s"%s>%s</option>', 297 $self->escape($val || ''), 298 $value eq $val ? ' selected="selected"' : '', 299 $self->escape($id || ''), 286 } 287 288 sub attr_field { 289 my ($self, $attr, $type) = @_; 290 291 my $attribute = ($self->{object} 292 ? $self->{object}->attribute($attr) 293 : $self->base->attribute($self->otype, $attr)) or return; 294 295 my $htmlname = $self->escape($self->attr_field_name($attr)); 296 297 my @html_fields; 298 foreach my $attr_raw_value ( 299 $attribute->{multiple} 300 ? ((grep { $_ } $self->attr_raw_value($attr)), 301 $attribute->readonly 302 ? () 303 : ('') 304 ) 305 : ($self->attr_raw_value($attr))) { 306 307 my $html_id = $htmlname . 308 (scalar(@html_fields) ? scalar(@html_fields) : ''); 309 310 my $html_field = ''; 311 for ($attribute->form_type) { 312 /^textarea$/i and do { 313 $html_field = sprintf( 314 '<textarea id="%s" name="%s" cols="40">%s</textarea>', 315 $self->escape($html_id), 316 $self->escape($htmlname), 317 $self->escape($attr_raw_value || ''), 300 318 ); 301 $select .= "\n"; 302 if($value eq $val) { 303 if (my $obj = $self->base->get_object($otype, $id)) { 304 $initial_observed = $obj->get_c_field($observe_keyfield) 305 || ''; 306 } 307 } 308 } 309 $select .= "</select>\n"; 310 $select .= $self->{c}->prototype->observe_field( $htmlname, { 311 update => "${htmlname}_span", 312 url => $self->{c}->uri_for('/ajax', 'rawattr', $otype), 313 frequency => 1, 314 with => "'attr=" . $observe_keyfield . 315 "&id='+element.options[element.selectedIndex].text", 316 }) . 317 qq|<span id="${htmlname}_span">$initial_observed</span>|; 318 return $select; 319 }; 320 /^text(-\w+)?(?::(\d+))?/ and do { 321 my $flag = $1 || ''; 322 if (my @allowed = $self->base->obj_attr_allowed_values( 323 $self->{otype}, $attr)) { 324 my $cvalue = $self->attr_raw_value($attr); 325 my $textf = sprintf('<select id="%s" name="%s">', 319 last; 320 }; 321 /^label$/i and do { 322 $attr_raw_value or last; 323 $html_field = $self->escape($attr_raw_value); 324 $html_field =~ s/\n/<br>/g; 325 $html_field .= sprintf('<input type="hidden" name="%s" value="%s">', 326 $self->escape($htmlname), ($attr_raw_value || '')); 327 last; 328 }; 329 /^date$/i and do { 330 my ($date, $time) = split(/ /, $self->attr_raw_value($attr) || ''); 331 if ($date && $date =~ /^(\d+)-(\d+)-(\d+)$/) { 332 $date = "$3/$2/$1"; 333 } 334 my $html = "\n" . q{<SCRIPT LANGUAGE="JavaScript" ID="js13"> 335 var cal13 = new CalendarPopup(); 336 </SCRIPT>} . "\n"; 337 $html .= sprintf( 338 '<input type="text" id="%s" name="%s" value="%s" size="12">', 339 $self->escape($html_id), 326 340 $self->escape($htmlname), 341 $self->escape($date) 342 ); 343 $html .= q{<DIV ID="testdiv1" STYLE="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"></DIV>}; 344 $html .= qq| 345 <A HREF="#" 346 onClick="cal13.select(document.getElementById('$html_id'),'${html_id}_anc','dd/MM/yyyy');return false;" 347 TITLE="Date" 348 NAME="${html_id}_anc" ID="${html_id}_anc"> 349 <img class="attr" src="| . $self->{c}->uri_for(qw(/static icons view-calendar-day.png)) 350 . qq{" style="ref"></A> 351 } . "\n"; 352 $html_field = $html; 353 last; 354 }; 355 /^checkbox(?::(\w+))?$/i and do { 356 my $options = $1 || ''; 357 $html_field = sprintf('<input type="checkbox" name="%s"%s>', 358 $self->escape($htmlname), 359 $attr_raw_value ? ' checked="yes"' : '' 360 ); 361 $html_field .= sprintf('<input type="hidden" name="%s">', 362 $self->escape($htmlname)); 363 if ($attribute->form_option('rawvalue')) { 364 $html_field .= $attr_raw_value 365 ? ' ' . $attr_raw_value 366 : ''; 367 } 368 last; 369 }; 370 /^LIST/ and do { 371 my $options = $1 || ''; 372 my $select = sprintf('<select id="%s" name="%s">', 373 $self->escape($html_id), 327 374 $self->escape($htmlname)) . "\n"; 328 $textf .= '<option value="">--</option>' . "\n"; 329 foreach (sort @allowed) { 330 $textf .= sprintf('<option value="%s"%s>%s</option>' . "\n", 331 $self->escape($_), 332 (($cvalue || '') eq $_ ? ' selected="selected"' : ''), 333 $self->escape($_), 375 $select .= '<option value="">--</option>' . "\n" 376 unless($attribute->mandatory); 377 my $value = $attr_raw_value || ''; 378 my $initial_observed = ''; 379 my @valslist; 380 foreach my $val (sort $attribute->can_values) { 381 push(@valslist, { 382 val => $val, 383 disp => $attribute->display($val || ''), 384 }); 385 } 386 foreach (sort { $a->{disp} cmp $b->{disp} } @valslist) { 387 $select .= sprintf( 388 ' <option value="%s"%s>%s</option>', 389 $self->escape($_->{val} || ''), 390 $value eq $_->{val} ? ' selected="selected"' : '', 391 $self->escape($_->{disp} || ''), 334 392 ); 335 } 336 $textf .= "</select>\n"; 337 return $textf; 338 } else { 339 my $textf = sprintf( 393 $select .= "\n"; 394 } 395 $select .= "</select>\n"; 396 397 $html_field = $select; 398 last; 399 }; 400 /^text(-\w+)?(?::(\d+))?/i and do { 401 my $flag = $1 || ''; 402 $html_field = sprintf( 340 403 '<input type="text" id="%s" name="%s" value="%s" size="%d">', 404 $self->escape($html_id), 341 405 $self->escape($htmlname), 342 $self->escape($htmlname), 343 $self->escape($self->attr_raw_value($attr)), 344 $2 || 30, 406 $self->escape($attr_raw_value), 407 $attribute->form_option('length') || 30, 345 408 ); 346 409 if ($flag =~ /A/) { 347 $textf .= qq|<span id="${htmlname}_auto_complete"></span>|; 348 $textf .= "\n"; 349 $textf .= $self->{c}->prototype->auto_complete_field( 350 $htmlname, 351 { 352 update => "${htmlname}_auto_complete", 353 url => $self->{c}->uri_for('/ajax', 'attrvalues', $self->otype, $attr), 354 indicator => "${htmlname}_stat", min_chars => 1, 355 with => "'val='+document.getElementById('$htmlname').value", 356 frequency => 2, 357 } 358 ); 359 } 360 if ($flag =~ /U/) { 361 $textf .= qq|<span id="${htmlname}_observer_uniq"></span>|; 362 $textf .= "\n"; 363 $textf .= $self->{c}->prototype->observe_field( 364 $htmlname, 365 { 366 update => "${htmlname}_observer_uniq", 367 url => $self->{c}->uri_for('/ajax', 'objattrexist', 368 $self->otype, $attr), 369 frequency => 2, 370 indicator => "${htmlname}_stat", min_chars => 1, 371 with => "'val='+document.getElementById('$htmlname').value" . 372 ($self->{object} ? "+'&exclude=" . $self->{object}->id . "'" : 373 ''), 374 } 375 ); 376 } 377 $textf .= qq|<span style="display:none" id="${htmlname}_stat">Searching...</span>|; 378 379 return $textf; 410 $html_field .= qq|<span id="${html_id}_auto_complete"></span>|; 411 $html_field .= "\n"; 412 $html_field .= $self->{c}->prototype->auto_complete_field( 413 $html_id, 414 { 415 update => "${html_id}_auto_complete", 416 url => $self->{c}->uri_for('/ajax', 'attrvalues', $self->otype, $attr), 417 indicator => "${html_id}_stat", min_chars => 1, 418 with => "'val='+document.getElementById('$html_id').value", 419 frequency => 2, 420 } 421 ); 422 } 423 if ($attribute->uniq) { 424 $html_field .= qq|<span class="inputvalidate" id="${html_id}_observer_uniq"></span>|; 425 $html_field .= "\n"; 426 $html_field .= $self->{c}->prototype->observe_field( 427 $html_id, 428 { 429 update => "${html_id}_observer_uniq", 430 url => $self->{c}->uri_for('/ajax', 'objattrexist', 431 $self->otype, $attr), 432 frequency => 2, 433 indicator => "${html_id}_stat", min_chars => 1, 434 with => "'val='+document.getElementById('$html_id').value" . 435 ($self->{object} ? "+'&exclude=" . $self->{object}->id . "'" : 436 ''), 437 } 438 ); 439 $html_field .= qq|<span style="display:none" id="${html_id}_stat">Searching...</span>|; 440 } 441 last; 442 }; 443 } 444 if (my $ref = $attribute->reference) { 445 my $uri_part= { 446 user => 'users', 447 group => 'groups', 448 nethost => 'nethosts', 449 netzone => 'netzones', 450 site => 'sites' 451 }->{$ref}; 452 my $text; 453 if ($self->base->attribute($ref, 'displayName')) { 454 if ($attr_raw_value && 455 (my $obj = $self->base->get_object($ref, $attr_raw_value))) 456 { 457 $text = $obj->get_attributes('displayName'); 458 } 459 460 $html_field .= $self->{c}->prototype->observe_field( $html_id, { 461 update => "${html_id}_span", 462 url => $self->{c}->uri_for('/ajax', 'rawattr', $ref), 463 frequency => 1, 464 with => "'attr=displayName" . 465 "&id=' + element.options[element.selectedIndex].text", 466 }) . "\n" if ($attribute->form_type =~ /list/i); 467 } elsif($attr_raw_value && $uri_part) { 468 $text = sprintf( 469 '<img class="attr" src="%s" title="%s">', 470 $self->{c}->uri_for('/static', 'icons', 'arrow-right.png'), 471 $attr_raw_value, 472 ) 380 473 } 381 }; 474 $html_field .= sprintf(qq{<span id="%s" style="margin-left: 1em">}, 475 "${html_id}_span"); 476 477 if (defined($text)) { 478 $html_field .= $uri_part 479 ? sprintf('<a href="%s">%s</a>', 480 $self->{c}->uri_for("/$uri_part", $attribute->display($attr_raw_value)), 481 $text,) 482 : $text; 483 } 484 485 $html_field .= "</span>\n"; 486 } 487 push(@html_fields, $html_field); 382 488 } 489 return join("<br>\n", @html_fields); 383 490 } 384 491 … … 391 498 } 392 499 500 sub write_attributes { 501 my ($self) = @_; 502 my @attrs; 503 foreach ($self->attributes) { 504 my $attr = ($self->{object} 505 ? $self->{object}->attribute($_) 506 : $self->base->attribute($self->otype, $_)) or next; 507 $attr->readonly and next; 508 push(@attrs, $_); 509 } 510 @attrs; 511 } 512 393 513 sub set_attrs { 394 514 my ($self) = @_; … … 396 516 my $prefix = $self->{object}->id . '_'; 397 517 my %fields; 398 foreach ( 399 grep { $self->base->get_field_name($self->otype, $_, 'w') } 400 $self->attributes) { 518 foreach ($self->write_attributes) { 519 my $attr = ($self->{object} 520 ? $self->{object}->attribute($_) 521 : $self->base->attribute($self->otype, $_)) or next; 401 522 if (($attrs->{$_}[1] || '') eq 'checkbox') { 402 523 $fields{$_} = $self->{c}->req->param("$prefix$_") ? 1 : 0; 524 } elsif ($attr->{multiple}) { 525 $fields{$_} = [ grep { $_ } $self->{c}->req->param("$prefix$_") ]; 403 526 } else { 404 527 $fields{$_} = $self->{c}->req->param("$prefix$_"); 405 528 } 406 529 } 407 $self->{object}->set_c_fields(%fields) or return; 530 $self->{object}->set_c_fields(%fields) or do { 531 $self->{c}->stash->{page}{error} = 532 LATMOS::Accounts::Log::lastmessage(LA_ERR); 533 $self->{object}->base->rollback; 534 return; 535 }; 408 536 $self->{object}->base->commit; 409 537 } -
LATMOS-Accounts-Web/root/html/ajax/objexist.tt
r500 r861 1 1 [% IF exists %] 2 <img src="[% c.uri_for('/static', 'images', 'dialog-cancel.png') %]">2 <img class="attr" src="[% c.uri_for('/static', 'images', 'dialog-cancel.png') %]"> 3 3 ([% exists %]) 4 4 [% ELSE %] 5 <img src="[% c.uri_for('/static', 'images', 'dialog-ok-apply.png') %]">5 <img class="attr" src="[% c.uri_for('/static', 'images', 'dialog-ok-apply.png') %]"> 6 6 [% END %] -
LATMOS-Accounts-Web/root/html/departments/default.tt
r148 r861 1 <!-- $Id: default.tt 432 2009-05-17 13:19:38Z nanardon $ -->1 <!-- $Id: default.tt 2800 2010-08-01 12:02:51Z nanardon $ --> 2 2 [% IF NOT department %] 3 3 No department [% departmentname | html %] found. -
LATMOS-Accounts-Web/root/html/departments/menu.tt
r148 r861 1 <!-- $Id: user_menu.tt 443 2009-05-18 03:52:21Z nanardon $ -->1 <!-- $Id: menu.tt 2800 2010-08-01 12:02:51Z nanardon $ --> 2 2 <div> 3 3 <table border="0"> -
LATMOS-Accounts-Web/root/html/groups/index.tt
r220 r861 10 10 <table border="0"> 11 11 <tr><td colspan="2">[% groupslist.size %] groupes</td></tr> 12 <tr><th>Nom</th><th>Description</th>< /tr>12 <tr><th>Nom</th><th>Description</th><th></th></tr> 13 13 [% FOREACH groupname = groupslist %] 14 14 [% group = db.get_object('group', groupname) %] 15 15 <tr> 16 <td>[% group.id | html %]</td> 17 <td>[% group.get_c_field('description') | truncate(30) | html %] 18 <a href="[% c.uri_for('/groups', groupname) %]"> 19 <img src="[% c.uri_for('/static', 'icons', 'arrow-right.png') %]" 16 <td><a href="[% c.uri_for('/groups', groupname) %]"> 17 <img src="[% c.uri_for('/static', 'icons', 'icon_edit.png') %]" 20 18 height="16" width="16" 21 19 alt="[% "edit " _ groupname | html %]"> 22 </a></td> 20 </a> [% group.id | html %]</td> 21 <td> 22 <span title="[% group.get_c_field('description') | html %]"> 23 [% group.get_c_field('description') | truncate(30) | html %] 24 </span> 25 </td> 23 26 </tr> 24 27 [% END %] -
LATMOS-Accounts-Web/root/html/groups/menu.tt
r544 r861 1 1 <!-- $Id$ --> 2 <div id="o menu">2 <div id="oinfo"> 3 3 [% INCLUDE 'includes/obj_prev_next.tt' objtype='group' objname=groupname %] 4 <table border="0"> 5 < tr><td>4 5 <div> 6 6 <img src="[% c.uri_for('/static', 'icons', 'user-group-properties.png') %]" 7 7 alt="[% "Groupe " _ groupname %]"> 8 </td> 9 <td> 10 [% groupname | html %]<br> 8 </div> 9 10 <div> 11 <p id="oname">[% groupname | html %]</p> 11 12 [% group.get_c_field('description') | html %] 12 </table> 13 <div style="clear: both;"></div> 13 </div> 14 15 </div> 16 <div style="clear: both;"></div> 17 <div id="omenu"> 14 18 <a href="[% c.uri_for(groupname) %]"><span [% 'id="oactive"' IF subform == '' %]>SystÚme</span></a> 15 19 <a href="[% c.uri_for(groupname, 'users') %]"><span [% 'id="oactive"' IF subform == 'users' %]>Utilisateurs</span></a> 20 [% IF group.get_attributes('sutype') == 'dpmt' %] 21 <a href="[% c.uri_for(groupname, 'dpmt') %]"><span [% 'id="oactive"' IF subform == 'dpmt' %]>Département</span></a> 22 [% END %] 16 23 </div> 24 <div style="clear: both;"></div> -
LATMOS-Accounts-Web/root/html/groups/users.tt
r756 r861 4 4 [% ELSE %] 5 5 6 [% modallow = c.model('Accounts').db.check_acl(group, 'memberUID', 'w') %] 6 [% modallow = c.model('Accounts').db.check_acl(group, 'memberUID', 'w') AND 7 NOT group.attribute('memberUID').ro %] 7 8 8 9 <div class="objectform" id="objectform"> … … 19 20 <b>Membres primaire:</b><br> 20 21 [% END %] 21 <a href="[% c.uri_for('/users', uid) %]">[% uid | html %]</a><br> 22 <a href="[% c.uri_for('/users', uid) %]">[% uid | html %]</a> 23 [% ouser = c.model('Accounts').db.get_object('user', uid) %] 24 [% INCLUDE user_flag ouser=ouser %] 25 <br> 22 26 [% END %] 23 27 24 28 [% FOREACH uid = group.get_c_field('member').sort %] 29 [% ouser = c.model('Accounts').db.get_object('user', uid) %] 25 30 [% IF loop.first %] 26 31 <b>Membres</b><br> 27 32 [% END %] 28 33 [% IF modallow %] 29 <form action="[% c.uri_for(groupname, subform) %]" method="POST"> 34 [% IF ouser.get_attributes('department') == group.id OR 35 ouser.get_attributes('contratType') == group.id %] 36 <img src="[% c.uri_for('/static', 'icons', 'changes-prevent.png') %]" 37 width="24" height="24" title="Ce groupe est géré via un autre attribut"> 38 [% ELSE %] 39 <form action="[% c.uri_for(groupname, subform) %]" method="POST" style="display: inline"> 30 40 <input type="hidden" name="deluser" value="[% uid | html %]"> 31 41 <input type="image" src="[% c.uri_for('/static', 'icons', 'user-group-delete.png') %]" width="24" height="24"> 42 </form> 32 43 [% END %] 33 <a href="[% c.uri_for('/users', uid) %]">[% uid | html %] 34 ([% c.model('Accounts').db.get_object('user', uid).get_attributes('displayName') | html %])</a><br> 44 [% END %] 45 <a href="[% c.uri_for('/users', uid, 'statut') %]">[% uid | html %] 46 ([% ouser.get_attributes('displayName') | html %])</a> 47 [% INCLUDE user_flag ouser=ouser %] 48 <br> 35 49 [% IF modallow %] 36 </form>37 50 [% END %] 38 51 [% IF loop.last %] -
LATMOS-Accounts-Web/root/html/includes/form.tt
r507 r861 1 1 <!-- $Id$ --> 2 <div id="oform" >2 <div id="oform" class="oform"> 3 3 [% attributes = form.attributes() %] 4 4 [% IF attributes.0 %] … … 13 13 <tr><th>[% form.attr_label(attr) %]</th><td>[% form.attr_field(attr) %]</td> 14 14 [% IF loop.last %] 15 [% IF form.write_attributes %] 15 16 <tr><td colspan=2>[% form.submit %]</td></tr> 17 [% END %] 16 18 </table> 17 19 </form> -
LATMOS-Accounts-Web/root/html/includes/header.tt
r689 r861 2 2 <html> 3 3 <head> 4 <title> [% page.title %]</title>4 <title>LATMOS::Accounts / [% page.title %]</title> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 6 6 <link rel="stylesheet" href="[% c.uri_for('/static', 'style.css') %]?" type="text/css"> … … 12 12 <script type="text/javascript" language="JavaScript" src="[% c.uri_for('/static', 'js', 'dragdrop.js') %]"></script> 13 13 <script type="text/javascript" language="JavaScript" src="[% c.uri_for('/static', 'js', 'controls.js') %]"></script> 14 <script type="text/javascript" language="JavaScript"> 15 function resetmenu() { 16 document.getElementById('menui').innerHTML = '[% page.title | html %]'; 17 } 18 19 [% IF page.error %] 20 window.onload = analert; 21 22 function analert () { 23 alert('[% page.error | replace('\'', '\\\'') %]'); 24 } 25 [% END %] 26 </script> 14 27 </head> 15 28 … … 20 33 [% END %] 21 34 35 [% BLOCK user_flag %] 36 [% INCLUDE object_flag object = ouser %] 37 [% END %] 38 39 [% BLOCK object_flag %] 40 [% IF object.type == 'user' %] 41 [% IF object.get_attributes('unexported') %] 42 <img src="[% c.uri_for('/static', 'icons', 'gtk-delete.png') %]" 43 class="notice" title="Ce compte est désactivé" alt="disable"> 44 [% ELSIF object.get_attributes('expired') %] 45 <img src="[% c.uri_for('/static', 'icons', 'emblem-urgent.png') %]" 46 class="notice" title="Ce compte est expiré ([% object.get_attributes('expired') %])" alt="expired"> 47 [% ELSIF object.get_attributes('expire') %] 48 <img src="[% c.uri_for('/static', 'icons', 'appointment-new.png') %]" 49 class="notice" title="Ce compte est temporaire ([% object.get_attributes('expire') %])" alt="temporary"> 50 [% END %] 51 [% ELSE %] 52 [% IF object.get_attributes('unexported') %] 53 <img src="[% c.uri_for('/static', 'icons', 'gtk-delete.png') %]" 54 class="notice" title="Cette entrée est désactivés" alt="disable"> 55 [% END %] 56 [% END %] 57 [% END %] 58 22 59 <body> 23 60 <!-- $Id$ --> 24 <div id="head" class="pmenu"> 25 Gestion des Utilisateurs du LATMOS 26 [% IF c.user.username %] 27 <span style="float:right; font-size: 0.5em;"> 28 Vous êtes [% c.user.username | html %] 29 </span> 30 [% END %] 61 <div id="head"> 62 <div class="pmenu"> 63 [% IF c.config.company %] 64 Gestion informatique - [% c.config.company | html %] 65 [% ELSE %] 66 Gestion informatique 67 [% END %] 68 [% IF c.user.username %] 69 <span style="float:right; font-size: 0.5em;"> 70 Vous êtes [% c.user.username | html %] 71 </span> 72 [% END %] 73 </div> 74 75 <div id="mainmenu" style="float: left"> 76 <span> 77 <a href="[% c.uri_for('/users') %]" 78 onMouseOver="document.getElementById('menui').innerHTML='Liste des utilisateurs';" 79 onMouseOut="resetmenu();" 80 > 81 <img title="Utilisateurs" src="[% c.uri_for('/static', 'icons', 'avatar-default.png') %]"></a> 82 [% IF c.model('Accounts').db.check_acl('user', '@CREATE', 'w') %] 83 <a href="[% c.uri_for('/create', 'user') %]" 84 onMouseOver="document.getElementById('menui').innerHTML='Créer un utilisateur';" 85 onMouseOut="resetmenu();" 86 > 87 <img title="Ajouter un utilisateurs" src="[% c.uri_for('/static', 'icons', 'add.png') %]"></a> 88 [% END %] 89 </span> 90 <span> 91 <a href="[% c.uri_for('/groups') %]" 92 onMouseOver="document.getElementById('menui').innerHTML='Liste des groupes';" 93 onMouseOut="resetmenu();" 94 > 95 <img title="Groupes" src="[% c.uri_for('/static', 'icons', 'system-users.png') %]"></a> 96 [% IF c.model('Accounts').db.check_acl('group', '@CREATE', 'w') %] 97 <a href="[% c.uri_for('/create', 'group') %]" 98 onMouseOver="document.getElementById('menui').innerHTML='Créer un groupe';" 99 onMouseOut="resetmenu();" 100 > 101 <img title="Ajouter un groupe" src="[% c.uri_for('/static', 'icons', 'add.png') %]"></a> 102 [% END %] 103 </span> 104 <span> 105 <a href="[% c.uri_for('/sites') %]" 106 onMouseOver="document.getElementById('menui').innerHTML='Liste des sites';" 107 onMouseOut="resetmenu();" 108 > 109 <img title="Sites" src="[% c.uri_for('/static', 'icons', 'xfce-internet.png') %]"></a> 110 </span> 111 [% # On cache volontairement les alias si l'utilisateur ne doit pas y 112 toucher %] 113 [% IF c.model('Accounts').db.check_acl('aliases', '@CREATE', 'w') %] 114 <span> 115 <a href="[% c.uri_for('/aliases') %]" 116 onMouseOver="document.getElementById('menui').innerHTML= 117 'Alias mail sans utilisateur';" 118 onMouseOut="resetmenu();" 119 > 120 <img title="Alias mail" src="[% c.uri_for('/static', 'icons', 'mail_forward.png') %]"></a> 121 </span> 122 [% END %] 123 <span> 124 <a href="[% c.uri_for('/nethosts') %]" 125 onMouseOver="document.getElementById('menui').innerHTML='Liste des hÃŽtes réseau';" 126 onMouseOut="resetmenu();" 127 > 128 <img title="HÃŽtes réseau" src="[% c.uri_for('/static', 'icons', 'video-display.png') %]"></a> 129 [% IF c.model('Accounts').db.check_acl('nethost', '@CREATE', 'w') %] 130 <a href="[% c.uri_for('/create', 'nethost') %]" 131 onMouseOver="document.getElementById('menui').innerHTML='Ajouter un hote réseau';" 132 onMouseOut="resetmenu();" 133 > 134 <img title="Ajouter un hÃŽte réseau" src="[% c.uri_for('/static', 'icons', 'add.png') %]"></a> 135 [% END %] 136 </span> 137 [% # On cache volontaire les zones si l'utilisateur ne doit pas y 138 toucher %] 139 [% IF c.model('Accounts').db.check_acl('netzone', '@CREATE', 'w') %] 140 <span> 141 <a href="[% c.uri_for('/netzones') %]" 142 onMouseOver="document.getElementById('menui').innerHTML='Liste des zones réseaux';" 143 onMouseOut="resetmenu();" 144 > 145 <img title="Gestion Réseau" src="[% c.uri_for('/static', 'icons', 'network-workgroup.png') %]"></a> 146 <a href="[% c.uri_for('/create', 'netzone') %]" 147 onMouseOver="document.getElementById('menui').innerHTML='Ajouter une zones réseau';" 148 onMouseOut="resetmenu();" 149 ><img title="Ajouter une zone" src="[% c.uri_for('/static', 'icons', 'add.png') %]"></a> 150 </span> 151 [% END %] 152 <span> 153 <a href="[% c.uri_for('/about') %]" 154 onMouseOver="document.getElementById('menui').innerHTML='A propos...';" 155 onMouseOut="resetmenu();" 156 > 157 <img title="A propos..." src="[% c.uri_for('/static', 'icons', 'gtk-about.png') %]"></a> 158 </span> 159 </div> 160 161 [% IF c.user.username %] 162 <div style="float: right"> 163 <span> 164 <a href="[% c.uri_for('/users', c.user.username) %]" 165 onMouseOver="document.getElementById('menui').innerHTML='Mon profile';" 166 onMouseOut="resetmenu();" 167 > 168 <img title="Mon profile" src="[% c.uri_for('/static', 'icons', 'gtk-home.png') %]"></a> 169 </span> 170 <span> 171 <a href="[% c.uri_for('/users', c.user.username, 'passwd') %]" 172 onMouseOver="document.getElementById('menui').innerHTML='Changer mon mot de passe';" 173 onMouseOut="resetmenu();" 174 > 175 <img title="Changer mon mot de passe" src="[% c.uri_for('/static', 176 'icons', 'dialog-password.png') %]"></a> 177 </span> 178 <span> 179 <a href="[% c.uri_for('/logout') %]" 180 onMouseOver="document.getElementById('menui').innerHTML='Se déconnecter';" 181 onMouseOut="resetmenu();" 182 > 183 <img title="Se déconnecter" src="[% c.uri_for('/static', 184 'icons', 'gtk-close.png') %]"></a> 185 </span> 186 </div> 187 [% END %] 188 189 <div style="clear: both"></div> 190 191 <p>> <span id="menui">[% page.title | html %]</span></p> 31 192 </div> 32 <div id="mainmenu" class="pmenu">33 <div style="float: left">[% mainmenu %]</div>34 [% IF c.user.username %]35 <div style="float: right">36 <a href="[% c.uri_for('/users', c.user.username) %]"><span>Mon profile</span></a>37 <a href="[% c.uri_for('/users', c.user.username, 'passwd') %]"><span>Mon mot de passe</span></a>38 <a href="[% c.uri_for('/logout') %]"><span>Se déconnecter</span></a>39 </div>40 [% END %]41 <div style="clear: both"></div>42 </div> -
LATMOS-Accounts-Web/root/html/includes/obj_prev_next.tt
r544 r861 1 1 <!-- $Id$ --> 2 2 3 <p style="float: right"> 4 [% prev_next = c.model('Accounts').object_prev_next(objtype, objname) %] 5 [% IF prev_next.0 %] 6 <a href="[% c.uri_for(prev_next.0, subform) %]" title="[% prev_next.0 | html 7 %]">Prec.</a> 8 [% ELSE %] 9 Prec. 10 [% END %] 11 [% IF prev_next.1 %] 12 <a href="[% c.uri_for(prev_next.1, subform) %]" title="[% prev_next.1 | html 13 %]">Suiv.</a> 14 [% ELSE %] 15 Suiv. 16 [% END %] 17 </p> 3 <div id="navigate" style="float: right"> 4 <p> 5 [% nav = c.model('Accounts').object_navigate(objtype, objname) %] 6 7 [% IF nav.ofirst %] 8 <a href="[% c.uri_for(nav.ofirst, subform) %]"> 9 <img src="[% c.uri_for('/static', 'icons/gtk-goto-first-ltr.png') %]" title="[% 10 nav.ofirst | html %]" alt="first"> 11 </a> 12 [% END %] 13 14 [% IF nav.oprev %] 15 <a href="[% c.uri_for(nav.oprev, subform) %]"> 16 <img src="[% c.uri_for('/static', 'icons/gtk-go-back-ltr.png') %]" title="[% 17 nav.oprev | html %]" alt="previous"> 18 </a> 19 [% END %] 20 21 [% IF nav.onext %] 22 <a href="[% c.uri_for(nav.onext, subform) %]"> 23 <img src="[% c.uri_for('/static', 'icons/gtk-go-back-rtl.png') %]" title="[% 24 nav.onext | html %]" alt="next"> 25 </a> 26 [% END %] 27 28 [% IF nav.olast %] 29 <a href="[% c.uri_for(nav.olast, subform) %]"> 30 <img src="[% c.uri_for('/static', 'icons/gtk-goto-first-rtl.png') %]" title="[% 31 nav.olast | html %]" alt="last"> 32 </a> 33 [% END %] 34 </p> 35 36 [% IF nav.list %] 37 <form action="[% c.uri_for('/ajax/goto') %]"> 38 <p> 39 <input type="hidden" name="otype" value="[% objtype | html %]"> 40 <input type="hidden" name="subform" value="[% subform | html %]"> 41 <select name="goto"> 42 [% FOREACH item = nav.list %] 43 <option value="[% item | html %]" [% 'selected="selected"' IF item == objname 44 %]>[% item | html %]</option> 45 [% END %] 46 </select> 47 <input type="image" alt="Go To" title="Aller à " src="[% 48 c.uri_for('/static', 'icons', 'gtk-jump-to-rtl.png') %]"> 49 </p> 50 </form> 51 [% END %] 52 53 </div> -
LATMOS-Accounts-Web/root/html/sites/default.tt
r214 r861 1 <!-- $Id: default.tt 432 2009-05-17 13:19:38Z nanardon $ -->1 <!-- $Id: default.tt 2800 2010-08-01 12:02:51Z nanardon $ --> 2 2 [% IF NOT site %] 3 3 No site [% sitename | html %] found. -
LATMOS-Accounts-Web/root/html/sites/menu.tt
r214 r861 1 <!-- $Id: user_menu.tt 443 2009-05-18 03:52:21Z nanardon $ --> 2 <div id="omenu"> 3 <table border="0"> 4 <tr><td> 1 <!-- $Id: menu.tt 3103 2010-08-26 12:47:15Z nanardon $ --> 2 <div id="oinfo"> 3 4 [% INCLUDE 'includes/obj_prev_next.tt' objtype='site' objname=sitename %] 5 6 <div> 5 7 <img src="[% c.uri_for('/static', 'icons', 'user-properties.png') %]" 6 8 alt="[% "User " _ sitename %]"> 7 </ td>8 < td>9 [% sitename | html %]<br>9 </div> 10 <div> 11 <p id="oname">[% sitename | html %]</p> 10 12 [% user.get_c_field('l') | html %] 11 </td></tr> 12 </table> 13 </div> 13 14 </div> 15 <div style="clear: both;"></div> -
LATMOS-Accounts-Web/root/html/users/address.tt
r686 r861 20 20 </form> 21 21 22 [% IF address.base.check_acl(address, '@DELETE', 'w') %] 22 23 <table border=1><tr><td align="center"> 23 24 <form action="[% c.uri_for(username, subform) %]" method="POST"> … … 28 29 </form> 29 30 </td></tr></table> 31 [% END %] 30 32 31 33 </div> -
LATMOS-Accounts-Web/root/html/users/address_form.tt
r760 r861 63 63 <td>[% form.attr_field('co', fieldtype) %]</td> 64 64 </tr> 65 [% IF form.write_attributes %] 65 66 <tr> 66 67 <th></th> 67 <td>[% form.submit %]</td> 68 <td> 69 [% form.submit %] 70 </td> 68 71 </tr> 72 [% END %] 69 73 </table> -
LATMOS-Accounts-Web/root/html/users/groups.tt
r508 r861 20 20 [% FOREACH g = user.get_c_field('memberOf') %] 21 21 [% IF modallow %] 22 <form action="[% c.uri_for(username, subform) %]" method="POST"> 22 [% IF user.get_attributes('department') == g OR 23 user.get_attributes('contratType') == g %] 24 <img src="[% c.uri_for('/static', 'icons', 'changes-prevent.png') %]" 25 width="24" height="24" title="Ce groupe est géré via un autre attribut"> 26 [% ELSE %] 27 <form action="[% c.uri_for(username, subform) %]" method="POST" style="display: inline"> 23 28 <input type="hidden" name="delgroup" value="[% g | html %]"> 24 29 <input type="image" src="[% c.uri_for('/static', 'icons', 'user-group-delete.png') %]" width="24" height="24"> 30 </form> 31 [% END %] 25 32 [% END %] 26 33 <a href="[% c.uri_for('/groups', g) %]">[% g | html %]</a><br> 27 34 [% IF modallow %] 28 </form>29 35 [% END %] 30 36 [% END %] -
LATMOS-Accounts-Web/root/html/users/index.tt
r682 r861 9 9 10 10 <table border="0"> 11 <tr><td colspan=" 2">[% objectslist.size %] Utilisateurs<br>11 <tr><td colspan="5"> 12 12 [% IF initials %] 13 13 Pages: … … 22 22 [% END %] 23 23 </td></tr> 24 <tr><t h>Login</th><th>Nom</th></tr>24 <tr><td></td><th>Login</th><th>Nom</th><th>Description</th><th>Mail</th></tr> 25 25 [% FOREACH username = userslist %] 26 26 [% user = db.get_object('user', username) %] 27 27 <tr> 28 <td>[% username | html %]</td> 28 <td> 29 [% INCLUDE 'user_flag' ouser=user %] 30 </td> 31 <td><a href="[% c.uri_for('/users', username) %]"> 32 <img src="[% c.uri_for('/static', 'icons', 'icon_edit.png') %]" 33 height="16" width="16" 34 alt="[% "edit " _ username | html %]"> 35 </a>[% username | html %]</td> 29 36 <td> 30 37 [% user.get_c_field('sn') | html %] 31 38 [% user.get_c_field('givenName') | html %] 32 [% user.get_c_field('description') | truncate(20) | html %] 33 <a href="[% c.uri_for('/users', username) %]"> 34 <img src="[% c.uri_for('/static', 'icons', 'arrow-right.png') %]" 35 height="16" width="16" 36 alt="[% "edit " _ username | html %]"> 37 </a></td> 39 </td> 40 <td> 41 <span title="[% user.get_c_field('description') | html %]"> 42 [% user.get_c_field('description') | truncate(20) | html %] 43 </span> 44 </td> 45 <td><span title="[% user.get_c_field('mail') | html %]"> 46 [% user.get_c_field('mail') | truncate(20) | html %]</span> 47 </td> 38 48 </tr> 39 49 [% END %] -
LATMOS-Accounts-Web/root/html/users/menu.tt
r730 r861 1 1 <!-- $Id$ --> 2 <div id="omenu"> 3 2 <div id="oinfo"> 4 3 [% INCLUDE 'includes/obj_prev_next.tt' objtype='user' objname=username %] 5 4 6 <table border="0"> 7 <tr><td> 8 [% IF NOT user.get_c_field('exported') OR user.get_c_field('locked') %] 9 <img src="[% c.uri_for('/static', 'icons', 'view-media-artist.png') %]" 10 [% ELSE %] 11 <img src="[% c.uri_for('/static', 'icons', 'user-properties.png') %]" 12 [% END %] 13 alt="[% "User " _ username %]"> 14 </td> 15 <td> 16 [% username | html %]<br> 17 [% user.get_c_field('displayName') | html %] 18 </td> 19 </tr> 20 </table> 5 <div> 6 [% IF NOT user.get_c_field('exported') %] 7 <img src="[% c.uri_for('/static', 'icons', 'gtk-delete.png') %]" 8 alt="[% "User " _ username %]" title="le compte est désactivé"> 9 [% ELSE %] 10 <img src="[% c.uri_for('/static', 'icons', 'user-properties.png') %]" 11 alt="[% "User " _ username %]"> 12 [% END %] 13 </div> 14 15 <div> 16 [% IF user.get_c_field('locked') %] 17 <img src="[% c.uri_for('/static', 'icons', 'locked.png') %]" 18 alt="le compte est vérrouillé" title="le compte est vérrouillé"> 19 [% END %] 20 </div> 21 22 <div> 23 <p id="oname">[% username | html %] 24 [% INCLUDE user_flag ouser = user %]</span></p> 25 [% user.get_c_field('displayName') | html %] 26 </div> 27 </div> 21 28 <div style="clear: both;"></div> 29 <div id="omenu"> 22 30 <a href="[% c.uri_for(username) %]"><span [% 'id="oactive"' IF subform == '' %]>SystÚme</span></a> 23 <a href="[% c.uri_for(username, 'statu s') %]"><span [% 'id="oactive"' IF subform == 'status' %]>Status</span></a>31 <a href="[% c.uri_for(username, 'statut') %]"><span [% 'id="oactive"' IF subform == 'statut' %]>Statut</span></a> 24 32 <a href="[% c.uri_for(username, 'groups') %]"><span [% 'id="oactive"' IF subform == 'groups' %]>Groupes</span></a> 25 33 <a href="[% c.uri_for(username, 'address') %]"><span [% 'id="oactive"' IF subform == 'address' %]>Adresses</span></a> 26 34 <a href="[% c.uri_for(username, 'mail') %]"><span [% 'id="oactive"' IF subform == 'mail' %]>eMail</span></a> 35 <a href="[% c.uri_for(username, 'my') %]"><span [% 'id="oactive"' IF subform == 'my' %]>My</span></a> 27 36 [% IF c.model('Accounts').db.check_acl(user, 'userPasswd', 'r') %] 28 37 <a href="[% c.uri_for(username, 'passwd') %]"><span [% 'id="oactive"' IF subform == 'passwd' %]>Mot de passe</span></a> 29 38 [% END %] 30 39 </div> 40 <div style="clear:both"></div> -
LATMOS-Accounts-Web/root/html/users/passwd.tt
r667 r861 3 3 [% INCLUDE 'users/menu.tt' %] 4 4 5 <script type="text/javascript"> 6 function check_passwd() { 7 new Ajax.Updater( 8 'perror', 9 '[% c.uri_for('/ajax', 'cracklib', username) %]', 10 { parameters: 'passwd=' + document.getElementById("passwd").value + 11 '&cpasswd=' + document.getElementById("cpasswd").value } 12 ) 13 } 14 </script> 15 5 16 <div id="oform"> 6 17 [% IF c.model('Accounts').db.check_acl(user, 'userPassword', 'w') %] 7 18 <form id="fpasswd" action="[% c.uri_for(username, subform) %]" method="POST"> 8 [% c.prototype.observe_form('fpasswd', {9 url => c.uri_for('/ajax', 'cracklib', username),10 update => 'perror',11 frequency => 1,12 }) %]13 19 <table border="1"> 14 20 <tr> 15 21 <th>Nouveau mot de passe:</th> 16 <td><input type="password" name="passwd" ></td>22 <td><input type="password" name="passwd" id="passwd" onkeyup="check_passwd()"></td> 17 23 </tr> 18 24 <tr> 19 25 <th>Confirmation:</th> 20 <td><input type="password" name="cpasswd" ></td>26 <td><input type="password" name="cpasswd" id="cpasswd" onkeyup="check_passwd()"></td> 21 27 </tr> 22 28 <tr><td colspan="2"><span id="perror">[% pmerror | html %]</span></td></tr> -
LATMOS-Accounts-Web/root/static/style.css
r507 r861 2 2 border: none; 3 3 vertical-align: middle; 4 padding: 0em 4 5 } 5 6 6 7 .pmenu { 8 padding: 0.5em; 9 font-size: 2em; 10 } 11 12 .permdenied { 13 padding: 0.5em; 14 } 15 16 #head { 7 17 background-color: #7DB4D8; 8 padding: 0.5em; 9 } 10 11 .permdenied { 12 padding: 0.5em; 13 } 14 15 #head { 16 font-size: 2em; 18 padding-bottom: 0.2em; 19 padding-top: 0.2em; 17 20 } 18 21 19 22 #mainmenu a { 20 font-size: 80%;23 font-size: 50px; 21 24 overflow: hidden; 22 25 text-decoration: none; … … 24 27 25 28 #mainmenu span { 29 padding-left: 1em; 30 padding-right: 1em; 31 text-decoration: none; 32 } 33 34 #mainmenu span#actif { 26 35 border-style: outset; 27 36 padding-left: 1em; 28 37 padding-right: 1em; 29 38 text-decoration: none; 30 } 31 32 #mainmenu span#actif { 33 border-style: inset; 34 border-size: 1px; 35 padding-left: 1em; 36 padding-right: 1em; 37 text-decoration: none; 39 height: 32px; 38 40 } 39 41 40 42 #mainmenu a:hover { 41 border: solid; 42 } 43 44 div#objectform { 43 /* border: solid;*/ 44 background-color: #7DB4D8; 45 } 46 47 #oinfo div { 48 float: left; 49 padding: 0.5em; 50 } 51 52 #oname { 53 font-size: 1.2em; 54 padding: 0em; 55 margin: 0em; 56 } 57 58 #omenu a { 59 text-decoration: none; 60 color: black; 61 } 62 63 #omenu div { 64 float: left; 65 padding-top: 0.5em; 66 padding-bottom: 0.5em; 67 } 68 69 70 #omenu span { 71 padding-left: 1em; 72 padding-right: 1em; 73 margin: 0; 74 border: groove thin; 75 text-decoration: none; 76 float: left; 77 background-color: #DDDDD9; 78 color: black; 79 } 80 81 #omenu span#oactive { 82 padding-left: 1em; 83 padding-right: 1em; 84 margin: 0; 85 border: groove thin; 86 text-decoration: none; 87 float: left; 88 background-color: #7DB4D8; 89 color: black; 90 } 91 92 #omenu a:hover { 93 /* border: inset; */ 94 text-color blue; 95 } 96 97 div.objectform { 45 98 border-style: outset; 46 99 width: 60%; … … 49 102 } 50 103 51 #objectform table {104 .objectform table { 52 105 margin-left: auto; 53 106 margin-right: auto; … … 56 109 } 57 110 58 #omenu a { 59 text-decoration: none; 60 } 61 62 #omenu td { 63 padding-left: 0.5em; 64 padding-right: 0.5em; 65 } 66 67 #omenu table { 111 div.objectformleft { 112 /* border-style: outset; */ 113 width: 60%; 114 margin-left: auto; 115 margin-right: auto; 116 } 117 118 .objectformleft table { 119 /* 120 margin-top: 1em; 121 margin-bottom: 1em; 122 */ 123 } 124 125 .objectformleft #oform { 126 /*border: inset;*/ 127 float: left; 128 } 129 130 .oform { 131 /* border: inset; */ 68 132 margin: 0.5em; 69 133 } 70 134 71 72 #omenu span { 73 padding-left: 1em; 74 padding-right: 1em; 75 margin: 0; 76 border: groove thin; 77 text-decoration: none; 78 } 79 80 #omenu span#oactive { 81 margin: 0; 82 padding-left: 1em; 83 padding-right: 1em; 84 border: outset; 85 border-bottom-style: none; 86 text-decoration: none; 87 font-weight:bold; 88 } 89 90 #omenu a:hover { 91 border: inset; 92 } 93 94 #oform { 95 border: inset; 96 } 97 98 table#oform { 99 margin-left: 20%; 100 margin-right: 20%; 135 .oform table { 136 /* margin-left: 20%; 137 margin-right: 20%; */ 138 } 139 140 .oform td { 141 vertical-align: top; 142 } 143 144 .oform p { 145 margin: 0.5em; 146 font-weight: bold; 147 } 148 149 .oform ul { 150 padding: 0.5em; 151 } 152 153 .oform li { 154 list-style-type: none; 155 padding-left: 0.2em; 156 } 157 158 .inputvalidate img { 159 width: 1em; 160 height:1em; 161 } 162 163 #navigate { 164 } 165 166 #navigate p { 167 margin: 0em; 168 text-align: center; 169 } 170 171 #navigate input { 172 width: 3em; 173 height:3em; 174 vertical-align: middle; 175 } 176 177 #navigate img { 178 width: 2em; 179 height:2em; 180 vertical-align: middle; 181 } 182 183 img.notice { 184 width: 1em; 185 height:1em; 186 vertical-align: middle; 187 } 188 189 img.attr { 190 width: 1.5em; 191 height:1.5em; 192 vertical-align: middle; 101 193 } 102 194
Note: See TracChangeset
for help on using the changeset viewer.