Ignore:
Timestamp:
07/24/12 11:18:18 (12 years ago)
Author:
nanardon
Message:
  • tag version 2.0
Location:
branches/2.0/LATMOS-Accounts-Web
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web.pm

    r861 r1062  
    2727 
    2828# Configure the application.  
    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 } 
     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. 
    3736 
    3837# http://stackoverflow.com/questions/1664816/is-there-a-way-to-force-c-urifor-in-catalyst-to-generate-a-uri-that-begins-wit 
  • branches/2.0/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Users.pm

    r861 r1062  
    7979                    if ($msg ne 'ok') { 
    8080                        $c->stash->{pmerror} = $msg . ', mot de passe inchangé'; 
    81                     } elsif ($suser && $suser->set_password($c->req->param('passwd'))) { 
     81                    } elsif ($suser && $suser->_set_password($c->req->param('passwd'))) { 
    8282                        $c->stash->{pmerror} = 'Mot de passe changé'; 
    8383                        $sync->commit; 
     
    162162            $c->stash->{db} = $base; 
    163163            $c->stash->{template} = 'users/my.tt'; 
     164            last; 
    164165        }; 
    165166        /^dump$/ and do { 
  • branches/2.0/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrFilter.pm

    r861 r1062  
    1919    group => [ qw(cn description gidNumber sutype) ], 
    2020    site => [ qw(l) ], 
    21     nethost => [ qw(name cname otherName ip macaddr owner serialNumber) ], 
     21    nethost => [ qw(name cname otherName ip macaddr owner) ], 
    2222    netzone => [ qw(net group type site) ], 
    2323}; 
  • branches/2.0/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrForms.pm

    r861 r1062  
    8080    siteNick => [ 'Acronyme' ], 
    8181    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' ], 
     82    user => [ 'Utilisateur' ], 
    8683}; 
    8784 
     
    114111            contratType 
    115112            expire 
    116         ) ], 
    117     }, 
    118     usermy => { 
    119         name => 'My', 
    120         attrs => [ qw( 
    121             snNative 
    122             givenNameNative 
    123             wWWHomePage 
    124             halReference 
    125113        ) ], 
    126114    }, 
     
    175163            serialNumber 
    176164            owner 
     165            user 
    177166            ip 
    178167            macaddr 
     
    498487} 
    499488 
    500 sub write_attributes { 
     489sub set_attrs { 
    501490    my ($self) = @_; 
    502     my @attrs; 
     491    $self->{c}->req->param($self->label) or return; 
     492    my $prefix = $self->{object}->id . '_'; 
     493    my %fields; 
    503494    foreach ($self->attributes) { 
    504495        my $attr = ($self->{object} 
     
    506497            : $self->base->attribute($self->otype, $_)) or next; 
    507498        $attr->readonly and next; 
    508         push(@attrs, $_); 
    509     } 
    510     @attrs; 
    511 } 
    512  
    513 sub set_attrs { 
    514     my ($self) = @_; 
    515     $self->{c}->req->param($self->label) or return; 
    516     my $prefix = $self->{object}->id . '_'; 
    517     my %fields; 
    518     foreach ($self->write_attributes) { 
    519         my $attr = ($self->{object} 
    520             ? $self->{object}->attribute($_) 
    521             : $self->base->attribute($self->otype, $_)) or next; 
    522499        if (($attrs->{$_}[1] || '') eq 'checkbox') { 
    523500            $fields{$_} = $self->{c}->req->param("$prefix$_") ? 1 : 0; 
  • branches/2.0/LATMOS-Accounts-Web/root/html/groups/index.tt

    r861 r1062  
    1010<table border="0"> 
    1111<tr><td colspan="2">[% groupslist.size %] groupes</td></tr> 
    12 <tr><th>Nom</th><th>Description</th><th></th></tr> 
     12<tr><th>Nom</th><th>Description</th></tr> 
    1313[% FOREACH groupname = groupslist %] 
    1414[% group = db.get_object('group', groupname) %] 
    1515<tr> 
    16     <td><a href="[% c.uri_for('/groups', groupname) %]"> 
    17         <img src="[% c.uri_for('/static', 'icons', 'icon_edit.png') %]" 
     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') %]" 
    1820            height="16" width="16" 
    1921            alt="[% "edit " _ groupname | html %]"> 
    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> 
     22    </a></td> 
    2623</tr> 
    2724[% END %] 
  • branches/2.0/LATMOS-Accounts-Web/root/html/includes/form.tt

    r861 r1062  
    1313<tr><th>[% form.attr_label(attr) %]</th><td>[% form.attr_field(attr) %]</td> 
    1414[% IF loop.last %] 
    15 [% IF form.write_attributes %] 
    1615<tr><td colspan=2>[% form.submit %]</td></tr> 
    17 [% END %] 
    1816</table> 
    1917</form> 
  • branches/2.0/LATMOS-Accounts-Web/root/html/includes/header.tt

    r861 r1062  
    3232</span> 
    3333[% END %] 
    34  
    3534[% 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') %] 
     35[% IF ouser.get_attributes('unexported') %] 
    4236<img src="[% c.uri_for('/static', 'icons', 'gtk-delete.png') %]" 
    4337class="notice" title="Ce compte est désactivé" alt="disable"> 
    44     [% ELSIF object.get_attributes('expired') %] 
     38[% ELSIF ouser.get_attributes('expired') %] 
    4539<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') %] 
     40class="notice" title="Ce compte est expiré ([% ouser.get_attributes('expired') %])" alt="expired"> 
     41[% ELSIF ouser.get_attributes('expire') %] 
    4842<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 %] 
     43class="notice" title="Ce compte est temporaire ([% ouser.get_attributes('expire') %])" alt="temporary"> 
    5644[% END %] 
    5745[% END %] 
     
    6149<div id="head"> 
    6250    <div class="pmenu"> 
    63         [% IF c.config.company %] 
    64         Gestion informatique - [% c.config.company | html %] 
    65         [% ELSE %] 
    66         Gestion informatique 
    67         [% END %] 
     51        Gestion informatique du LATMOS 
    6852    [% IF c.user.username %] 
    6953    <span style="float:right; font-size: 0.5em;"> 
  • branches/2.0/LATMOS-Accounts-Web/root/html/nethosts/default.tt

    r861 r1062  
    1 <!-- $Id: default.tt 3673 2010-09-17 16:57:32Z nanardon $ --> 
     1<!-- $Id: default.tt 3055 2010-08-20 17:34:56Z nanardon $ --> 
    22[% IF NOT nethost %] 
    33No group [% nethostname | html %] found. 
     
    2424[% END %] 
    2525 
     26[% IF c.model('Accounts').db.check_acl('nethost', 'ip', 'w') %] 
     27<tr><th>Ajouter une ip libre:</th> 
    2628<tr><td> 
    27 [% IF c.model('Accounts').db.check_acl('nethost', 'ip', 'w') %] 
    28 <fieldset> 
    29 <legend>Ajouter une ip libre:</legend> 
    3029<form action="[% c.uri_for(nethostname) %]" method="POST"> 
    3130<label  for="zone">Zone:</label> <select name="zone" id="zone"> 
     
    4847<input type="submit" name="addip"> 
    4948</form> 
    50 </fieldset> 
     49</td></tr> 
    5150[% END %] 
    5251 
    5352[% IF c.model('Accounts').db.check_acl('nethost', '@CREATE', 'w') %] 
    54 <fieldset><legend>Renommer la machine en:</legend> 
     53<tr><th>Renommer la machine en:</th></tr> 
     54<tr><td> 
    5555<form action="[% c.uri_for(nethostname) %]" method="POST"> 
    5656<input type="text" name="to"><br> 
     
    5959<input type="submit" name="rename"> 
    6060</form> 
    61 </fieldset> 
     61</td></tr> 
    6262[% END %] 
    6363 
     
    7575// --> 
    7676</script> 
    77 <fieldset> 
    78 <legend>Supprimer cet hÃŽte</legend> 
     77<tr><th>Supprimer cet hÃŽte</th></tr> 
     78<tr><td> 
    7979<form action="[% c.uri_for(nethostname) %]" method="POST" onsubmit="return confirmSubmit()"> 
    80 <input type="image" name="delete" value="Supprimer" title="Supprimer" alt="effacer" src="[% 
    81 c.uri_for('/static', 'images', 'edit-delete.png') %]"> 
    82 <input type="hidden" name="delete" value="Supprimer"> 
     80<input type="submit" name="delete" value="Supprimer"> 
    8381</form> 
    84 </fieldset> 
     82</td></tr> 
    8583[% END %] 
    8684 
    87 </td></tr> 
    8885</table> 
    8986</div> 
  • branches/2.0/LATMOS-Accounts-Web/root/html/nethosts/index.tt

    r861 r1062  
    99 
    1010<table border="0"> 
    11 <tr><td colspan="3"> 
     11<tr><td colspan="2"> 
    1212[% IF initials %] 
    1313Pages: 
     
    2222[% END %] 
    2323</td></tr> 
    24 <tr><td></td><th>Nom</th><th>Description</th></tr> 
     24<tr><th>Nom</th><th>Description</th></tr> 
    2525[% FOREACH nethostname = nethostlist %] 
    2626[% nethost = db.get_object('nethost', nethostname) %] 
    2727<tr> 
     28    <td>[% nethostname | html %]</td> 
    2829    <td> 
    29 [% INCLUDE 'object_flag' object=nethost %] 
    30     </td> 
    31     <td> 
    32     <a href="[% c.uri_for('/nethosts', nethostname) %]"> 
    33     <img src="[% c.uri_for('/static', 'icons', 'icon_edit.png') %]" 
    34       height="16" width="16" 
    35       alt="[% "edit " _ nethostname | html %]"> 
    36     </a>[% username | html %] 
    37     [% nethostname | html %] 
    3830    [% IF nethost.get_attributes('owner') %] 
    3931    (<a href="[% c.uri_for('/users', nethost.get_attributes('owner')) %]">[% nethost.get_attributes('owner') %]</a>) 
    4032    [% END %] 
    41     </td> 
    42     <td> 
    43     <span title="[% nethost.get_attributes('description') | html %]"> 
    4433    [% nethost.get_attributes('description') | truncate(20) | html %] 
    45     </span> 
    46     </td> 
     34    <a href="[% c.uri_for('/nethosts', nethostname) %]"> 
     35        <img src="[% c.uri_for('/static', 'icons', 'arrow-right.png') %]" 
     36            height="16" width="16" 
     37            alt="[% "edit " _ nethostname | html %]"> 
     38    </a></td> 
    4739</tr> 
    4840[% END %] 
  • branches/2.0/LATMOS-Accounts-Web/root/html/netzones/default.tt

    r861 r1062  
    1 <!-- $Id: default.tt 3673 2010-09-17 16:57:32Z nanardon $ --> 
     1<!-- $Id: default.tt 2902 2010-08-07 13:49:21Z nanardon $ --> 
    22[% IF NOT netzone %] 
    33No group [% netzonename | html %] found. 
     
    2222<td> 
    2323[% END %] 
    24 [% ohost = c.model('Accounts').db.get_object('nethost', host) %] 
    2524<a href="[% c.uri_for('/nethosts', host) %]">[% host | html %]</a><br> 
    26 [% INCLUDE object_flag object = ohost %] 
    2725[% IF loop.last %] 
    2826</td> 
     
    3836<td> 
    3937[% END %] 
    40 [% ohost = c.model('Accounts').db.get_object('nethost', host) %] 
    41 <a href="[% c.uri_for('/nethosts', host) %]">[% host | html %]</a> 
    42 [% INCLUDE object_flag object = ohost %] 
    43 <br> 
     38<a href="[% c.uri_for('/nethosts', host) %]">[% host | html %]</a><br> 
    4439[% IF loop.last %] 
    4540</td></tr> 
  • branches/2.0/LATMOS-Accounts-Web/root/html/netzones/index.tt

    r861 r1062  
    1818    <td> 
    1919    <a href="[% c.uri_for('/netzones', netzonename) %]"> 
    20         <img src="[% c.uri_for('/static', 'icons', 'icon_edit.png') %]" 
     20        <img src="[% c.uri_for('/static', 'icons', 'arrow-right.png') %]" 
    2121            height="16" width="16" 
    2222            alt="[% "edit " _ netzonename | html %]"> 
     
    3333[% netzonelist = db.search_objects('netzone', 'type=' _ netztype) %] 
    3434[% FOREACH netzonename = netzonelist.sort %] 
    35 [% netzone = db.get_object('netzone', netzonename) %] 
    3635[% IF loop.first %] 
    37 <tr><th colspan="2">[% netztype | ucfirst | html %]</th></tr> 
    38 <tr><th>Nom</th><th>Description</th></tr> 
     36<table> 
     37<tr><th colspan="2">[% netztype | html %]</th></tr> 
    3938[% END %] 
    4039<tr> 
     40    <td>[% netzonename | html %]</td> 
    4141    <td> 
    4242    <a href="[% c.uri_for('/netzones', netzonename) %]"> 
    43         <img src="[% c.uri_for('/static', 'icons', 'icon_edit.png') %]" 
     43        <img src="[% c.uri_for('/static', 'icons', 'arrow-right.png') %]" 
    4444            height="16" width="16" 
    4545            alt="[% "edit " _ netzonename | html %]"> 
    46         </a> 
    47         [% netzonename | html %] 
    48     </td> 
    49     <td> 
    50         <span title="[% netzone.get_c_field('description') | html %]"> 
    51         [% netzone.get_c_field('description') | truncate(20) | html %] 
    52         </span> 
    53     </td> 
     46    </a></td> 
    5447</tr> 
    5548[% IF loop.last %] 
     49</table> 
    5650[% END %] 
    5751[% END %] 
  • branches/2.0/LATMOS-Accounts-Web/root/html/users/address.tt

    r861 r1062  
    2020</form> 
    2121 
    22 [% IF address.base.check_acl(address, '@DELETE', 'w') %] 
    2322<table border=1><tr><td align="center"> 
    2423<form action="[% c.uri_for(username, subform) %]" method="POST"> 
     
    2928</form> 
    3029</td></tr></table> 
    31 [% END %] 
    3230 
    3331</div> 
  • branches/2.0/LATMOS-Accounts-Web/root/html/users/address_form.tt

    r861 r1062  
    6363    <td>[% form.attr_field('co', fieldtype) %]</td> 
    6464</tr> 
    65 [% IF form.write_attributes %] 
    6665<tr> 
    6766    <th></th> 
    68     <td> 
    69     [% form.submit %] 
    70     </td> 
     67    <td>[% form.submit %]</td> 
    7168</tr> 
    72 [% END %] 
    7369</table> 
  • branches/2.0/LATMOS-Accounts-Web/root/html/users/index.tt

    r861 r1062  
    99 
    1010<table border="0"> 
    11 <tr><td colspan="5"> 
     11<tr><td colspan="3"> 
    1212[% IF initials %] 
    1313Pages:  
     
    2222[% END %] 
    2323</td></tr> 
    24 <tr><td></td><th>Login</th><th>Nom</th><th>Description</th><th>Mail</th></tr> 
     24<tr><td></td><th>Login</th><th>Nom</th></tr> 
    2525[% FOREACH username = userslist %] 
    2626[% user = db.get_object('user', username) %] 
     
    2929[% INCLUDE 'user_flag' ouser=user %] 
    3030    </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> 
     31    <td>[% username | html %]</td> 
    3632    <td> 
    3733        [% user.get_c_field('sn') | html %] 
    3834        [% user.get_c_field('givenName') | html %] 
    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> 
     35        [% user.get_c_field('description') | truncate(20) | html %] 
     36    <a href="[% c.uri_for('/users', username) %]"> 
     37        <img src="[% c.uri_for('/static', 'icons', 'arrow-right.png') %]" 
     38            height="16" width="16" 
     39            alt="[% "edit " _ username | html %]"> 
     40    </a></td> 
    4841</tr> 
    4942[% END %] 
  • branches/2.0/LATMOS-Accounts-Web/root/html/users/my.tt

    r861 r1062  
    1 <!-- $Id: my.tt 7943 2011-11-10 15:33:13Z nanardon $ --> 
     1<!-- $Id: my.tt 3103 2010-08-26 12:47:15Z nanardon $ --> 
    22[% IF NOT user %] 
    33No user [% username | html %] found. 
     
    66<div id="objectform" class="objectform"> 
    77[% INCLUDE 'users/menu.tt' %] 
    8  
    9 [% INCLUDE 'includes/form.tt' 
    10     form = form 
    11     form_uri = c.uri_for(username, subform) %] 
    128 
    139<div class="oform"> 
  • branches/2.0/LATMOS-Accounts-Web/root/html/users/passwd.tt

    r861 r1062  
    33[% INCLUDE 'users/menu.tt' %] 
    44 
    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  
    165<div id="oform"> 
    176[% IF c.model('Accounts').db.check_acl(user, 'userPassword', 'w') %] 
    187<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}) %] 
    1913<table border="1"> 
    2014<tr> 
    2115<th>Nouveau mot de passe:</th> 
    22 <td><input type="password" name="passwd" id="passwd" onkeyup="check_passwd()"></td> 
     16<td><input type="password" name="passwd"></td> 
    2317</tr> 
    2418<tr> 
    2519<th>Confirmation:</th> 
    26 <td><input type="password" name="cpasswd" id="cpasswd" onkeyup="check_passwd()"></td> 
     20<td><input type="password" name="cpasswd"></td> 
    2721</tr> 
    2822<tr><td colspan="2"><span id="perror">[% pmerror | html %]</span></td></tr> 
Note: See TracChangeset for help on using the changeset viewer.