Drupal9: trgovina in prijava.
This commit is contained in:
parent
a0c60c3848
commit
1d75524806
@ -1106,6 +1106,49 @@ class ApiLogin
|
||||
global $cookie_domain;
|
||||
global $global_user_id;
|
||||
|
||||
if($this->method == 'AJAX') {
|
||||
|
||||
$domene[] = $cookie_domain;
|
||||
if(substr_count($cookie_domain, '.') > 1){
|
||||
$domene[] = substr($cookie_domain, strpos($cookie_domain, '.') + 1);
|
||||
}
|
||||
|
||||
foreach($domene as $key => $domena) {
|
||||
$piskotek['uid_'.$key] = [
|
||||
'ime' => 'uid',
|
||||
'vrednost' => '',
|
||||
'opcije' => [
|
||||
'expires' => time() - 3600,
|
||||
'path' => '/',
|
||||
'domain' => $domena
|
||||
]
|
||||
];
|
||||
$piskotek['unam_'.$key] = [
|
||||
'ime' => 'unam',
|
||||
'vrednost' => '',
|
||||
'opcije' => [
|
||||
'expires' => time() - 3600,
|
||||
'path' => '/',
|
||||
'domain' => $domena
|
||||
]
|
||||
];
|
||||
$piskotek['secret_'.$key] = [
|
||||
'ime' => 'secret',
|
||||
'vrednost' => '',
|
||||
'opcije' => [
|
||||
'expires' => time() - 3600,
|
||||
'path' => '/',
|
||||
'domain' => $domena
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
return $this->ajaxResponse('success', [
|
||||
'url' => $site_url,
|
||||
'piskotek' => $this->cookieEncode($piskotek)
|
||||
]);
|
||||
}
|
||||
|
||||
setcookie('uid', '', time() - 3600, '/', $cookie_domain);
|
||||
setcookie('unam', '', time() - 3600, '/', $cookie_domain);
|
||||
setcookie('secret', '', time() - 3600, '/', $cookie_domain);
|
||||
|
@ -7,12 +7,6 @@
|
||||
function prijava_1ka_theme()
|
||||
{
|
||||
|
||||
if(\Drupal::languageManager()->getCurrentLanguage()->getId() == 'sl') {
|
||||
include (__DIR__ . '/../../../../../../lang/1.php');
|
||||
}else{
|
||||
include (__DIR__ . '/../../../../../../lang/2.php');
|
||||
}
|
||||
|
||||
$google2fa =false;
|
||||
|
||||
//Url linki za preusmeritev
|
||||
@ -32,10 +26,9 @@ function prijava_1ka_theme()
|
||||
return [
|
||||
'prijava_block' => [
|
||||
'variables' => [
|
||||
'lang' => $lang,
|
||||
'prijavljen' => (isset($_COOKIE['unam']) ? true : false),
|
||||
'title_login' => ($google2fa ? $lang['google_2fa'] : $lang['cms_login_title']),
|
||||
'title_register_new_email' => ($google2fa ? $lang['google_2fa'] : $lang['cms_register_new_user_email']),
|
||||
//'title_login' => ($google2fa ? $lang['google_2fa'] : $lang['cms_login_title']),
|
||||
//'title_register_new_email' => ($google2fa ? $lang['google_2fa'] : $lang['cms_register_new_user_email']),
|
||||
'jezik' => \Drupal::languageManager()->getCurrentLanguage()->getId(),
|
||||
'google2fa_error' => '',
|
||||
'email' => '',
|
||||
@ -46,10 +39,10 @@ function prijava_1ka_theme()
|
||||
],
|
||||
'prijava_intro_block' => [
|
||||
'variables' => [
|
||||
'lang' => $lang,
|
||||
|
||||
'prijavljen' => (isset($_COOKIE['unam']) ? true : false),
|
||||
'title_login' => ($google2fa ? $lang['google_2fa'] : $lang['cms_login_title']),
|
||||
'title_register_new_email' => ($google2fa ? $lang['google_2fa'] : $lang['cms_register_new_user_email']),
|
||||
//'title_login' => ($google2fa ? $lang['google_2fa'] : $lang['cms_login_title']),
|
||||
//'title_register_new_email' => ($google2fa ? $lang['google_2fa'] : $lang['cms_register_new_user_email']),
|
||||
'jezik' => \Drupal::languageManager()->getCurrentLanguage()->getId(),
|
||||
'google2fa_error' => '',
|
||||
'email' => '',
|
||||
@ -61,13 +54,13 @@ function prijava_1ka_theme()
|
||||
|
||||
'prijava_obnovitev_gesla_block' => [
|
||||
'variables' => [
|
||||
'lang' => $lang,
|
||||
|
||||
]
|
||||
],
|
||||
'prijava_obnovitev_gesla_aktivacija_blok' => [
|
||||
'variables' => [
|
||||
'lang' => $lang,
|
||||
'jezik' => \Drupal::languageManager()->getCurrentLanguage()->getId(),
|
||||
|
||||
//'jezik' => \Drupal::languageManager()->getCurrentLanguage()->getId(),
|
||||
'prijavljen' => (isset($_COOKIE['unam']) ? true : false),
|
||||
'rememberMe' => (isset($_COOKIE['remember-me']) ? false : true)
|
||||
]
|
||||
@ -75,9 +68,9 @@ function prijava_1ka_theme()
|
||||
|
||||
'prijava_z_racuni_block' => [
|
||||
'variables' => [
|
||||
'lang' => $lang,
|
||||
|
||||
'url_google' => $url_google,
|
||||
'jezik' => \Drupal::languageManager()->getCurrentLanguage()->getId(),
|
||||
//'jezik' => \Drupal::languageManager()->getCurrentLanguage()->getId(),
|
||||
'prijavljen' => (isset($_COOKIE['unam']) ? true : false),
|
||||
]
|
||||
],
|
||||
@ -85,12 +78,12 @@ function prijava_1ka_theme()
|
||||
|
||||
'prijava_arnes_modal_block' => [
|
||||
'variables' => [
|
||||
'lang' => $lang,
|
||||
|
||||
]
|
||||
],
|
||||
'prijava_podatki_o_uporabniku_block' => [
|
||||
'variables' => [
|
||||
'lang' => $lang,
|
||||
|
||||
'prijavljen' => (isset($_COOKIE['unam']) ? true : false),
|
||||
'ime' => (isset($_COOKIE['unam']) ? base64_decode($_COOKIE['unam']) : null),
|
||||
'from1ka' => (isset($_GET['from1ka']) ? $_GET['from1ka'] : false) ,
|
||||
@ -99,13 +92,13 @@ function prijava_1ka_theme()
|
||||
|
||||
'prijava_individualno_svetovanje_modal_block' => [
|
||||
'variables' => [
|
||||
'lang' => $lang,
|
||||
|
||||
]
|
||||
],
|
||||
|
||||
'prijava_z_racuni_modal_block' => [
|
||||
'variables' => [
|
||||
'lang' => $lang,
|
||||
|
||||
'rememberMe' => (empty($_COOKIE['remember-me']) ? true : false),
|
||||
'url_google' => $url_google
|
||||
]
|
||||
@ -117,6 +110,29 @@ function prijava_1ka_theme()
|
||||
* Never cache
|
||||
*/
|
||||
function prijava_1ka_preprocess(&$variables)
|
||||
{
|
||||
// if(!empty($variables['plugin_id']) && in_array($variables['plugin_id'], [
|
||||
// 'prijava_intro_block',
|
||||
// 'prijava_block',
|
||||
// 'prijava_obnovitev_gesla_block',
|
||||
// 'prijava_obnovitev_gesla_aktivacija_blok',
|
||||
// 'prijava_podatki_o_uporabniku_block'
|
||||
// ])
|
||||
// ){
|
||||
|
||||
if(\Drupal::languageManager()->getCurrentLanguage()->getId() == 'sl') {
|
||||
include (__DIR__ . '/../../../../../../lang/1.php');
|
||||
}else{
|
||||
include (__DIR__ . '/../../../../../../lang/2.php');
|
||||
}
|
||||
$variables['lang'] = $lang;
|
||||
$variables['#cache']['max-age'] = 0;
|
||||
// }
|
||||
|
||||
return $variables;
|
||||
}
|
||||
|
||||
function prijava_1ka_preprocess_block(&$variables)
|
||||
{
|
||||
if(!empty($variables['plugin_id']) && in_array($variables['plugin_id'], [
|
||||
'prijava_intro_block',
|
||||
@ -125,7 +141,7 @@ function prijava_1ka_preprocess(&$variables)
|
||||
'prijava_obnovitev_gesla_aktivacija_blok',
|
||||
'prijava_podatki_o_uporabniku_block'
|
||||
])
|
||||
){
|
||||
){;
|
||||
$variables['#cache']['max-age'] = 0;
|
||||
}
|
||||
|
||||
|
@ -5,3 +5,5 @@ prijava_1ka.ajax_prijava_submit:
|
||||
_title: ''
|
||||
requirements:
|
||||
_permission: 'access content'
|
||||
options:
|
||||
no_cache: 'TRUE'
|
||||
|
@ -81,7 +81,7 @@
|
||||
|
||||
<div class="w-clearfix">
|
||||
<div class="col _3-3-3-12">
|
||||
<input type="text" id="em" class="input-field w-input {{ (email == 'error' ? "error-field" : "") }}" name="email" value="{{ (email != 'error' ? email : null) }}" size="30" placeholder="E-mail" onClick="this.value=\'\" required="required"/>
|
||||
<input type="text" id="em" class="input-field w-input {{ (email == 'error' ? "error-field" : "") }}" name="email" value="{{ (email != 'error' ? email : null) }}" size="30" placeholder="E-mail" onClick="this.value=\'\'" required="required"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
<div class="display-block">
|
||||
<div class="col">
|
||||
<p class="besedilo" style="padding-top: 0.5rem;">{{ lang['cms_intro_modal_1ka_text'] | raw }}<br /><br /></p>
|
||||
<p class="besedilo" style="padding-top: 0.5rem;">{{ lang['cms_intro_modal_1ka_text'] | raw }}</p>
|
||||
<div class="submit-btn w-button gumb" id="modal-open-1ka">
|
||||
<span class="modal-intro-title modal-intro-login-text">{{ lang['login_short'] }}</span>
|
||||
<span class="modal-intro-title modal-intro-registration-text"> {{ lang['e_login_register'] }}</span>
|
||||
|
@ -6,6 +6,9 @@ trgovina_1ka.cenik_zasebni_paketi:
|
||||
_title: 'Zasebni paketi'
|
||||
requirements:
|
||||
_access: 'TRUE'
|
||||
options:
|
||||
no_cache: 'TRUE'
|
||||
|
||||
|
||||
trgovina_1ka.izvedi_nakup:
|
||||
path: '/izvedi-nakup/{paket}/podatki'
|
||||
@ -14,6 +17,8 @@ trgovina_1ka.izvedi_nakup:
|
||||
_title: ''
|
||||
requirements:
|
||||
_access: 'TRUE'
|
||||
options:
|
||||
no_cache: 'TRUE'
|
||||
|
||||
trgovina_1ka.nakupovanje_api:
|
||||
path: '/nakupovanje-api/{parameter}'
|
||||
@ -23,6 +28,8 @@ trgovina_1ka.nakupovanje_api:
|
||||
methods: 'POST'
|
||||
requirements:
|
||||
_access: 'TRUE'
|
||||
options:
|
||||
no_cache: 'TRUE'
|
||||
## END cenik zasebni ##
|
||||
|
||||
|
||||
@ -44,6 +51,8 @@ trgovina_1ka.narocilo_paypal:
|
||||
_title: 'Uspešno plačilo preko PayPala'
|
||||
requirements:
|
||||
_access: 'TRUE'
|
||||
options:
|
||||
no_cache: 'TRUE'
|
||||
|
||||
trgovina_1ka.narocilo_paypal_cancel:
|
||||
path: '/narocilo/paypal-cancel'
|
||||
@ -52,6 +61,8 @@ trgovina_1ka.narocilo_paypal_cancel:
|
||||
_title: 'Preklicano plačilo preko PayPala'
|
||||
requirements:
|
||||
_access: 'TRUE'
|
||||
options:
|
||||
no_cache: 'TRUE'
|
||||
|
||||
trgovina_1ka.narocilo_stripe:
|
||||
path: '/narocilo/stripe'
|
||||
@ -60,6 +71,8 @@ trgovina_1ka.narocilo_stripe:
|
||||
_title: 'Uspešno plačilo preko Stripe sistema'
|
||||
requirements:
|
||||
_access: 'TRUE'
|
||||
options:
|
||||
no_cache: 'TRUE'
|
||||
|
||||
trgovina_1ka.narocilo_stripe_cancel:
|
||||
path: '/narocilo/stripe-cancel'
|
||||
@ -68,6 +81,8 @@ trgovina_1ka.narocilo_stripe_cancel:
|
||||
_title: 'Preklicano plačilo preko Stripe sistema'
|
||||
requirements:
|
||||
_access: 'TRUE'
|
||||
options:
|
||||
no_cache: 'TRUE'
|
||||
|
||||
trgovina_1ka.narocilo_pregled_pdf:
|
||||
path: '/narocilo-pregled/{narocilo}/pdf'
|
||||
@ -76,7 +91,8 @@ trgovina_1ka.narocilo_pregled_pdf:
|
||||
_title: 'Račun prenesi'
|
||||
requirements:
|
||||
_access: 'TRUE'
|
||||
|
||||
options:
|
||||
no_cache: 'TRUE'
|
||||
## END return call ##
|
||||
|
||||
|
||||
|
@ -14,6 +14,11 @@
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
// Ob zaprtju modala odstranimo vse napake
|
||||
jQuery('.closemodal').on('click', function(){
|
||||
jQuery('.error-message').hide();
|
||||
});
|
||||
|
||||
/*
|
||||
* LOGIN SKRIPTE
|
||||
*/
|
||||
@ -299,6 +304,53 @@
|
||||
});
|
||||
|
||||
|
||||
// GUmbi na desni front
|
||||
jQuery('#odpri-prijavo, .odpri-prijavo').on('click', function () {
|
||||
jQuery('.error-message').html('').hide();
|
||||
jQuery('.rexister-modal').hide();
|
||||
jQuery('#modal-login').css('display', 'flex');
|
||||
});
|
||||
jQuery(document).on('click', "#odpri-registracijo", function () {
|
||||
jQuery('.rexister-modal').hide();
|
||||
jQuery('.error-message').html('').hide();
|
||||
jQuery('#modal-registration').css('display', 'flex');
|
||||
});
|
||||
|
||||
if (window.location.hash == '#neregistriran-uporabnik') {
|
||||
jQuery('#spletna-uporaba-modal').show();
|
||||
}
|
||||
|
||||
jQuery(document).on('click', '#gumb-spletna-uporaba, .gumb-spletna-uporaba', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if(jQuery('html')[0].lang == 'sl') {
|
||||
odpriAaiLoginObvestilo();
|
||||
} else {
|
||||
jQuery('#spletna-uporaba-modal').show();
|
||||
}
|
||||
});
|
||||
jQuery('#gumb-lastna-namestitev').on('click', function () {
|
||||
jQuery('#lastna-namestitev-modal').show();
|
||||
});
|
||||
|
||||
|
||||
// Odjava v Drupalu
|
||||
jQuery('#poslji-odjavo').on('click', function(){
|
||||
jQuery.post(jQuery('[name="odjava"]').attr('action'), {
|
||||
ajax: true,
|
||||
}, function (data) {
|
||||
var response = JSON.parse(data);
|
||||
|
||||
if(response.type == 'success') {
|
||||
setTimeout(function () {
|
||||
window.location = response.data.url;
|
||||
}, 500);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
@ -30,6 +30,11 @@
|
||||
|
||||
jQuery('#nakup-1ka #polje-drzava').attr('readonly', false);
|
||||
|
||||
if(val.length < 2 ){
|
||||
console.log('Države ni mogoče določiti');
|
||||
return '';
|
||||
}
|
||||
|
||||
val = JSON.parse(val);
|
||||
|
||||
if(val.drzava && val.drzava.length > 1){
|
||||
|
@ -272,33 +272,7 @@
|
||||
|
||||
|
||||
|
||||
// GUmbi na desni front
|
||||
jQuery('#odpri-prijavo, .odpri-prijavo').on('click', function () {
|
||||
jQuery('.rexister-modal').hide();
|
||||
jQuery('#modal-login').css('display', 'flex');
|
||||
});
|
||||
jQuery(document).on('click', "#odpri-registracijo", function () {
|
||||
jQuery('.rexister-modal').hide();
|
||||
jQuery('.w-form-fail').html('').hide();
|
||||
jQuery('#modal-registration').css('display', 'flex');
|
||||
});
|
||||
|
||||
if (window.location.hash == '#neregistriran-uporabnik') {
|
||||
jQuery('#spletna-uporaba-modal').show();
|
||||
}
|
||||
|
||||
jQuery(document).on('click', '#gumb-spletna-uporaba, .gumb-spletna-uporaba', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if(jQuery('html')[0].lang == 'sl') {
|
||||
odpriAaiLoginObvestilo();
|
||||
} else {
|
||||
jQuery('#spletna-uporaba-modal').show();
|
||||
}
|
||||
});
|
||||
jQuery('#gumb-lastna-namestitev').on('click', function () {
|
||||
jQuery('#lastna-namestitev-modal').show();
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -576,6 +550,9 @@
|
||||
jQuery('#forma-d-posta-ime').text(jQuery('[name="podjetje_posta"]').val());
|
||||
}
|
||||
|
||||
//Scrol on top
|
||||
window.scrollTo(0,0);
|
||||
|
||||
var placilo = "";
|
||||
if (jQuery('html')[0].lang == 'sl') {
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
<div class="pdf-ikona">
|
||||
<a href="{{ pdf }}" target="_blank">
|
||||
<i class="far fa-file-pdf"></i>
|
||||
<img src="/tema1ka/svg/file-pdf.svg" style="height: 2rem;" />
|
||||
{% if language.id == 'sl' %}
|
||||
Prenesi predračun
|
||||
{% else %}
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
<div class="pdf-ikona">
|
||||
<a href="{{ pdf }}" target="_blank">
|
||||
<i class="far fa-file-pdf"></i>
|
||||
<img src="/tema1ka/svg/file-pdf.svg" style="height: 2rem;"/>
|
||||
{% if language.id == 'sl' %}
|
||||
Prenesi predračun
|
||||
{% else %}
|
||||
|
@ -53,7 +53,7 @@
|
||||
<img src="/tema1ka/svg/icons8-chevron-right.svg" loading="lazy" alt="" class="button-right-arrow"
|
||||
style="transform: rotateZ(90deg);">
|
||||
<div id="user-menu" style="display: none;">
|
||||
<div name="odjava" method="post" action="/frontend/api/api.php?action=logout">
|
||||
<div name="odjava" method="post" action="/api/drupal/logout">
|
||||
<ul class="user-menu-link">
|
||||
<li>
|
||||
<a class="user-submenu-link" href="/admin/survey/index.php?a=nastavitve&m=global_user_myProfile">
|
||||
|
Loading…
x
Reference in New Issue
Block a user