1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
|
<?php
include_once '../../function.php';
include_once '../../vendor/autoload.php';
include_once '../../sql/class.ImportDB.php';
class DisplayController{
var $stran; // stran na kateri se nahajamo
var $podstran; // podstran na kateri se nahajamo
var $lang_id = 1; // izbran jezik
var $root = ''; // Za kasneje ce bomo vklopili rewrite
function __construct(){
global $admin_type;
global $site_url;
global $lang;
global $global_user_id;
// Ce smo ze logirani vedno preusmerimo na moje ankete
if($global_user_id != '' && $global_user_id > 0){
header ('location: '.$site_url.'admin/survey/index.php');
die();
}
if(isset($_GET['a']))
$this->stran = $_GET['a'];
if(isset($_GET['b']))
$this->podstran = $_GET['b'];
// Nastavimo jezik
if(isset($_GET['lang_id']))
$this->lang_id = $_GET['lang_id'];
elseif(isset($_SESSION['lang_id']))
$this->lang_id = $_SESSION['lang_id'];
$_SESSION['langX'] = $site_url .'lang/'.$this->lang_id.'.php';
$_SESSION['lang_id'] = $this->lang_id;
$file = '../../lang/'.$this->lang_id.'.php';
include($file);
}
public function displayHead(){
global $site_url;
global $app_settings;
global $lang;
echo ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo ' <meta charset="utf-8">';
echo ' <meta name = "viewport" content = "user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width">';
echo ' <meta name="keywords" content="web survey software, internet survey, online survey, web questionaires">';
echo ' <meta name="keywords" content="spletne ankete, spletna anketa, spletno anketiranje, internetne ankete, slovenščina, slovenski jezik, software, softver, programska oprema, orodje za spletne ankete, internetno anketiranje, online vprašalniki, ankete po internetu, internet, internetne ankete, anketa" lang="si">';
echo ' <meta name="description" content="1KA je orodje za spletne ankete, hkrati pa je tudi on-line platforma (gostitelj), na kateri se lahko spletna anketa brezplačno izdela.">';
echo ' <meta name="abstract" content="1KA je orodje za spletne ankete">';
echo ' <meta name="author" content="CDI, FDV">';
echo ' <meta name="publisher" content="">';
echo ' <meta name="copyright" content="CDI, FDV">';
echo ' <meta name="audience" content="splošna populacija">';
echo ' <meta name="page-topic" content="spletne aplikacije">';
echo ' <meta name="revisit-after" content="7">';
// Custom header title
if(isset($app_settings['head_title_custom']) && $app_settings['head_title_custom'] == 1){
echo '<title>'.$app_settings['head_title_text'].'</title>' . "\n";
}
// Default header title
else{
echo '<title>'.$lang['1ka_surveys'].'</title>' . "\n";
}
echo ' <!-- CSS -->';
echo ' <link type="text/css" href="'.$site_url.'frontend/simple/css/style.css" rel="stylesheet" />';
echo ' <link type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" /">';
echo ' <!-- JAVASCRIPT -->';
echo ' <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>';
echo ' <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>';
echo ' <script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>';
echo ' <script type="text/javascript" src="'.$site_url.'frontend/simple/script/init.js"></script>';
echo ' <script type="text/javascript" src="'.$site_url.'frontend/simple/script/script.js"></script>';
echo ' <!-- FAVICON -->';
echo ' <link rel="shortcut icon" type="image/ico" href="'.$site_url.'/favicon.ico" />';
}
// Izris zgornje vrstice z logotipom in menijem
public function displayHeader(){
global $site_url;
global $lang;
global $google_login_client_id;
global $aai_instalacija;
// Logo v glavi
echo '<div class="logo ">';
echo ' <a href="'.$site_url.$this->root.'index.php">';
echo ' <img src="'.$site_url.'/public/img/logo/1ka_'.($this->lang_id != 1 ? 'eng' : 'slo').'.svg">';
if($aai_instalacija){
echo ' <img src="'.$site_url.'/public/img/logo/arnes_logo.png" style="margin-left:30px;">';
}
echo ' </a>';
echo '</div>';
// Navigacija
echo '<nav>';
// Hidden polje z lang_id-jem
echo ' <input type="hidden" name="lang_id" value="'.$this->lang_id.'" />';
// GDPR zahtevek je prisoten samo na virtualkah in na lastno zahtevo
echo '<span class="menu_item '.($this->stran == 'gdpr' ? 'active' : '').'">';
echo ' <a href="index.php?a=gdpr">'.$lang['srv_gdpr_drupal_tab'].'</a>';
echo '</span>';
// Preklop jezika
echo '<span class="menu_item lang_switch">';
$params = '?' . (isset($_GET['a']) ? 'a='.$_GET['a'].'&' : '') . (isset($_GET['b']) ? 'b='.$_GET['b'].'&' : '');
if($this->lang_id == 1){
echo ' <a href="'.$site_url.$this->root.'index.php'.$params.'lang_id=2">';
echo ' <div class="flag eng"></div> <span>English</span>';
echo ' </a>';
}
else{
echo ' <a href="'.$site_url.$this->root.'index.php'.$params.'lang_id=1">';
echo ' <div class="flag slo"></div> <span>Slovenščina</span>';
echo '</a>';
}
echo '</span>';
echo '</nav>';
}
// Izris vsebine
public function displayMain(){
global $virtual_domain;
switch($this->stran){
/*case 'login':
$this->displayLoginPage();
break;*/
/*case 'login_noEmail':
$this->displayLoginNoEmailPage();
break;*/
case 'login_2fa':
$this->displayLogin2faPage();
break;
/*case 'register':
if(!$virtual_domain)
$this->displayRegisterPage();
else
$this->displayFrontPage();
break;*/
case 'register_confirm':
if(!$virtual_domain)
$this->displayRegisterPageConfirm();
else
$this->displayFrontPage();
break;
case 'register_email':
if(!$virtual_domain)
$this->displayRegisterPageEmail();
else
$this->displayFrontPage();
break;
case 'unregister':
if(!$virtual_domain)
$this->displayUnregisterPage();
else
$this->displayFrontPage();
break;
case 'unregister_confirm':
if(!$virtual_domain)
$this->displayUnregisterPageConfirm();
else
$this->displayFrontPage();
break;
case 'reset_password':
$this->displayResetPasswordPage();
break;
case 'reset_password_activate':
$this->displayResetPasswordPageActivate();
break;
case 'gdpr':
$this->displayGDPRPage();
break;
default:
$this->displayFrontPage();
break;
}
}
// Izris footerja
public function displayFooter(){
global $virtual_domain;
global $lang;
global $app_settings;
global $aai_instalacija;
// Stolpec 1
echo '<div class="col">';
echo ' <h2>'.$lang['simple_footer_about'].'</h2>';
echo ' <span>'.$lang['simple_footer_about_1ka'].'</span>';
if($aai_instalacija)
echo ' <span>'.$lang['simple_footer_about_faq'].'</span>';
echo ' <span>'.$lang['simple_footer_about_general'].'</span>';
echo ' <span>'.$lang['simple_footer_about_privacy'].'</span>';
echo ' <span>'.$lang['simple_footer_about_cookies'].'</span>';
echo ' <span>'.$lang['simple_footer_about_antispam'].'</span>';
echo ' <div class="follow">'.$lang['simple_footer_about_follow'].': ';
echo ' <a href="https://twitter.com/enklikanketa" target="_blank"><span class="icon twitter"></span></a>';
echo ' <a href="https://www.facebook.com/1KA-123545614388521/" target="_blank"><span class="icon fb"></span></a>';
echo ' </div>';
echo '</div>';
// Stolpec 2
echo '<div class="col">';
echo ' <h2>'.$lang['simple_footer_company'].'</h2>';
echo ' <span class="semi-bold">'.$app_settings['owner'].'</span>';
echo ' <span><a href="mailto:'.$app_settings['admin_email'].'">'.$app_settings['admin_email'].'</a></span>';
echo ' <span><a href="'.$app_settings['owner_website'].'" target="_blank">'.$app_settings['owner_website'].'</a></span>';
echo '</div>';
// Stolpec 3 - logotipi
echo '<div class="col">';
// Logotipa FDV in CDI - samo pri virtualkah
if($virtual_domain || $aai_instalacija){
echo '<div class="logo_holder">';
echo ' <img src="'.$site_url.'/public/img/logo/fdv.png">';
echo ' <img src="'.$site_url.'/public/img/logo/cdi_'.($this->lang_id != 1 ? 'eng' : 'slo').'.png">';
echo '</div>';
}
echo '</div>';
}
// Izris prve strani
private function displayFrontPage(){
global $aai_instalacija;
// AAI
if($aai_instalacija)
$this->displayFrontPageFormAAI();
else
$this->displayFrontPageForm();
}
// Izris okna na prvi strani
private function displayFrontPageForm(){
global $lang;
global $site_url;
global $app_settings;
global $virtual_domain;
echo '<div class="app_title">'.$app_settings['app_name'].'</div>';
// WHITE BOX FOR LOGIN / REGISTRATION
echo '<div class="landing_page_window">';
// Tabs - samo pri lastni instalaciji, pri virtualkah nimamo registracije
if($virtual_domain){
echo ' <div class="tabs">';
echo ' <div class="tab full_width">'.$lang['login_short'].'</div>';
echo ' </div>';
}
else{
echo ' <div class="tabs">';
echo ' <div class="tab '.(isset($_GET['a']) && $_GET['a'] == 'register' ? '' : 'active').'" onClick="switchLoginRegistration(this);">'.$lang['login_short'].'</div>';
echo ' <div class="tab '.(!isset($_GET['a']) || $_GET['a'] != 'register' ? '' : 'active').'" onClick="switchLoginRegistration(this);">'.$lang['nu_register'].'</div>';
echo ' </div>';
}
// SKB ima blokirano prijavo za vse ipje razen svojega
$ip = $_SERVER['REMOTE_ADDR'];
if(isset($app_settings['admin_allow_only_ip'])
&& $app_settings['admin_allow_only_ip'] != ''
&& !empty($app_settings['admin_allow_only_ip'])
&& !in_array($ip, $app_settings['admin_allow_only_ip'])
){
echo '<div style="padding: 50px; line-height: 30px; text-align: center; font-weight: 600;">Prijava v aplikacijo iz obstoječega IP naslova ('.$ip.') ni mogoča!</div>';
}
else{
// LOGIN
echo ' <div id="login_holder" '.(isset($_GET['a']) && $_GET['a'] == 'register' ? '' : 'class="active"').'>';
$this->displayFrontPageLogin();
echo ' </div>';
// REGISTRATION
echo ' <div id="registration_holder" '.(!isset($_GET['a']) || $_GET['a'] != 'register' ? '' : 'class="active"').'>';
$this->displayFrontPageRegistration();
echo ' </div>';
}
echo '</div>';
// APP SUBTITLE
echo '<div class="app_subtitle">';
if($virtual_domain)
echo $lang['app_virtual_domain'];
else
echo $lang['app_installation'];
echo '</div>';
}
// Izris okna na prvi strani - AAI
private function displayFrontPageFormAAI(){
global $lang;
global $site_url;
global $app_settings;
// WHITE BOX FOR LOGIN / REGISTRATION
echo '<div class="landing_page_window">';
// APP TITLE - aai
echo '<div class="app_title" style="text-transform: initial;">'.$app_settings['app_name'].'</div>';
// AAI logo
//echo '<div class="arnes_logo"><img src="'.$site_url.'/public/img/logo/arnes_logo.png"></div>';
// AAI text
echo ' <div class="tabs">';
echo ' <div class="tab full_width">'.$lang['app_aai_installation_text'].'</div>';
echo ' </div>';
// AAI login/register
echo ' <a href="'.$site_url.'/aai"><input type="button" name="aai-login" title="'.$lang['aaiPopupTitle'].'" value="'.$lang['aaiPopupTitle'].'"></a>';
echo '</div>';
// APP SUBTITLE
/*echo '<div class="app_subtitle">';
echo $lang['app_aai_installation'];
echo '</div>';*/
}
// Izris okna za login na prvi strani
private function displayFrontPageLogin(){
global $lang;
global $site_url;
if(isset($_GET['a']) && $_GET['a'] == 'register'){
$email = '';
$error = '';
}
else{
$email = (isset($_GET['email'])) ? $_GET['email'] : '';
$error = '';
if(isset($_GET['a']) && $_GET['a'] == 'login_noEmail'){
$error = 'email';
}
elseif(isset($_GET['error']) && $_GET['error'] == 'password'){
$error = 'password';
}
}
// Forma za vpis
echo '<form name="login_1" id="login_form" class="login_form" action="'.$site_url.'/frontend/api/api.php?action=login" method="post">';
// Email
echo ' <label for="email" '.($error == 'email' ? 'class="red"': '').'>'.$lang['email'].'</label>';
echo ' <input id="em" '.($error == 'email' ? 'class="red"': '').' name="email" value="'.$email.'" size="30" placeholder="E-mail" onblur="CheckEmailFP();" type="text">';
// Password
echo ' <label for="pass" '.($error == 'password' ? 'class="red"': '').'>'.$lang['password'].'</label>';
echo ' <input '.($error == 'password' ? 'class="red"': '').' name="pass" placeholder="'.$lang['login_password'].'" type="password">';
// Error text
if($error != ''){
echo ' <div class="error_holder">';
if($error == 'email' && $email == '')
echo $lang['cms_error_missing_email'];
elseif($error == 'email')
echo $lang['cms_error_wrong_email'];
elseif($error == 'password')
echo $lang['cms_error_password'];
echo ' </div>';
}
// Lost pass
echo ' <div class="lostpass"><a class="RegLastPage" href="#" onclick="LostPassword(\''.$lang['please_insert_email'].'\');">'.$lang['forgot_password'].'</a></div>';
// Submit
echo ' <input name="submit" title="'.$lang['login'].'" value="'.$lang['next1'].'" type="submit">';
echo '</form>';
}
// Izris okna za registracijo na prvi strani
private function displayFrontPageRegistration(){
global $lang;
global $site_url;
global $secret_captcha;
global $recaptcha_sitekey;
if(!isset($_GET['a']) || $_GET['a'] != 'register'){
$email = '';
$ime = '';
$error = array();
}
else{
$email = (isset($_GET['email'])) ? $_GET['email'] : '';
$ime = (isset($_GET['ime'])) ? $_GET['ime'] : '';
if(isset($_GET['invalid_email']) && $_GET['invalid_email'] == '1'){
$error['email'] = '1';
}
if(isset($_GET['existing_email']) && $_GET['existing_email'] == '1'){
$error['email'] = '1';
}
if(isset($_GET['missing_ime']) && $_GET['missing_ime'] == '1'){
$error['ime'] = '1';
}
if(isset($_GET['pass_complex']) && $_GET['pass_complex'] == '1'){
$error['password'] = '1';
}
if(isset($_GET['pass_mismatch']) && $_GET['pass_mismatch'] == '1'){
$error['password'] = '1';
}
if(isset($_GET['missing_agree']) && $_GET['missing_agree'] == '1'){
$error['agree'] = '1';
}
}
echo '<form name="register" id="register_form" class="register_form" action="'.$site_url.'frontend/api/api.php?action=register" method="post">';
echo ' <span class="subtitle">'.$lang['cms_register_user_text'].'</span>';
// Email
echo ' <label for="email" '.(isset($error['email']) ? 'class="red"' : '').'>'.$lang['email'].':</label>';
echo ' <input class="regfield '.(isset($error['email']) ? 'red' : '').'" id="email" name="email" value="'.$email.'" placeholder="'.$lang['email'].'" type="text">';
// Ime
echo ' <label for="ime" '.(isset($error['ime']) ? 'class="red"' : '').'>'.$lang['cms_register_user_nickname'].':</label>';
echo ' <input class="regfield '.(isset($error['ime']) ? 'red' : '').'" id="ime" name="ime" value="'.$ime.'" placeholder="'.$lang['cms_register_user_nickname'].'" type="text">';
// RECAPTCHA
if($secret_captcha != '' && $recaptcha_sitekey != '')
echo ' <div class="g-recaptcha" data-sitekey="'.$recaptcha_sitekey.'" '.(isset($_GET['invalid_recaptcha']) ? ' style="border:1px red solid"' : '').'></div>';
// Geslo
echo ' <label for="p1" '.(isset($error['password']) ? 'class="red"' : '').'>'.$lang['login_password'].':</label>';
echo ' <input id="p1" class="text '.(isset($error['password']) ? 'red' : '').'" value="" name="geslo" placeholder="'.$lang['password'].'" type="password">';
// Geslo2
echo ' <label for="p2" '.(isset($error['password']) ? 'class="red"' : '').'>'.$lang['cms_register_user_repeat_password'].':</label>';
echo ' <input id="p2" class="text '.(isset($error['password']) ? 'red' : '').'" value="" name="geslo2" placeholder="'.$lang['cms_register_user_repeat_password'].'" type="password">';
// Strinjam se s pogoji
//echo ' <input id="IAgree" type="hidden" name="agree" value="1">';
$terms_url = ($lang['id'] == '1') ? 'https://www.1ka.si/d/sl/o-1ka/pogoji-uporabe-storitve-1ka' : 'https://www.1ka.si/d/en/about/terms-of-use';
echo ' <div class="form_row agreement '.(isset($_GET['missing_agree']) ? ' red' : '').'">';
echo ' <input id="IAgree" type="checkbox" name="agree" value="1"><label for="IAgree">';
echo '<div class="checkbox_text_holder"> '.str_replace('TERMS_URL', $terms_url, $lang['cms_register_user_terms_of_use']).'</label>';
echo ' <br /><span class="red italic">*'.$lang['cms_register_mandatory_field'].'</span></div>';
echo ' </div>';
// Error text
if(!empty($error)){
echo ' <div class="error_holder">';
foreach($error as $error_key => $error_type){
if($error_key == 'email' && $email == '')
echo $lang['cms_error_missing_email'].'<br />';
elseif($error_key == 'email' && $_GET['existing_email'] == '1')
echo $lang['srv_added_false'].'<br />';
elseif($error_key == 'email')
echo $lang['cms_error_wrong_email'].'<br />';
if($error_key == 'ime')
echo $lang['cms_error_user_field_empty'].'<br />';
if($error_key == 'password' && $_GET['pass_complex'] == '1')
echo $lang['password_err_complex'].'<br />';
if($error_key == 'password' && $_GET['pass_mismatch'] == '1')
echo $lang['ent_pass_doesnt_match'].'<br />';
if($error_key == 'agree')
echo $lang['MustAgree'].'<br />';
}
echo ' </div>';
}
// Submit
echo ' <input name="submit" value="'.$lang['next1'].'" class="regfield" type="submit">';
echo '</form>';
}
// Izris strani za prijavo
private function displayLoginPage(){
global $lang;
global $site_url;
echo '<div class="login_holder">';
// Prijava
echo ' <h1>'.$lang['login_for_existing2'].'</h1>';
echo ' <form name="login_2" id="login_2" action="'.$site_url.'frontend/api/api.php?action=login" method="post">';
// Ce je email v getu pomeni da se je zmotil pri passwordu
if(isset($_GET['email']) && $_GET['email'] != ''){
$email = $_GET['email'];
echo $lang['hello'].' <span class="bold">'.$email.'</span>';
echo ' <input id="em" name="email" value="'.$email.'" type="hidden"><br /><br />';
// Warning za napacno geslo
echo '<p><span class="red italic">'.$lang['wrong_password2'].'</span></p>';
}
else{
echo ' <div class="form_row"><span class="label"><label for="email">'.$lang['email'].':</label></span>';
echo ' <input class="regfield" id="em" name="email" value="" placeholder="'.$lang['login_email'].'" type="text">';
echo ' </div>';
}
// Geslo
echo ' <div class="form_row"><span class="label"><label for="pass">'.$lang['password'].':</label></span>';
echo ' <input class="regfield" name="pass" value="" placeholder="'.$lang['password'].'" type="password">';
echo ' </div>';
// Pozabljeno geslo
echo ' <div class="form_row">';
echo ' <span class="lostpass"><a class="RegLastPage" href="#" onclick="LostPassword(\''.$lang['please_insert_email'].'\');">'.$lang['forgot_password'].'</a></span>';
echo ' </div>';
// Zapomni si me
echo ' <div class="form_row">';
echo ' <input name="remember" id="remember_me" value="1" type="checkbox"> <label for="remember_me">'.$lang['remember_me2'].'</label>';
echo ' </div>';
echo ' <input name="submit" value="'.$lang['login'].'" class="regfield" type="submit">';
echo ' <span class="spaceLeft">'.str_replace('#URL#', $site_url.$this->root.'index.php?a=register', $lang['cms_login_registration_link']).'</span>';
echo ' </form>';
echo '</div>';
}
// Izris strani za prijavo
private function displayLogin2faPage(){
global $lang;
global $site_url;
echo '<div class="login_holder">';
// Prijava
echo ' <div class="login_element login">';
echo ' <h1>'.$lang['google_2fa'].'</h1>';
echo ' <form name="login_2" id="login_2" action="'.$site_url.'frontend/api/api.php?action=login_2fa" method="post">';
if(!empty($_GET['error'])){
echo '<p class="red">'.$lang['google_2fa_user_error_code'].'</p>';
}
// Ce je email v getu pomeni da se je zmotil pri passwordu
echo ' <input class="regfield '.(!empty($_GET['error']) ? 'red' : '').'" style="margin:5px 0 5px 13px;" name="google_2fa_number" placeholder="'.$lang['google_2fa_user_code'].'" type="text">';
echo ' <br />';
echo ' <br />';
echo ' <input name="submit" value="'.$lang['google_2fa_user_send'].'" class="regfield" type="submit">';
echo ' </form>';
echo ' </div>';
echo '</div>';
}
// Izris strani z opozorilom da mail za login ne obstaja
private function displayLoginNoEmailPage(){
global $lang;
global $site_url;
$email = (isset($_GET['email'])) ? $_GET['email'] : '';
echo '<div class="login_holder">';
echo ' <h1>'.$lang['error'].'</h1>';
echo ' <p>'.$lang['e_login_invalid'].'</p>';
echo ' <p><span class="bold">'.$email.'</span></p>';
echo ' <input onclick="location.href=\''.$site_url.$this->root.'index.php\'" name="retry" value="'.$lang['e_login_retry'].'" type="button">';
echo ' <input onclick="location.href=\''.$site_url.$this->root.'index.php?a=register\'" name="register" style="margin-left:10px;" value="'.$lang['e_login_register'].'" type="button">';
echo '</div>';
}
// Izris strani za registracijo
private function displayRegisterPage(){
global $lang;
global $site_url;
global $secret_captcha;
global $recaptcha_sitekey;
// Pogledamo ce imamo kaksen error v GET-u
$error = false;
if(isset($_GET['missing_email']) || isset($_GET['invalid_email']) || isset($_GET['existing_email'])
|| isset($_GET['missing_ime']) || isset($_GET['existing_ime'])
|| isset($_GET['pass_mismatch'])
|| isset($_GET['pass_complex'])
|| isset($_GET['invalid_recaptcha'])
|| isset($_GET['missing_agree'])){
$error = true;
}
// Pogledamo ce imamo poslane podatke preko GET-a
$email = (isset($_GET['email'])) ? $_GET['email'] : '';
$ime = (isset($_GET['ime'])) ? $_GET['ime'] : '';
echo '<div class="register_holder">';
if($error)
echo ' <h1>'.$lang['e_nu_could_not'].'</h1>';
else
echo ' <h1>'.$lang['register_new_user'].'</h1>';
echo ' <span class="subtitle">'.$lang['cms_register_user_text'].'</span>';
echo ' <form name="register" id="register" action="'.$site_url.'frontend/api/api.php?action=register" method="post">';
// Email
echo ' <div class="form_row '.(isset($_GET['missing_email']) || isset($_GET['invalid_email']) || isset($_GET['existing_email']) ? ' red' : '').'"><span class="label"><label for="email">'.$lang['email'].':</label></span>';
echo ' <input class="regfield" id="email" name="email" value="'.$email.'" placeholder="'.$lang['email'].'" type="text"></div>';
// Ime
echo ' <div class="form_row '.(isset($_GET['missing_ime']) || isset($_GET['existing_ime']) ? ' red' : '').'"><span class="label"><label for="ime">'.$lang['cms_register_user_nickname'].':</label></span>';
echo ' <input class="regfield" id="ime" name="ime" value="'.$ime.'" placeholder="'.$lang['cms_register_user_nickname'].'" type="text"></div>';
// RECAPTCHA
if($secret_captcha != '' && $recaptcha_sitekey != '')
echo '<div class="g-recaptcha" data-sitekey="'.$recaptcha_sitekey.'" '.(isset($_GET['invalid_recaptcha']) ? ' style="border:1px red solid"' : '').'></div>';
// Geslo
echo ' <div class="form_row '.(isset($_GET['pass_mismatch']) || isset($_GET['pass_complex']) ? ' red' : '').'"><span class="label"><label for="geslo">'.$lang['login_password'].':</label></span>';
echo ' <input id="p1" class="text " value="" name="geslo" placeholder="'.$lang['password'].'" type="password">';
echo ' </div>';
// Geslo 2
echo ' <div class="form_row '.(isset($_GET['pass_mismatch']) || isset($_GET['pass_complex']) ? ' red' : '').'"><span class="label"><label for="geslo2">'.$lang['cms_register_user_repeat_password'].':</label></span>';
echo ' <input id="p2" class="text " value="" name="geslo2" placeholder="'.$lang['cms_register_user_repeat_password'].'" type="password">';
echo ' </div>';
if(isset($_GET['pass_complex']))
echo ' <span class="red italic">'.$lang['password_err_complex'].'</span><br /><br />';
// Strinjam se s pogoji
//echo ' <input id="IAgree" type="hidden" name="agree" value="1">';
$terms_url = ($lang['id'] == '1') ? 'https://www.1ka.si/d/sl/o-1ka/pogoji-uporabe-storitve-1ka' : 'https://www.1ka.si/d/en/about/terms-of-use';
echo ' <div class="form_row agreement '.(isset($_GET['missing_agree']) ? ' red' : '').'">';
echo ' <input id="IAgree" type="checkbox" name="agree" value="1"><label for="IAgree">';
echo '<div class="checkbox_text_holder"> '.str_replace('TERMS_URL', $terms_url, $lang['cms_register_user_terms_of_use']).'</label>';
echo ' <br /><span class="red italic">*'.$lang['cms_register_mandatory_field'].'</span></div>';
echo ' </div>';
// Strinjam se s posiljanjem mailov (gdpr)
/*echo ' <div class="form_row gdpr-agree">';
echo ' <input id="gdpr-agree" type="checkbox" name="gdpr-agree" value="1">';
echo ' <div class="checkbox_text_holder"><label for="gdpr-agree"> '.$lang['cms_register_gdpr_agree'].'</label><br /><span class="as_link bold clr" onClick="$(\'#checkbox_explain_text_holder\').toggle(); return false;">'.$lang['more2'].' >></span></div>';
echo ' <div id="checkbox_explain_text_holder" class="checkbox_explain_text_holder"> '.$lang['cms_register_gdpr_agree_explain'].'</div>';
echo ' </div>';*/
echo ' <input name="submit" value="'.$lang['next1'].'" class="regfield" type="submit">';
echo ' <span class="have_account spaceLeft">'.str_replace('#URL#', $site_url.$this->root.'index.php?a=login', $lang['cms_register_login_link']).'</span>';
echo ' </form>';
echo '</div>';
}
// Izris strani za registracijo - po vnosu podatkov
private function displayRegisterPageConfirm(){
global $lang;
global $site_url;
$email = (isset($_POST['email'])) ? $_POST['email'] : '';
$ime = (isset($_POST['ime'])) ? $_POST['ime'] : '';
$geslo = (isset($_POST['geslo'])) ? $_POST['geslo'] : '';
$gdpr_agree = (isset($_POST['gdpr-agree'])) ? $_POST['gdpr-agree'] : '0';
echo '<div class="register_holder">';
echo ' <h1>'.$lang['register_new_user'].'</h1>';
echo ' <div class="confirm_text">'.$lang['check_login_data'].'</div>';
echo ' <form name="register" id="register" action="'.$site_url.'frontend/api/api.php?action=register_confirm" method="post">';
// Hidden polja potrebna za registracijo
echo ' <input name="email" value="'.$email.'" type="hidden">';
echo ' <input name="ime" value="'.$ime.'" type="hidden">';
echo ' <input name="geslo" value="'.$geslo.'" type="hidden">';
echo ' <input name="geslo2" value="'.$geslo.'" type="hidden">';
echo ' <input name="gdpr-agree" value="'.$gdpr_agree.'" type="hidden">';
echo ' <input name="language" value="'.$lang['id'].'" type="hidden">';
// Url za nazaj na urejanje vnesenih podatkov
$url_edit = $site_url.$this->root.'index.php?a=register&email='.$email.'&ime='.$ime;
// Email
echo ' <p><span class="label edit"><label for="email">'.$lang['login_email'].':</label></span>';
echo ' <a href="'.$url_edit.'">'.$email.'</a></p>';
// Ime
echo ' <p><span class="label edit"><label for="ime">'.$lang['login_name'].':</label></span>';
echo ' <a href="'.$url_edit.'">'.$ime.'</a></p>';
// Geslo
echo ' <p><span class="label edit"><label for="pass">'.$lang['password'].':</label></span>';
echo ' <a href="'.$url_edit.'">'.($geslo == '' ? $lang['no1'] : $lang['yes']).'</a></p>';
echo ' <br /><input name="submit" value="'.$lang['next1'].'" class="regfield" type="submit"><br />';
echo ' </form>';
echo '</div>';
}
// Izris strani za registracijo - po poslanem potrditvenem mailu
private function displayRegisterPageEmail(){
global $lang;
global $site_url;
global $site_url;
global $confirm_registration;
// Ce nimamo poslanega emaila preusmerimo nazaj na prvo stran registracije
if(empty($_GET['e'])){
header ('location: '.$site_url.$this->root.'index.php?a=register');
die();
}
else{
$email = base64_decode(urldecode($_GET['e']));
}
echo '<div class="register_holder">';
echo ' <h1>'.$lang['user_confirm_h'].'</h1>';
// Ce iammo vklopljeno potrjevanje s strani admina je text drugacen
if (isset($confirm_registration) && $confirm_registration == 1)
echo ' <p>'.str_replace("SFMAIL", $email, $lang['user_confirm_p_admin']).'</p>';
else
echo ' <p>'.str_replace("SFMAIL", $email, $lang['user_confirm_p']).'</p>';
// Gumb nazaj na naslovnico
echo ' <br />';
echo ' <a href="'.$site_url.$this->root.'index.php?a=register"><input type="button" value="'.$lang['install_finish_redirect'].'"></a>';
echo '</div>';
}
// Izris strani za odregistracijo
private function displayUnregisterPage(){
global $lang;
global $site_url;
if (isset($_GET['email'])){
$email = strtolower($_GET['email']);
}
else{
header ('location: '.$site_url.$this->root.'index.php');
die();
}
echo '<div class="register_holder">';
echo ' <p>'.$lang['unregister_confirm'].'</p>';
echo ' <br /><br />';
echo ' <a href="'.$site_url.$this->root.'index.php">'.$lang['no1'].'</a> ';
//echo ' <a href="'.$site_url.$this->root.'index.php?a=email='.$email.'&c=1&o=1">'.$lang['yes'].'</a>';
echo ' <a href="'.$site_url.'frontend/api/api.php?action=unregister_confirm&email='.$email.'">'.$lang['yes'].'</a>';
echo "<br><br><br>";
$result = sisplet_query ("SELECT trim(value) from misc where what='UnregisterEmbed' AND length(value)>3");
if (mysqli_num_rows ($result) > 0) {
$r = mysqli_fetch_row($result);
echo stripslashes($r[0]);
}
echo '</div>';
}
// Izris strani po potrditvi odregistracije
private function displayUnregisterPageConfirm(){
global $lang;
global $site_url;
echo '<div class="register_holder">';
echo ' <h1>'.$lang['unregister_ok'].'</h1>';
echo ' <p>'.$lang['unregister_ok_text'].'</p>';
echo ' <p><a href="'.$site_url.'">'.$lang['e_back_to_fp'].'</a></p>';
echo '</div>';
}
// Izris strani za reset gesla
private function displayResetPasswordPage(){
global $lang;
global $site_url;
if (isset($_GET['email'])){
$email = strtolower($_GET['email']);
}
else{
header ('location: '.$site_url.$this->root.'index.php');
die();
}
echo '<div class="register_holder">';
echo ' <h1>'.$lang['forgotten_password'].'</h1>';
echo ' <p>'.$lang['lp_sent'].' <span class="semibold">'.$email.'</span>.</p>';
echo ' <p><input onclick="document.location.href=\''.$site_url.'\'" value="'.$lang['back'].'" type="button"></p>';
echo '</div>';
}
// Izris strani po aktivaciji resetiranega gesla
private function displayResetPasswordPageActivate(){
global $lang;
global $site_url;
// Izpisemo da smo uspesno aktivirali novo geslo
if(isset($_GET['success']) && $_GET['success'] == '1'){
echo '<div class="register_holder">';
echo '<h1>'.$lang['forgotten_password'].'</h1>';
echo '<p>'.$lang['lp_activate_activation'].' '.$lang['has_been_successful'].'</p>';
echo '<p>'.$lang['you_can_change_pass_anytime'].'</p>';
echo '<p><a class="RegLastPage" href="'.$site_url.'">'.$lang['to_front'].'</a></p>';
echo '</div>';
}
// Ce so vneseni napacni podatki za aktivacijo
elseif(isset($_GET['error']) && $_GET['error'] == '1'){
echo '<div class="register_holder">';
echo '<h1>'.$lang['forgotten_password'].'</h1>';
echo '<p><strong>' .$lang['lp_activate_error'] .'</strong></p>';
echo '<form name="aktivacija" method="post" action="'.$site_url.'frontend/api/api.php?action=reset_password_activate">';
echo ' <input type="hidden" name="code" value="<?=$code?>" />';
echo ' <div class="form_row">';
echo ' <div class="label"><label for="email">'.$lang['lp_activate_email'].'</label></div><input type="text" name="email" id="email" />';
echo ' </div>';
echo ' <div class="form_row">';
echo ' <div class="label"><label for="pass">'.$lang['lp_activate_pass'].'</label></div><input type="text" name="pass" id="pass" />';
echo ' </div>';
echo ' <input type="submit" value="'.$lang['lp_activate_activate'].'" style="width: 220px;" />';
echo '</form>';
echo '</div>';
}
// Drugace izpisemo formo za vnos vseh podatkov (novo geslo, email)
else{
if (isset($_GET['code']) && $_GET['code'] != ""){
$code = $_GET['code'];
echo '<div class="register_holder">';
echo '<h1>'.$lang['forgotten_password'].'</h1>';
echo '<p>'.$lang['lp_activate_p'].'</p>';
echo '<form name="aktivacija" method="post" action="'.$site_url.'frontend/api/api.php?action=reset_password_activate">';
echo ' <input type="hidden" name="code" value="'.$code.'" />';
echo ' <div class="form_row">';
echo ' <div class="label"><label for="email">'.$lang['lp_activate_email'].'</label></div><input type="text" name="email" id="email" />';
echo ' </div>';
echo ' <div class="form_row">';
echo ' <div class="label"><label for="pass">'.$lang['lp_activate_pass'].'</label></div><input type="text" name="pass" id="pass" />';
echo ' </div>';
echo '<br>';
echo ' <input type="submit" value="'.$lang['lp_activate_activate'].'" style="width: 220px;" />';
echo '</form>';
echo '</div>';
}
else{
echo '<div class="register_holder">';
echo '<h1>'.$lang['forgotten_password'].'</h1>';
echo '<p>'.$lang['srv_wrongcode'].'</p>';
echo '</div>';
}
}
}
// Izris strani za prosnjo za izbris (GDPR)
private function displayGDPRPage(){
global $lang;
global $site_url;
// Ce imamo kaksen error
$error = array();
echo '<div id="gdpr_holder" class="register_holder gdpr">';
GDPR::displayGDPRRequestForm();
echo '</div>';
}
}
|