/[smeserver]/rpms/smeserver-manager/sme10/smeserver-manager-0.1.4-toggle_password_and_menu-jquery_cond-csrf_get.patch
ViewVC logotype

Contents of /rpms/smeserver-manager/sme10/smeserver-manager-0.1.4-toggle_password_and_menu-jquery_cond-csrf_get.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Wed Jan 5 10:22:16 2022 UTC (2 years, 4 months ago) by michel
Branch: MAIN
CVS Tags: smeserver-manager-0_1_4-22_el7_sme, smeserver-manager-0_1_4-17_el7_sme, smeserver-manager-0_1_4-33_el7_sme, smeserver-manager-0_1_4-19_el7_sme, smeserver-manager-0_1_4-26_el7_sme, smeserver-manager-0_1_4-18_el7_sme, smeserver-manager-0_1_4-27_el7_sme, smeserver-manager-0_1_4-11_el7_sme, smeserver-manager-0_1_4-16_el7_sme, smeserver-manager-0_1_4-32_el7_sme, smeserver-manager-0_1_4-31_el7_sme, smeserver-manager-0_1_4-20_el7_sme, smeserver-manager-0_1_4-25_el7_sme, smeserver-manager-0_1_4-13_el7_sme, smeserver-manager-0_1_4-28_el7_sme, smeserver-manager-0_1_4-15_el7_sme, smeserver-manager-0_1_4-14_el7_sme, smeserver-manager-0_1_4-12_el7_sme, smeserver-manager-0_1_4-24_el7_sme, smeserver-manager-0_1_4-29_el7_sme, smeserver-manager-0_1_4-23_el7_sme, smeserver-manager-0_1_4-21_el7_sme, HEAD
make: « clog » est à jour.

