diff options
Diffstat (limited to 'frontend/simple/classes/DisplayController.php')
-rw-r--r-- | frontend/simple/classes/DisplayController.php | 514 |
1 files changed, 367 insertions, 147 deletions
diff --git a/frontend/simple/classes/DisplayController.php b/frontend/simple/classes/DisplayController.php index 6b4d1bc..4296659 100644 --- a/frontend/simple/classes/DisplayController.php +++ b/frontend/simple/classes/DisplayController.php @@ -2,7 +2,7 @@ include_once '../../function.php';
include_once '../../vendor/autoload.php';
-include_once '../../sql/class.ImportDB.php';
+include_once '../install/classes/class.ImportDB.php';
class DisplayController{
@@ -50,16 +50,30 @@ class DisplayController{ public function displayHead(){
global $site_url;
- global $app_settings;
global $lang;
+
+ // Google analytics za AAI
+ if(isAAI()){
+ echo '<!-- Global site tag (gtag.js) - Google Analytics -->
+ <script async src="https://www.googletagmanager.com/gtag/js?id=UA-141542153-2"></script>
+ <script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag(){dataLayer.push(arguments);}
+ gtag(\'js\', new Date());
+
+ gtag(\'config\', \'UA-141542153-2\');
+ </script>';
+ }
+
+
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="keywords" content="spletne , 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">';
@@ -70,8 +84,8 @@ class DisplayController{ 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";
+ if(AppSettings::getInstance()->getSetting('app_settings-head_title_custom')){
+ echo '<title>'.AppSettings::getInstance()->getSetting('app_settings-head_title_text').'</title>' . "\n";
}
// Default header title
else{
@@ -80,6 +94,9 @@ class DisplayController{ echo ' <!-- CSS -->';
echo ' <link type="text/css" href="'.$site_url.'frontend/simple/css/style.css" rel="stylesheet" />';
+ if(isAAI()){
+ echo ' <link type="text/css" href="'.$site_url.'frontend/simple/css/aai.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 -->';
@@ -99,25 +116,75 @@ class DisplayController{ 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;">';
+
+ if(isAAI()){
+ echo ' <img src="'.$site_url.'/public/img/logo/1ka_logo_arnes.svg">';
+ echo ' <img src="'.$site_url.'/public/img/logo/Arnes.svg"">';
+ }
+ else{
+ echo ' <img src="'.$site_url.'/public/img/logo/'.($this->lang_id == 1 ? '1ka_logo_namestitev.svg' : '1ka_logo_installation.svg').'">';
}
+
echo ' </a>';
echo '</div>';
+
+ // moblie nav ----------------------
+ echo '<div class="mobile">';
+ echo ' <div id="nav-icon3">';
+ echo ' <span></span> ';
+ echo ' <span></span> ';
+ echo ' <span></span> ';
+ echo ' <span></span> ';
+ echo ' </div>';
+
+ echo '<div id="links" class="links">' ;
+ // 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='.htmlspecialchars($_GET['a'], ENT_QUOTES).'&' : '') . (isset($_GET['b']) ? 'b='.htmlspecialchars($_GET['b'], ENT_QUOTES).'&' : '');
+ if($this->lang_id == 1){
+ echo ' <a href="'.$site_url.$this->root.'index.php'.$params.'lang_id=2">';
+ echo ' <div class="flag eng">'.$lang['lang_flag'].' </div> ';
+
+ echo ' </a>';
+ }
+ else{
+ echo ' <a href="'.$site_url.$this->root.'index.php'.$params.'lang_id=1">';
+ echo ' <div class="flag eng">'.$lang['lang_flag'].' </div> ';
+
+ echo ' </a>';
+ }
+ echo '</span>';
+
+ if(isAAI()){
+ // AAI PRIJAVA
+ echo '<span class="menu_item ">';
+ echo '<a id="header-btn" href="'.$site_url.'/aai">'.$lang['AAI_prijava'].' </a> ';
+ echo '</span>';
+ }
+
+ echo '</div>';
+ echo '</div>';
+
+ echo '<script type="text/javascript" src="frontend/simple/script/nav-mobile.js"></script> ';
+ //---------------------------------------------------
+
// Navigacija
- echo '<nav>';
+ echo '<nav class=nav-desktop>';
// Hidden polje z lang_id-jem
echo ' <input type="hidden" name="lang_id" value="'.$this->lang_id.'" />';
@@ -129,25 +196,33 @@ class DisplayController{ // Preklop jezika
echo '<span class="menu_item lang_switch">';
- $params = '?' . (isset($_GET['a']) ? 'a='.$_GET['a'].'&' : '') . (isset($_GET['b']) ? 'b='.$_GET['b'].'&' : '');
+ $params = '?' . (isset($_GET['a']) ? 'a='.htmlspecialchars($_GET['a'], ENT_QUOTES).'&' : '') . (isset($_GET['b']) ? 'b='.htmlspecialchars($_GET['b'], ENT_QUOTES).'&' : '');
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 ' <div class= "flag" >'.$lang['lang_flag'].' </div> ';
+
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 ' <div class = "flag" > <img src="public/img/flags/english_flag.svg" alt="english flag"> <span>SLO</span> </div> ';
echo '</a>';
}
echo '</span>';
-
- echo '</nav>';
+
+ // AAI PRIJAVA
+ if(isAAI()) {
+ echo '<span class="menu_item ">';
+ echo '<a id="header-btn" href="'.$site_url.'/aai">'.$lang['AAI_prijava'].' </a> ';
+ echo '</span>';
+
+
+ echo '</nav>';
+ }
}
// Izris vsebine
public function displayMain(){
- global $virtual_domain;
switch($this->stran){
@@ -164,35 +239,35 @@ class DisplayController{ break;
/*case 'register':
- if(!$virtual_domain)
+ if(!isVirtual())
$this->displayRegisterPage();
else
$this->displayFrontPage();
break;*/
case 'register_confirm':
- if(!$virtual_domain)
+ if(!isVirtual())
$this->displayRegisterPageConfirm();
else
$this->displayFrontPage();
break;
case 'register_email':
- if(!$virtual_domain)
+ if(!isVirtual())
$this->displayRegisterPageEmail();
else
$this->displayFrontPage();
break;
case 'unregister':
- if(!$virtual_domain)
+ if(!isVirtual())
$this->displayUnregisterPage();
else
$this->displayFrontPage();
break;
case 'unregister_confirm':
- if(!$virtual_domain)
+ if(!isVirtual())
$this->displayUnregisterPageConfirm();
else
$this->displayFrontPage();
@@ -220,59 +295,105 @@ class DisplayController{ // Izris footerja
public function displayFooter(){
- global $virtual_domain;
global $lang;
- global $app_settings;
- global $aai_instalacija;
-
+ global $site_url;
// Stolpec 1
- echo '<div class="col">';
+ echo '<div class="col col1">';
+
echo ' <h2>'.$lang['simple_footer_about'].'</h2>';
+ echo ' <div class="col1-flex">';
echo ' <span>'.$lang['simple_footer_about_1ka'].'</span>';
- if($aai_instalacija)
+ if(isAAI())
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 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>';
- 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">';
+ // samo za AAI
+ if(isAAI()){
+
+ // Stolpec 2
+ echo '<div class="col col2">';
+
+ echo ' <h2>'.$lang['simple_footer_company'].'</h2>';
+ echo ' <a href="http://www.arnes.si/">Arnes</a>';
+
+ echo '</div>';
+
+
+ // stolpec 3 - spremljajte nas
+ echo '<div class="col col3">';
+
+ echo ' <h2>'.$lang['simple_footer_about_follow'].'</h2>';
+ echo ' <div class= "social_logo_flex">';
+ echo ' <a href="https://www.facebook.com/1KAenklikanketa/"> <img src="public/img/social/fb_orange.svg" alt="Facebook logo"> </a>';
+ echo ' <a href="https://twitter.com/enklikanketa"> <img src="public/img/social/twitter_orange.svg" alt="Twitter logo"> </a>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ // Stolpec 4 - logotipi
+ echo '<div class="col col4">';
+
+ echo ' <h2>'.$lang['simple_footer_namestitev'].'</h2>';
+
+ // Logotipa FDV in CDI - samo pri virtualkah
+ if(isVirtual() || isAAI()){
+ echo ' <div class="logo_holder">';
+
+ echo ' <img src="public/img/logo/ministrstvo.svg" alt="ministrstvo za izobraževanje znanost in šport">';
+ echo ' <img class="arnes-logo" src="'.$site_url.'/public/img/logo/Arnes.svg">';
+ echo ' <img src="'.$site_url.'/public/img/logo/fdv.png">';
+
+ echo ' </div>';
+ }
- // 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>';
}
+ else{
- echo '</div>';
+ // Stolpec 2
+ echo '<div class="col col2">';
+
+ echo ' <h2>'.$lang['simple_footer_company'].'</h2>';
+ //echo ' <a href="https://www.1ka.si/">'.$lang['simple_footer_company_1ka'].' </a>';
+ echo ' <span>'.AppSettings::getInstance()->getSetting('app_settings-owner').'</span>';
+ echo ' <span><a href="mailto:'.AppSettings::getInstance()->getSetting('app_settings-admin_email').'">'.AppSettings::getInstance()->getSetting('app_settings-admin_email').'</a></span>';
+ echo ' <span><a href="'.AppSettings::getInstance()->getSetting('app_settings-owner_website').'" target="_blank">'.AppSettings::getInstance()->getSetting('app_settings-owner_website').'</a></span>';
+
+ echo '</div>';
+
+
+ // stolpec 3 - spremljajte nas
+ echo '<div class="col col3">';
+
+ echo ' <h2>'.$lang['simple_footer_about_follow'].'</h2>';
+ echo ' <div class= "social_logo_flex">';
+ echo ' <a href="https://www.facebook.com/1KAenklikanketa/"> <img src="public/img/social/FB_blue_new.svg " alt="Facebook logo"> </a>';
+ echo ' <a href="https://twitter.com/enklikanketa"> <img src="public/img/social/twitter_blue_new.svg" alt="Twitter logo"> </a>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
}
// Izris prve strani
private function displayFrontPage(){
- global $aai_instalacija;
// AAI
- if($aai_instalacija)
+ if(isAAI())
$this->displayFrontPageFormAAI();
else
$this->displayFrontPageForm();
@@ -282,18 +403,24 @@ class DisplayController{ private function displayFrontPageForm(){
global $lang;
global $site_url;
- global $app_settings;
- global $virtual_domain;
-
-
- echo '<div class="app_title">'.$app_settings['app_name'].'</div>';
-
+ echo '<div class="landing_page_content"> ';
+ echo '<div class="landing_page_title">'.AppSettings::getInstance()->getSetting('app_settings-app_name').'</div>';
+
+ // APP SUBTITLE
+ echo '<div class="app_subtitle">';
+ if(isVirtual())
+ echo $lang['app_virtual_domain'];
+ else
+ echo $lang['app_installation'];
+ echo '</div>';
// WHITE BOX FOR LOGIN / REGISTRATION
- echo '<div class="landing_page_window">';
+
+ echo '<div class="landing_page_window">';
+
// Tabs - samo pri lastni instalaciji, pri virtualkah nimamo registracije
- if($virtual_domain){
+ if(isVirtual()){
echo ' <div class="tabs">';
echo ' <div class="tab full_width">'.$lang['login_short'].'</div>';
echo ' </div>';
@@ -307,10 +434,10 @@ class DisplayController{ // 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'])
+ $admin_allow_only_ip = AppSettings::getInstance()->getSetting('app_limits-admin_allow_only_ip');
+ if($admin_allow_only_ip !== false
+ && !empty($admin_allow_only_ip)
+ && !in_array($ip, $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>';
}
@@ -325,50 +452,114 @@ class DisplayController{ $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>';
echo '</div>';
}
// Izris okna na prvi strani - AAI
private function displayFrontPageFormAAI(){
global $lang;
- global $site_url;
- global $app_settings;
+ global $site_url;
+
+ // HERO - stara verzija -----------------------
+
+
+ echo '<div class= "hero-container"> ';
- // WHITE BOX FOR LOGIN / REGISTRATION
- echo '<div class="landing_page_window">';
+ echo '<div class="text">';
+ echo '<h1>'.$lang["hero_heading"].'</h1>';
+ echo '<p>'.$lang["hero_text"].'</p>';
+
+ echo '<a href="'.$site_url.'/aai"> '.$lang["AAI_prijava"].' <img src="public/img/icons/chevron.svg"></a>';
+
+
+ echo '</div>';
- // APP TITLE - aai
- echo '<div class="app_title" style="text-transform: initial;">'.$app_settings['app_name'].'</div>';
+ // STARA SLIKA
+ // echo '<img src="public/img/icons/hero.svg" alt="hero image">';
- // AAI logo
- //echo '<div class="arnes_logo"><img src="'.$site_url.'/public/img/logo/arnes_logo.png"></div>';
+ // NOVA SLIKA - TEST
- // 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 class= "hero_image">';
+ echo'<img src="public/img/icons/enka-kv3-02.svg" loading="lazy" alt="" class="kv-image-3 l1">';
+ echo'<img src="public/img/icons/enka-kv3-03.svg" loading="lazy" alt="" class="kv-image-3 i2">';
+ echo '</div>';
+
+
+
echo '</div>';
- // APP SUBTITLE
- /*echo '<div class="app_subtitle">';
- echo $lang['app_aai_installation'];
- echo '</div>';*/
+ // HERO - animiran ------------------------------------------
+
+
+ // echo '<div class="section kvs">';
+ // echo '<div class="div-block-10">';
+ // echo '<div class="kv-right-col">';
+ // echo'<img src="public/img/icons/enka-kv3-02.svg" loading="lazy" alt="" class="kv-image-3 l1">';
+ // echo'<img src="public/img/icons/enka-kv3-03.svg" loading="lazy" alt="" class="kv-image-3 i2">';
+ // echo'</div>';
+ // echo '</div>';
+ // echo '</div>';
+
+ echo '<script src="https://d3e54v103j8qbb.cloudfront.net/js/jquery-3.5.1.min.dc5e7f18c8.js?site=60f9932f0024f1393a09a367" type="text/javascript" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>';
+ echo '<script src="frontend/simple/script/enka-21.js" type="text/javascript"></script>';
+
+
+ // ---------------------------------------------------------
+
+ // POMEMBNE POVEZAVE
+ echo '<div class=povezave_container>';
+ echo '<div class="pomembne_povezave">';
+ echo '<h2 class="title">'.$lang["povezave_pomembne_povezave"].'</h2>';
+
+ echo '<div class="povezave">';
+
+ echo '<div class= "col"> ';
+ echo '<img class="povezave_img" src="public/img/icons/icon_kako_deluje.svg" alt="kako deluje">';
+ echo '<h2>'.$lang["povezave__kako_deluje_h2"].'</h2>';
+ echo '<p> '.$lang["povezave__kako_deluje_text"].' </p>';
+ if($lang['id'] == '1')
+ echo '<a id="povezave-btn"href="https://www.1ka.si/d/sl/pomoc" target="_blank"> '.$lang["povezave_preberi_vec"].'<img src="public/img/icons/chevron_orange.svg" alt="hero image"> </a>';
+ else
+ echo '<a id="povezave-btn"href="https://www.1ka.si/d/en/help" target="_blank"> '.$lang["povezave_preberi_vec"].'<img src="public/img/icons/chevron_orange.svg" alt="hero image"> </a>';
+ echo '</div>';
+
+ echo '<div class= "col"> ';
+ echo '<img class="povezave_img" src="public/img/icons/icon_o_1ka.svg" alt="o 1ka">';
+ echo '<h2>'.$lang["povezave_pogosta_h2"].'</h2>';
+ echo '<p> '.$lang["povezave_pogosta_text"].' </p>';
+ if($lang['id'] == '1')
+ echo ' <a id="povezave-btn" href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/pogosta-vprasanja-o-arnes-aai-prijavi-uporabi-orodja-1ka" target="_blank"> '.$lang["povezave_preberi_vec"].'<img src="public/img/icons/chevron_orange.svg" alt="hero image"> </a>';
+ else
+ echo ' <a id="povezave-btn" href="https://www.1ka.si/d/en/about/general-description" target="_blank"> '.$lang["povezave_preberi_vec"].'<img src="public/img/icons/chevron_orange.svg" alt="hero image"> </a>';
+ echo '</div>';
+
+ echo '<div class= "col"> ';
+ echo '<img class="povezave_img" src="public/img/icons/icon_1ka_podpora.svg" alt="1ka podpora">';
+ echo '<h2>'.$lang["povezave_1ka_podpora_h2"].'</h2>';
+ echo '<p> '.$lang["povezave_1ka_podpora_text"].' </p>';
+ if($lang['id'] == '1')
+ echo ' <a id="povezave-btn" href="https://www.1ka.si/help1KA" target="_blank"> '.$lang["povezave_preberi_vec"].'<img src="public/img/icons/chevron_orange.svg" alt="hero image"> </a>';
+ else
+ echo ' <a id="povezave-btn" href="https://www.1ka.si/a/72864?Q1=292032&language=2" target="_blank"> '.$lang["povezave_preberi_vec"].'<img src="public/img/icons/chevron_orange.svg" alt="hero image"> </a>';
+ echo '</div>';
+
+ echo '<div class= "col"> ';
+ echo '<img class="povezave_img" src="public/img/icons/icon_arnes_podpora.svg" alt="arnes podpora">';
+ echo '<h2>'.$lang["povezave_arnes_podpora_h2"].'</h2>';
+ echo '<p> '.$lang["povezave_arnes_podpora_text"].' </p>';
+ if($lang['id'] == '1')
+ echo ' <a id="povezave-btn" href="https://www.arnes.si/zavod-arnes/kontakti/" target="_blank"> '.$lang["povezave_preberi_vec"].'<img src="public/img/icons/chevron_orange.svg" alt="hero image"> </a>';
+ else
+ echo ' <a id="povezave-btn" href="https://www.arnes.si/about-arnes/contact-us/" target="_blank"> '.$lang["povezave_preberi_vec"].'<img src="public/img/icons/chevron_orange.svg" alt="hero image"> </a>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
+ echo '</div>';
}
// Izris okna za login na prvi strani
@@ -381,7 +572,7 @@ class DisplayController{ $error = '';
}
else{
- $email = (isset($_GET['email'])) ? $_GET['email'] : '';
+ $email = (isset($_GET['email'])) ? htmlspecialchars($_GET['email'], ENT_QUOTES) : '';
$error = '';
if(isset($_GET['a']) && $_GET['a'] == 'login_noEmail'){
@@ -398,11 +589,11 @@ class DisplayController{ // 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">';
+ echo ' <input id="em" '.($error == 'email' ? 'class="red"': '').' name="email" value="'.$email.'" size="30" placeholder="" 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">';
+ echo ' <input '.($error == 'password' ? 'class="red"': '').' name="pass" placeholder="" type="password">';
// Error text
if($error != ''){
@@ -418,11 +609,14 @@ class DisplayController{ echo ' </div>';
}
+ // Submit
+ echo ' <input name="submit" title="'.$lang['login'].'" value="'.$lang['next2'].'" type="submit">';
+
// 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">';
+ // // Submit
+ // echo ' <input name="submit" title="'.$lang['login'].'" value="'.$lang['next1'].'" type="submit">';
echo '</form>';
}
@@ -431,8 +625,6 @@ class DisplayController{ private function displayFrontPageRegistration(){
global $lang;
global $site_url;
- global $secret_captcha;
- global $recaptcha_sitekey;
if(!isset($_GET['a']) || $_GET['a'] != 'register'){
$email = '';
@@ -440,8 +632,8 @@ class DisplayController{ $error = array();
}
else{
- $email = (isset($_GET['email'])) ? $_GET['email'] : '';
- $ime = (isset($_GET['ime'])) ? $_GET['ime'] : '';
+ $email = (isset($_GET['email'])) ? htmlspecialchars($_GET['email'], ENT_QUOTES) : '';
+ $ime = (isset($_GET['ime'])) ? htmlspecialchars($_GET['ime'], ENT_QUOTES) : '';
if(isset($_GET['invalid_email']) && $_GET['invalid_email'] == '1'){
$error['email'] = '1';
@@ -464,38 +656,35 @@ class DisplayController{ }
- echo '<form name="register" id="register_form" class="register_form" action="'.$site_url.'frontend/api/api.php?action=register" method="post">';
+ echo '<form name="register" id="register_form" class="register_form register_window" 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">';
+ 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="" 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>';
-
+ echo ' <input class="regfield '.(isset($error['ime']) ? 'red' : '').'" id="ime" name="ime" value="'.$ime.'" placeholder="" type="text">';
+
// 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">';
+ echo ' <input id="p1" class="text '.(isset($error['password']) ? 'red' : '').'" value="" name="geslo" placeholder="" 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">';
+ echo ' <input id="p2" class="text '.(isset($error['password']) ? 'red' : '').'" value="" name="geslo2" placeholder="" 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 ' <input id="IAgree" type="checkbox" name="agree" value="1">';
+ echo ' <label for="IAgree"><div class="checkbox_text_holder"> '.str_replace('TERMS_URL', $terms_url, $lang['cms_register_user_terms_of_use2']).'</div></label>';
echo ' </div>';
+
+ // RECAPTCHA
+ if(AppSettings::getInstance()->getSetting('google-secret_captcha') !== false && AppSettings::getInstance()->getSetting('google-recaptcha_sitekey') !== false)
+ echo ' <div class="g-recaptcha" data-sitekey="'.AppSettings::getInstance()->getSetting('google-recaptcha_sitekey').'" '.(isset($_GET['invalid_recaptcha']) ? ' style="border:1px red solid"' : '').'></div>';
+
// Error text
if(!empty($error)){
@@ -527,8 +716,12 @@ class DisplayController{ }
// Submit
- echo ' <input name="submit" value="'.$lang['next1'].'" class="regfield" type="submit">';
+ echo ' <input name="submit" value="'.$lang['register'].'" class="regfield" type="submit">';
+ // Lost pass
+ echo ' <div class="lostpass"><a class="RegLastPage" href="#" onclick="LostPassword(\''.$lang['please_insert_email'].'\');">'.$lang['forgot_password'].'</a></div>';
+
+
echo '</form>';
}
@@ -547,7 +740,7 @@ class DisplayController{ // Ce je email v getu pomeni da se je zmotil pri passwordu
if(isset($_GET['email']) && $_GET['email'] != ''){
- $email = $_GET['email'];
+ $email = htmlspecialchars($_GET['email'], ENT_QUOTES);
echo $lang['hello'].' <span class="bold">'.$email.'</span>';
echo ' <input id="em" name="email" value="'.$email.'" type="hidden"><br /><br />';
@@ -578,6 +771,8 @@ class DisplayController{ 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>';
@@ -591,7 +786,7 @@ class DisplayController{ - echo '<div class="login_holder">';
+ echo '<div class="register_holder 2fa">';
// Prijava
echo ' <div class="login_element login">';
@@ -620,7 +815,7 @@ class DisplayController{ global $lang;
global $site_url;
- $email = (isset($_GET['email'])) ? $_GET['email'] : '';
+ $email = (isset($_GET['email'])) ? htmlspecialchars($_GET['email'], ENT_QUOTES) : '';
echo '<div class="login_holder">';
echo ' <h1>'.$lang['error'].'</h1>';
@@ -637,8 +832,6 @@ class DisplayController{ private function displayRegisterPage(){
global $lang;
global $site_url;
- global $secret_captcha;
- global $recaptcha_sitekey;
// Pogledamo ce imamo kaksen error v GET-u
$error = false;
@@ -653,8 +846,8 @@ class DisplayController{ }
// Pogledamo ce imamo poslane podatke preko GET-a
- $email = (isset($_GET['email'])) ? $_GET['email'] : '';
- $ime = (isset($_GET['ime'])) ? $_GET['ime'] : '';
+ $email = (isset($_GET['email'])) ? htmlspecialchars($_GET['email'], ENT_QUOTES) : '';
+ $ime = (isset($_GET['ime'])) ? htmlspecialchars($_GET['ime'], ENT_QUOTES) : '';
echo '<div class="register_holder">';
@@ -677,8 +870,8 @@ class DisplayController{ 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>';
+ if(AppSettings::getInstance()->getSetting('google-secret_captcha') !== false && AppSettings::getInstance()->getSetting('google-recaptcha_sitekey') !== false)
+ echo '<div class="g-recaptcha" data-sitekey="'.AppSettings::getInstance()->getSetting('google-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>';
@@ -698,8 +891,8 @@ class DisplayController{ $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 class="checkbox_text_holder"> '.str_replace('TERMS_URL', $terms_url, $lang['cms_register_user_terms_of_use2']).'</label>';
+
echo ' </div>';
// Strinjam se s posiljanjem mailov (gdpr)
@@ -709,7 +902,7 @@ class DisplayController{ 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 ' <input name="submit" value="'.$lang['next2'].'" 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>';
@@ -757,7 +950,7 @@ class DisplayController{ 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 ' <br /><input name="submit" value="'.$lang['next1'].'" class="regfield" type="submit"><br />';
echo ' </form>';
@@ -769,7 +962,6 @@ class DisplayController{ 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'])){
@@ -785,7 +977,7 @@ class DisplayController{ echo ' <h1>'.$lang['user_confirm_h'].'</h1>';
// Ce iammo vklopljeno potrjevanje s strani admina je text drugacen
- if (isset($confirm_registration) && $confirm_registration == 1)
+ if (AppSettings::getInstance()->getSetting('confirm_registration') === true)
echo ' <p>'.str_replace("SFMAIL", $email, $lang['user_confirm_p_admin']).'</p>';
else
echo ' <p>'.str_replace("SFMAIL", $email, $lang['user_confirm_p']).'</p>';
@@ -804,7 +996,7 @@ class DisplayController{ global $site_url;
if (isset($_GET['email'])){
- $email = strtolower($_GET['email']);
+ $email = strtolower(htmlspecialchars($_GET['email'], ENT_QUOTES));
}
else{
header ('location: '.$site_url.$this->root.'index.php');
@@ -816,16 +1008,8 @@ class DisplayController{ 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>';
}
@@ -850,7 +1034,7 @@ class DisplayController{ global $site_url;
if (isset($_GET['email'])){
- $email = strtolower($_GET['email']);
+ $email = strtolower(htmlspecialchars($_GET['email'], ENT_QUOTES));
}
else{
header ('location: '.$site_url.$this->root.'index.php');
@@ -914,7 +1098,7 @@ class DisplayController{ // Drugace izpisemo formo za vnos vseh podatkov (novo geslo, email)
else{
if (isset($_GET['code']) && $_GET['code'] != ""){
- $code = $_GET['code'];
+ $code = htmlspecialchars($_GET['code'], ENT_QUOTES);
echo '<div class="register_holder">';
@@ -964,4 +1148,40 @@ class DisplayController{ echo '</div>';
}
-}
\ No newline at end of file +
+
+ // Cookie notice
+ public function displayCookieNotice(){
+ global $lang;
+ global $cookie_domain;
+
+ if(!isAAI()){
+ return;
+ }
+
+ if(isset($_COOKIE['simple_frontend_cookie'])){
+ return;
+ }
+
+ echo '<div class="cookie_notice">';
+
+ echo ' <div class="left">';
+ echo ' <p class="bold">'.$lang['simple_cookie_1'].'</p>';
+ echo ' <p>'.$lang['simple_cookie_2'].'</p>';
+ echo ' </div>';
+
+ echo ' <div class="right">';
+ echo ' <button onClick="cookie_confirm();">'.$lang['simple_cookie_button'].'</button>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+ // Confirm cookie
+ public function cookieConfirm(){
+
+ // Set cookie for 90 days
+ setcookie("simple_frontend_cookie", "1", time() + (60*60*24*90), "/");
+ }
+}
+
|