Popravki, pri registraciji in trgovini
This commit is contained in:
parent
8500b9f6c9
commit
6f63a6ac50
@ -544,7 +544,7 @@ class ApiLogin
|
||||
if($this->method == 'AJAX'){
|
||||
|
||||
$piskotek['unam'] = [
|
||||
'ime' => 'unme',
|
||||
'ime' => 'unam',
|
||||
'vrednost' => base64_encode($r['name'].' '.$r['surname']),
|
||||
'opcije' => [
|
||||
'expires' => time() + $LifeTime,
|
||||
@ -1870,6 +1870,8 @@ class ApiLogin
|
||||
|
||||
// Ce emaila ni v bazi
|
||||
$user_id_1ka = User::findByEmail($email);
|
||||
return json_encode($user_id_1ka);
|
||||
|
||||
if (empty($user_id_1ka)) {
|
||||
|
||||
if($ajaxKlic){
|
||||
|
@ -1,6 +1,6 @@
|
||||
prijava_1ka.library:
|
||||
version: 1.x
|
||||
js:
|
||||
js/prijava_1ka_script.js: {}
|
||||
js/login.js: {}
|
||||
dependencies:
|
||||
- core/jquery
|
||||
- core/jquery
|
||||
|
@ -6,10 +6,15 @@
|
||||
*/
|
||||
function prijava_1ka_theme()
|
||||
{
|
||||
$google2fa =false;
|
||||
|
||||
if(\Drupal::languageManager()->getCurrentLanguage()->getId() == 'sl') {
|
||||
include_once(__DIR__ . '/../../../../../../lang/1.php');
|
||||
}else{
|
||||
include_once(__DIR__ . '/../../../../../../lang/2.php');
|
||||
}
|
||||
|
||||
$google2fa =false;
|
||||
|
||||
include_once (__DIR__. '/../../../../../../lang/1.php');
|
||||
|
||||
return [
|
||||
'prijava_block' => [
|
||||
@ -18,7 +23,7 @@ function prijava_1ka_theme()
|
||||
'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']),
|
||||
'jezik' => 'Pridobi jezik forme',
|
||||
'jezik' => \Drupal::languageManager()->getCurrentLanguage()->getId(),
|
||||
'google2fa_error' => '',
|
||||
'email' => '',
|
||||
'password' => '',
|
||||
@ -32,7 +37,7 @@ function prijava_1ka_theme()
|
||||
'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']),
|
||||
'jezik' => 'Pridobi jezik forme',
|
||||
'jezik' => \Drupal::languageManager()->getCurrentLanguage()->getId(),
|
||||
'google2fa_error' => '',
|
||||
'email' => '',
|
||||
'password' => '',
|
||||
@ -49,7 +54,7 @@ function prijava_1ka_theme()
|
||||
'prijava_obnovitev_gesla_aktivacija_blok' => [
|
||||
'variables' => [
|
||||
'lang' => $lang,
|
||||
'jezik' => 'Pridobi jezik forme',
|
||||
'jezik' => \Drupal::languageManager()->getCurrentLanguage()->getId(),
|
||||
'prijavljen' => (isset($_COOKIE['unam']) ? true : false),
|
||||
]
|
||||
],
|
||||
|
@ -25,14 +25,16 @@
|
||||
|
||||
<div class="w-clearfix">
|
||||
<div class="col _3-3-3-12">
|
||||
<input type="email" value="" name="obnovitev-email" id="obnovitev-gesla" class="input-field w-input" placeholder="{{ lang['email'] }}" />
|
||||
<input type="email" value="" name="obnovitev-email" id="obnovitev-gesla-email" class="input-field w-input" placeholder="{{ lang['email'] }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="col w-clearfix">
|
||||
<button type="button" value="{{ lang['srv_potrdi'] }}" data-wait="Please wait..." class="button submit w-button" id="submit-lost-password">
|
||||
</div>
|
||||
<a href="#" class="button secondary-button w-inline-block" id="submit-lost-password">
|
||||
<div class="button-label">{{ lang['srv_potrdi'] }}</div>
|
||||
<img src="/tema1ka/svg/icons8-chevron-right.svg" loading="lazy" alt="" class="button-right-arrow" style="transform: translate3d(0px, 0px, 0px) scale3d(1, 1, 1) rotateX(0deg) rotateY(0deg) rotateZ(0deg) skew(0deg, 0deg); transform-style: preserve-3d;">
|
||||
<div class="button-flyin button-flyin-secondary" style="transform: translate3d(-100%, 0px, 0px) scale3d(1, 1, 1) rotateX(0deg) rotateY(0deg) rotateZ(0deg) skew(0deg, 0deg); transform-style: preserve-3d; display: block;"></div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -10,17 +10,17 @@ s
|
||||
<span id="iskanje">
|
||||
<img alt="{{ lang['cms_search'] }}" src="/tema1ka/img/ikone/iskanje.svg" style="height:18px; width:19px" />
|
||||
</span>
|
||||
|
||||
|
||||
<span class="only-pc" data-clarity-mask="True">';
|
||||
|
||||
|
||||
{# // Izpišemo podaztke o registriranem uporabniku ali možnost za prijavo#}
|
||||
|
||||
|
||||
{% if prijavljen %}
|
||||
| <div id="user-1ka">
|
||||
<span class="user-name">
|
||||
{{ ime }} <span class="arrow-down"></span>
|
||||
</span>
|
||||
|
||||
|
||||
<div id="user-menu">
|
||||
<form name="odjava" method="post" action="/frontend/api/api.php?action=logout">
|
||||
<span class="user-submenu">
|
||||
@ -34,15 +34,14 @@ s
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
|
||||
{#// $html_user .= ' <span class="user-1ka"></span> | <a href="' . (nalozi_ustrezen_jezik(TRUE) == 'sl' ? '/d/sl/registracija' : '/d/en/registration') . '">' . $lang['cms_register_link'] . '</a>#}
|
||||
{#// | <a href="' . (nalozi_ustrezen_jezik(TRUE) == 'sl' ? '/d/sl/prijava' : '/d/en/login') . '">' . $lang['cms_login_link'] . '</a>';#}
|
||||
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
@ -1,8 +1,6 @@
|
||||
registracija-1ka:
|
||||
registracija_1ka.library:
|
||||
version: 1.x
|
||||
|
||||
js:
|
||||
js/registracija_1ka_script.js: {}
|
||||
|
||||
#js/registracija_1ka_script.js: {}
|
||||
dependencies:
|
||||
- core/jquery
|
||||
- core/jquery
|
||||
|
@ -2,10 +2,18 @@
|
||||
|
||||
/**
|
||||
* Omogči, da se uporabi Twig templaet
|
||||
* @return array[][][]
|
||||
*/
|
||||
/**
|
||||
* Implements hook_theme().
|
||||
*/
|
||||
function registracija_1ka_theme()
|
||||
{
|
||||
include_once (__DIR__. '/../../../../../../lang/1.php');
|
||||
if(\Drupal::languageManager()->getCurrentLanguage()->getId() == 'sl') {
|
||||
include(__DIR__ . '/../../../../../../lang/1.php');
|
||||
}else{
|
||||
include(__DIR__ . '/../../../../../../lang/2.php');
|
||||
}
|
||||
|
||||
|
||||
// $lang['cms_register_user_text'] = str_replace('GOOGLE_URL', variable_get('1ka_google_prijava'), $lang['cms_register_user_text']);
|
||||
@ -22,26 +30,30 @@ function registracija_1ka_theme()
|
||||
// require(drupal_get_path('module', 'registracija_1ka') . '/../../../../../../settings_optional.php');
|
||||
// }
|
||||
|
||||
// Pridobimo jezik iz izbranega jezika Drupala
|
||||
$jezik = 'sl';
|
||||
|
||||
$recaptcha_sitekey = ''; // pridobi podatke settings_optional
|
||||
|
||||
// Pridobi vse $_GET parametre in jih shrani v polje
|
||||
$parametri = []; //drupal_get_query_parameters();
|
||||
$register_url = '/frontend/api/api.php?action=register';
|
||||
$obvestila = []; //$this->preveriNapake($parametri);
|
||||
// $parametri = []; //drupal_get_query_parameters();
|
||||
// $register_url = '/frontend/api/api.php?action=register';
|
||||
// $obvestila = []; //$this->preveriNapake($parametri);
|
||||
|
||||
return [
|
||||
'registracija_block' => [
|
||||
'variables' => [
|
||||
'lang' => $lang ?? [],
|
||||
'jezik' => $jezik ?? 'sl',
|
||||
'jezik' => \Drupal::languageManager()->getCurrentLanguage()->getId(),
|
||||
//'obvestila' => $obvestila,
|
||||
'recaptcha_sitekey' => $recaptcha_sitekey ?? '',
|
||||
'login__link' => str_replace('#URL#', '#', $lang['cms_register_login_link'])
|
||||
'login__link' => (isset($lang['cms_register_login_link']) ? str_replace('#URL#', '#', $lang['cms_register_login_link']) : '')
|
||||
]
|
||||
],
|
||||
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
// Development
|
||||
function registracija_1ka_preprocess_block(&$vars)
|
||||
{
|
||||
if($vars['plugin_id'] == 'registracija_block'){
|
||||
$var['#cache'] ['max-age'] = 0;
|
||||
}
|
||||
}
|
||||
|
@ -4,103 +4,29 @@ namespace Drupal\registracija_1ka\Plugin\Block;
|
||||
|
||||
use Drupal\Core\Block\BlockBase;
|
||||
|
||||
|
||||
/**
|
||||
* Priskrbi obrazec za prijavo
|
||||
*
|
||||
* @Block(
|
||||
* id = "registracija_intro_block",
|
||||
* admin_label = @Translation("Registracija: novega uporabnika 1KA (1KA, AAI)"),
|
||||
* id = "registracija_block",
|
||||
* admin_label = @Translation("Registracija: Obrazec za registracijo novega uporabnika"),
|
||||
* category = @Translation("1KA"),
|
||||
* )
|
||||
*/
|
||||
class RegistracijaBlock extends BlockBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function build() {
|
||||
|
||||
return [
|
||||
'#theme' => 'registracija_block',
|
||||
];
|
||||
}
|
||||
|
||||
/*
|
||||
private function preveriNapake($parametri)
|
||||
{
|
||||
|
||||
$lang = nalozi_ustrezen_jezik();
|
||||
|
||||
$napaka = [];
|
||||
|
||||
|
||||
// Napaka pri emailu in opozorilo
|
||||
$error_email = FALSE;
|
||||
if (!empty($parametri['missing_email']) && $parametri['missing_email'] == 1) {
|
||||
|
||||
$error_email = TRUE;
|
||||
$napaka[] = $lang['cms_error_missing_email'];
|
||||
|
||||
}elseif (!empty($parametri['invalid_email']) && $parametri['invalid_email'] == 1){
|
||||
|
||||
$error_email = TRUE;
|
||||
$napaka[] = $lang['cms_error_email'];
|
||||
|
||||
} elseif (!empty($parametri['existing_email']) && $parametri['existing_email'] == 1){
|
||||
|
||||
$error_email = TRUE;
|
||||
$napaka[] = str_replace('RESTORE_PASSWORD',
|
||||
'/frontend/api/api.php?action=reset_password&email=' . $parametri['email'],
|
||||
$lang['cms_error_email_took']);
|
||||
|
||||
}
|
||||
|
||||
// Napaka pri imenu
|
||||
$error_ime = FALSE;
|
||||
if (!empty($parametri['missing_ime']) && $parametri['missing_ime'] == 1) {
|
||||
|
||||
$error_ime = TRUE;
|
||||
$napaka[] = $lang['cms_error_user_field_empty'];
|
||||
|
||||
} elseif (!empty($parametri['existing_ime']) && $parametri['existing_ime'] == 1) {
|
||||
|
||||
$error_ime = TRUE;
|
||||
$napaka[] = $lang['cms_error_user_took'];
|
||||
|
||||
}
|
||||
|
||||
// Recaptcha error
|
||||
$error_recaptcha = FALSE;
|
||||
if (!empty($parametri['invalid_recaptcha']) && $parametri['invalid_recaptcha'] == 1) {
|
||||
|
||||
$error_recaptcha = TRUE;
|
||||
$napaka[] = $lang['cms_error_recaptcha'];
|
||||
|
||||
}
|
||||
|
||||
// Napaka pri napačno vpisanih geslih
|
||||
$error_geslo = FALSE;
|
||||
if (!empty($parametri['pass_mismatch']) && $parametri['pass_mismatch'] == 1) {
|
||||
|
||||
$error_geslo = TRUE;
|
||||
$napaka[] = $lang['cms_error_password_incorrect'];
|
||||
}
|
||||
// Geslo ni dovolj kompleksno
|
||||
if (!$error_geslo && !empty($parametri['pass_complex']) && $parametri['pass_complex'] == 1) {
|
||||
|
||||
$error_geslo = TRUE;
|
||||
$napaka[] = $lang['password_err_complex'];
|
||||
}
|
||||
|
||||
/*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function build() {
|
||||
return [
|
||||
'napaka' => $napaka,
|
||||
'error_geslo' => $error_geslo,
|
||||
'error_ime' => $error_ime,
|
||||
'error_email' => $error_email,
|
||||
'error_recaptcha' => $error_recaptcha
|
||||
'#theme' => 'registracija_block',
|
||||
];
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public function getCacheMaxAge() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,28 +1,28 @@
|
||||
<div class="rexister-modal" id="modal-registration">
|
||||
<div class="modal-box w-max-1024"><img src="/tema1ka/img/ikone/zapri.svg" class="closemodal">
|
||||
|
||||
|
||||
<div class="row glavni-naslov">
|
||||
<div class="col">
|
||||
<h3 class="modra center">{{ lang['cms_register_title'] }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{# // Forma za registracijo#}
|
||||
<div id="register-form" class="dva-stolpca">
|
||||
|
||||
|
||||
{# //Registracija#}
|
||||
<div class="registracija forma">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h4>{{ lang['cms_register_new_user_email'] }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="w-form">
|
||||
<form name="registracija" id="registracija-uporabnika" class="{{ jezik }}" action="{{ register_url }}" method="post">
|
||||
<input type="hidden" name="jezik" value="{{ jezik }}"/>
|
||||
|
||||
|
||||
<div class="w-clearfix">
|
||||
<div class="col _6-6-6-12">
|
||||
<input type="email" class="input-field w-input {% if obvestila['error_email'] %} error-field {% endif %}" name="email" placeholder="{{ lang['email'] }}" onchange="InsertName();" onblur="CheckEmail(\'{{ lang['cms_register_user_email_incorrect'] }}\');CheckEmailTypo(\'{{ lang['cms_register_user_typo_email'] }}\')" value="{% if parametri['email'] %} {{ parametri['email'] }} {% endif %}">
|
||||
@ -31,7 +31,7 @@
|
||||
<input type="text" id="registracija-vzdevek" class="input-field w-input {% if obvestila['error_ime'] %} error-field {% endif %}" name="ime" placeholder="{{ lang['cms_register_user_nickname'] }}" value="{% if parametri['ime'] %} {{ parametri['ime'] }} {% endif %}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="w-clearfix">
|
||||
<div class="col _6-6-6-12">
|
||||
<input type="password" class="input-field w-input {% if obvestila['error_geslo'] %} error-field {% endif %}" value="" id="geslo" name="geslo" placeholder="{{ lang['cms_register_user_password'] }}">
|
||||
@ -40,7 +40,7 @@
|
||||
<input type="password" class="input-field w-input {% if obvestila['error_geslo'] %} error-field {% endif %}" value="" id="geslo2" name="geslo2" placeholder="{{ lang['cms_register_user_repeat_password'] }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% if recaptcha_sitekey %} {
|
||||
<div class="w-clearfix">
|
||||
<div class="col _6-6-6-12">
|
||||
@ -48,12 +48,12 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{# // SPAM protection, če nimamo reCaptcha#}
|
||||
<div class="form_row">
|
||||
<input type="text" class="varnostno-polje" name="varnostno-polje" value="" style="display: none;"/>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<div class="col toppadding">
|
||||
{# // Pogoji uporabe#}
|
||||
@ -62,7 +62,7 @@
|
||||
<span class="checkbox-display {% if obvestila['missing_agree'] %} error-field {% endif %}"></span>
|
||||
<span id="agreelabel" {% if obvestila['missing_agree'] %} error-field {% endif %}><label for="IAgree" class="checkbox-label w-form-label"> {{ lang['cms_register_user_terms_of_use'] | raw }}</label></span>
|
||||
</div>
|
||||
|
||||
|
||||
{# // GDPR strinjanje za email obveščanje - v bazi vse nove zahtevke postavimo na 2 ali 0, če se ne strinja#}
|
||||
<div class="checkbox-field w-checkbox">
|
||||
<input type="checkbox" id="GdprAgree" name="gdpr-agree" value="1" class="cb w-checkbox-input" {% if parametri['gdpr'] and parametri['gdpr'] == 1 %} checked="checked" {% endif %}>
|
||||
@ -75,113 +75,113 @@
|
||||
</span>
|
||||
<div id="gdpr-vec-text">{{ lang['cms_register_gdpr_agree_explain'] }}</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<div class="col w-clearfix">
|
||||
<a href="#" class="submit-btn w-button">{{ lang['next1'] }}</a>
|
||||
<p class="paragraph" class="odpri-prijavo">{{ login_link }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
{# // Vse obstoječe napake, damo v list#}
|
||||
<div class="w-form-fail napaka-registracija"></div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{# // Prijava preko računov#}
|
||||
<div class="preko-racunov">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h4>{{ lang['cms_register_other_email'] }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ostale-prijave">
|
||||
|
||||
|
||||
<div class="ikona ikona-custom-login ikona-facebook" data-login="facebook">
|
||||
<div class="gumb">
|
||||
<img alt="{{ lang['login_with_facebook'] }}" src="/tema1ka/svg/prijava-facebook.svg"/>
|
||||
{{ lang['login_with_facebook'] }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ikona ikona-custom-login ikona-google" data-login="google">
|
||||
<div class="gumb">
|
||||
<img alt="{{ lang['login_with_google'] }}" src="/tema1ka/svg/prijava-gmail.svg" style="height: 1.5rem;"/>
|
||||
{{ lang['login_with_google'] }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
{# // Email confirm#}
|
||||
<div id="register-form-confirm">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h4>{{ lang['cms_register_new_user_email'] }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
{# // Besedilo za pred podatki#}
|
||||
<div class="col">
|
||||
{{ lang['check_login_data'] }}
|
||||
{{ lang['check_login_data'] | raw }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="preged-podatkov">
|
||||
|
||||
|
||||
{# // Email#}
|
||||
<div class="col pb">
|
||||
<span class="label">{{ lang['email'] }}:</span>
|
||||
<span class="field oznacen-rdec" id="reg-confirm-email"></span>
|
||||
</div>
|
||||
|
||||
|
||||
{# // Vzdevek#}
|
||||
<div class="col pb">
|
||||
<span class="label">{{ lang['cms_register_user_nickname'] }}:</span>
|
||||
<span class="field" id="reg-confirm-ime"></span>
|
||||
</div>
|
||||
|
||||
|
||||
{# // Geslo#}
|
||||
<div class="col pb">
|
||||
<span class="label">{{ lang['cms_register_user_password'] }}:</span>
|
||||
<span class="field" id="reg-confirm-geslo"></span>
|
||||
</div>
|
||||
|
||||
|
||||
{# // Obveščanje#}
|
||||
<div class="col pb">
|
||||
<span class="label">{{ lang['cms_register_confirm_notification'] }}:</span>
|
||||
<span class="field" id="reg-confirm-gdpr"></span>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col w-clearfix">
|
||||
<a href="#" class="submit-btn w-button" id="reg-confirm-next">{{ lang['next1'] }}</a>
|
||||
<a href="#" class="submit-btn w-button" style="float: left;" id="reg-confirm-back">{{ lang['back'] }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{# // Email je bil poslan#}
|
||||
<div id="register-form-email-sent">
|
||||
<div class="row">
|
||||
@ -189,15 +189,15 @@
|
||||
<h3>{{ lang['user_confirm_h'] }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{ lang['user_confirm_p'] }}
|
||||
<div class="col" style="display: block;">
|
||||
{{ lang['user_confirm_p'] | raw }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -78,6 +78,7 @@ class CenikController extends ControllerBase
|
||||
protected function getVariables() {
|
||||
$variables = [
|
||||
'module' => $this->getModuleName(),
|
||||
'email_uporabnika' => (!empty($_COOKIE['uid']) ? base64_decode($_COOKIE['uid']) : ''),
|
||||
];
|
||||
return $variables;
|
||||
}
|
||||
|
@ -97,6 +97,7 @@ class NarociloController extends ControllerBase
|
||||
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
|
||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
|
||||
} else {
|
||||
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
@ -105,7 +106,6 @@ class NarociloController extends ControllerBase
|
||||
$request_method = 'POST';
|
||||
$post_data = ['ip' => $ip];
|
||||
$raw_post_data = http_build_query($post_data);
|
||||
|
||||
}
|
||||
|
||||
// Pripravimo stvari za izdelavo tokena
|
||||
|
@ -18,12 +18,12 @@ trgovina_1ka.izvedi_nakup:
|
||||
trgovina_1ka.nakupovanje_api:
|
||||
path: '/nakupovanje-api/{parameter}'
|
||||
defaults:
|
||||
_form: '\Drupal\trgovina_1ka\Controller\NarociloController::apiKlici'
|
||||
_controller: '\Drupal\trgovina_1ka\Controller\NarociloController::apiKlici'
|
||||
_title: 'Nakupovanje API'
|
||||
url_parameter: ''
|
||||
methods: 'POST'
|
||||
requirements:
|
||||
_permission: 'access content'
|
||||
_permission: 'TRUE'
|
||||
## END cenik zasebni ##
|
||||
|
||||
|
||||
|
@ -62,7 +62,7 @@
|
||||
jQuery('.obvestilo').empty().hide();
|
||||
jQuery('#input-obnovitev-email').removeClass('error');
|
||||
|
||||
var emailObnovitev = jQuery('#input-obnovitev-email').val();
|
||||
var emailObnovitev = jQuery('#obnovitev-gesla-email').val();
|
||||
|
||||
if (emailObnovitev.length == 0 || emailObnovitev.length > 1 && (emailObnovitev.search('@') == -1 || emailObnovitev.indexOf('.') == -1)) {
|
||||
jQuery('#input-obnovitev-email').addClass('error');
|
||||
@ -71,10 +71,10 @@
|
||||
}
|
||||
|
||||
// V kolikor je vse ok poljemo POST request, da preverimo v bazi
|
||||
jQuery.post('/frontend/api/api.php?action=reset_password', {
|
||||
jQuery.post('/api/drupal/reset_password', {
|
||||
email: emailObnovitev,
|
||||
ajax: true,
|
||||
jezik: jQuery('[name="jezik"]').val()
|
||||
jezik: pridobiJezik()
|
||||
}).done(function (val) {
|
||||
val = JSON.parse(val);
|
||||
|
||||
@ -101,6 +101,69 @@
|
||||
});
|
||||
|
||||
|
||||
// AKtivacija izgubljenega gesla
|
||||
if (window.location.hash == '#aktivacija-gesla') {
|
||||
jQuery('#modal-lost-password-activate').show();
|
||||
}
|
||||
|
||||
jQuery('#submit-lost-password-activation').on('click', function () {
|
||||
jQuery('.w-form-fail').hide();
|
||||
jQuery('.error').removeClass('error');
|
||||
|
||||
var email = jQuery('#aktivacija-email').val();
|
||||
var geslo = jQuery('#aktivacija-geslo').val();
|
||||
var koda = '';
|
||||
var jezik = jQuery('#modal-lost-password [name="jezik"]').val();
|
||||
|
||||
var results = new RegExp('[\?&]code=([^&#]*)').exec(window.location.href);
|
||||
if (results[1].length > 10)
|
||||
koda = results[1];
|
||||
|
||||
if (email.length == 0 || geslo.length == 0 || koda.length == 0) {
|
||||
jQuery('#error-aktivacija-gesla').show();
|
||||
|
||||
if (email.length == 0) {
|
||||
jQuery('#aktivacija-email').addClass('error');
|
||||
}
|
||||
|
||||
if (geslo.length == 0) {
|
||||
jQuery('#aktivacija-geslo').addClass('error');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// V kolikor je vse ok poljemo POST request, da preverimo v bazi
|
||||
jQuery.post('/frontend/api/api.php?action=reset_password_activate', {
|
||||
email: email,
|
||||
pass: geslo,
|
||||
code: koda,
|
||||
ajax: true,
|
||||
lang: jezik
|
||||
}).done(function (val) {
|
||||
val = JSON.parse(val);
|
||||
|
||||
jQuery('#error-aktivacija-gesla').removeClass('w-form-fail').removeClass('w-form-done').html('').hide();
|
||||
|
||||
if (val.type == 'success') {
|
||||
jQuery('#error-aktivacija-gesla').addClass('w-form-done').html('<div>' + val.text + '</div>').show();
|
||||
|
||||
// Če je bil email uspešno poslal potem okno zapremo po 5 sekundah
|
||||
setTimeout(function () {
|
||||
window.location.href = val.action;
|
||||
}, 5000);
|
||||
|
||||
} else {
|
||||
|
||||
// Napaka, če email ne obstaja v bazi
|
||||
jQuery('#error-aktivacija-gesla').addClass('w-form-fail').html('<div>' + val.text + '</div>').show();
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@ -109,6 +172,10 @@
|
||||
|
||||
})(jQuery, Drupal, this, this.document);
|
||||
|
||||
function pridobiJezik(){
|
||||
|
||||
}
|
||||
|
||||
function vrniBesediloNapake(besedilo){
|
||||
let sporocilo;
|
||||
|
||||
@ -236,7 +303,7 @@ function preveriZaTipkarskoNapakoVemailu(uporabnikovaDomena, domena) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function lang() {
|
||||
function pridobiJezik() {
|
||||
return jQuery('html')[0].lang;
|
||||
}
|
||||
|
||||
@ -245,7 +312,7 @@ function odpriAaiLoginObvestilo(){
|
||||
jQuery('.nakup-prijava').hide();
|
||||
jQuery('.modal-intro-login-text').css('display', 'flex');
|
||||
|
||||
if(jQuery('html')[0].lang == 'sl') {
|
||||
if(pridobiJezik() == 'sl') {
|
||||
jQuery('#modal-open-1ka').removeClass('modal-goto-registration').addClass('modal-open-login-obrazec');
|
||||
jQuery('#modal-info-login').css('display', 'flex');
|
||||
|
||||
|
@ -26,42 +26,42 @@
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
// Drupal nova prijava
|
||||
jQuery('.submit-prijava').on('click', function(){
|
||||
// ODstranimo vse napake
|
||||
jQuery('.error-field').removeClass('error-field')
|
||||
|
||||
|
||||
jQuery(':input[required]:visible').each(function () {
|
||||
if (jQuery(this).val() == '') {
|
||||
jQuery(this).addClass('error-field');
|
||||
}
|
||||
});
|
||||
|
||||
if( jQuery('.error-field').length > 0){
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
jQuery('#prijava-1ka error-message').append('').hide();
|
||||
|
||||
var sendVariables = jQuery('#forma-prijava :input').serialize()
|
||||
var url = jQuery('#forma-prijava').attr('action')
|
||||
|
||||
jQuery.post(url, sendVariables, function (data) {
|
||||
var response = JSON.parse(data)
|
||||
|
||||
if(response.type == 'success'){
|
||||
|
||||
return window.location = response.data.url
|
||||
|
||||
} else if(response.type == 'error') {
|
||||
|
||||
jQuery('#prijava-1ka error-message').append(response.message).show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
// jQuery('.submit-prijava').on('click', function(){
|
||||
// // ODstranimo vse napake
|
||||
// jQuery('.error-field').removeClass('error-field');
|
||||
//
|
||||
//
|
||||
// jQuery(':input[required]:visible').each(function () {
|
||||
// if (jQuery(this).val() == '') {
|
||||
// jQuery(this).addClass('error-field');
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// if( jQuery('.error-field').length > 0){
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// jQuery('#prijava-1ka error-message').append('').hide();
|
||||
//
|
||||
// var sendVariables = jQuery('#forma-prijava :input').serialize()
|
||||
// var url = jQuery('#forma-prijava').attr('action')
|
||||
//
|
||||
// jQuery.post(url, sendVariables, function (data) {
|
||||
// var response = JSON.parse(data)
|
||||
//
|
||||
// if(response.type == 'success'){
|
||||
//
|
||||
// return window.location = response.data.url
|
||||
//
|
||||
// } else if(response.type == 'error') {
|
||||
//
|
||||
// jQuery('#prijava-1ka error-message').append(response.message).show();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
//
|
||||
// });
|
||||
|
||||
|
||||
|
||||
@ -265,7 +265,7 @@
|
||||
|
||||
// Prijava modal
|
||||
jQuery('.modal-open-login-obrazec').on('click', function () {
|
||||
jQuery('.rexister-modal').hide();
|
||||
jQuery('.rexister-modal').css('display', 'none');
|
||||
jQuery('#modal-login').css('display', 'flex');
|
||||
});
|
||||
|
||||
@ -479,112 +479,114 @@
|
||||
|
||||
|
||||
// Izgubljeno geslo
|
||||
jQuery('#open-modal-lost-password').on('click', function () {
|
||||
jQuery('#modal-login').hide();
|
||||
jQuery('#modal-lost-password').css('display', 'flex');
|
||||
});
|
||||
jQuery('#submit-lost-password').on('click', function () {
|
||||
jQuery('.w-form-fail').hide();
|
||||
// jQuery('#open-modal-lost-password').on('click', function () {
|
||||
// jQuery('#modal-login').hide();
|
||||
// jQuery('#modal-lost-password').css('display', 'flex');
|
||||
// });
|
||||
// jQuery('#submit-lost-password').on('click', function () {
|
||||
// jQuery('.w-form-fail').hide();
|
||||
//
|
||||
// var emailObnovitev = jQuery('#obnovitev-gesla').val();
|
||||
// var jezik = jQuery('#modal-lost-password [name="jezik"]').val();
|
||||
//
|
||||
// if (emailObnovitev.length == 0 || emailObnovitev.length > 1 && (emailObnovitev.search('@') == -1 || emailObnovitev.indexOf('.') == -1)) {
|
||||
// jQuery('#error-lost-password').show();
|
||||
//
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// // V kolikor je vse ok poljemo POST request, da preverimo v bazi
|
||||
// jQuery.post('/frontend/api/api.php?action=reset_password', {
|
||||
// email: emailObnovitev,
|
||||
// ajax: true,
|
||||
// jezik: jezik
|
||||
// }).done(function (val) {
|
||||
// val = JSON.parse(val);
|
||||
//
|
||||
// jQuery('#modal-lost-password .w-form-done').html('').hide();
|
||||
// jQuery('#modal-lost-password .w-form-fail').hide();
|
||||
//
|
||||
// if (val.type == 'success') {
|
||||
// jQuery('#modal-lost-password .w-form-done').html('<div>' + val.text + '</div>').show();
|
||||
//
|
||||
// // Če je bil email uspešno poslal potem okno zapremo po 5 sekundah
|
||||
// setTimeout(function () {
|
||||
// jQuery("#modal-lost-password").hide();
|
||||
// jQuery('#modal-lost-password .w-form-done').hide();
|
||||
// jQuery("#obnovitev-gesla").val('');
|
||||
// }, 2000);
|
||||
//
|
||||
// } else {
|
||||
//
|
||||
// // Napaka, če email ne obstaja v bazi
|
||||
// jQuery('#modal-lost-password .w-form-fail').html('<div>' + val.text + '</div>').show();
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
|
||||
var emailObnovitev = jQuery('#obnovitev-gesla').val();
|
||||
var jezik = jQuery('#modal-lost-password [name="jezik"]').val();
|
||||
// // AKtivacija izgubljenega gesla
|
||||
// if (window.location.hash == '#aktivacija-gesla') {
|
||||
// jQuery('#modal-lost-password-activate').show();
|
||||
// }
|
||||
|
||||
if (emailObnovitev.length == 0 || emailObnovitev.length > 1 && (emailObnovitev.search('@') == -1 || emailObnovitev.indexOf('.') == -1)) {
|
||||
jQuery('#error-lost-password').show();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// V kolikor je vse ok poljemo POST request, da preverimo v bazi
|
||||
jQuery.post('/frontend/api/api.php?action=reset_password', {
|
||||
email: emailObnovitev,
|
||||
ajax: true,
|
||||
jezik: jezik
|
||||
}).done(function (val) {
|
||||
val = JSON.parse(val);
|
||||
|
||||
jQuery('#modal-lost-password .w-form-done').html('').hide();
|
||||
jQuery('#modal-lost-password .w-form-fail').hide();
|
||||
|
||||
if (val.type == 'success') {
|
||||
jQuery('#modal-lost-password .w-form-done').html('<div>' + val.text + '</div>').show();
|
||||
|
||||
// Če je bil email uspešno poslal potem okno zapremo po 5 sekundah
|
||||
setTimeout(function () {
|
||||
jQuery("#modal-lost-password").hide();
|
||||
jQuery('#modal-lost-password .w-form-done').hide();
|
||||
jQuery("#obnovitev-gesla").val('');
|
||||
}, 2000);
|
||||
|
||||
} else {
|
||||
|
||||
// Napaka, če email ne obstaja v bazi
|
||||
jQuery('#modal-lost-password .w-form-fail').html('<div>' + val.text + '</div>').show();
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// AKtivacija izgubljenega gesla
|
||||
if (window.location.hash == '#aktivacija-gesla') {
|
||||
jQuery('#modal-lost-password-activate').show();
|
||||
}
|
||||
jQuery('#submit-lost-password-activation').on('click', function () {
|
||||
jQuery('.w-form-fail').hide();
|
||||
jQuery('.error').removeClass('error');
|
||||
|
||||
var email = jQuery('#aktivacija-email').val();
|
||||
var geslo = jQuery('#aktivacija-geslo').val();
|
||||
var koda = '';
|
||||
var jezik = jQuery('#modal-lost-password [name="jezik"]').val();
|
||||
|
||||
var results = new RegExp('[\?&]code=([^&#]*)').exec(window.location.href);
|
||||
if (results[1].length > 10)
|
||||
koda = results[1];
|
||||
|
||||
if (email.length == 0 || geslo.length == 0 || koda.length == 0) {
|
||||
jQuery('#error-aktivacija-gesla').show();
|
||||
|
||||
if (email.length == 0) {
|
||||
jQuery('#aktivacija-email').addClass('error');
|
||||
}
|
||||
|
||||
if (geslo.length == 0) {
|
||||
jQuery('#aktivacija-geslo').addClass('error');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// V kolikor je vse ok poljemo POST request, da preverimo v bazi
|
||||
jQuery.post('/frontend/api/api.php?action=reset_password_activate', {
|
||||
email: email,
|
||||
pass: geslo,
|
||||
code: koda,
|
||||
ajax: true,
|
||||
lang: jezik
|
||||
}).done(function (val) {
|
||||
val = JSON.parse(val);
|
||||
|
||||
jQuery('#error-aktivacija-gesla').removeClass('w-form-fail').removeClass('w-form-done').html('').hide();
|
||||
|
||||
if (val.type == 'success') {
|
||||
jQuery('#error-aktivacija-gesla').addClass('w-form-done').html('<div>' + val.text + '</div>').show();
|
||||
|
||||
// Če je bil email uspešno poslal potem okno zapremo po 5 sekundah
|
||||
setTimeout(function () {
|
||||
window.location.href = val.action;
|
||||
}, 5000);
|
||||
|
||||
} else {
|
||||
|
||||
// Napaka, če email ne obstaja v bazi
|
||||
jQuery('#error-aktivacija-gesla').addClass('w-form-fail').html('<div>' + val.text + '</div>').show();
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
// V datoteki login.js
|
||||
// jQuery('#submit-lost-password-activation').on('click', function () {
|
||||
// jQuery('.w-form-fail').hide();
|
||||
// jQuery('.error').removeClass('error');
|
||||
//
|
||||
// var email = jQuery('#aktivacija-email').val();
|
||||
// var geslo = jQuery('#aktivacija-geslo').val();
|
||||
// var koda = '';
|
||||
// var jezik = jQuery('#modal-lost-password [name="jezik"]').val();
|
||||
//
|
||||
// var results = new RegExp('[\?&]code=([^&#]*)').exec(window.location.href);
|
||||
// if (results[1].length > 10)
|
||||
// koda = results[1];
|
||||
//
|
||||
// if (email.length == 0 || geslo.length == 0 || koda.length == 0) {
|
||||
// jQuery('#error-aktivacija-gesla').show();
|
||||
//
|
||||
// if (email.length == 0) {
|
||||
// jQuery('#aktivacija-email').addClass('error');
|
||||
// }
|
||||
//
|
||||
// if (geslo.length == 0) {
|
||||
// jQuery('#aktivacija-geslo').addClass('error');
|
||||
// }
|
||||
//
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// // V kolikor je vse ok poljemo POST request, da preverimo v bazi
|
||||
// jQuery.post('/frontend/api/api.php?action=reset_password_activate', {
|
||||
// email: email,
|
||||
// pass: geslo,
|
||||
// code: koda,
|
||||
// ajax: true,
|
||||
// lang: jezik
|
||||
// }).done(function (val) {
|
||||
// val = JSON.parse(val);
|
||||
//
|
||||
// jQuery('#error-aktivacija-gesla').removeClass('w-form-fail').removeClass('w-form-done').html('').hide();
|
||||
//
|
||||
// if (val.type == 'success') {
|
||||
// jQuery('#error-aktivacija-gesla').addClass('w-form-done').html('<div>' + val.text + '</div>').show();
|
||||
//
|
||||
// // Če je bil email uspešno poslal potem okno zapremo po 5 sekundah
|
||||
// setTimeout(function () {
|
||||
// window.location.href = val.action;
|
||||
// }, 5000);
|
||||
//
|
||||
// } else {
|
||||
//
|
||||
// // Napaka, če email ne obstaja v bazi
|
||||
// jQuery('#error-aktivacija-gesla').addClass('w-form-fail').html('<div>' + val.text + '</div>').show();
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
|
||||
//Prijava z ostalimi računi
|
||||
jQuery('#agreelabel, #cutom-login-agree, .checkbox-agree').on('click', function () {
|
||||
|
@ -9,6 +9,7 @@ global-styling:
|
||||
# js/enka-default.js: {}
|
||||
# js/enka-21.js: {}
|
||||
js/script.js: {}
|
||||
js/login.js: {}
|
||||
js/modernizr-custom.js: {}
|
||||
|
||||
dependencies:
|
||||
|
@ -18,8 +18,8 @@ function pro1ka_preprocess_page(&$variables) {
|
||||
}
|
||||
|
||||
$variables['lang'] = $lang;
|
||||
|
||||
$variables['uporabnik'] = (!empty($_COOKIE['unam']) ? base64_decode($_COOKIE['unam']) : '');
|
||||
$variables['emailUporabnik'] = 'da'.(!empty($_COOKIE['uid']) ? base64_decode($_COOKIE['uid']) : '');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -124,18 +124,18 @@
|
||||
font-weight: 600;
|
||||
letter-spacing: 1px;
|
||||
cursor: pointer;
|
||||
|
||||
|
||||
transition: 0.2s;
|
||||
|
||||
|
||||
&:hover {
|
||||
background: $modra-hover;
|
||||
}
|
||||
|
||||
|
||||
&.gumb-aai{
|
||||
text-transform: uppercase;
|
||||
background: #e35205;
|
||||
letter-spacing: 0.5px;
|
||||
|
||||
|
||||
&.login{
|
||||
margin-top: 6px;
|
||||
width: 50%;
|
||||
@ -145,12 +145,12 @@
|
||||
span{
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
|
||||
&:hover{
|
||||
background: #fa6c21;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
img {
|
||||
height: 1.6rem;
|
||||
width: 52px;
|
||||
@ -241,6 +241,12 @@
|
||||
.prijava.forma {
|
||||
padding-right: 1rem;
|
||||
width: 100%;
|
||||
|
||||
.error-message {
|
||||
background: #ff000024;
|
||||
padding: 0.25rem 0.75rem;
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.intro-modal{
|
||||
|
@ -89,7 +89,7 @@ END HEADER #}
|
||||
{% if email_uporabnika %}
|
||||
<a href="/admin/survey" class="button-pricechart pcb1 w-button">Preizkusi brezplačno</a>
|
||||
{% else %}
|
||||
<a href="/admin/survey" class="button-pricechart pcb1 w-button">Preizkusi brezplačno</a>
|
||||
<a href="#" class="button-pricechart pcb1 w-button">Preizkusi brezplačno</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<div class="button-label">Preizkusite</div><img src="/tema1ka/svg/icons8-chevron-right.svg" loading="lazy" alt="" class="button-right-arrow">
|
||||
<div class="button-flyin main"></div>
|
||||
</a>
|
||||
<a href="#" class="button secondary-button-white shrink w-inline-block">
|
||||
<a href="/d/sl/cenik/zasebni-paketi/" class="button secondary-button-white shrink w-inline-block">
|
||||
<div class="button-label">Vsi paketi</div><img src="/tema1ka/svg/icons8-chevron-right-bela.svg" loading="lazy" alt="" class="button-right-arrow">
|
||||
<div class="button-flyin"></div>
|
||||
</a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user