PageSourceSearch

https://levitacia.co/local/templates/levitacia/assets/scripts/authSms.js?161995714011568

js levitacia.co collected 2026-10-08 19:05:32 UTC 11,568 bytes, 268 lines download raw bytes

1$(document).ready(function () {
2    hashCode = function(s){
3        return s.split("").reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a},0);
4    }
5
6   $(document).on('click', '.lk-tab__submit[name="Login"]', function (e) {
7
8       let success = $(this).data('success');
9       var form = $(this).closest('form');
10       let pass = form.find('[name="USER_PASSWORD"]');
11       const email = /^[\w-\.]+@[\w-]+\.[a-z]{2,4}$/i;
12       const phone = /^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$/;
13       let userField = form.find('[name="USER_LOGIN"]').val();
14       let emailValid = email.test(userField);
15       let phoneValid = phone.test(userField);
16       var passLabel = form.find('[for="password"]');
17
18       if(!success){
19           e.preventDefault();
20           if(emailValid) {
21               console.log('email', emailValid);
22               form.data('success', true);
23               pass.attr('required', true);
24               $(this).data('success', true);
25               passLabel.html('Пароль:');
26               $(this).click();
27           } else if (phoneValid) {
28               $('#auth_submit').val('Войти');
29               $('#password').show();
30               $('[for="password"]').show();
31               if (pass.attr('required')) {
32                   pass.removeAttr('required');
33               }
34               //passLabel.html('Код:');
35               form.submit();
36           }
37       } else {
38           /*if(emailValid) {
39               pass.attr('required', true);
40           } else if (phoneValid) {
41               form.data('success', '');
42               pass.removeAttr('required');
43           }*/
44           //$(this).data('success', '');
45           console.log('button', success);
46       }
47   });
48
49   $(document).on('submit', '[name="form_auth"]', function (e) {
50       var form = $(this);
51       let success = form.data('success');
52
53       if(success) {
54           console.log('form', success);
55       } else {
56           e.preventDefault();
57           let url = '/local/templates/levitacia/assets/php/authSMS.php';
58           let hash = form.data('hash');
59           let code = form.find('[name="USER_PASSWORD"]').val();
60           var error = form.find('.error');
61           var success_auth = form.find('.success_auth');
62           var btn = form.find('.lk-tab__submit[name="Login"]');
63           const phoneElem = form.find('[name="USER_LOGIN"]')
64           btn.attr("disabled", true);
65           if(hash.length == 0) {
66               let phone = $(phoneElem).val().replace(/[^\d;]/g, '');
67               $.ajax({
68                   type: 'POST',
69                   url: url,
70                   dataType: 'json',
71                   data: {
72                       phone: phone
73                   },
74                   success: function(data){
75                       if (data.success) {
76                           error.fadeOut();
77                           form.data('hash', data.hash);
78                           success_auth.html(data.response);
79                           success_auth.fadeIn();
80                       } else {
81                           success_auth.fadeOut();
82                           document.querySelector('[href="#lk-acc2"]').click()
83                           document.querySelector('#personal_phone').setAttribute('value', phone)
84                           $(phoneElem).val('')
85                           setTimeout(() => {
86                               IMask(document.querySelector('#personal_phone'), {
87                                       mask: '+{7}(000)000-00-00'
88                                   }
89                               );
90                           }, 200)
91                           /*error.html(data.response);
92                           error.fadeIn();*/
93                       }
94                   },
95                   error: function(jqXHR, exception){
96                       success_auth.fadeOut();
97                       console.log(exception);
98                       error.html('Ошибка авторизации. Свяжитесь с администратором сайта или попробуйте авторизоваться с помощью E-mail.');
99                       error.fadeIn();
100                   }
101               });
102           } else if (code.length > 0){
103               $.ajax({
104                   type: 'POST',
105                   url: url,
106                   dataType: 'json',
107                   data: {
108                       hash: hash,
109                       code: code
110                   },
111                   success: function(data){
112                       if (data.success) {
113                           form.data('hash', '');
114                           error.fadeOut();
115                           form.data('success', true);
116                           success_auth.html(data.response);
117                           success_auth.fadeIn();
118                           setTimeout(function () {
119                               document.location = '/personal/';
120                           }, 1000);
121                       } else {
122                           error.html(data.response);
123                           error.fadeIn();
124                       }
125                   },
126                   error: function(jqXHR, exception){
127                       console.log(exception);
128                       error.html('Ошибка авторизации. Свяжитесь с администратором сайта или попробуйте авторизоваться с помощью E-mail.');
129                       error.fadeIn();
130                   }
131               });
132           }
133       }
134       setTimeout(function () {
135           btn.attr("disabled", false);
136       }, 2000);
137   })
138
139    $(document).on('submit', '.send_forgot_from', function (e) {
140        var form = $(this);
141        let formSuccessValid = form.data('success');
142
143        if(formSuccessValid) {
144            console.log(formSuccessValid);
145        } else {
146            e.preventDefault();
147            const email = /^[\w-\.]+@[\w-]+\.[a-z]{2,4}$/i;
148            const phone = /^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$/;
149            let userField = form.find('[name="USER_EMAIL"]').val();
150            let emailValid = email.test(userField);
151            let phoneValid = phone.test(userField);
152            var error = form.find('.error');
153            var success = form.find('#success_forgot');
154            var btn = form.find('[name="send_account_info"]');
155
156            if(emailValid) {
157                console.log('email', emailValid);
158                form.find('#success_forgot').fadeIn();
159                form.data('success', true);
160                setTimeout(function () {
161                    form.submit();
162                }, 2000);
163            } else if (phoneValid) {
164                console.log('phone', phoneValid);
165                let userPhone = userField.replace(/[^\d;]/g, '');
166                $.ajax({
167                    type: 'POST',
168                    url: '/local/templates/levitacia/assets/php/forgotSMS.php',
169                    dataType: 'json',
170                    data: {
171                        phone: userPhone
172                    },
173                    success: function(data){
174                        if (data.success) {
175                            setTimeout(function () {
176                                document.location = '/personal/forgot/?forgot_password=yes#lk-acc2'
177                            }, 1000);
178                            btn.attr("disabled", true);
179                            error.fadeOut();
180                            //form.data('hash', data.response);
181                            success.html(data.response);
182                            success.fadeIn();
183                        } else {
184                            success.fadeOut();
185                            error.html(data.response);
186                            error.fadeIn();
187                        }
188                    },
189                    error: function(jqXHR, exception){
190                        console.log(exception);
191                        error.html('Ошибка авторизации. Свяжитесь с администратором сайта.');
192                        error.fadeIn();
193                    }
194                });
195
196            }  else {
197                console.log(emailValid, phoneValid);
198                error.html('Введите валидный номер или email!');
199                error.fadeIn();
200            }
201        }
202    })
203//NBSkhjA*EnRf
204     $(document).on('submit', '.change_forgot_from', function (e) {
205        var form = $(this);
206        let formSuccessValid = form.data('success');
207        let forgotWithPhone = form.data('phoneforgot');
208
209        if(formSuccessValid) {
210            console.log(formSuccessValid);
211        } else {
212            if (forgotWithPhone) {
213                e.preventDefault();
214                var error = form.find('.error');
215                var success = form.find('.success');
216                const hash = form.data('hash');
217                const code = form.find('[name="USER_CHECKWORD"]').val();
218                const userLogin = form.find('[name="USER_EMAIL"]').val();
219                const userPassw = form.find('[name="USER_PASSWORD"]').val();
220                const userPasswConfirm = form.find('[name="USER_CONFIRM_PASSWORD"]').val();
221                const btn = form.find('[name="change_pwd"]');
222                if(hash && code.length > 0) {
223                    $.ajax({
224                        type: 'POST',
225                        url: '/local/templates/levitacia/assets/php/forgotSMS.php',
226                        dataType: 'json',
227                        data: {
228                            hash: hash,
229                            code: code,
230                            userLogin: userLogin,
231                            userPassw: userPassw,
232                            userPasswConfirm: userPasswConfirm
233                        },
234                        success: function(data){
235                            if (data.success) {
236                                btn.attr("disabled", true);
237                                form.data('success', true);
238                                error.fadeOut();
239                                form.data('hash', '');
240                                form.data('phoneforgot', '');
241                                success.html(data.response);
242                                success.fadeIn();
243                                setTimeout(() => {
244                                    document.location = '/personal/';
245                                }, 2000);
246
247                            } else {
248                                error.html(data.response);
249                                error.fadeIn();
250                            }
251                        },
252                        error: function(jqXHR, exception){
253                            console.log(exception);
254                            error.html('Ошибка авторизации. Свяжитесь с администратором сайта.');
255                            error.fadeIn();
256                        }
257                    });
258                } else {
259                    error.html('Что-то пошло не так! Перейдите на форму "Выслать данные" и отправьте заново!');
260                    error.fadeIn();
261                }
262            } else {
263                form.data('success', true);
264                form.submit();
265            }
266        }
267    })
268});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.