]> git.sur5r.net Git - bacula/bacula/blob - gui/bweb/tpl/display_user.tpl
Renamed cleanup goto target into bail_out which is the prefered name from the develop...
[bacula/bacula] / gui / bweb / tpl / display_user.tpl
1 <div class='titlediv'>
2   <h1 class='newstitle'>__User:__ <TMPL_VAR username></h1>
3 </div>
4 <div class='bodydiv'>
5
6 <form name="form1" action="?">
7 <input type="hidden" value='1' name="create">
8  <table>
9  <tr>
10   <td>__Username:__</td> <td> <input class="formulaire" type="text" name="username" value='<TMPL_VAR username>'> </td>
11 <!-- </tr><tr>
12   <td>__Password:__</td> <td> <input class="formulaire" type="password" name="passwd" value='<TMPL_VAR passwd>'> </td>
13 -->
14  </tr><tr>
15   <td>__Comment:__</td> <td> <input class="formulaire" type="text" name="comment" value='<TMPL_VAR comment>'> </td>
16  </tr><tr>
17   <td>__Language:__</td> 
18    <td> 
19  <select name="lang" id='lang' class="formulaire">
20   <option id='lang_en' value='en'>__English__</option>
21   <option id='lang_fr' value='fr'>__French__</option>
22   <option id='lang_es' value='es'>__Spanish__</option>
23  </select>
24    </td>
25  </tr><tr>
26 <td> __Profile:__</td><td>
27  <select name="profile" id='profile' class="formulaire">
28   <option onclick='set_role("")'></option>
29   <option onclick='set_role("administrator")'>__Administrator__</option>
30   <option onclick='set_role("customer")'>__Customer__</option>
31  </select>
32 </td><td>__Or like an existing user:__ </td><td>
33  <select name="copy_username" class="formulaire">
34   <option onclick="disable_sel(false)"></option>
35  <TMPL_LOOP db_usernames>
36   <option title="<TMPL_VAR comment>" onclick="disable_sel(true)" value='<TMPL_VAR username>'><TMPL_VAR username></option>
37  </TMPL_LOOP>
38  </select>
39 </td>
40  </tr><tr>
41  </tr><tr>
42 <td> __Roles:__</td><td>
43  <select name="rolename" id='rolename' multiple class="formulaire" size=15>
44  <TMPL_LOOP db_roles>
45   <option title="<TMPL_VAR comment>" value='<TMPL_VAR rolename>' <TMPL_IF userid>selected</TMPL_IF> ><TMPL_VAR rolename></option>
46  </TMPL_LOOP>
47  </select>
48  </td>
49 </tr><tr>
50 <td> __Use groups filter:__</td><td>
51 <input class="formulaire" onclick="disable_group(this.checked == false)" type="checkbox" name="use_acl" <TMPL_IF use_acl> checked </TMPL_IF> > </td>
52 </tr><tr>
53 <td> __Groups:__</td><td>
54  <select name="client_group" id='client_group' multiple class="formulaire" size=15>
55 <TMPL_LOOP db_client_groups>
56         <option id='group_<TMPL_VAR name>'><TMPL_VAR name></option>
57 </TMPL_LOOP>
58  </select>
59  </td>
60 </tr>
61 </table>
62     <button type="submit" class="bp" name='action' value='user_save'>
63      <img src='/bweb/save.png' alt=''> </button>
64 </form>
65 </div>
66
67 <script type="text/javascript" language='JavaScript'>
68
69 <TMPL_LOOP client_group>
70     document.getElementById('group_<TMPL_VAR name>').selected = true;
71 </TMPL_LOOP>
72
73 <TMPL_UNLESS use_acl>
74 disable_group(true); 
75 </TMPL_UNLESS>
76
77 function disable_sel(val) 
78 {
79         document.form1.profile.disabled = val;
80         document.form1.rolename.disabled = val;
81 }
82 function disable_group(val) 
83 {
84         document.form1.client_group.disabled = val;
85 }
86 function set_role(val)
87 {
88    if (val == "administrator") {
89         for (var i=0; i < document.form1.rolename.length; ++i) {
90               document.form1.rolename[i].selected = true;
91         }
92    } else if (val == "production") {
93         for (var i=0; i < document.form1.rolename.length; ++i) {
94            if (document.form1.rolename[i].value != 'r_configure' &&
95                document.form1.rolename[i].value != 'r_user_mgnt' &&
96                document.form1.rolename[i].value != 'r_group_mgnt'
97                )
98            {
99               document.form1.rolename[i].selected = true;
100            }
101         }
102    } else if (val == "customer") {
103         for (var i=0; i < document.form1.rolename.length; ++i) {
104            if (document.form1.rolename[i].value == 'r_view_stats'   ||
105                document.form1.rolename[i].value == 'r_view_history' ||
106                document.form1.rolename[i].value == 'r_view_log'
107                )
108            {
109               document.form1.rolename[i].selected = true;
110            } else {
111               document.form1.rolename[i].selected = false;
112            }
113         }
114    }
115
116 }
117 <TMPL_IF lang>
118   document.getElementById('lang_<TMPL_VAR lang>').selected = true;
119 </TMPL_IF>
120 </script>