1 diff -urN smeserver-manager-0.1.4.old/root/etc/e-smith/templates/usr/share/smanager/conf/srvmngr.conf/28hasJquery smeserver-manager-0.1.4/root/etc/e-smith/templates/usr/share/smanager/conf/srvmngr.conf/28hasJquery
2 --- smeserver-manager-0.1.4.old/root/etc/e-smith/templates/usr/share/smanager/conf/srvmngr.conf/28hasJquery 1970-01-01 04:00:00.000000000 +0400
3 +++ smeserver-manager-0.1.4/root/etc/e-smith/templates/usr/share/smanager/conf/srvmngr.conf/28hasJquery 2022-01-03 12:27:43.000000000 +0400
4 @@ -0,0 +1,2 @@
5 + # is js-jquery available
6 + hasJquery => { -f '/usr/share/smanager/themes/default/public/js/jquery.min.js' ? '1' : '0'; },
7 diff -urN smeserver-manager-0.1.4.old/root/etc/e-smith/templates/usr/share/smanager/themes/default/public/css/styles.css/50body smeserver-manager-0.1.4/root/etc/e-smith/templates/usr/share/smanager/themes/default/public/css/styles.css/50body
8 --- smeserver-manager-0.1.4.old/root/etc/e-smith/templates/usr/share/smanager/themes/default/public/css/styles.css/50body 2022-01-05 12:30:15.000000000 +0400
9 +++ smeserver-manager-0.1.4/root/etc/e-smith/templates/usr/share/smanager/themes/default/public/css/styles.css/50body 2021-12-22 23:07:33.000000000 +0400
10 @@ -192,13 +192,13 @@
11 font-weight: bold;
12 }
13
14 -.section {
15 +a.section {
16 }
17 .a, .item {
18 line-height: 12px;
19 }
20
21 -.section-title {
22 +a.section-title {
23 display: inline-block;
24 color: #6CA345; /*#888;*/
25 padding-left: 5px;
26 @@ -256,7 +256,16 @@
27 text-align: center;
28 }
29
30 -/*end*/
31 +.toggle-password {
32 + margin-left: -30px;
33 +}
34
35 +.tg-icon {
36 + position: relative;
37 + top: 5px;
38 + left: 2px;
39 +}
40 +
41 +/*end*/
42 EOF
43 }
44 diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr/Plugin/CSRFDefender.pm smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr/Plugin/CSRFDefender.pm
45 --- smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr/Plugin/CSRFDefender.pm 2022-01-05 12:30:15.000000000 +0400
46 +++ smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr/Plugin/CSRFDefender.pm 2022-01-05 13:59:23.942000000 +0400
47 @@ -84,7 +84,9 @@
48 my $session_token = $c->session($s_name);
49
50 # POST method or local GET with params.
51 - if ( $c->req->method eq 'POST' or ( $c->req->method eq 'GET' && %{$c->req->params->to_hash} ) ) {
52 +# if ( $c->req->method eq 'POST' or ( $c->req->method eq 'GET' && %{$c->req->params->to_hash} ) ) {
53 +# POST method or local GET with param csrftoken present
54 + if ( $c->req->method eq 'POST' or ( $c->req->method eq 'GET' && $request_token ) ) {
55 return 0 unless $request_token;
56 return 0 unless $session_token;
57 return 0 unless $request_token eq $session_token;
58 diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr.pm smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr.pm
59 --- smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr.pm 2022-01-05 12:30:15.000000000 +0400
60 +++ smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr.pm 2022-01-05 13:45:34.891000000 +0400
61 @@ -23,7 +23,7 @@
62 use SrvMngr::Model::Main;
63
64
65 -our $VERSION = '1.410';
66 +our $VERSION = '1.411';
67 $VERSION = eval $VERSION;
68
69 use Exporter 'import';
70 diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep
71 --- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep 2021-06-21 13:25:10.000000000 +0400
72 +++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep 2022-01-03 12:03:07.000000000 +0400
73 @@ -12,8 +12,10 @@
74 %= stylesheet '/css/sme_menu.css'
75 %= stylesheet '/css/styles.css'
76 %= content_for 'head_contrib'
77 - %= include 'partials/_js_imports'
78 - %= include 'common_js'
79 + % if (config 'hasJquery') {
80 + %= include 'partials/_js_imports'
81 + %= include 'common_js'
82 + % }
83 %= content_for 'refresh'
84 </head>
85
86 @@ -24,13 +26,15 @@
87 <div id="header">
88 %= include 'partials/_header'
89 % if ($c->is_logged_in && scalar @{SrvMngr::theme_list( $c )} > 1) {
90 - %= include 'partials/_swt_theme'
91 + %= include 'partials/_swt_theme'
92 % }
93 </div>
94
95 <div id="container">
96
97 - %= content 'js_toggleMenu'
98 + % if (config 'hasJquery') {
99 + %= content 'js_toggleMenu'
100 + % }
101
102 <div id="navigation" class="col-md-3">
103 %= include 'partials/_nav_menu'
104 @@ -65,7 +69,10 @@
105 </div>
106 </div>
107
108 - %= content 'js_swapClass'
109 + % if (config 'hasJquery') {
110 + %= content 'js_swapClass'
111 + %= content 'js_togglePassword'
112 + % }
113
114 </body>
115 </html>
116 diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/login.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/login.html.ep
117 --- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/login.html.ep 2022-01-05 12:30:15.000000000 +0400
118 +++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/login.html.ep 2022-01-05 14:09:14.947000000 +0400
119 @@ -36,7 +36,10 @@
120 <p><span class=label>
121 %=l 'PASSWORD'
122 </span><span class=input>
123 - %= password_field 'Password'
124 + %= password_field 'Password', id => 'id_password', autocomplete => 'current-password'
125 + % if (config 'hasJquery') {
126 + <a href='#' id='togglePassword' class='toggle-password tg-icon'> <img src="images/visible.png" height="16" alt="Visible"></a>
127 + % }
128 </span></p>
129
130 %= hidden_field 'From' => $c->tx->req->url
131 diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep
132 --- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep 2020-11-19 11:53:26.000000000 +0400
133 +++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep 2021-12-22 16:45:36.000000000 +0400
134 @@ -1,4 +1,30 @@
135
136 +<!--*** toggle hide/unhide password field in login panel ***-->
137 +
138 +% content_for 'js_togglePassword' => begin
139 + %= javascript begin
140 +
141 + $(document).ready(function() {
142 +
143 + const togglePassword = document.querySelector('#togglePassword');
144 + const password = document.querySelector('#id_password');
145 +
146 + if (( togglePassword ) && ( password )) {
147 + togglePassword.addEventListener('click', function (e) {
148 + // toggle the type attribute
149 + const type = password.getAttribute('type') === 'password' ? 'text' : 'password';
150 + password.setAttribute('type', type);
151 + // toggle the eye slash icon
152 + // this.classList.toggle('eye-slash');
153 + })
154 + }
155 + });
156 +
157 + % end
158 +% end
159 +
160 +<!--*** toggle hide/unhide menu contents navigation menu ***-->
161 +
162 % content_for 'js_toggleMenu' => begin
163 %= javascript begin
164
165 @@ -7,16 +33,26 @@
166 $('#menunav').toggle({ duration: 300 });
167 });
168 $('#toguser').click(function() {
169 - $('#menuuser').toggle({ duration: 600 });
170 + $('#menuuser').toggle({ duration: 300 });
171 });
172 $('#togadm').click(function() {
173 - $('#menuadm').toggle({ duration: 900 });
174 + $('#menuadm').toggle({ duration: 300 });
175 });
176 + $('.section-title').click(function() {
177 + var $section = $(this).parent().next('div');
178 + if(!$section.length){
179 + // alert('No element found!');
180 + return false;
181 + }
182 + $section.toggle({ duration: 600 });
183 + })
184 });
185
186 % end
187 % end
188
189 +<!--*** swap class on menu element chosen ***-->
190 +
191 % content_for 'js_swapClass' => begin
192 %= javascript begin
193 (function($) {
194 diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/partials/_navig2.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/partials/_navig2.html.ep
195 --- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/partials/_navig2.html.ep 2020-11-19 11:53:26.000000000 +0400
196 +++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/partials/_navig2.html.ep 2021-12-22 13:10:50.000000000 +0400
197 @@ -2,14 +2,14 @@
198 % my %nav = %{SrvMngr->getNavigation( $c->languages(), 'A' )};
199
200 <div id='navigat2'>
201 - <a href='#' id='togadm' class='menu-title'>ADMINISTRATION</a>
202 + <div><a href='#' id='togadm' class='menu-title'>ADMINISTRATION</a></div>
203 <div id='menuadm'>
204
205 % my $cc = 1;
206 % foreach my $h (sort { ($nav{$a}{'WEIGHT'}/$nav{$a}{'COUNT'})
207 % <=> ($nav{$b}{'WEIGHT'}/$nav{$b}{'COUNT'}) } keys %nav) {
208 -%
209 - <div class='section section-title'><%= $h %></div>
210 + <div><a href='#' class='section section-title'><%= $h %></a></div>
211 + <div class='togms'>
212 % my ($classNew, $target, $href) = '';
213 % foreach (sort { $a->{'WEIGHT'} <=> $b->{'WEIGHT'} } @{$nav{$h}{'DESCRIPTIONS'}}) {
214
215 @@ -27,7 +27,7 @@
216 id='sme<%= $cc %>' href='<%= $href %>'><%= $_->{'DESCRIPTION'} %></a></div>
217 % $cc++;
218 % }
219 -
220 + </div>
221 % }
222
223 </div>

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed