##// END OF EJS Templates
user: show your current IP in ip whitelist page
marcink -
r1670:ca81c8dc default
parent child Browse files
Show More
@@ -1,77 +1,78 b''
1 1 <div class="panel panel-default">
2 2 <div class="panel-heading">
3 3 <h3 class="panel-title">${_('Custom IP Whitelist')}</h3>
4 4 </div>
5 5 <div class="panel-body">
6 6 <div class="ips_wrap">
7 <h5>${_('Current IP address')}: <code>${c.rhodecode_user.ip_addr}</code></h5>
7 8 <table class="rctable ip-whitelist">
8 9 <tr>
9 <th>IP Address</th>
10 <th>IP Range</th>
11 <th>Description</th>
10 <th>${_('IP Address')}</th>
11 <th>${_('IP Range')}</th>
12 <th>${_('Description')}</th>
12 13 <th></th>
13 14 </tr>
14 15 %if c.default_user_ip_map and c.inherit_default_ips:
15 16 %for ip in c.default_user_ip_map:
16 17 <tr>
17 18 <td class="td-ip"><div class="ip">${ip.ip_addr}</div></td>
18 19 <td class="td-iprange"><div class="ip">${h.ip_range(ip.ip_addr)}</div></td>
19 20 <td class="td-description">${h.literal(_('Inherited from %s') % h.link_to('*default*',h.url('admin_permissions_ips')))}</td>
20 21 <td></td>
21 22 </tr>
22 23 %endfor
23 24 %endif
24 25
25 26 %if c.user_ip_map:
26 27 %for ip in c.user_ip_map:
27 28 <tr>
28 29 <td class="td-ip"><div class="ip">${ip.ip_addr}</div></td>
29 30 <td class="td-iprange"><div class="ip">${h.ip_range(ip.ip_addr)}</div></td>
30 31 <td class="td-description"><div class="ip">${ip.description}</div></td>
31 32 <td class="td-action">
32 33 ${h.secure_form(url('edit_user_ips', user_id=c.user.user_id),method='delete')}
33 34 ${h.hidden('del_ip_id',ip.ip_id)}
34 35 ${h.submit('remove_',_('Delete'),id="remove_ip_%s" % ip.ip_id,
35 36 class_="btn btn-link btn-danger", onclick="return confirm('"+_('Confirm to delete this ip: %s') % ip.ip_addr+"');")}
36 37 ${h.end_form()}
37 38 </td>
38 39 </tr>
39 40 %endfor
40 41 %endif
41 42 %if not c.default_user_ip_map and not c.user_ip_map:
42 43 <tr>
43 44 <td><h2 class="ip">${_('All IP addresses are allowed')}</h2></td>
44 45 <td></td>
45 46 <td></td>
46 47 <td></td>
47 48 </tr>
48 49 %endif
49 50 </table>
50 51 </div>
51 52
52 53 <div>
53 54 ${h.secure_form(url('edit_user_ips', user_id=c.user.user_id),method='put')}
54 55 <div class="form">
55 56 <!-- fields -->
56 57 <div class="fields">
57 58 <div class="field">
58 59 <div class="label">
59 60 <label for="new_ip">${_('New IP Address')}:</label>
60 61 </div>
61 62 <div class="input">
62 63 ${h.text('new_ip')} ${h.text('description', placeholder=_('Description...'))}
63 64 <span class="help-block">${_('Enter comma separated list of ip addresses like 127.0.0.1,\n'
64 65 'or use a ip address with a mask 127.0.0.1/24, to create a network range.\n'
65 66 'To specify multiple address range use 127.0.0.1-127.0.0.10 syntax')}</span>
66 67 </div>
67 68 </div>
68 69 <div class="buttons">
69 70 ${h.submit('save',_('Add'),class_="btn btn-small")}
70 71 ${h.reset('reset',_('Reset'),class_="btn btn-small")}
71 72 </div>
72 73 </div>
73 74 </div>
74 75 ${h.end_form()}
75 76 </div>
76 77 </div>
77 78 </div>
General Comments 0
You need to be logged in to leave comments. Login now