Prenos vseh globalnih spremenljivk v settings_optional.php v bazo
This commit is contained in:
parent
0a16e9850e
commit
41d86001d6
@ -220,8 +220,7 @@ class SurveyAdmin
|
|||||||
echo '<input type="hidden" name="editing_mode" id="editing_mode" value="1" />';
|
echo '<input type="hidden" name="editing_mode" id="editing_mode" value="1" />';
|
||||||
|
|
||||||
// Ce imamo vklopljene komercialne pakete
|
// Ce imamo vklopljene komercialne pakete
|
||||||
global $app_settings;
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
if($app_settings['commercial_packages']){
|
|
||||||
$userAccess = UserAccess::getInstance($global_user_id);
|
$userAccess = UserAccess::getInstance($global_user_id);
|
||||||
|
|
||||||
// Ce gre za staro anketo nimamo omejitev
|
// Ce gre za staro anketo nimamo omejitev
|
||||||
@ -264,7 +263,6 @@ class SurveyAdmin
|
|||||||
global $lang;
|
global $lang;
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
global $site_domain;
|
global $site_domain;
|
||||||
global $aai_instalacija;
|
|
||||||
|
|
||||||
|
|
||||||
echo '<div id="main_holder">';
|
echo '<div id="main_holder">';
|
||||||
@ -510,8 +508,7 @@ class SurveyAdmin
|
|||||||
// Gumb za nadgraditev paketa v mojih anketah (ce imamo vklopljene pakete in nimamo 3ka paketa)
|
// Gumb za nadgraditev paketa v mojih anketah (ce imamo vklopljene pakete in nimamo 3ka paketa)
|
||||||
if($this->anketa == 0){
|
if($this->anketa == 0){
|
||||||
|
|
||||||
global $app_settings;
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
if($app_settings['commercial_packages'] == true){
|
|
||||||
|
|
||||||
// Preverimo trenuten paket uporabnika
|
// Preverimo trenuten paket uporabnika
|
||||||
$userAccess = UserAccess::getInstance($global_user_id);
|
$userAccess = UserAccess::getInstance($global_user_id);
|
||||||
@ -683,8 +680,12 @@ class SurveyAdmin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GDPR popup za prejemanje obvestil - force ce ga se ni izpolnil - SAMO NA www.1ka.si, test.1ka.si in virtualkah
|
// GDPR popup za prejemanje obvestil - force ce ga se ni izpolnil - SAMO NA www.1ka.si, test.1ka.si in virtualkah
|
||||||
if (($site_url == 'https://www.1ka.si/' || $site_url == 'http://test.1ka.si/' || $site_url == 'https://1ka.arnes.si/' || ($cookie_domain == '.1ka.si' && $virtual_domain == true))
|
if ( ($site_url == 'http://test.1ka.si/'
|
||||||
&& User::getInstance()->getSetting($setting='gdpr_agree') == '-1') {
|
|| isWWW()
|
||||||
|
|| isAAI()
|
||||||
|
|| ($cookie_domain == '.1ka.si' && isVirtual()))
|
||||||
|
&& User::getInstance()->getSetting($setting='gdpr_agree') == '-1'
|
||||||
|
) {
|
||||||
|
|
||||||
// Avtomatsko prikazemo po loadu
|
// Avtomatsko prikazemo po loadu
|
||||||
echo '<script>$(document).ready(function(){showGDPRMessage();})</script>';
|
echo '<script>$(document).ready(function(){showGDPRMessage();})</script>';
|
||||||
@ -710,9 +711,7 @@ class SurveyAdmin
|
|||||||
// Priakz footerja
|
// Priakz footerja
|
||||||
private function displayFooter(){
|
private function displayFooter(){
|
||||||
global $lang;
|
global $lang;
|
||||||
global $app_settings;
|
|
||||||
global $site_frontend;
|
global $site_frontend;
|
||||||
global $aai_instalacija;
|
|
||||||
global $mysql_database_name;
|
global $mysql_database_name;
|
||||||
|
|
||||||
|
|
||||||
@ -723,14 +722,14 @@ class SurveyAdmin
|
|||||||
echo '<div class="footer_left">';
|
echo '<div class="footer_left">';
|
||||||
|
|
||||||
// Custom footer
|
// Custom footer
|
||||||
if(isset($app_settings['footer_custom']) && $app_settings['footer_custom'] == 1){
|
if(AppSettings::getInstance()->getSetting('app_settings-footer_custom') !== false){
|
||||||
echo $app_settings['footer_text'];
|
echo AppSettings::getInstance()->getSetting('app_settings-footer_text');
|
||||||
}
|
}
|
||||||
// Default footer
|
// Default footer
|
||||||
else{
|
else{
|
||||||
echo $lang['srv_footer_links'];
|
echo $lang['srv_footer_links'];
|
||||||
|
|
||||||
if(isset($aai_instalacija) && $aai_instalacija == true){
|
if(isAAI()){
|
||||||
echo ' | <a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/pogosta-vprasanja-o-arnes-aai-prijavi-uporabi-orodja-1ka" target="_blank">'.$lang['aa4'].'</a>';
|
echo ' | <a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/pogosta-vprasanja-o-arnes-aai-prijavi-uporabi-orodja-1ka" target="_blank">'.$lang['aa4'].'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -774,7 +773,7 @@ class SurveyAdmin
|
|||||||
if (Common::checkModule('gorenje')){
|
if (Common::checkModule('gorenje')){
|
||||||
echo '<a href="https://helpdesk.gorenje.com/SubmitSR.jsp" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
|
echo '<a href="https://helpdesk.gorenje.com/SubmitSR.jsp" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
|
||||||
}
|
}
|
||||||
elseif(isset($aai_instalacija) && $aai_instalacija == true){
|
elseif(isAAI()){
|
||||||
echo '<a href="https://www.1ka.si/help1KA" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
|
echo '<a href="https://www.1ka.si/help1KA" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -877,9 +876,8 @@ class SurveyAdmin
|
|||||||
|
|
||||||
|
|
||||||
// Gumb za nadgraditev paketa (ce imamo vklopljene pakete in nimamo 3ka paketa)
|
// Gumb za nadgraditev paketa (ce imamo vklopljene pakete in nimamo 3ka paketa)
|
||||||
global $app_settings;
|
|
||||||
global $global_user_id;
|
global $global_user_id;
|
||||||
if($app_settings['commercial_packages'] == true){
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
|
|
||||||
// Preverimo trenuten paket uporabnika
|
// Preverimo trenuten paket uporabnika
|
||||||
$userAccess = UserAccess::getInstance($global_user_id);
|
$userAccess = UserAccess::getInstance($global_user_id);
|
||||||
@ -4190,8 +4188,7 @@ class SurveyAdmin
|
|||||||
|
|
||||||
|
|
||||||
// Javascript s katerim povozimo urlje za izvoze, ki niso na voljo v paketu
|
// Javascript s katerim povozimo urlje za izvoze, ki niso na voljo v paketu
|
||||||
global $app_settings;
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
if($app_settings['commercial_packages'] == true){
|
|
||||||
echo '<script> userAccessExport(); </script>';
|
echo '<script> userAccessExport(); </script>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -754,8 +754,7 @@ class SurveyAdminAjax {
|
|||||||
|
|
||||||
$poslji_email = [];
|
$poslji_email = [];
|
||||||
|
|
||||||
global $app_settings;
|
$PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
|
||||||
$PageName = $app_settings['app_name'];
|
|
||||||
|
|
||||||
// Pošljemo email na alternativni email in nato še na primarni email samo obvestilo o dodanem emailu
|
// Pošljemo email na alternativni email in nato še na primarni email samo obvestilo o dodanem emailu
|
||||||
$poslji_email['novi'] = [
|
$poslji_email['novi'] = [
|
||||||
@ -5556,7 +5555,6 @@ class SurveyAdminAjax {
|
|||||||
function ajax_alert_custom() {
|
function ajax_alert_custom() {
|
||||||
global $lang;
|
global $lang;
|
||||||
global $global_user_id;
|
global $global_user_id;
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
$anketa = $this->anketa;
|
$anketa = $this->anketa;
|
||||||
$type = $_POST['type'];
|
$type = $_POST['type'];
|
||||||
|
@ -2684,7 +2684,6 @@ class SurveyAdminSettings {
|
|||||||
global $lang;
|
global $lang;
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
$anketa = $this->anketa;
|
$anketa = $this->anketa;
|
||||||
|
|
||||||
@ -4350,22 +4349,20 @@ class SurveyAdminSettings {
|
|||||||
public function display_add_survey_dostop(){
|
public function display_add_survey_dostop(){
|
||||||
global $lang;
|
global $lang;
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
global $app_settings;
|
|
||||||
global $aai_instalacija;
|
|
||||||
|
|
||||||
echo '<p class="bold">';
|
echo '<p class="bold">';
|
||||||
|
|
||||||
// Admini in managerji lahko dodajo dostop komurkoli
|
// Admini in managerji lahko dodajo dostop komurkoli
|
||||||
if($admin_type == 0 || $admin_type == 1){
|
if($admin_type == 0 || $admin_type == 1){
|
||||||
echo $lang['srv_dostop_adduserstxt_admin'].' '.$app_settings['app_name'].'. ';
|
echo $lang['srv_dostop_adduserstxt_admin'].' '.AppSettings::getInstance()->getSetting('app_settings-app_name').'. ';
|
||||||
}
|
}
|
||||||
// Ostali uporabniki lahko dodajo dostop samo ze registriranim uporabnikom
|
// Ostali uporabniki lahko dodajo dostop samo ze registriranim uporabnikom
|
||||||
else{
|
else{
|
||||||
echo $lang['srv_dostop_adduserstxt'].' '.$app_settings['app_name'].'! ';
|
echo $lang['srv_dostop_adduserstxt'].' '.AppSettings::getInstance()->getSetting('app_settings-app_name').'! ';
|
||||||
}
|
}
|
||||||
|
|
||||||
// AAI ima poseben link na help
|
// AAI ima poseben link na help
|
||||||
if(isset($aai_instalacija) && $aai_instalacija == true){
|
if(isAAI()){
|
||||||
echo $lang['srv_dostop_adduserstxt_aai_more'];
|
echo $lang['srv_dostop_adduserstxt_aai_more'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8202,7 +8199,6 @@ class SurveyAdminSettings {
|
|||||||
public function dodajNovegaUporabnika(){
|
public function dodajNovegaUporabnika(){
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
global $lang;
|
global $lang;
|
||||||
global $virtual_domain;
|
|
||||||
|
|
||||||
// admini lahko dodajajo uporabnike, ki jih nato managirajo
|
// admini lahko dodajajo uporabnike, ki jih nato managirajo
|
||||||
if($admin_type != 0)
|
if($admin_type != 0)
|
||||||
@ -8243,14 +8239,13 @@ class SurveyAdminSettings {
|
|||||||
global $admin_type;
|
global $admin_type;
|
||||||
global $lang;
|
global $lang;
|
||||||
global $global_user_id;
|
global $global_user_id;
|
||||||
global $virtual_domain;
|
|
||||||
|
|
||||||
// managerji in admini lahko dodajajo uporabnike, ki jih nato managirajo
|
// managerji in admini lahko dodajajo uporabnike, ki jih nato managirajo
|
||||||
if( !($admin_type == 1 || $admin_type == 0) )
|
if( !($admin_type == 1 || $admin_type == 0) )
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
// Na virtualkah imajo managerji omejitev st. dodeljenih uporabnikov - ZAENKRAT JE TO ONEMOGOCENO, KASNEJE SE LAHKO OMEJI NA PAKET
|
// Na virtualkah imajo managerji omejitev st. dodeljenih uporabnikov - ZAENKRAT JE TO ONEMOGOCENO, KASNEJE SE LAHKO OMEJI NA PAKET
|
||||||
if(false && $virtual_domain && $admin_type == 1){
|
if(false && isVirtual() && $admin_type == 1){
|
||||||
|
|
||||||
// Limit st. dodeljenih uporabnikov
|
// Limit st. dodeljenih uporabnikov
|
||||||
$managed_accounts_limit = 5;
|
$managed_accounts_limit = 5;
|
||||||
@ -9317,7 +9312,7 @@ class SurveyAdminSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function globalUserMyProfile () {
|
function globalUserMyProfile () {
|
||||||
global $lang, $global_user_id, $admin_type, $site_domain, $site_url, $app_settings, $aai_instalacija;
|
global $lang, $global_user_id, $admin_type, $site_domain, $site_url;
|
||||||
|
|
||||||
// podatki prijavljenega uporabnika
|
// podatki prijavljenega uporabnika
|
||||||
$sql = sisplet_query("SELECT id, name, surname, email, type, gdpr_agree, last_login FROM users WHERE id = '$global_user_id'");
|
$sql = sisplet_query("SELECT id, name, surname, email, type, gdpr_agree, last_login FROM users WHERE id = '$global_user_id'");
|
||||||
@ -9345,7 +9340,7 @@ class SurveyAdminSettings {
|
|||||||
|
|
||||||
|
|
||||||
// Trenutni paket funkcionalnosti
|
// Trenutni paket funkcionalnosti
|
||||||
if($app_settings['commercial_packages']){
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
|
|
||||||
echo '<br>';
|
echo '<br>';
|
||||||
|
|
||||||
@ -9400,7 +9395,7 @@ class SurveyAdminSettings {
|
|||||||
echo '<br />';
|
echo '<br />';
|
||||||
|
|
||||||
// AAI nima moznosti spreminjanja imena, priimka, emaila, gesla...
|
// AAI nima moznosti spreminjanja imena, priimka, emaila, gesla...
|
||||||
if($aai_instalacija){
|
if(isAAI()){
|
||||||
echo '<span class="italic">'.$lang['srv_profil_aai_warning'].'</span>';
|
echo '<span class="italic">'.$lang['srv_profil_aai_warning'].'</span>';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -9504,7 +9499,7 @@ class SurveyAdminSettings {
|
|||||||
|
|
||||||
|
|
||||||
// Save gumb - ce ni AAI
|
// Save gumb - ce ni AAI
|
||||||
if(!$aai_instalacija){
|
if(!isAAI()){
|
||||||
|
|
||||||
echo ' <div class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_gray" href="#" onclick="izbrisi1kaRacun();"><span>'.$lang['delete_account'] . '</span></a></div>';
|
echo ' <div class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_gray" href="#" onclick="izbrisi1kaRacun();"><span>'.$lang['delete_account'] . '</span></a></div>';
|
||||||
echo ' <div class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="save1kaRacunSettings();"><span>'.$lang['edit1337'] . '</span></a></div>';
|
echo ' <div class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="save1kaRacunSettings();"><span>'.$lang['edit1337'] . '</span></a></div>';
|
||||||
|
@ -121,11 +121,10 @@ class ApiController{
|
|||||||
|
|
||||||
// TUKAJ PRIDE DODATEN POGOJ CE GRE ZA PRIJAVO PREKO GOOGLA, FB... - V TEM PRIMERU NIMAMO PASSWORDA
|
// TUKAJ PRIDE DODATEN POGOJ CE GRE ZA PRIJAVO PREKO GOOGLA, FB... - V TEM PRIMERU NIMAMO PASSWORDA
|
||||||
if(!isset($this->data['Login']['password']) && isset($this->data['Login']['special_login'])){
|
if(!isset($this->data['Login']['password']) && isset($this->data['Login']['special_login'])){
|
||||||
global $APP_special_login_key;
|
|
||||||
|
|
||||||
// DODATI FUNKCIJO checkSpecialLogin v SurveyMobile, kjer se pogleda samo če obstaja mail in nastavi ustrezno user id
|
// DODATI FUNKCIJO checkSpecialLogin v SurveyMobile, kjer se pogleda samo če obstaja mail in nastavi ustrezno user id
|
||||||
if($this->data['Login']['special_login'] == 'nekajzavsakslucajv4x7in6' ||
|
if($this->data['Login']['special_login'] == 'nekajzavsakslucajv4x7in6' ||
|
||||||
$this->data['Login']['special_login'] == $APP_special_login_key){
|
$this->data['Login']['special_login'] == AppSettings::getInstance()->getSetting('maza-APP_special_login_key')){
|
||||||
$user_id = $sm->googleLogin($this->data['Login']['username']);
|
$user_id = $sm->googleLogin($this->data['Login']['username']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
152
admin/survey/classes/class.AppSettings.php
Normal file
152
admin/survey/classes/class.AppSettings.php
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
Class ki skrbi za vse globalne nastavitve aplikacije (ki so bile vcasih v settings_optional.php)
|
||||||
|
|
||||||
|
Spremenljivke:
|
||||||
|
'debug' => 0,
|
||||||
|
|
||||||
|
// INSTALLATION TYPE (0->lastna, 1->www, 2->aai, 3->virtualka)
|
||||||
|
'installation_type' => 0,
|
||||||
|
|
||||||
|
// APP SETTINGS
|
||||||
|
'app_settings_app_name' => '',
|
||||||
|
'app_settings_admin_email' => '',
|
||||||
|
'app_settings_owner' => '',
|
||||||
|
'app_settings_owner_website' => '',
|
||||||
|
'app_settings_footer_custom' => 0,
|
||||||
|
'app_settings_footer_text' => '',
|
||||||
|
'app_settings_footer_survey_custom' => 0,
|
||||||
|
'app_settings_footer_survey_text' => '',
|
||||||
|
'app_settings_email_signature_custom'=> 0,
|
||||||
|
'app_settings_email_signature_text' => '',
|
||||||
|
'app_settings_survey_finish_url' => '',
|
||||||
|
'app_settings_export_type' => 'new',
|
||||||
|
'app_settings_commercial_packages' => 0,
|
||||||
|
|
||||||
|
APP LIMITS
|
||||||
|
'app_limits_clicks_per_minute_limit'=> '',
|
||||||
|
'app_limits_question_count_limit' => '',
|
||||||
|
'app_limits_response_count_limit' => '',
|
||||||
|
'app_limits_invitation_count_limit' => '',
|
||||||
|
'app_limits_admin_allow_only_ip' => '',
|
||||||
|
|
||||||
|
SMTP SETTINGS
|
||||||
|
'email_server_settings_SMTPFrom' => '',
|
||||||
|
'email_server_settings_SMTPFromNice'=> '',
|
||||||
|
'email_server_settings_SMTPReplyTo' => '',
|
||||||
|
'email_server_settings_SMTPHost' => '',
|
||||||
|
'email_server_settings_SMTPPort' => '',
|
||||||
|
'email_server_settings_SMTPSecure' => '',
|
||||||
|
'email_server_settings_SMTPAuth' => '',
|
||||||
|
'email_server_settings_SMTPUsername'=> '',
|
||||||
|
'email_server_settings_SMTPPassword'=> '',
|
||||||
|
'email_server_fromSurvey' => '',
|
||||||
|
|
||||||
|
'confirm_registration' => 0,
|
||||||
|
'confirm_registration_admin' => '',
|
||||||
|
'gdpr_admin_email' => '',
|
||||||
|
|
||||||
|
'meta_admin_ids' => '',
|
||||||
|
|
||||||
|
GOOGLE
|
||||||
|
'google_recaptcha_sitekey' => '',
|
||||||
|
'google_secret_captcha' => '',
|
||||||
|
'google_login_client_id' => '',
|
||||||
|
'google_login_client_secret' => '',
|
||||||
|
'google_maps_API_key' => '',
|
||||||
|
|
||||||
|
FACEBOOK
|
||||||
|
'facebook_appid' => '',
|
||||||
|
'facebook_appsecret' => '',
|
||||||
|
|
||||||
|
MODULE MAZA
|
||||||
|
'maza_FCM_server_key' => '',
|
||||||
|
'maza_APP_special_login_key' => '',
|
||||||
|
'maza_NextPinMainToken' => '',
|
||||||
|
'maza_NextPinMainPassword' => '',
|
||||||
|
|
||||||
|
MODULE HIERARHIJA
|
||||||
|
'hierarhija_folder_id' => '',
|
||||||
|
'hierarhija_default_id' => '',
|
||||||
|
|
||||||
|
SQUALO MAIL
|
||||||
|
'squalo_user' => '',
|
||||||
|
'squalo_key' => '',
|
||||||
|
|
||||||
|
CEBELICA PAYMENTS
|
||||||
|
'cebelica_api' => '',
|
||||||
|
|
||||||
|
STRIPE PAYMENTS
|
||||||
|
'stripe_key' => '',
|
||||||
|
'stripe_secret' => '',
|
||||||
|
|
||||||
|
PAYPAL PAYMENTS
|
||||||
|
'paypal_account' => '',
|
||||||
|
'paypal_client_id' => '',
|
||||||
|
'paypal_secret' => '',
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class AppSettings {
|
||||||
|
|
||||||
|
|
||||||
|
private static $instance = null;
|
||||||
|
private static $settings = array();
|
||||||
|
|
||||||
|
|
||||||
|
private function __construct(){
|
||||||
|
|
||||||
|
$this->prepareSettings();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function getInstance(){
|
||||||
|
|
||||||
|
if (self::$instance == null){
|
||||||
|
self::$instance = new AppSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::$instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Get all app settings from database (based on domain)
|
||||||
|
private function prepareSettings(){
|
||||||
|
global $site_domain;
|
||||||
|
|
||||||
|
$sqlSetting = sisplet_query("SELECT what, value FROM app_settings WHERE domain='".$site_domain."'");
|
||||||
|
|
||||||
|
while ($rowSetting = mysqli_fetch_array($sqlSetting)) {
|
||||||
|
$this->settings[$rowSetting['what']] = $rowSetting['value'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Get app setting
|
||||||
|
public function getSetting($what){
|
||||||
|
|
||||||
|
if(isset($this->settings[$what])){
|
||||||
|
|
||||||
|
// Nastavitev true
|
||||||
|
if($this->settings[$what] === '1' || $this->settings[$what] === true || $this->settings[$what] === 'true')
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Nastavitev false
|
||||||
|
if($this->settings[$what] === '0' || $this->settings[$what] === '' || $this->settings[$what] === false || $this->settings[$what] === 'false')
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Nastavitev array
|
||||||
|
if($what == 'confirm_registration_admin' || $what == 'meta_admin_ids' || $what == 'app_limits-admin_allow_only_ip')
|
||||||
|
return implode(',', $this->settings[$what]);
|
||||||
|
|
||||||
|
return $this->settings[$what];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
@ -706,10 +706,10 @@ class Common {
|
|||||||
* @return Ambigous <string, multitype:>
|
* @return Ambigous <string, multitype:>
|
||||||
*/
|
*/
|
||||||
function getFromEmail() {
|
function getFromEmail() {
|
||||||
global $global_user_id, $site_domain, $email_server_settings;
|
global $global_user_id, $site_domain;
|
||||||
|
|
||||||
if(isset($email_server_settings['SMTPFrom']))
|
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom') !== false)
|
||||||
$MailFrom = $email_server_settings['SMTPFrom'];
|
$MailFrom = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom');
|
||||||
|
|
||||||
# Če je slučanjo napaka nastavimo info@1ka.si
|
# Če je slučanjo napaka nastavimo info@1ka.si
|
||||||
if ($MailFrom == null || trim($MailFrom) == '' || !$this->validEmail($MailFrom)){
|
if ($MailFrom == null || trim($MailFrom) == '' || !$this->validEmail($MailFrom)){
|
||||||
@ -2146,10 +2146,9 @@ class Common {
|
|||||||
// Vrne string s signaturjem za email v ustreznem jeziku (default slovenski)
|
// Vrne string s signaturjem za email v ustreznem jeziku (default slovenski)
|
||||||
public static function getEmailSignature($lang_id = 0){
|
public static function getEmailSignature($lang_id = 0){
|
||||||
global $lang;
|
global $lang;
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
if(isset($app_settings['email_signature_custom']) && $app_settings['email_signature_custom'] == 1){
|
if(AppSettings::getInstance()->getSetting('app_settings-email_signature_custom') !== false){
|
||||||
$signature = '<br /><br /><br />'.$app_settings['email_signature_text'];
|
$signature = '<br /><br /><br />'.AppSettings::getInstance()->getSetting('app_settings-email_signature_text');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ class Dostop {
|
|||||||
*/
|
*/
|
||||||
public function ajax_add_new_user()
|
public function ajax_add_new_user()
|
||||||
{
|
{
|
||||||
global $pass_salt, $site_url, $site_domain, $virtual_domain, $lang, $app_settings;
|
global $pass_salt, $site_url, $site_domain, $lang;
|
||||||
|
|
||||||
$email = $_POST['email'];
|
$email = $_POST['email'];
|
||||||
$name = $_POST['name'];
|
$name = $_POST['name'];
|
||||||
@ -320,13 +320,13 @@ class Dostop {
|
|||||||
|
|
||||||
$UserContent .= $lang['register_add_user_content_edit'];
|
$UserContent .= $lang['register_add_user_content_edit'];
|
||||||
|
|
||||||
$PageName = $app_settings['app_name'];
|
$PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
|
||||||
|
|
||||||
$change = '<a href="'.$site_url.'admin/survey/index.php?a=nastavitve&m=global_user_myProfile">';
|
$change = '<a href="'.$site_url.'admin/survey/index.php?a=nastavitve&m=global_user_myProfile">';
|
||||||
$out = '<a href="'.$this->page_urls['page_unregister'].'?email='.$email.'">';
|
$out = '<a href="'.$this->page_urls['page_unregister'].'?email='.$email.'">';
|
||||||
|
|
||||||
// Ce gre slucajno za virtualko
|
// Ce gre slucajno za virtualko
|
||||||
$Subject = ($virtual_domain) ? $lang['register_user_subject_virtual'] : $lang['register_user_subject'];
|
$Subject = (isVirtual()) ? $lang['register_user_subject_virtual'] : $lang['register_user_subject'];
|
||||||
|
|
||||||
$UserContent = str_replace("SFNAME", $name, $UserContent);
|
$UserContent = str_replace("SFNAME", $name, $UserContent);
|
||||||
$UserContent = str_replace("SFMAIL", $email, $UserContent);
|
$UserContent = str_replace("SFMAIL", $email, $UserContent);
|
||||||
@ -339,7 +339,7 @@ class Dostop {
|
|||||||
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
|
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
|
||||||
|
|
||||||
// Ce gre slucajno za virtualko
|
// Ce gre slucajno za virtualko
|
||||||
if($virtual_domain)
|
if(isVirtual())
|
||||||
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
|
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
|
||||||
|
|
||||||
if ($password2 == "") {
|
if ($password2 == "") {
|
||||||
@ -683,7 +683,6 @@ class Dostop {
|
|||||||
global $lang;
|
global $lang;
|
||||||
global $global_user_id;
|
global $global_user_id;
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
global $virtual_domain;
|
|
||||||
|
|
||||||
$uid = $_POST['uid'];
|
$uid = $_POST['uid'];
|
||||||
|
|
||||||
@ -757,7 +756,7 @@ class Dostop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Na virtualkah manager ne sme odstraniti uporabnika iz pregleda (zaradi omejitve)
|
// Na virtualkah manager ne sme odstraniti uporabnika iz pregleda (zaradi omejitve)
|
||||||
if($admin_type != '1' || !$virtual_domain){
|
if($admin_type != '1' || !isVirtual()){
|
||||||
$sqlu = sisplet_query("SELECT * FROM srv_dostop_manage WHERE manager='$global_user_id' AND user='$uid'");
|
$sqlu = sisplet_query("SELECT * FROM srv_dostop_manage WHERE manager='$global_user_id' AND user='$uid'");
|
||||||
|
|
||||||
if (mysqli_num_rows($sqlu) > 0) {
|
if (mysqli_num_rows($sqlu) > 0) {
|
||||||
@ -768,8 +767,7 @@ class Dostop {
|
|||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
// Segment paket
|
// Segment paket
|
||||||
global $app_settings;
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
if($app_settings['commercial_packages'] == true){
|
|
||||||
echo '<div class="segment user_package">';
|
echo '<div class="segment user_package">';
|
||||||
|
|
||||||
$userAccess = UserAccess::getInstance($uid);
|
$userAccess = UserAccess::getInstance($uid);
|
||||||
@ -1510,7 +1508,6 @@ class Dostop {
|
|||||||
public function ajax_confirm_user_email(){
|
public function ajax_confirm_user_email(){
|
||||||
global $pass_salt;
|
global $pass_salt;
|
||||||
global $lang;
|
global $lang;
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
$uid = (!empty($_POST['uid']) ? $_POST['uid'] : NULL);
|
$uid = (!empty($_POST['uid']) ? $_POST['uid'] : NULL);
|
||||||
|
|
||||||
@ -1540,7 +1537,7 @@ class Dostop {
|
|||||||
// Ce gre slucajno za virutalko
|
// Ce gre slucajno za virutalko
|
||||||
$Subject = $lang['confirmed_user_mail_subject'];
|
$Subject = $lang['confirmed_user_mail_subject'];
|
||||||
|
|
||||||
$PageName = $app_settings['app_name'];
|
$PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
|
||||||
$ZaMail = '<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN">'.'<html><head> <title>'.$Subject.'</title><meta content="text/html; charset=utf-8" http-equiv=Content-type></head><body>';
|
$ZaMail = '<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN">'.'<html><head> <title>'.$Subject.'</title><meta content="text/html; charset=utf-8" http-equiv=Content-type></head><body>';
|
||||||
|
|
||||||
// Besedilo v lang dilu je potrebno popravit, ker nimamo vec cel kup parametrov
|
// Besedilo v lang dilu je potrebno popravit, ker nimamo vec cel kup parametrov
|
||||||
|
@ -1471,8 +1471,6 @@ class GDPR{
|
|||||||
// Poskrbi za vse potrebno ko respondent zahteva izbris oz. vpogled v podatke
|
// Poskrbi za vse potrebno ko respondent zahteva izbris oz. vpogled v podatke
|
||||||
public function sendGDPRRequest($request_data){
|
public function sendGDPRRequest($request_data){
|
||||||
global $lang;
|
global $lang;
|
||||||
global $gdpr_admin_email;
|
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
|
||||||
@ -1635,7 +1633,7 @@ class GDPR{
|
|||||||
//$MA->addRecipients('dusan.rutnik@gorenje.com');
|
//$MA->addRecipients('dusan.rutnik@gorenje.com');
|
||||||
$MA->addRecipients('gdpr@gorenje.com');
|
$MA->addRecipients('gdpr@gorenje.com');
|
||||||
}
|
}
|
||||||
elseif(isset($gdpr_admin_email) && $gdpr_admin_email != ''){
|
elseif(AppSettings::getInstance()->getSetting('gdpr_admin_email') !== false){
|
||||||
$MA->addRecipients($gdpr_admin_email);
|
$MA->addRecipients($gdpr_admin_email);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -954,9 +954,8 @@ class Library {
|
|||||||
$hierarhija = (empty($_POST['hierarhija']) ? false : true);
|
$hierarhija = (empty($_POST['hierarhija']) ? false : true);
|
||||||
|
|
||||||
if($hierarhija && $ank_id == 'privzeta'){
|
if($hierarhija && $ank_id == 'privzeta'){
|
||||||
global $hierarhija_default_id;
|
|
||||||
|
|
||||||
$ank_id = $hierarhija_default_id;
|
$ank_id = AppSettings::getInstance()->getSetting('hierarhija-default_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($anketa > 0) {
|
if ($anketa > 0) {
|
||||||
@ -1030,10 +1029,10 @@ class Library {
|
|||||||
|
|
||||||
// Če imamo hierarhijo in je privzeta anketa potem preverimo v settings_optional.php
|
// Če imamo hierarhijo in je privzeta anketa potem preverimo v settings_optional.php
|
||||||
if(!empty($_POST['hierarhija']) && $ank_id == 'privzeta'){
|
if(!empty($_POST['hierarhija']) && $ank_id == 'privzeta'){
|
||||||
global $hierarhija_default_id;
|
$ank_id = AppSettings::getInstance()->getSetting('hierarhija-default_id');
|
||||||
$ank_id=$hierarhija_default_id;
|
|
||||||
}
|
}
|
||||||
}else {
|
}
|
||||||
|
else {
|
||||||
$API_call = true;
|
$API_call = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,8 +46,6 @@ class NewSurvey{
|
|||||||
global $lang;
|
global $lang;
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $site_path;
|
global $site_path;
|
||||||
global $virtual_domain;
|
|
||||||
global $debug;
|
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
|
|
||||||
echo '<div class="title">'.$lang['srv_newSurvey_title'].':</div>';
|
echo '<div class="title">'.$lang['srv_newSurvey_title'].':</div>';
|
||||||
@ -56,10 +54,10 @@ class NewSurvey{
|
|||||||
echo '<a href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=new" title="'.$lang['srv_newSurvey_survey_new2'].'"><span class="item '.($this->subpage == 'new' ? ' active' : '').'" onClick="">'.$lang['srv_newSurvey_survey_new'].'</span></a>';
|
echo '<a href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=new" title="'.$lang['srv_newSurvey_survey_new2'].'"><span class="item '.($this->subpage == 'new' ? ' active' : '').'" onClick="">'.$lang['srv_newSurvey_survey_new'].'</span></a>';
|
||||||
|
|
||||||
// Anketa iz predloga (knjiznice) - samo na www.1ka.si, testu in arnesu
|
// Anketa iz predloga (knjiznice) - samo na www.1ka.si, testu in arnesu
|
||||||
if((strpos($site_url, 'www.1ka.si') !== false && !$virtual_domain)
|
if((strpos($site_url, 'www.1ka.si') !== false && !isVirtual())
|
||||||
|| strpos($site_url, 'test.1ka.si')
|
|| strpos($site_url, 'test.1ka.si')
|
||||||
|| strpos($site_url, '1ka.arnes.si')
|
|| strpos($site_url, '1ka.arnes.si')
|
||||||
|| $debug == '1'){
|
|| isDebug()){
|
||||||
|
|
||||||
echo '<a href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=template" title="'.$lang['srv_newSurvey_survey_template2'].'"><span class="item '.($this->subpage == 'template' ? ' active' : '').'">'.$lang['srv_newSurvey_survey_template'].'</span></a>';
|
echo '<a href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=template" title="'.$lang['srv_newSurvey_survey_template2'].'"><span class="item '.($this->subpage == 'template' ? ' active' : '').'">'.$lang['srv_newSurvey_survey_template'].'</span></a>';
|
||||||
|
|
||||||
@ -540,7 +538,6 @@ class NewSurvey{
|
|||||||
echo '<div class="setting archive" id="hierarhija-opcije-vklopa">';
|
echo '<div class="setting archive" id="hierarhija-opcije-vklopa">';
|
||||||
|
|
||||||
if(!empty($_GET['c']) && $_GET['c'] == 'izbira'){
|
if(!empty($_GET['c']) && $_GET['c'] == 'izbira'){
|
||||||
global $hierarhija_default_id;
|
|
||||||
|
|
||||||
echo '<h4>'.$lang['srv_hierarchy_intro_select_title'].':</h4>';
|
echo '<h4>'.$lang['srv_hierarchy_intro_select_title'].':</h4>';
|
||||||
echo '<div class="izbira">';
|
echo '<div class="izbira">';
|
||||||
@ -563,7 +560,7 @@ class NewSurvey{
|
|||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
echo '<label class="strong block"><input type="radio" id="prevzeta-anketa" name="izberi-anketo" onclick="pridobiKnjiznicoZaHierarhijo(\'privzeta\')" value="prevzeta" /><span class="enka-checkbox-radio"></span>'.$lang['srv_hierarchy_intro_option_default'].'
|
echo '<label class="strong block"><input type="radio" id="prevzeta-anketa" name="izberi-anketo" onclick="pridobiKnjiznicoZaHierarhijo(\'privzeta\')" value="prevzeta" /><span class="enka-checkbox-radio"></span>'.$lang['srv_hierarchy_intro_option_default'].'
|
||||||
<a href="/main/survey/index.php?anketa='.$hierarhija_default_id.'&preview=on" target="_blank" title="Predogled ankete">
|
<a href="/main/survey/index.php?anketa='.AppSettings::getInstance()->getSetting('hierarhija-default_id').'&preview=on" target="_blank" title="Predogled ankete">
|
||||||
<span class="faicon preview"></span>
|
<span class="faicon preview"></span>
|
||||||
</a>
|
</a>
|
||||||
</label>';
|
</label>';
|
||||||
|
@ -392,14 +392,14 @@ class Notifications {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function ajax_viewGDPRMessage(){
|
public function ajax_viewGDPRMessage(){
|
||||||
global $lang, $global_user_id, $aai_instalacija;
|
global $lang, $global_user_id;
|
||||||
|
|
||||||
echo '<h2>'.$lang['srv_notifications_unread'].'</h2>';
|
echo '<h2>'.$lang['srv_notifications_unread'].'</h2>';
|
||||||
|
|
||||||
echo '<ul>';
|
echo '<ul>';
|
||||||
echo '<li class="unread active">';
|
echo '<li class="unread active">';
|
||||||
|
|
||||||
if(isset($aai_instalacija) && $aai_instalacija == true){
|
if(isAAI()){
|
||||||
echo '<span class="bold">'.$lang['srv_gdpr_notification_title_aai'].'</span>';
|
echo '<span class="bold">'.$lang['srv_gdpr_notification_title_aai'].'</span>';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -15,7 +15,7 @@ class SurveyAktivnost{
|
|||||||
* @desc prikaze diagnostiko anket
|
* @desc prikaze diagnostiko anket
|
||||||
*/
|
*/
|
||||||
public function diagnostics() {
|
public function diagnostics() {
|
||||||
global $lang, $global_user_id, $admin_type, $app_settings;
|
global $lang, $global_user_id, $admin_type;
|
||||||
|
|
||||||
$sum = 0;
|
$sum = 0;
|
||||||
$sum_survey = 0;
|
$sum_survey = 0;
|
||||||
@ -53,7 +53,7 @@ class SurveyAktivnost{
|
|||||||
|
|
||||||
$language = (isset($_GET['language'])) ? $_GET['language'] : 0;
|
$language = (isset($_GET['language'])) ? $_GET['language'] : 0;
|
||||||
|
|
||||||
if(isset($app_settings['commercial_packages']) && $app_settings['commercial_packages'] == true){
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
|
|
||||||
$package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
|
$package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
|
||||||
$package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
|
$package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
|
||||||
@ -710,7 +710,7 @@ class SurveyAktivnost{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function diagnostics_show_interval ($t) {
|
private function diagnostics_show_interval ($t) {
|
||||||
global $lang, $app_settings;
|
global $lang;
|
||||||
|
|
||||||
echo '<form name="intr" action="index.php" method="get">';
|
echo '<form name="intr" action="index.php" method="get">';
|
||||||
echo '<input type="hidden" name="a" value="diagnostics">';
|
echo '<input type="hidden" name="a" value="diagnostics">';
|
||||||
@ -727,7 +727,7 @@ class SurveyAktivnost{
|
|||||||
|
|
||||||
$language = (isset($_GET['language'])) ? $_GET['language'] : 0;
|
$language = (isset($_GET['language'])) ? $_GET['language'] : 0;
|
||||||
|
|
||||||
if(isset($app_settings['commercial_packages']) && $app_settings['commercial_packages'] == true){
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
|
|
||||||
$package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
|
$package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
|
||||||
$package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
|
$package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
|
||||||
@ -868,11 +868,10 @@ class SurveyAktivnost{
|
|||||||
|
|
||||||
// Filter po paketih, ce jih imamo
|
// Filter po paketih, ce jih imamo
|
||||||
private function diagnostics_get_user_package(){
|
private function diagnostics_get_user_package(){
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
$filter = '';
|
$filter = '';
|
||||||
|
|
||||||
if(isset($app_settings['commercial_packages']) && $app_settings['commercial_packages'] == true){
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
|
|
||||||
$package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
|
$package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
|
||||||
$package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
|
$package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
|
||||||
|
@ -23,22 +23,21 @@ class SurveyCheck {
|
|||||||
|
|
||||||
// Preverimo stevilo vprasanj v anketi
|
// Preverimo stevilo vprasanj v anketi
|
||||||
public function checkLimitSpremenljivke(){
|
public function checkLimitSpremenljivke(){
|
||||||
global $app_limits;
|
|
||||||
|
|
||||||
// Ce limit ni nastavljen ignoriramo
|
// Ce limit ni nastavljen ignoriramo
|
||||||
if(!isset($app_limits['question_count_limit']) || $app_limits['question_count_limit'] <= 0)
|
if(!AppSettings::getInstance()->getSetting('app_limits-question_count_limit'))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Dobimo stevilo vprasanj v anketi
|
// Dobimo stevilo vprasanj v anketi
|
||||||
$stevilo_vprasanj = SurveyInfo::getInstance()->getSurveyQuestionCount();
|
$stevilo_vprasanj = SurveyInfo::getInstance()->getSurveyQuestionCount();
|
||||||
|
|
||||||
// Obvestilo (mail adminu) posljemo pri dosezeni stevilki
|
// Obvestilo (mail adminu) posljemo pri dosezeni stevilki
|
||||||
if($stevilo_vprasanj == $app_limits['question_count_limit']){
|
if($stevilo_vprasanj == AppSettings::getInstance()->getSetting('app_limits-question_count_limit')){
|
||||||
$this->sendAlert($alert_type='limit_spremenljivke', $stevilo_vprasanj);
|
$this->sendAlert($alert_type='limit_spremenljivke', $stevilo_vprasanj);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ce je v anketi ze vec vprasanj kot je limit
|
// Ce je v anketi ze vec vprasanj kot je limit
|
||||||
if($stevilo_vprasanj > $app_limits['question_count_limit']){
|
if($stevilo_vprasanj > AppSettings::getInstance()->getSetting('app_limits-question_count_limit')){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -48,10 +47,9 @@ class SurveyCheck {
|
|||||||
|
|
||||||
// Preverimo stevilo poslanih vabil
|
// Preverimo stevilo poslanih vabil
|
||||||
public function checkLimitVabila(){
|
public function checkLimitVabila(){
|
||||||
global $app_limits;
|
|
||||||
|
|
||||||
// Ce limit ni nastavljen ignoriramo
|
// Ce limit ni nastavljen ignoriramo
|
||||||
if(!isset($app_limits['invitation_count_limit']) || $app_limits['invitation_count_limit'] <= 0)
|
if(!AppSettings::getInstance()->getSetting('app_limits-invitation_count_limit'))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Prestejemo poslana vabila
|
// Prestejemo poslana vabila
|
||||||
@ -64,12 +62,12 @@ class SurveyCheck {
|
|||||||
$stevilo_vabil = $row['stevilo_vabil'];
|
$stevilo_vabil = $row['stevilo_vabil'];
|
||||||
|
|
||||||
// Obvestilo (mail adminu) posljemo pri dosezeni stevilki
|
// Obvestilo (mail adminu) posljemo pri dosezeni stevilki
|
||||||
if($stevilo_vabil == $app_limits['invitation_count_limit']){
|
if($stevilo_vabil == AppSettings::getInstance()->getSetting('app_limits-invitation_count_limit')){
|
||||||
$this->sendAlert($alert_type='limit_vabila', $stevilo_vabil);
|
$this->sendAlert($alert_type='limit_vabila', $stevilo_vabil);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ce je poslanih ze vec vabil kot je limit
|
// Ce je poslanih ze vec vabil kot je limit
|
||||||
if($stevilo_vabil > $app_limits['invitation_count_limit']){
|
if($stevilo_vabil > AppSettings::getInstance()->getSetting('app_limits-invitation_count_limit')){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -79,22 +77,21 @@ class SurveyCheck {
|
|||||||
|
|
||||||
// Preverimo stevilo responsov na anketo
|
// Preverimo stevilo responsov na anketo
|
||||||
public function checkLimitResponses(){
|
public function checkLimitResponses(){
|
||||||
global $app_limits;
|
|
||||||
|
|
||||||
// Ce limit ni nastavljen ignoriramo
|
// Ce limit ni nastavljen ignoriramo
|
||||||
if(!isset($app_limits['response_count_limit']) || $app_limits['response_count_limit'] <= 0)
|
if(!AppSettings::getInstance()->getSetting('app_limits-response_count_limit'))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Dobimo stevilo odgovorov na anketo
|
// Dobimo stevilo odgovorov na anketo
|
||||||
$stevilo_odgovorov = SurveyInfo::getInstance()->getSurveyAnswersCount();
|
$stevilo_odgovorov = SurveyInfo::getInstance()->getSurveyAnswersCount();
|
||||||
|
|
||||||
// Obvestilo (mail adminu) posljemo pri dosezeni stevilki
|
// Obvestilo (mail adminu) posljemo pri dosezeni stevilki
|
||||||
if($stevilo_odgovorov == $app_limits['response_count_limit']){
|
if($stevilo_odgovorov == AppSettings::getInstance()->getSetting('app_limits-response_count_limit')){
|
||||||
$this->sendAlert($alert_type='limit_responses', $stevilo_odgovorov);
|
$this->sendAlert($alert_type='limit_responses', $stevilo_odgovorov);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ce je na anketo ze vec responsov kot je limit
|
// Ce je na anketo ze vec responsov kot je limit
|
||||||
if($stevilo_odgovorov > $app_limits['response_count_limit']){
|
if($stevilo_odgovorov > AppSettings::getInstance()->getSetting('app_limits-response_count_limit')){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -147,14 +144,77 @@ class SurveyCheck {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pri izpolnjevanju ankete preverimo stevilo klikov na minuto - ce jih je prevec, respondenta zavrnemo, drugace se lahko sql zafila in streznik ni vec odziven
|
||||||
|
public function checkClicksPerMinute(){
|
||||||
|
|
||||||
|
// Ce maximum na minuto ni nastavljen ignoriramo limit
|
||||||
|
if(!AppSettings::getInstance()->getSetting('app_limits-clicks_per_minute_limit'))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Preverimo ce gre za izpolnjevanje ankete
|
||||||
|
if($_SERVER["SCRIPT_NAME"] != '/main/survey/index.php')
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Preverimo ce gre za prvi prihod na doloceno stran ankete in ne na prvo stran
|
||||||
|
if(isset($_GET['grupa']))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Preverimo ce je id ankete ustrezno nastavljen
|
||||||
|
if(!isset($_GET['anketa']) || $_GET['anketa'] <= 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
|
||||||
|
$click_time = time();
|
||||||
|
|
||||||
|
$sql = sisplet_query("SELECT click_count, click_time FROM srv_clicks WHERE ank_id='".$_GET['anketa']."'");
|
||||||
|
if (mysqli_num_rows($sql) > 0) {
|
||||||
|
|
||||||
|
list($click_count, $first_click_time) = mysqli_fetch_array($sql);
|
||||||
|
|
||||||
|
// Ce nismo znotraj minute vse resetiramo in pustimo naprej
|
||||||
|
if($click_time - $first_click_time > 60){
|
||||||
|
$sqlI = sisplet_query("UPDATE srv_clicks SET click_count='1', click_time='".$click_time."' WHERE ank_id='".$_GET['anketa']."'");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Click count je ok - pustimo naprej
|
||||||
|
if($click_count <= AppSettings::getInstance()->getSetting('app_limits-clicks_per_minute_limit')){
|
||||||
|
$sqlI = sisplet_query("UPDATE srv_clicks SET click_count=click_count+1 WHERE ank_id='".$_GET['anketa']."'");
|
||||||
|
|
||||||
|
// Dosegli smo limit - posljemo mail adminu
|
||||||
|
if($click_count == AppSettings::getInstance()->getSetting('app_limits-clicks_per_minute_limit')){
|
||||||
|
|
||||||
|
// Includamo vse da lahko posljemo mail
|
||||||
|
include_once('../../vendor/autoload.php');
|
||||||
|
|
||||||
|
// Posljemo mail adminu
|
||||||
|
$this->sendAlert($alert_type='limit_clicks', $click_count);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Click count je previsok - ZAVRNEMO
|
||||||
|
else{
|
||||||
|
// Prikazemo error stran ki jo refreshamo na 5 sekund
|
||||||
|
$this->displayClicksPerMinuteError();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$sqlI = sisplet_query("INSERT INTO srv_clicks (ank_id, click_count, click_time) VALUES ('".$_GET['anketa']."', '1', '".$click_time."')");
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Posljemo obvestilo adminu o prebitem limitu, phishing anketi...
|
// Posljemo obvestilo adminu o prebitem limitu, phishing anketi...
|
||||||
private function sendAlert($alert_type, $count=0){
|
private function sendAlert($alert_type, $count=0){
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $lastna_instalacija;
|
|
||||||
|
|
||||||
// Alerta ne posljemo na lastnih instalacijah
|
// Alerta ne posljemo na lastnih instalacijah
|
||||||
if($lastna_instalacija)
|
if(isLastnaInstalacija())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch($alert_type){
|
switch($alert_type){
|
||||||
@ -181,12 +241,19 @@ class SurveyCheck {
|
|||||||
$title = 'Opozorilo - potencialna phishing anketa';
|
$title = 'Opozorilo - potencialna phishing anketa';
|
||||||
$content = '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'">Anketa '.$this->anketa.'</a> - potencialen phishing!';
|
$content = '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'">Anketa '.$this->anketa.'</a> - potencialen phishing!';
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'limit_clicks':
|
||||||
|
$title = 'Opozorilo - dosežena omejitev klikov na minuto';
|
||||||
|
$content = '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'">Anketa '.$this->anketa.'</a> ima doseženo omejitev klikov na minuto ('.$count.')!';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
$MA = new MailAdapter($anketa=null, $type='admin');
|
$MA = new MailAdapter($anketa=null, $type='admin');
|
||||||
$MA->addRecipients('info@1ka.si');
|
$MA->addRecipients('peter.hrvatin@gmail.com');
|
||||||
|
//$MA->addRecipients('info@1ka.si');
|
||||||
$resultX = $MA->sendMail($content, $title);
|
$resultX = $MA->sendMail($content, $title);
|
||||||
}
|
}
|
||||||
catch (Exception $e){
|
catch (Exception $e){
|
||||||
@ -197,6 +264,73 @@ class SurveyCheck {
|
|||||||
$SL->addMessage(SurveyLog::ERROR, $title.' - anketa '.$this->anketa);
|
$SL->addMessage(SurveyLog::ERROR, $title.' - anketa '.$this->anketa);
|
||||||
$SL->write();
|
$SL->write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prikazemo stran z errorjem za presezeno stevilo klikov na minuto
|
||||||
|
private function displayClicksPerMinuteError(){
|
||||||
|
global $site_url;
|
||||||
|
|
||||||
|
$refresh_every = 5;
|
||||||
|
|
||||||
|
echo '<!DOCTYPE html>';
|
||||||
|
echo '<html>';
|
||||||
|
|
||||||
|
echo '<head>';
|
||||||
|
echo ' <title>Server Limit Reached</title>';
|
||||||
|
echo ' <meta http-equiv="refresh" content="'.$refresh_every.'" />';
|
||||||
|
echo ' <meta name="viewport" content="width=device-width, initial-scale=1.0" />';
|
||||||
|
|
||||||
|
echo ' <style>
|
||||||
|
body{
|
||||||
|
display: flex;
|
||||||
|
align-content: center;
|
||||||
|
height: 90vh;
|
||||||
|
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-content: center;
|
||||||
|
}
|
||||||
|
.main{
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 50px auto;
|
||||||
|
padding: 0 20px;
|
||||||
|
|
||||||
|
font-family: Montserrat, Arial, Sans-Serif !important;
|
||||||
|
color: #505050;
|
||||||
|
}
|
||||||
|
h1{
|
||||||
|
color: #1e88e5;
|
||||||
|
text-align: center;
|
||||||
|
margin: 30px 0;
|
||||||
|
}
|
||||||
|
hr{
|
||||||
|
margin: 50px 0;
|
||||||
|
|
||||||
|
border: 0;
|
||||||
|
border-top: 1px solid #ddeffd;
|
||||||
|
}
|
||||||
|
.loading{
|
||||||
|
margin: 50px 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
img{
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
</style>';
|
||||||
|
echo '</head>';
|
||||||
|
|
||||||
|
echo '<body><div class="main">';
|
||||||
|
echo ' <div class="loading"><img src="'.$site_url.'/public/img/icons/spinner.gif" /></div>';
|
||||||
|
echo ' <h1>Dosežena omejitev strežnika</h1>';
|
||||||
|
echo ' <h3>Prosimo, počakajte nekaj trenutkov. Trenutno je doseženo maksimalno število vnosov ankete na minuto.</h3>';
|
||||||
|
echo ' <hr>';
|
||||||
|
echo ' <h1>Server Limit Reached</h1>';
|
||||||
|
echo ' <h3>Please wait a few moments. Currently, the maximum number of survey entries per minute has been reached.</h3>';
|
||||||
|
echo '</div></body>';
|
||||||
|
|
||||||
|
echo '</html>';
|
||||||
|
|
||||||
|
die();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@ -232,7 +232,7 @@ class SurveyList {
|
|||||||
* @desc prikaze zgornjo navigacijo
|
* @desc prikaze zgornjo navigacijo
|
||||||
*/
|
*/
|
||||||
function display_sub_tabs () {
|
function display_sub_tabs () {
|
||||||
global $lang, $global_user_id, $admin_type, $site_domain, $aai_instalacija;
|
global $lang, $global_user_id, $admin_type, $site_domain;
|
||||||
|
|
||||||
$SLCount = $this->countSurveys();
|
$SLCount = $this->countSurveys();
|
||||||
|
|
||||||
@ -772,8 +772,7 @@ class SurveyList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Narocila - samo ce imamo vklopljene pakete
|
# Narocila - samo ce imamo vklopljene pakete
|
||||||
global $app_settings;
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
if($app_settings['commercial_packages']){
|
|
||||||
echo '<li class="spaceBig"> </li>';
|
echo '<li class="spaceBig"> </li>';
|
||||||
|
|
||||||
echo '<li>';
|
echo '<li>';
|
||||||
|
@ -15,7 +15,6 @@ class SurveyTheme {
|
|||||||
global $site_domain;
|
global $site_domain;
|
||||||
global $global_user_id;
|
global $global_user_id;
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
global $debug;
|
|
||||||
|
|
||||||
$this->sid = $sid;
|
$this->sid = $sid;
|
||||||
|
|
||||||
@ -67,12 +66,11 @@ class SurveyTheme {
|
|||||||
12 => 'Embed2.css',
|
12 => 'Embed2.css',
|
||||||
13 => 'Slideshow.css'
|
13 => 'Slideshow.css'
|
||||||
);
|
);
|
||||||
//if((($admin_type == '0' || $admin_type == '1') && (strpos($site_url, 'www.1ka.si') || strpos($site_url, 'test.1ka.si'))) || $debug == '1'){
|
|
||||||
$standard_skins[14] = 'Uni.css';
|
$standard_skins[14] = 'Uni.css';
|
||||||
$standard_skins[15] = 'Fdv.css';
|
$standard_skins[15] = 'Fdv.css';
|
||||||
$standard_skins[16] = 'Cdi.css';
|
$standard_skins[16] = 'Cdi.css';
|
||||||
$standard_skins[17] = 'WebSM.css';
|
$standard_skins[17] = 'WebSM.css';
|
||||||
//}
|
|
||||||
|
|
||||||
// Novi safe skini so v loceni skupini
|
// Novi safe skini so v loceni skupini
|
||||||
$safe_skins = array(
|
$safe_skins = array(
|
||||||
@ -96,11 +94,10 @@ class SurveyTheme {
|
|||||||
5 => 'MobilePurple.css',
|
5 => 'MobilePurple.css',
|
||||||
6 => 'MobileBlack.css'
|
6 => 'MobileBlack.css'
|
||||||
);
|
);
|
||||||
//if((($admin_type == '0' || $admin_type == '1') && (strpos($site_url, 'www.1ka.si') || strpos($site_url, 'test.1ka.si'))) || $debug == '1'){
|
|
||||||
$mobile_skins[7] = 'MobileUni.css';
|
$mobile_skins[7] = 'MobileUni.css';
|
||||||
$mobile_skins[8] = 'MobileFdv.css';
|
$mobile_skins[8] = 'MobileFdv.css';
|
||||||
$mobile_skins[9] = 'MobileCdi.css';
|
$mobile_skins[9] = 'MobileCdi.css';
|
||||||
//}
|
|
||||||
|
|
||||||
// Safe skini
|
// Safe skini
|
||||||
if(in_array($file, $safe_skins)){
|
if(in_array($file, $safe_skins)){
|
||||||
|
@ -293,7 +293,7 @@ class MobileSurveyAdmin{
|
|||||||
|
|
||||||
// Izris glavne navigacije v mojih anketah
|
// Izris glavne navigacije v mojih anketah
|
||||||
private function displayMenuMySurveysNavigation(){
|
private function displayMenuMySurveysNavigation(){
|
||||||
global $lang, $admin_type, $app_settings;
|
global $lang, $admin_type;
|
||||||
|
|
||||||
|
|
||||||
# naložimo razred z seznamom anket
|
# naložimo razred z seznamom anket
|
||||||
@ -518,7 +518,7 @@ class MobileSurveyAdmin{
|
|||||||
|
|
||||||
|
|
||||||
// NAROCILA
|
// NAROCILA
|
||||||
if($app_settings['commercial_packages']){
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
|
|
||||||
// placila - samo admini
|
// placila - samo admini
|
||||||
if ($admin_type == '0') {
|
if ($admin_type == '0') {
|
||||||
|
@ -71,8 +71,6 @@ class MailAdapter{
|
|||||||
private function prepareSurveySettings(){
|
private function prepareSurveySettings(){
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
global $mysql_database_name;
|
global $mysql_database_name;
|
||||||
global $email_server_settings;
|
|
||||||
global $email_server_fromSurvey;
|
|
||||||
|
|
||||||
|
|
||||||
// Polovimo nastavitve ce obstajajo v bazi
|
// Polovimo nastavitve ce obstajajo v bazi
|
||||||
@ -112,33 +110,34 @@ class MailAdapter{
|
|||||||
|
|
||||||
// Pri 1ka nastavitvah lahko nastavljamo samo reply to, vse ostalo je veedno default
|
// Pri 1ka nastavitvah lahko nastavljamo samo reply to, vse ostalo je veedno default
|
||||||
if($this->settings['1ka']['SMTPReplyTo'] == '')
|
if($this->settings['1ka']['SMTPReplyTo'] == '')
|
||||||
$this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['SMTPReplyTo'];
|
$this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPReplyTo');
|
||||||
|
|
||||||
$this->settings['1ka']['SMTPFrom'] = $email_server_settings['SMTPFrom'];
|
$this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom');
|
||||||
$this->settings['1ka']['SMTPFromNice'] = $email_server_settings['SMTPFromNice'];
|
$this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFromNice');
|
||||||
$this->settings['1ka']['SMTPHost'] = $email_server_settings['SMTPHost'];
|
$this->settings['1ka']['SMTPHost'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPHost');
|
||||||
$this->settings['1ka']['SMTPPort'] = $email_server_settings['SMTPPort'];
|
$this->settings['1ka']['SMTPPort'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPort');
|
||||||
|
|
||||||
if(isset($email_server_settings['SMTPAuth']) && $email_server_settings['SMTPAuth'] == 1){
|
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPAuth') === true){
|
||||||
$this->settings['1ka']['SMTPAuth'] = $email_server_settings['SMTPAuth'];
|
$this->settings['1ka']['SMTPAuth'] = 1;
|
||||||
$this->settings['1ka']['SMTPUsername'] = $email_server_settings['SMTPUsername'];
|
$this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername');
|
||||||
$this->settings['1ka']['SMTPPassword'] = $email_server_settings['SMTPPassword'];
|
$this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPassword');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($email_server_settings['SMTPSecure']))
|
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure') !== false)
|
||||||
$this->settings['1ka']['SMTPSecure'] = $email_server_settings['SMTPSecure'];
|
$this->settings['1ka']['SMTPSecure'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure');
|
||||||
|
|
||||||
// Pri google smtp je username vedno email
|
// Pri google smtp je username vedno email
|
||||||
if($this->mailMode == 'google')
|
if($this->mailMode == 'google')
|
||||||
$this->settings['google']['SMTPUsername'] = $this->settings['google']['SMTPFrom'];
|
$this->settings['google']['SMTPUsername'] = $this->settings['google']['SMTPFrom'];
|
||||||
|
|
||||||
// ce posiljamo mail vabila in smo na www.1ka.si oz. virutalkah in smo admin - posiljamo preko sekundarnega maila (raziskave@1ka.si)
|
// ce posiljamo mail vabila in smo na www.1ka.si oz. virutalkah in smo admin - posiljamo preko sekundarnega maila (raziskave@1ka.si)
|
||||||
if($this->type == 'invitation' && $admin_type == 0 && isset($email_server_settings['secondary_mail'])){
|
if($this->type == 'invitation' && $admin_type == 0 && AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom') !== false){
|
||||||
$this->settings['1ka']['SMTPFrom'] = $email_server_settings['secondary_mail']['SMTPFrom'];
|
|
||||||
$this->settings['1ka']['SMTPFromNice'] = $email_server_settings['secondary_mail']['SMTPFromNice'];
|
$this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom');
|
||||||
$this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['secondary_mail']['SMTPReplyTo'];
|
$this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFromNice');
|
||||||
$this->settings['1ka']['SMTPUsername'] = $email_server_settings['secondary_mail']['SMTPUsername'];
|
$this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPReplyTo');
|
||||||
$this->settings['1ka']['SMTPPassword'] = $email_server_settings['secondary_mail']['SMTPPassword'];
|
$this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPUsername');
|
||||||
|
$this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPPassword');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nastavimo default delay
|
// Nastavimo default delay
|
||||||
@ -149,20 +148,20 @@ class MailAdapter{
|
|||||||
else{
|
else{
|
||||||
|
|
||||||
// Nastavimo 1ka smtp
|
// Nastavimo 1ka smtp
|
||||||
$this->settings['1ka']['SMTPFrom'] = $email_server_settings['SMTPFrom'];
|
$this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom');
|
||||||
$this->settings['1ka']['SMTPFromNice'] = $email_server_settings['SMTPFromNice'];
|
$this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFromNice');
|
||||||
$this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['SMTPReplyTo'];
|
$this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPReplyTo');
|
||||||
$this->settings['1ka']['SMTPHost'] = $email_server_settings['SMTPHost'];
|
$this->settings['1ka']['SMTPHost'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPHost');
|
||||||
$this->settings['1ka']['SMTPPort'] = $email_server_settings['SMTPPort'];
|
$this->settings['1ka']['SMTPPort'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPort');
|
||||||
|
|
||||||
if(isset($email_server_settings['SMTPAuth']) && $email_server_settings['SMTPAuth'] == 1){
|
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPAuth') === true){
|
||||||
$this->settings['1ka']['SMTPAuth'] = $email_server_settings['SMTPAuth'];
|
$this->settings['1ka']['SMTPAuth'] = 1;
|
||||||
$this->settings['1ka']['SMTPUsername'] = $email_server_settings['SMTPUsername'];
|
$this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername');
|
||||||
$this->settings['1ka']['SMTPPassword'] = $email_server_settings['SMTPPassword'];
|
$this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPassword');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($email_server_settings['SMTPSecure']))
|
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure') !== false)
|
||||||
$this->settings['1ka']['SMTPSecure'] = $email_server_settings['SMTPSecure'];
|
$this->settings['1ka']['SMTPSecure'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure');
|
||||||
|
|
||||||
// Nastavimo default delay
|
// Nastavimo default delay
|
||||||
$this->settings['1ka']['SMTPDelay'] = 500000;
|
$this->settings['1ka']['SMTPDelay'] = 500000;
|
||||||
@ -178,7 +177,7 @@ class MailAdapter{
|
|||||||
|
|
||||||
|
|
||||||
// Ce imamo nastavljeno, da se za posiljanje iz ankete uporabi isti smtp streznik kot za generalno posiljanje
|
// Ce imamo nastavljeno, da se za posiljanje iz ankete uporabi isti smtp streznik kot za generalno posiljanje
|
||||||
if($email_server_fromSurvey){
|
if(AppSettings::getInstance()->getSetting('email_server_fromSurvey') === true){
|
||||||
$this->prepareGeneralSettings();
|
$this->prepareGeneralSettings();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -187,13 +186,13 @@ class MailAdapter{
|
|||||||
if($this->type == 'invitation'){
|
if($this->type == 'invitation'){
|
||||||
|
|
||||||
// Pri vabilih je default 1ka streznik samo na www.1ka.si in to samo za admine
|
// Pri vabilih je default 1ka streznik samo na www.1ka.si in to samo za admine
|
||||||
if($admin_type == 0 && isset($email_server_settings['secondary_mail'])){
|
if($admin_type == 0 && AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom') !== false){
|
||||||
$this->mailMode = '1ka';
|
$this->mailMode = '1ka';
|
||||||
$this->settings['1ka']['SMTPFrom'] = $email_server_settings['secondary_mail']['SMTPFrom'];
|
$this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom');
|
||||||
$this->settings['1ka']['SMTPFromNice'] = $email_server_settings['secondary_mail']['SMTPFromNice'];
|
$this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFromNice');
|
||||||
$this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['secondary_mail']['SMTPReplyTo'];
|
$this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPReplyTo');
|
||||||
$this->settings['1ka']['SMTPUsername'] = $email_server_settings['secondary_mail']['SMTPUsername'];
|
$this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPUsername');
|
||||||
$this->settings['1ka']['SMTPPassword'] = $email_server_settings['secondary_mail']['SMTPPassword'];
|
$this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPPassword');
|
||||||
}
|
}
|
||||||
// Drugace je potrebno nastaviti smtp
|
// Drugace je potrebno nastaviti smtp
|
||||||
else{
|
else{
|
||||||
@ -211,37 +210,36 @@ class MailAdapter{
|
|||||||
|
|
||||||
// Pripravimo nastavitve splosnega posiljanja v aplikaciji glede na nastavitve v settings_optional.php
|
// Pripravimo nastavitve splosnega posiljanja v aplikaciji glede na nastavitve v settings_optional.php
|
||||||
private function prepareGeneralSettings(){
|
private function prepareGeneralSettings(){
|
||||||
global $email_server_settings;
|
|
||||||
global $mysql_database_name;
|
global $mysql_database_name;
|
||||||
|
|
||||||
$this->mailMode = 'smtp';
|
$this->mailMode = 'smtp';
|
||||||
$this->settings['SMTPMailMode'] = 2;
|
$this->settings['SMTPMailMode'] = 2;
|
||||||
|
|
||||||
$this->settings['smtp'] = array(
|
$this->settings['smtp'] = array(
|
||||||
'SMTPFrom' => $email_server_settings['SMTPFrom'],
|
'SMTPFrom' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom'),
|
||||||
'SMTPFromNice' => $email_server_settings['SMTPFromNice'],
|
'SMTPFromNice' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPFromNice'),
|
||||||
'SMTPReplyTo' => $email_server_settings['SMTPReplyTo'],
|
'SMTPReplyTo' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPReplyTo'),
|
||||||
|
|
||||||
'SMTPHost' => $email_server_settings['SMTPHost'],
|
'SMTPHost' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPHost'),
|
||||||
'SMTPPort' => $email_server_settings['SMTPPort']
|
'SMTPPort' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPPort')
|
||||||
);
|
);
|
||||||
|
|
||||||
if(isset($email_server_settings['SMTPAuth']) && $email_server_settings['SMTPAuth'] == 1){
|
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPAuth') === true){
|
||||||
$this->settings['smtp']['SMTPAuth'] = $email_server_settings['SMTPAuth'];
|
$this->settings['smtp']['SMTPAuth'] = 1;
|
||||||
$this->settings['smtp']['SMTPUsername'] = $email_server_settings['SMTPUsername'];
|
$this->settings['smtp']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername');
|
||||||
$this->settings['smtp']['SMTPPassword'] = $email_server_settings['SMTPPassword'];
|
$this->settings['smtp']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPassword');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($email_server_settings['SMTPSecure']))
|
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername') !== false)
|
||||||
$this->settings['smtp']['SMTPSecure'] = $email_server_settings['SMTPSecure'];
|
$this->settings['smtp']['SMTPSecure'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure');
|
||||||
|
|
||||||
// ce posiljamo v povezavi s placili (racuni, predracuni...) - posiljamo preko tretjega maila (invoice@1ka.si)
|
// ce posiljamo v povezavi s placili (racuni, predracuni...) - posiljamo preko tretjega maila (invoice@1ka.si)
|
||||||
if($this->type == 'payments' && isset($email_server_settings['payments_mail']) && $mysql_database_name == 'real1kasi'){
|
if($this->type == 'payments' && AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPFrom') !== false && $mysql_database_name == 'real1kasi'){
|
||||||
$this->settings['smtp']['SMTPFrom'] = $email_server_settings['payments_mail']['SMTPFrom'];
|
$this->settings['smtp']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPFrom');
|
||||||
$this->settings['smtp']['SMTPFromNice'] = $email_server_settings['payments_mail']['SMTPFromNice'];
|
$this->settings['smtp']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPFromNice');
|
||||||
$this->settings['smtp']['SMTPReplyTo'] = $email_server_settings['payments_mail']['SMTPReplyTo'];
|
$this->settings['smtp']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPReplyTo');
|
||||||
$this->settings['smtp']['SMTPUsername'] = $email_server_settings['payments_mail']['SMTPUsername'];
|
$this->settings['smtp']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPUsername');
|
||||||
$this->settings['smtp']['SMTPPassword'] = $email_server_settings['payments_mail']['SMTPPassword'];
|
$this->settings['smtp']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPPassword');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nastavimo default delay
|
// Nastavimo default delay
|
||||||
@ -709,7 +707,7 @@ class MailAdapter{
|
|||||||
|
|
||||||
// Pripravimo design emaila
|
// Pripravimo design emaila
|
||||||
private function prepareEmailDesign($content, $heading='', $image='', $button=''){
|
private function prepareEmailDesign($content, $heading='', $image='', $button=''){
|
||||||
global $lang, $app_settings, $site_domain;
|
global $lang, $site_domain;
|
||||||
|
|
||||||
// V nekaterih primerih ne designeramo maila
|
// V nekaterih primerih ne designeramo maila
|
||||||
if(!in_array($this->type, array('account', 'payments')) || !in_array($site_domain, array('localhost', 'www.1ka.si', 'test.1ka.si', 'test2.1ka.si'))){
|
if(!in_array($this->type, array('account', 'payments')) || !in_array($site_domain, array('localhost', 'www.1ka.si', 'test.1ka.si', 'test2.1ka.si'))){
|
||||||
|
@ -7159,8 +7159,7 @@ class SurveyAnalysis {
|
|||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
// Javascript s katerim povozimo urlje za izvoze, ki niso na voljo v paketu
|
// Javascript s katerim povozimo urlje za izvoze, ki niso na voljo v paketu
|
||||||
global $app_settings;
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
if($app_settings['commercial_packages'] == true){
|
|
||||||
echo '<script> userAccessExport(); </script>';
|
echo '<script> userAccessExport(); </script>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1526,8 +1526,7 @@ class SurveyBreak
|
|||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
// Javascript s katerim povozimo urlje za izvoze, ki niso na voljo v paketu
|
// Javascript s katerim povozimo urlje za izvoze, ki niso na voljo v paketu
|
||||||
global $app_settings;
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||||
if($app_settings['commercial_packages'] == true){
|
|
||||||
echo '<script> userAccessExport(); </script>';
|
echo '<script> userAccessExport(); </script>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ class SurveyAlert
|
|||||||
* se s pomočjo crontaba zaganja vsak dan samodejno.
|
* se s pomočjo crontaba zaganja vsak dan samodejno.
|
||||||
*/
|
*/
|
||||||
static function prepareSendExpireAlerts() {
|
static function prepareSendExpireAlerts() {
|
||||||
global $site_url, $lang, $mysql_database_name, $app_settings;
|
global $site_url, $lang, $mysql_database_name;
|
||||||
|
|
||||||
// napolnimo tabelo srv_alert v bazi surveycrontab
|
// napolnimo tabelo srv_alert v bazi surveycrontab
|
||||||
$sqlSurvey = sisplet_query("SELECT active FROM srv_anketa WHERE id='".self::getSurveyId()."'");
|
$sqlSurvey = sisplet_query("SELECT active FROM srv_anketa WHERE id='".self::getSurveyId()."'");
|
||||||
@ -245,7 +245,7 @@ class SurveyAlert
|
|||||||
* Funkcija pošlje emaile ob spremembi aktivnosti ankete
|
* Funkcija pošlje emaile ob spremembi aktivnosti ankete
|
||||||
*/
|
*/
|
||||||
static function sendMailActive() {
|
static function sendMailActive() {
|
||||||
global $lang, $site_url, $site_path, $app_settings;
|
global $lang, $site_url, $site_path;
|
||||||
|
|
||||||
// poiščemo vse email naslove
|
// poiščemo vse email naslove
|
||||||
// poiscemo e-maile od avtorja in userjev v dostopu
|
// poiscemo e-maile od avtorja in userjev v dostopu
|
||||||
@ -368,7 +368,7 @@ class SurveyAlert
|
|||||||
* Funkcija pošlje emaile ob izbrisu ankete
|
* Funkcija pošlje emaile ob izbrisu ankete
|
||||||
*/
|
*/
|
||||||
static function sendMailDelete() {
|
static function sendMailDelete() {
|
||||||
global $lang, $site_url, $site_path, $app_settings;
|
global $lang, $site_url, $site_path;
|
||||||
|
|
||||||
// poiščemo vse email naslove
|
// poiščemo vse email naslove
|
||||||
// poiscemo e-maile od avtorja in userjev v dostopu
|
// poiscemo e-maile od avtorja in userjev v dostopu
|
||||||
@ -484,7 +484,7 @@ class SurveyAlert
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function setDefaultAlertBeforeExpire() {
|
static function setDefaultAlertBeforeExpire() {
|
||||||
global $lang, $site_url, $site_path, $app_settings;
|
global $lang, $site_url, $site_path;
|
||||||
|
|
||||||
$turn_on_alert = false;
|
$turn_on_alert = false;
|
||||||
|
|
||||||
@ -535,7 +535,6 @@ class SurveyAlert
|
|||||||
static function setDefaultAlertActivation() {
|
static function setDefaultAlertActivation() {
|
||||||
global $lang;
|
global $lang;
|
||||||
global $global_user_id;
|
global $global_user_id;
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
$anketa = self::getSurveyId();
|
$anketa = self::getSurveyId();
|
||||||
|
|
||||||
|
@ -89,7 +89,6 @@ class SurveyInvitationsNew {
|
|||||||
function action($action) {
|
function action($action) {
|
||||||
global $lang;
|
global $lang;
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $app_settings;
|
|
||||||
global $global_user_id;
|
global $global_user_id;
|
||||||
|
|
||||||
$NoNavi = $_POST['noNavi'];
|
$NoNavi = $_POST['noNavi'];
|
||||||
@ -2764,7 +2763,7 @@ class SurveyInvitationsNew {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function displayNavigation() {
|
function displayNavigation() {
|
||||||
global $lang, $admin_type, $global_user_id, $app_settings;
|
global $lang, $admin_type, $global_user_id;
|
||||||
|
|
||||||
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
||||||
|
|
||||||
@ -3713,7 +3712,7 @@ class SurveyInvitationsNew {
|
|||||||
|
|
||||||
// Glavno posiljanje mail vabil
|
// Glavno posiljanje mail vabil
|
||||||
function sendMail() {
|
function sendMail() {
|
||||||
global $lang, $site_path, $site_url, $global_user_id, $lastna_instalacija;
|
global $lang, $site_path, $site_url, $global_user_id;
|
||||||
|
|
||||||
Common::getInstance()->Init($this->sid);
|
Common::getInstance()->Init($this->sid);
|
||||||
|
|
||||||
@ -3799,7 +3798,7 @@ class SurveyInvitationsNew {
|
|||||||
$numRows = mysqli_num_rows($sql_query);
|
$numRows = mysqli_num_rows($sql_query);
|
||||||
|
|
||||||
# če pošiljamo na večje število reposndentov obvestimo info@1ka.si
|
# če pošiljamo na večje število reposndentov obvestimo info@1ka.si
|
||||||
if ($numRows > NOTIFY_INFO1KA && (!isset($lastna_instalacija) || $lastna_instalacija == false)) {
|
if ($numRows > NOTIFY_INFO1KA && !isLastnaInstalacija()) {
|
||||||
|
|
||||||
// Gorenje tega nima
|
// Gorenje tega nima
|
||||||
if (!Common::checkModule('gorenje')){
|
if (!Common::checkModule('gorenje')){
|
||||||
@ -6968,7 +6967,7 @@ class SurveyInvitationsNew {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showInvitationStatus() {
|
function showInvitationStatus() {
|
||||||
global $admin_type, $app_settings, $global_user_id;
|
global $admin_type, $global_user_id;
|
||||||
|
|
||||||
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
||||||
$d = new Dostop();
|
$d = new Dostop();
|
||||||
@ -7004,7 +7003,7 @@ class SurveyInvitationsNew {
|
|||||||
|
|
||||||
// Prikaz statusov posiljanj
|
// Prikaz statusov posiljanj
|
||||||
private function displayInvitationStatusNew() {
|
private function displayInvitationStatusNew() {
|
||||||
global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
|
global $lang, $admin_type, $global_user_id, $site_url, $site_path;
|
||||||
|
|
||||||
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
||||||
|
|
||||||
@ -7470,7 +7469,7 @@ class SurveyInvitationsNew {
|
|||||||
|
|
||||||
// Prikaz statusov posiljanj pri volitvah
|
// Prikaz statusov posiljanj pri volitvah
|
||||||
private function displayInvitationStatusVoting() {
|
private function displayInvitationStatusVoting() {
|
||||||
global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
|
global $lang, $admin_type, $global_user_id, $site_url, $site_path;
|
||||||
|
|
||||||
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
||||||
|
|
||||||
@ -7610,7 +7609,7 @@ class SurveyInvitationsNew {
|
|||||||
|
|
||||||
|
|
||||||
function showInvitationSettings() {
|
function showInvitationSettings() {
|
||||||
global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
|
global $lang, $admin_type, $global_user_id, $site_url, $site_path;
|
||||||
|
|
||||||
$row = $this->surveySettings;
|
$row = $this->surveySettings;
|
||||||
$_email = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
$_email = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
||||||
@ -9831,7 +9830,6 @@ class SurveyInvitationsNew {
|
|||||||
global $admin_type;
|
global $admin_type;
|
||||||
global $global_user_id;
|
global $global_user_id;
|
||||||
global $mysql_database_name;
|
global $mysql_database_name;
|
||||||
global $aai_instalacija;
|
|
||||||
|
|
||||||
|
|
||||||
$row = SurveyInfo::getInstance()->getSurveyRow();
|
$row = SurveyInfo::getInstance()->getSurveyRow();
|
||||||
@ -9886,7 +9884,7 @@ class SurveyInvitationsNew {
|
|||||||
echo '<span class="bold">'.$lang['srv_email_setting_select_server'].'</span> ';
|
echo '<span class="bold">'.$lang['srv_email_setting_select_server'].'</span> ';
|
||||||
|
|
||||||
// AAI ima Arnesov smtp
|
// AAI ima Arnesov smtp
|
||||||
if($aai_instalacija){
|
if(isAAI()){
|
||||||
echo '<label><input type="radio" name="SMTPMailMode" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' onclick="smtpAAIPopupShow();">';
|
echo '<label><input type="radio" name="SMTPMailMode" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' onclick="smtpAAIPopupShow();">';
|
||||||
echo $lang['srv_email_setting_adapter0_aai']. ' </label>';
|
echo $lang['srv_email_setting_adapter0_aai']. ' </label>';
|
||||||
}
|
}
|
||||||
|
@ -18,12 +18,10 @@ class SqualoApi {
|
|||||||
|
|
||||||
|
|
||||||
private function executeCall($action, $method, $data){
|
private function executeCall($action, $method, $data){
|
||||||
global $squalo_user;
|
|
||||||
global $squalo_key;
|
|
||||||
|
|
||||||
// Add credentials
|
// Add credentials
|
||||||
$data['apiUser'] = $squalo_user;
|
$data['apiUser'] = AppSettings::getInstance()->getSetting('squalo-user');
|
||||||
$data['apiKey'] = $squalo_key;
|
$data['apiKey'] = AppSettings::getInstance()->getSetting('squalo-key');
|
||||||
|
|
||||||
// GET call - set url params
|
// GET call - set url params
|
||||||
if($method == 'GET'){
|
if($method == 'GET'){
|
||||||
|
@ -38,8 +38,6 @@ class SurveyInvitationsSqualo {
|
|||||||
private function checkSqualoEnabled(){
|
private function checkSqualoEnabled(){
|
||||||
global $mysql_database_name;
|
global $mysql_database_name;
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
global $squalo_user;
|
|
||||||
global $squalo_key;
|
|
||||||
|
|
||||||
// Zaenkrat imajo squalo samo admini
|
// Zaenkrat imajo squalo samo admini
|
||||||
if($admin_type != 0)
|
if($admin_type != 0)
|
||||||
@ -50,7 +48,7 @@ class SurveyInvitationsSqualo {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Zaenkrat imajo squalo samo admini
|
// Zaenkrat imajo squalo samo admini
|
||||||
if(!isset($squalo_user) || $squalo_user == '' || !isset($squalo_key) || $squalo_key == '')
|
if(AppSettings::getInstance()->getSetting('squalo-user') === false || AppSettings::getInstance()->getSetting('squalo-key') === false)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
global $site_url, $global_user_id, $app_settings;
|
global $site_url, $global_user_id;
|
||||||
|
|
||||||
$surveySkin = 0;
|
$surveySkin = 0;
|
||||||
|
|
||||||
@ -85,8 +85,8 @@
|
|||||||
$rowv = mysqli_fetch_array($sqlv);
|
$rowv = mysqli_fetch_array($sqlv);
|
||||||
|
|
||||||
// Custom head title
|
// Custom head title
|
||||||
if(isset($app_settings['head_title_custom']) && $app_settings['head_title_custom'] == 1){
|
if(AppSettings::getInstance()->getSetting('app_settings-head_title_custom')){
|
||||||
echo '<title>'.$app_settings['head_title_text'].'</title>' . "\n";
|
echo '<title>'.AppSettings::getInstance()->getSetting('app_settings-head_title_text').'</title>' . "\n";
|
||||||
}
|
}
|
||||||
// Default head title
|
// Default head title
|
||||||
else{
|
else{
|
||||||
|
@ -6,7 +6,7 @@ include_once('definition.php');
|
|||||||
include_once('../../function.php');
|
include_once('../../function.php');
|
||||||
include_once('../../vendor/autoload.php');
|
include_once('../../vendor/autoload.php');
|
||||||
|
|
||||||
global $site_path, $global_user_id, $admin_type, $lang, $app_settings;
|
global $site_path, $global_user_id, $admin_type, $lang;
|
||||||
|
|
||||||
|
|
||||||
# error reporting
|
# error reporting
|
||||||
@ -143,11 +143,11 @@ elseif(in_array($_GET['m'], array('pdf_teammeter','pdf_employmeter', 'pdf_evoli'
|
|||||||
$export_type = 'old';
|
$export_type = 'old';
|
||||||
}
|
}
|
||||||
// Ce imamo vklopljeno nastavitev za nove izvoze
|
// Ce imamo vklopljeno nastavitev za nove izvoze
|
||||||
elseif(isset($app_settings['export_type']) && $app_settings['export_type'] == 'new'){
|
elseif(AppSettings::getInstance()->getSetting('app_settings-export_type') == 'new'){
|
||||||
$export_type = 'new';
|
$export_type = 'new';
|
||||||
}
|
}
|
||||||
// Ce imamo vklopljeno nastavitev za nove izvoze samo za admine
|
// Ce imamo vklopljeno nastavitev za nove izvoze samo za admine
|
||||||
elseif(isset($app_settings['export_type']) && $app_settings['export_type'] == 'new_admin' && $admin_type == 0){
|
elseif(AppSettings::getInstance()->getSetting('app_settings-export_type') == 'new_admin' && $admin_type == 0){
|
||||||
$export_type = 'new';
|
$export_type = 'new';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -1115,12 +1115,11 @@ class MAZA {
|
|||||||
* @return type - json result of curl output
|
* @return type - json result of curl output
|
||||||
*/
|
*/
|
||||||
private function send_FCM_mesage_curl($fields){
|
private function send_FCM_mesage_curl($fields){
|
||||||
#API access key from Google API's Console
|
|
||||||
global $FCM_server_key;
|
|
||||||
|
|
||||||
|
#API access key from Google API's Console
|
||||||
$headers = array
|
$headers = array
|
||||||
(
|
(
|
||||||
'Authorization: key=' . $FCM_server_key,
|
'Authorization: key=' . AppSettings::getInstance()->getSetting('maza-FCM_server_key'),
|
||||||
'Content-Type: application/json'
|
'Content-Type: application/json'
|
||||||
);
|
);
|
||||||
#Send Reponse To FireBase Server
|
#Send Reponse To FireBase Server
|
||||||
@ -1790,16 +1789,14 @@ class MAZA {
|
|||||||
* @param type $password - passwor to set in nextpin for this user
|
* @param type $password - passwor to set in nextpin for this user
|
||||||
*/
|
*/
|
||||||
public function nextpin_create_user($identifier, $password){
|
public function nextpin_create_user($identifier, $password){
|
||||||
#credentials to use nextpin API
|
#credentials to use nextpin API
|
||||||
global $NextPinMainToken;
|
|
||||||
|
|
||||||
$fields = array
|
$fields = array
|
||||||
(
|
(
|
||||||
'username' => $this->nextpin_token_prefix . $identifier,
|
'username' => $this->nextpin_token_prefix . $identifier,
|
||||||
'password' => $password
|
'password' => $password
|
||||||
);
|
);
|
||||||
|
|
||||||
$this -> nextpin_API_call($NextPinMainToken, $fields, 'auth/createUser');
|
$this -> nextpin_API_call(AppSettings::getInstance()->getSetting('maza-NextPinMainToken'), $fields, 'auth/createUser');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,7 +99,6 @@ class WPN {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function sendWebPushNotificationsToAll(){
|
public function sendWebPushNotificationsToAll(){
|
||||||
//global $FCM_server_key;
|
|
||||||
|
|
||||||
$title = $_POST['wpn_title'];
|
$title = $_POST['wpn_title'];
|
||||||
$message = $_POST['wpn_message'];
|
$message = $_POST['wpn_message'];
|
||||||
|
@ -922,10 +922,9 @@ class HierarhijaAjax
|
|||||||
public function pridobiVseAnketeKiSoVknjizniciZaHierarhijo()
|
public function pridobiVseAnketeKiSoVknjizniciZaHierarhijo()
|
||||||
{
|
{
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $hierarhija_folder_id;
|
|
||||||
|
|
||||||
$ime_mape = sisplet_query("SELECT * FROM srv_library_folder where id='" . $hierarhija_folder_id . "'", "obj")->naslov;
|
$ime_mape = sisplet_query("SELECT * FROM srv_library_folder where id='" . AppSettings::getInstance()->getSetting('hierarhija-folder_id') . "'", "obj")->naslov;
|
||||||
$ankete_v_knjiznici = sisplet_query("SELECT * FROM srv_library_anketa WHERE folder='" . $hierarhija_folder_id . "'", "obj");
|
$ankete_v_knjiznici = sisplet_query("SELECT * FROM srv_library_anketa WHERE folder='" . AppSettings::getInstance()->getSetting('hierarhija-folder_id') . "'", "obj");
|
||||||
|
|
||||||
if (empty($ime_mape) && sizeof($ankete_v_knjiznici) == 0) {
|
if (empty($ime_mape) && sizeof($ankete_v_knjiznici) == 0) {
|
||||||
echo 'Knjižnica je prazna.';
|
echo 'Knjižnica je prazna.';
|
||||||
|
@ -32,11 +32,10 @@ class ApiLogin
|
|||||||
global $site_path;
|
global $site_path;
|
||||||
global $site_domain;
|
global $site_domain;
|
||||||
global $cookie_domain;
|
global $cookie_domain;
|
||||||
global $virtual_domain;
|
|
||||||
|
|
||||||
|
|
||||||
// Overridi za virtualne domene na TUS strezniku
|
// Overridi za virtualne domene na TUS strezniku
|
||||||
if(isset($virtual_domain) && $virtual_domain == true){
|
if(isVirtual()){
|
||||||
if (getenv('apache_site_path') != '') $site_url = getenv('apache_site_url');
|
if (getenv('apache_site_path') != '') $site_url = getenv('apache_site_url');
|
||||||
if (getenv('apache_site_path') != '') $site_path = getenv('apache_site_path');
|
if (getenv('apache_site_path') != '') $site_path = getenv('apache_site_path');
|
||||||
if (getenv('apache_site_domain') != '') $site_domain = getenv('apache_site_domain');
|
if (getenv('apache_site_domain') != '') $site_domain = getenv('apache_site_domain');
|
||||||
@ -416,16 +415,16 @@ class ApiLogin
|
|||||||
global $cookie_domain;
|
global $cookie_domain;
|
||||||
global $originating_domain;
|
global $originating_domain;
|
||||||
global $keep_domain;
|
global $keep_domain;
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
|
|
||||||
// Ce imamo vklopljeno blokiranje dostopa do admina glede na ip
|
// Ce imamo vklopljeno blokiranje dostopa do admina glede na ip
|
||||||
if(isset($app_settings['admin_allow_only_ip']) && $app_settings['admin_allow_only_ip'] != '' && !empty($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)){
|
||||||
|
|
||||||
$ip = $_SERVER['REMOTE_ADDR'];
|
$ip = $_SERVER['REMOTE_ADDR'];
|
||||||
|
|
||||||
// Preverimo ip - ce se ne ujema ne pustimo logina
|
// Preverimo ip - ce se ne ujema ne pustimo logina
|
||||||
if(!in_array($ip, $app_settings['admin_allow_only_ip'])){
|
if(!in_array($ip, $admin_allow_only_ip)){
|
||||||
header('location: '.$this->page_urls['page_login'.$this->prijava]);
|
header('location: '.$this->page_urls['page_login'.$this->prijava]);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
@ -602,8 +601,6 @@ class ApiLogin
|
|||||||
{
|
{
|
||||||
require_once('../../function/JWT.php');
|
require_once('../../function/JWT.php');
|
||||||
|
|
||||||
global $google_login_client_id;
|
|
||||||
global $google_login_client_secret;
|
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $lang;
|
global $lang;
|
||||||
global $proxy;
|
global $proxy;
|
||||||
@ -617,8 +614,8 @@ class ApiLogin
|
|||||||
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'content' => http_build_query([
|
'content' => http_build_query([
|
||||||
'client_id' => $google_login_client_id,
|
'client_id' => AppSettings::getInstance()->getSetting('google-login_client_id'),
|
||||||
'client_secret' => $google_login_client_secret,
|
'client_secret' => AppSettings::getInstance()->getSetting('google-login_client_secret'),
|
||||||
'code' => $oauth2_code,
|
'code' => $oauth2_code,
|
||||||
'grant_type' => 'authorization_code',
|
'grant_type' => 'authorization_code',
|
||||||
'redirect_uri' => $site_url.'frontend/api/google-oauth2.php',
|
'redirect_uri' => $site_url.'frontend/api/google-oauth2.php',
|
||||||
@ -634,8 +631,8 @@ class ApiLogin
|
|||||||
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'content' => http_build_query([
|
'content' => http_build_query([
|
||||||
'client_id' => $google_login_client_id,
|
'client_id' => AppSettings::getInstance()->getSetting('google-login_client_id'),
|
||||||
'client_secret' => $google_login_client_secret,
|
'client_secret' => AppSettings::getInstance()->getSetting('google-login_client_secret'),
|
||||||
'code' => $oauth2_code,
|
'code' => $oauth2_code,
|
||||||
'grant_type' => 'authorization_code',
|
'grant_type' => 'authorization_code',
|
||||||
'redirect_uri' => $site_url.'frontend/api/google-oauth2.php',
|
'redirect_uri' => $site_url.'frontend/api/google-oauth2.php',
|
||||||
@ -713,11 +710,9 @@ class ApiLogin
|
|||||||
// Prijavi userja v 1ko z FB racunom (kopirano iz ProfileClass.php) - PRETESTIRATI
|
// Prijavi userja v 1ko z FB racunom (kopirano iz ProfileClass.php) - PRETESTIRATI
|
||||||
private function userLoginFacebook()
|
private function userLoginFacebook()
|
||||||
{
|
{
|
||||||
global $facebook_appid;
|
|
||||||
global $facebook_appsecret;
|
|
||||||
global $cookie_path;
|
global $cookie_path;
|
||||||
|
|
||||||
if ($r = file_get_contents("https://graph.facebook.com/v2.9/oauth/access_token?client_id=".$facebook_appid."&redirect_uri=https://www.1ka.si/frontend/api/fb_login.php&client_secret=".$facebook_appsecret."&code=".$_GET['code'])) {
|
if ($r = file_get_contents("https://graph.facebook.com/v2.9/oauth/access_token?client_id=".AppSettings::getInstance()->getSetting('facebook-appid')."&redirect_uri=https://www.1ka.si/frontend/api/fb_login.php&client_secret=".AppSettings::getInstance()->getSetting('facebook-appsecret')."&code=".$_GET['code'])) {
|
||||||
|
|
||||||
$at = json_decode($r);
|
$at = json_decode($r);
|
||||||
$user = json_decode(file_get_contents('https://graph.facebook.com/me?fields=email,first_name,last_name&access_token='.$at->{'access_token'}));
|
$user = json_decode(file_get_contents('https://graph.facebook.com/me?fields=email,first_name,last_name&access_token='.$at->{'access_token'}));
|
||||||
@ -981,7 +976,6 @@ class ApiLogin
|
|||||||
global $site_url;
|
global $site_url;
|
||||||
global $cookie_domain;
|
global $cookie_domain;
|
||||||
global $global_user_id;
|
global $global_user_id;
|
||||||
global $aai_instalacija;
|
|
||||||
|
|
||||||
setcookie('uid', '', time() - 3600, '/', $cookie_domain);
|
setcookie('uid', '', time() - 3600, '/', $cookie_domain);
|
||||||
setcookie('unam', '', time() - 3600, '/', $cookie_domain);
|
setcookie('unam', '', time() - 3600, '/', $cookie_domain);
|
||||||
@ -1022,7 +1016,7 @@ class ApiLogin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ce gre za arnes aai odjavo odjavimo posebej
|
// Ce gre za arnes aai odjavo odjavimo posebej
|
||||||
if ($aai_instalacija){
|
if (isAAI()){
|
||||||
setcookie("aai", '', time() - 3600, '/', $cookie_domain);
|
setcookie("aai", '', time() - 3600, '/', $cookie_domain);
|
||||||
header('location: '.$site_url.'/logout_AAI.php?return='.$site_url);
|
header('location: '.$site_url.'/logout_AAI.php?return='.$site_url);
|
||||||
die();
|
die();
|
||||||
@ -1035,8 +1029,6 @@ class ApiLogin
|
|||||||
// Registrira userja v 1ko - vnos podatkov
|
// Registrira userja v 1ko - vnos podatkov
|
||||||
private function userRegister()
|
private function userRegister()
|
||||||
{
|
{
|
||||||
global $secret_captcha;
|
|
||||||
|
|
||||||
$error = [];
|
$error = [];
|
||||||
|
|
||||||
$email = (isset($_POST['email'])) ? $_POST['email'] : '';
|
$email = (isset($_POST['email'])) ? $_POST['email'] : '';
|
||||||
@ -1055,9 +1047,9 @@ class ApiLogin
|
|||||||
|
|
||||||
|
|
||||||
// Preverimo ReCaptcha
|
// Preverimo ReCaptcha
|
||||||
if (!empty($secret_captcha)) {
|
if (AppSettings::getInstance()->getSetting('google-secret_captcha') !== false) {
|
||||||
$recaptchaResponse = $_POST['g-recaptcha-response'];
|
$recaptchaResponse = $_POST['g-recaptcha-response'];
|
||||||
$requestReCaptcha = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secret_captcha."&response=".$recaptchaResponse);
|
$requestReCaptcha = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".AppSettings::getInstance()->getSetting('google-secret_captcha')."&response=".$recaptchaResponse);
|
||||||
|
|
||||||
if (!strstr($requestReCaptcha, "true")) {
|
if (!strstr($requestReCaptcha, "true")) {
|
||||||
$error['invalid_recaptcha'] = '1';
|
$error['invalid_recaptcha'] = '1';
|
||||||
@ -1265,11 +1257,8 @@ class ApiLogin
|
|||||||
global $site_url;
|
global $site_url;
|
||||||
global $site_path;
|
global $site_path;
|
||||||
global $site_domain;
|
global $site_domain;
|
||||||
global $virtual_domain;
|
|
||||||
global $pass_salt;
|
global $pass_salt;
|
||||||
global $lang;
|
global $lang;
|
||||||
global $confirm_registration;
|
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
|
|
||||||
$email = (isset($_POST['email']) ? $_POST['email'] : '');
|
$email = (isset($_POST['email']) ? $_POST['email'] : '');
|
||||||
@ -1306,7 +1295,7 @@ class ApiLogin
|
|||||||
$priimek = '';
|
$priimek = '';
|
||||||
|
|
||||||
// Ce imamo vklopljeno potrjevanje urednika aplikacije ga potrdi admin
|
// Ce imamo vklopljeno potrjevanje urednika aplikacije ga potrdi admin
|
||||||
if (isset($confirm_registration) && $confirm_registration == 1)
|
if (AppSettings::getInstance()->getSetting('confirm_registration') === true)
|
||||||
$status = 2;
|
$status = 2;
|
||||||
else
|
else
|
||||||
$status = 1;
|
$status = 1;
|
||||||
@ -1337,16 +1326,16 @@ class ApiLogin
|
|||||||
$Content .= $lang['confirm_user_mail_ignore'];
|
$Content .= $lang['confirm_user_mail_ignore'];
|
||||||
|
|
||||||
// Ce gre slucajno za virutalko
|
// Ce gre slucajno za virutalko
|
||||||
$Subject = ($virtual_domain) ? $lang['confirm_user_mail_subject_virtual'] : $lang['confirm_user_mail_subject'];
|
$Subject = (isVirtual()) ? $lang['confirm_user_mail_subject_virtual'] : $lang['confirm_user_mail_subject'];
|
||||||
|
|
||||||
// Ce mora admin potrditi dobi email admin in ne uporabnik!
|
// Ce mora admin potrditi dobi email admin in ne uporabnik!
|
||||||
if(isset($confirm_registration) && $confirm_registration == 1){
|
if(AppSettings::getInstance()->getSetting('confirm_registration') === true){
|
||||||
|
|
||||||
// Popravimo besedilo emaila
|
// Popravimo besedilo emaila
|
||||||
$Content = $lang['confirm_user_mail_admin'];
|
$Content = $lang['confirm_user_mail_admin'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$PageName = $app_settings['app_name'];
|
$PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
|
||||||
|
|
||||||
$ZaMail = '<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN">'.'<html><head> <title>'.$Subject.'</title><meta content="text/html; charset=utf-8" http-equiv=Content-type></head><body>';
|
$ZaMail = '<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN">'.'<html><head> <title>'.$Subject.'</title><meta content="text/html; charset=utf-8" http-equiv=Content-type></head><body>';
|
||||||
|
|
||||||
@ -1363,7 +1352,7 @@ class ApiLogin
|
|||||||
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
|
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
|
||||||
|
|
||||||
// Ce gre slucajno za virutalko
|
// Ce gre slucajno za virutalko
|
||||||
if($virtual_domain)
|
if(isVirtual())
|
||||||
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
|
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
|
||||||
|
|
||||||
|
|
||||||
@ -1382,8 +1371,8 @@ class ApiLogin
|
|||||||
$MA = new MailAdapter(null, 'account');
|
$MA = new MailAdapter(null, 'account');
|
||||||
|
|
||||||
// Ce mora admin potrditi, posljemo njemu mail
|
// Ce mora admin potrditi, posljemo njemu mail
|
||||||
if(isset($confirm_registration) && $confirm_registration == 1){
|
if(AppSettings::getInstance()->getSetting('confirm_registration') === true){
|
||||||
global $confirm_registration_admin;
|
$confirm_registration_admin = AppSettings::getInstance()->getSetting('confirm_registration_admin');
|
||||||
|
|
||||||
if(is_array($confirm_registration_admin)){
|
if(is_array($confirm_registration_admin)){
|
||||||
// Mail posljemo vsem nastavljenim adminom
|
// Mail posljemo vsem nastavljenim adminom
|
||||||
@ -1428,11 +1417,8 @@ class ApiLogin
|
|||||||
global $site_url;
|
global $site_url;
|
||||||
global $site_path;
|
global $site_path;
|
||||||
global $site_domain;
|
global $site_domain;
|
||||||
global $virtual_domain;
|
|
||||||
global $pass_salt;
|
global $pass_salt;
|
||||||
global $cookie_domain;
|
global $cookie_domain;
|
||||||
global $confirm_registration;
|
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
|
|
||||||
if (!isset ($_GET['code'])) {
|
if (!isset ($_GET['code'])) {
|
||||||
@ -1462,14 +1448,14 @@ class ApiLogin
|
|||||||
$pass = $r['pass'];
|
$pass = $r['pass'];
|
||||||
$ime = $r['name'];
|
$ime = $r['name'];
|
||||||
|
|
||||||
$PageName = $app_settings['app_name'];
|
$PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
|
||||||
|
|
||||||
include_once('../../lang/'.$r['lang'].'.php');
|
include_once('../../lang/'.$r['lang'].'.php');
|
||||||
$Content = $lang['confirm_user_content'];
|
$Content = $lang['confirm_user_content'];
|
||||||
$Subject = $lang['confirm_user_subject'];
|
$Subject = $lang['confirm_user_subject'];
|
||||||
|
|
||||||
// Ce je ga moramo po registraciji odobriti dobi drugacno sporocilo
|
// Ce je ga moramo po registraciji odobriti dobi drugacno sporocilo
|
||||||
if (isset($confirm_registration) && $confirm_registration == 1){
|
if (AppSettings::getInstance()->getSetting('confirm_registration') === true){
|
||||||
$UserContent = $lang['register_user_banned_content'];
|
$UserContent = $lang['register_user_banned_content'];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -1486,7 +1472,7 @@ class ApiLogin
|
|||||||
$out = '<a href="'.$this->page_urls['page_unregister'].'?email='.$email.'">';
|
$out = '<a href="'.$this->page_urls['page_unregister'].'?email='.$email.'">';
|
||||||
|
|
||||||
// Ce gre slucajno za virtualko
|
// Ce gre slucajno za virtualko
|
||||||
$Subject = ($virtual_domain) ? $lang['register_user_subject_virtual'] : $lang['register_user_subject'];
|
$Subject = (isVirtual()) ? $lang['register_user_subject_virtual'] : $lang['register_user_subject'];
|
||||||
|
|
||||||
$UserContent = str_replace("SFNAME", $ime, $UserContent);
|
$UserContent = str_replace("SFNAME", $ime, $UserContent);
|
||||||
$UserContent = str_replace("SFMAIL", $email, $UserContent);
|
$UserContent = str_replace("SFMAIL", $email, $UserContent);
|
||||||
@ -1498,7 +1484,7 @@ class ApiLogin
|
|||||||
|
|
||||||
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
|
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
|
||||||
// Ce gre slucajno za virtualko
|
// Ce gre slucajno za virtualko
|
||||||
if($virtual_domain)
|
if(isVirtual())
|
||||||
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
|
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
|
||||||
|
|
||||||
if ($geslo2 == "") {
|
if ($geslo2 == "") {
|
||||||
@ -1537,7 +1523,7 @@ class ApiLogin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ce imamo vklopljeno potrjevanje urednika aplikacije je to izvedel admin in ne prijavljamo
|
// Ce imamo vklopljeno potrjevanje urednika aplikacije je to izvedel admin in ne prijavljamo
|
||||||
if (!isset($confirm_registration) || $confirm_registration != 1){
|
if (AppSettings::getInstance()->getSetting('confirm_registration') !== true){
|
||||||
|
|
||||||
// določi še, od kje se je prijavil
|
// določi še, od kje se je prijavil
|
||||||
$hostname = "";
|
$hostname = "";
|
||||||
@ -1620,7 +1606,6 @@ class ApiLogin
|
|||||||
global $lang;
|
global $lang;
|
||||||
global $global_user_id;
|
global $global_user_id;
|
||||||
global $cookie_domain;
|
global $cookie_domain;
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
$email = $global_user_id;
|
$email = $global_user_id;
|
||||||
|
|
||||||
@ -1642,7 +1627,7 @@ class ApiLogin
|
|||||||
$result = sisplet_query("SELECT name FROM users WHERE email='$email'");
|
$result = sisplet_query("SELECT name FROM users WHERE email='$email'");
|
||||||
list ($ime) = mysqli_fetch_row($result);
|
list ($ime) = mysqli_fetch_row($result);
|
||||||
|
|
||||||
$PageName = $app_settings['app_name'];
|
$PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
|
||||||
|
|
||||||
$ByeEmail = str_replace("SFPAGENAME", $PageName, $ByeEmail);
|
$ByeEmail = str_replace("SFPAGENAME", $PageName, $ByeEmail);
|
||||||
if (strlen($ime) > 2) {
|
if (strlen($ime) > 2) {
|
||||||
@ -1715,9 +1700,7 @@ class ApiLogin
|
|||||||
global $pass_salt;
|
global $pass_salt;
|
||||||
global $site_path;
|
global $site_path;
|
||||||
global $site_domain;
|
global $site_domain;
|
||||||
global $virtual_domain;
|
|
||||||
global $cookie_domain;
|
global $cookie_domain;
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
if (isset ($_GET['email']) || isset ($_POST['email'])) {
|
if (isset ($_GET['email']) || isset ($_POST['email'])) {
|
||||||
|
|
||||||
@ -1778,11 +1761,11 @@ class ApiLogin
|
|||||||
$result = sisplet_query("UPDATE users SET LastLP=UNIX_TIMESTAMP(NOW()), lost_password='".base64_encode((hash(SHA256, $geslo.$pass_salt)))."', lost_password_code='$passhint' WHERE email='$email'");
|
$result = sisplet_query("UPDATE users SET LastLP=UNIX_TIMESTAMP(NOW()), lost_password='".base64_encode((hash(SHA256, $geslo.$pass_salt)))."', lost_password_code='$passhint' WHERE email='$email'");
|
||||||
|
|
||||||
// Ce gre slucajno za virtualko
|
// Ce gre slucajno za virtualko
|
||||||
$Subject = ($virtual_domain) ? $lang['lost_pass_subject_virtual'] : $lang['lost_pass_subject'];
|
$Subject = (isVirtual()) ? $lang['lost_pass_subject_virtual'] : $lang['lost_pass_subject'];
|
||||||
|
|
||||||
$Content = $lang['lost_pass_mail'];
|
$Content = $lang['lost_pass_mail'];
|
||||||
|
|
||||||
$PageName = $app_settings['app_name'];
|
$PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
|
||||||
|
|
||||||
$ZaMail = '<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN">'.'<html><head> <title>'.$Subject.'</title><meta content="text/html; charset=utf-8" http-equiv=Content-type></head><body>';
|
$ZaMail = '<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN">'.'<html><head> <title>'.$Subject.'</title><meta content="text/html; charset=utf-8" http-equiv=Content-type></head><body>';
|
||||||
|
|
||||||
@ -1804,7 +1787,7 @@ class ApiLogin
|
|||||||
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
|
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
|
||||||
|
|
||||||
// Ce gre slucajno za virtualko
|
// Ce gre slucajno za virtualko
|
||||||
if($virtual_domain)
|
if(isVirtual())
|
||||||
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
|
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
|
||||||
|
|
||||||
if ($LoginWith == 1) {
|
if ($LoginWith == 1) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
include_once '../../settings.php';
|
include_once '../../settings.php';
|
||||||
include_once '../../settings_optional.php';
|
|
||||||
include_once '../../function.php';
|
include_once '../../function.php';
|
||||||
include_once '../../vendor/autoload.php';
|
include_once '../../vendor/autoload.php';
|
||||||
|
|
||||||
@ -11,7 +10,7 @@
|
|||||||
$login->executeAction($params=array('action'=>'login_facebook'), $data=array());
|
$login->executeAction($params=array('action'=>'login_facebook'), $data=array());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header ('location: https://www.facebook.com/v2.10/dialog/oauth?client_id=' .$facebook_appid .'&redirect_uri=https://www.1ka.si/frontend/api/fb_login.php&auth_type=rerequest&scope=email,public_profile');
|
header ('location: https://www.facebook.com/v2.10/dialog/oauth?client_id=' .AppSettings::getInstance()->getSetting('facebook-appid') .'&redirect_uri=https://www.1ka.si/frontend/api/fb_login.php&auth_type=rerequest&scope=email,public_profile');
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -76,7 +76,6 @@ class DisplayDatabase{
|
|||||||
public function displayUpdate($update){
|
public function displayUpdate($update){
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $lang;
|
global $lang;
|
||||||
global $debug;
|
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
|
|
||||||
echo '<p>'.$lang['install_database_update'].'</p>';
|
echo '<p>'.$lang['install_database_update'].'</p>';
|
||||||
@ -86,7 +85,7 @@ class DisplayDatabase{
|
|||||||
echo '<p>'.$lang['install_database_version_update'].': <b>'.$update['new_version'].'</b></p>';
|
echo '<p>'.$lang['install_database_version_update'].': <b>'.$update['new_version'].'</b></p>';
|
||||||
|
|
||||||
// Ce smo admin ali v debugu izpisemo tudi vrstice za update
|
// Ce smo admin ali v debugu izpisemo tudi vrstice za update
|
||||||
if($admin_type == '0' || $debug == '1'){
|
if($admin_type == '0' || isDebug()){
|
||||||
|
|
||||||
foreach ($update['update_lines'] as $key => $update_line) {
|
foreach ($update['update_lines'] as $key => $update_line) {
|
||||||
echo $update_line.'<br /><br />';
|
echo $update_line.'<br /><br />';
|
||||||
|
@ -56,7 +56,6 @@ class DisplaySettings{
|
|||||||
private function displaySettingsApp(){
|
private function displaySettingsApp(){
|
||||||
global $lang;
|
global $lang;
|
||||||
global $app_settings;
|
global $app_settings;
|
||||||
global $confirm_registration;
|
|
||||||
|
|
||||||
echo '<h3>'.$lang['install_settings_app_title'].'</h3>';
|
echo '<h3>'.$lang['install_settings_app_title'].'</h3>';
|
||||||
|
|
||||||
@ -170,8 +169,8 @@ class DisplaySettings{
|
|||||||
echo '<div class="settings_item radio">';
|
echo '<div class="settings_item radio">';
|
||||||
echo ' <div class="what">'.$lang['install_settings_confirm_registration'].':</div>';
|
echo ' <div class="what">'.$lang['install_settings_confirm_registration'].':</div>';
|
||||||
echo ' <div class="value">';
|
echo ' <div class="value">';
|
||||||
echo ' <input type="radio" name="confirm_registration" id="confirm_registration_0" value="0" '.($confirm_registration != '1' ? 'checked="checked"' : '').'><label for="confirm_registration_0">'.$lang['no'].'</label>';
|
echo ' <input type="radio" name="confirm_registration" id="confirm_registration_0" value="0" '.(!AppSettings::getInstance()->getSetting('confirm_registration') ? 'checked="checked"' : '').'><label for="confirm_registration_0">'.$lang['no'].'</label>';
|
||||||
echo ' <input type="radio" name="confirm_registration" id="confirm_registration_1" value="1" '.($confirm_registration == '1' ? 'checked="checked"' : '').'><label for="confirm_registration_1">'.$lang['yes'].'</label>';
|
echo ' <input type="radio" name="confirm_registration" id="confirm_registration_1" value="1" '.(AppSettings::getInstance()->getSetting('confirm_registration') ? 'checked="checked"' : '').'><label for="confirm_registration_1">'.$lang['yes'].'</label>';
|
||||||
echo ' </div>';
|
echo ' </div>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
@ -248,8 +247,6 @@ class DisplaySettings{
|
|||||||
|
|
||||||
private function displaySettingsGoogle(){
|
private function displaySettingsGoogle(){
|
||||||
global $lang;
|
global $lang;
|
||||||
global $recaptcha_sitekey;
|
|
||||||
global $secret_captcha;
|
|
||||||
global $google_maps_API_key;
|
global $google_maps_API_key;
|
||||||
|
|
||||||
echo '<h3>'.$lang['install_settings_google_title'].'</h3>';
|
echo '<h3>'.$lang['install_settings_google_title'].'</h3>';
|
||||||
@ -257,19 +254,19 @@ class DisplaySettings{
|
|||||||
// Google recaptcha_sitekey
|
// Google recaptcha_sitekey
|
||||||
echo '<div class="settings_item text">';
|
echo '<div class="settings_item text">';
|
||||||
echo ' <div class="what">'.$lang['install_settings_recaptcha_sitekey'].':</div>';
|
echo ' <div class="what">'.$lang['install_settings_recaptcha_sitekey'].':</div>';
|
||||||
echo ' <div class="value"><input type="text" name="recaptcha_sitekey" value="'.$recaptcha_sitekey.'"></div>';
|
echo ' <div class="value"><input type="text" name="recaptcha_sitekey" value="'.AppSettings::getInstance()->getSetting('google-recaptcha_sitekey').'"></div>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
// Google secret_captcha
|
// Google secret_captcha
|
||||||
echo '<div class="settings_item text">';
|
echo '<div class="settings_item text">';
|
||||||
echo ' <div class="what">'.$lang['install_settings_secret_captcha'].':</div>';
|
echo ' <div class="what">'.$lang['install_settings_secret_captcha'].':</div>';
|
||||||
echo ' <div class="value"><input type="text" name="secret_captcha" value="'.$secret_captcha.'"></div>';
|
echo ' <div class="value"><input type="text" name="secret_captcha" value="'.AppSettings::getInstance()->getSetting('google-secret_captcha').'"></div>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
// Google google_maps_API_key
|
// Google google_maps_API_key
|
||||||
echo '<div class="settings_item text">';
|
echo '<div class="settings_item text">';
|
||||||
echo ' <div class="what">'.$lang['install_settings_google_maps_API_key'].':</div>';
|
echo ' <div class="what">'.$lang['install_settings_google_maps_API_key'].':</div>';
|
||||||
echo ' <div class="value"><input type="text" name="google_maps_API_key" value="'.$google_maps_API_key.'"></div>';
|
echo ' <div class="value"><input type="text" name="google_maps_API_key" value="'.AppSettings::getInstance()->getSetting('google-maps_API_key').'"></div>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,10 +120,9 @@ class UserAccess{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function __construct($usr_id){
|
private function __construct($usr_id){
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
// Ce so paketi onemogoceni nič ne preverjamo
|
// Ce so paketi onemogoceni nič ne preverjamo
|
||||||
if(!isset($app_settings['commercial_packages']) || $app_settings['commercial_packages'] == false){
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') !== true){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,13 +228,12 @@ class UserAccess{
|
|||||||
|
|
||||||
// Preverimo ce ima uporabnik dostop do neke funkcionalnosti
|
// Preverimo ce ima uporabnik dostop do neke funkcionalnosti
|
||||||
public function checkUserAccess($what=''){
|
public function checkUserAccess($what=''){
|
||||||
global $app_settings;
|
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
global $global_user_id;
|
global $global_user_id;
|
||||||
global $mysql_database_name;
|
global $mysql_database_name;
|
||||||
|
|
||||||
// Ce so paketi onemogoceni vrnemo vedno true
|
// Ce so paketi onemogoceni vrnemo vedno true
|
||||||
if(!isset($app_settings['commercial_packages']) || $app_settings['commercial_packages'] == false){
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') !== true){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,11 +275,10 @@ class UserAccess{
|
|||||||
|
|
||||||
// Vrnemo paket uporabnika
|
// Vrnemo paket uporabnika
|
||||||
public function getPackage(){
|
public function getPackage(){
|
||||||
global $app_settings;
|
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
|
|
||||||
// Ce so paketi onemogoceni vrnemo -1
|
// Ce so paketi onemogoceni vrnemo -1
|
||||||
if(!isset($app_settings['commercial_packages']) || $app_settings['commercial_packages'] == false){
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') !== true){
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -419,7 +419,7 @@ class UserNarocila{
|
|||||||
|
|
||||||
// Izpisemo seznam vseh narocil - admin
|
// Izpisemo seznam vseh narocil - admin
|
||||||
public function displayNarocilaTableAdmin(){
|
public function displayNarocilaTableAdmin(){
|
||||||
global $lang, $global_user_id, $app_settings;
|
global $lang, $global_user_id;
|
||||||
|
|
||||||
// Admini vidijo vsa narocila
|
// Admini vidijo vsa narocila
|
||||||
$data = $this->getNarocila();
|
$data = $this->getNarocila();
|
||||||
@ -492,7 +492,7 @@ class UserNarocila{
|
|||||||
echo $lang['srv_narocilo_status_'.$data_row['status']];
|
echo $lang['srv_narocilo_status_'.$data_row['status']];
|
||||||
|
|
||||||
// Na www.1ka.si lahko narocilo placa samo Goran
|
// Na www.1ka.si lahko narocilo placa samo Goran
|
||||||
if($data_row['status'] != '1' && $data_row['status'] != '2' && ($app_settings['app_name'] != 'www.1ka.si' || $global_user_id == '112696')){
|
if($data_row['status'] != '1' && $data_row['status'] != '2' && (AppSettings::getInstance()->getSetting('app_settings-app_name') != 'www.1ka.si' || $global_user_id == '112696')){
|
||||||
echo '<br />';
|
echo '<br />';
|
||||||
echo '<span class="as_link" onClick="urediNarociloPay(\''.$data_row['id'].'\')">'.$lang['srv_narocilo_placaj'].'</span>';
|
echo '<span class="as_link" onClick="urediNarociloPay(\''.$data_row['id'].'\')">'.$lang['srv_narocilo_placaj'].'</span>';
|
||||||
|
|
||||||
|
@ -29,10 +29,9 @@ class UserNarocilaCebelica{
|
|||||||
|
|
||||||
|
|
||||||
public function __construct($narocilo_id=0){
|
public function __construct($narocilo_id=0){
|
||||||
global $cebelica_api;
|
|
||||||
|
|
||||||
// Api koda za komunikacijo s cebelico
|
// Api koda za komunikacijo s cebelico
|
||||||
define("API_KODA", $cebelica_api);
|
define("API_KODA", AppSettings::getInstance()->getSetting('cebelica_api'));
|
||||||
|
|
||||||
if($narocilo_id > 0){
|
if($narocilo_id > 0){
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ class UserNarocilaCron{
|
|||||||
|
|
||||||
|
|
||||||
public function __construct(){
|
public function __construct(){
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,10 +21,7 @@ class UserNarocilaPaypal{
|
|||||||
private $paypal_client;
|
private $paypal_client;
|
||||||
|
|
||||||
|
|
||||||
public function __construct($narocilo_id){
|
public function __construct($narocilo_id){
|
||||||
global $app_settings;
|
|
||||||
global $paypal_client_id;
|
|
||||||
global $paypal_secret;
|
|
||||||
global $mysql_database_name;
|
global $mysql_database_name;
|
||||||
|
|
||||||
if($narocilo_id > 0){
|
if($narocilo_id > 0){
|
||||||
@ -43,9 +40,9 @@ class UserNarocilaPaypal{
|
|||||||
|
|
||||||
// Ustvarimo okolje za paypal
|
// Ustvarimo okolje za paypal
|
||||||
if($mysql_database_name == 'real1kasi')
|
if($mysql_database_name == 'real1kasi')
|
||||||
$environment = new ProductionEnvironment($paypal_client_id, $paypal_secret);
|
$environment = new ProductionEnvironment(AppSettings::getInstance()->getSetting('paypal-client_id'), AppSettings::getInstance()->getSetting('paypal-secret'));
|
||||||
else
|
else
|
||||||
$environment = new SandboxEnvironment($paypal_client_id, $paypal_secret);
|
$environment = new SandboxEnvironment(AppSettings::getInstance()->getSetting('paypal-client_id'), AppSettings::getInstance()->getSetting('paypal-secret'));
|
||||||
|
|
||||||
$this->paypal_client = new PayPalHttpClient($environment);
|
$this->paypal_client = new PayPalHttpClient($environment);
|
||||||
}
|
}
|
||||||
|
@ -25,11 +25,8 @@ class UserNarocilaStripe{
|
|||||||
|
|
||||||
|
|
||||||
public function __construct($narocilo_id){
|
public function __construct($narocilo_id){
|
||||||
global $app_settings;
|
|
||||||
global $stripe_secret;
|
|
||||||
global $stripe_key;
|
|
||||||
|
|
||||||
$this->stripeService = new \Stripe\StripeClient($stripe_secret);
|
$this->stripeService = new \Stripe\StripeClient(AppSettings::getInstance()->getSetting('stripe-secret'));
|
||||||
|
|
||||||
if($narocilo_id > 0){
|
if($narocilo_id > 0){
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ class UserPlacila{
|
|||||||
|
|
||||||
// Izpisemo podatke o placilih
|
// Izpisemo podatke o placilih
|
||||||
public function displayPlacila(){
|
public function displayPlacila(){
|
||||||
global $lang, $global_user_id, $app_settings;
|
global $lang, $global_user_id;
|
||||||
|
|
||||||
// Tabela vseh placil
|
// Tabela vseh placil
|
||||||
$this->displayPlacilaTable();
|
$this->displayPlacilaTable();
|
||||||
@ -116,13 +116,13 @@ class UserPlacila{
|
|||||||
echo '</div>';*/
|
echo '</div>';*/
|
||||||
|
|
||||||
// Izracun zasluzka in provizij po mesecih - samo Goran
|
// Izracun zasluzka in provizij po mesecih - samo Goran
|
||||||
if($app_settings['app_name'] == 'www.1ka.si' && $global_user_id == '112696')
|
if(AppSettings::getInstance()->getSetting('app_settings-app_name') == 'www.1ka.si' && $global_user_id == '112696')
|
||||||
$this->displayPlacilaPovzetek();
|
$this->displayPlacilaPovzetek();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Izpisemo seznam vseh placil
|
// Izpisemo seznam vseh placil
|
||||||
public function displayPlacilaTable(){
|
public function displayPlacilaTable(){
|
||||||
global $lang, $global_user_id, $app_settings;
|
global $lang, $global_user_id;
|
||||||
|
|
||||||
// Admini vidijo vsa placila
|
// Admini vidijo vsa placila
|
||||||
$data = $this->getPlacila();
|
$data = $this->getPlacila();
|
||||||
@ -194,7 +194,7 @@ class UserPlacila{
|
|||||||
// Edit / delete
|
// Edit / delete
|
||||||
echo '<td>';
|
echo '<td>';
|
||||||
// Na www.1ka.si lahko placilo ureja samo Goran
|
// Na www.1ka.si lahko placilo ureja samo Goran
|
||||||
if($app_settings['app_name'] != 'www.1ka.si' || $global_user_id == '112696'){
|
if(AppSettings::getInstance()->getSetting('app_settings-app_name') != 'www.1ka.si' || $global_user_id == '112696'){
|
||||||
|
|
||||||
// Uredi
|
// Uredi
|
||||||
echo '<a href="#" onClick="displayPlaciloPopup(\''.$data_row['id'].'\')" title="'.$lang['srv_placila_edit'].'"><i class="fa fa-pencil-alt link-sv-moder"></i></a> <span class="no-print"> | </span>';
|
echo '<a href="#" onClick="displayPlaciloPopup(\''.$data_row['id'].'\')" title="'.$lang['srv_placila_edit'].'"><i class="fa fa-pencil-alt link-sv-moder"></i></a> <span class="no-print"> | </span>';
|
||||||
|
@ -50,13 +50,11 @@ class DisplayController{
|
|||||||
|
|
||||||
public function displayHead(){
|
public function displayHead(){
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $app_settings;
|
|
||||||
global $lang;
|
global $lang;
|
||||||
global $aai_instalacija;
|
|
||||||
|
|
||||||
|
|
||||||
// Google analytics za AAI
|
// Google analytics za AAI
|
||||||
if(isset($aai_instalacija) && $aai_instalacija == true){
|
if(isAAI()){
|
||||||
echo '<!-- Global site tag (gtag.js) - Google Analytics -->
|
echo '<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-141542153-2"></script>
|
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-141542153-2"></script>
|
||||||
<script>
|
<script>
|
||||||
@ -86,8 +84,8 @@ class DisplayController{
|
|||||||
echo ' <meta name="revisit-after" content="7">';
|
echo ' <meta name="revisit-after" content="7">';
|
||||||
|
|
||||||
// Custom header title
|
// Custom header title
|
||||||
if(isset($app_settings['head_title_custom']) && $app_settings['head_title_custom'] == 1){
|
if(AppSettings::getInstance()->getSetting('app_settings-head_title_custom')){
|
||||||
echo '<title>'.$app_settings['head_title_text'].'</title>' . "\n";
|
echo '<title>'.AppSettings::getInstance()->getSetting('app_settings-head_title_text').'</title>' . "\n";
|
||||||
}
|
}
|
||||||
// Default header title
|
// Default header title
|
||||||
else{
|
else{
|
||||||
@ -115,8 +113,6 @@ class DisplayController{
|
|||||||
public function displayHeader(){
|
public function displayHeader(){
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $lang;
|
global $lang;
|
||||||
global $google_login_client_id;
|
|
||||||
global $aai_instalacija;
|
|
||||||
|
|
||||||
|
|
||||||
// Logo v glavi
|
// Logo v glavi
|
||||||
@ -124,7 +120,7 @@ class DisplayController{
|
|||||||
|
|
||||||
echo ' <a href="'.$site_url.$this->root.'index.php">';
|
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">';
|
echo ' <img src="'.$site_url.'/public/img/logo/1ka_'.($this->lang_id != 1 ? 'eng' : 'slo').'.svg">';
|
||||||
if($aai_instalacija){
|
if(isAAI()){
|
||||||
echo ' <img src="'.$site_url.'/public/img/logo/arnes_logo.png" style="margin-left:30px;">';
|
echo ' <img src="'.$site_url.'/public/img/logo/arnes_logo.png" style="margin-left:30px;">';
|
||||||
}
|
}
|
||||||
echo ' </a>';
|
echo ' </a>';
|
||||||
@ -163,7 +159,6 @@ class DisplayController{
|
|||||||
|
|
||||||
// Izris vsebine
|
// Izris vsebine
|
||||||
public function displayMain(){
|
public function displayMain(){
|
||||||
global $virtual_domain;
|
|
||||||
|
|
||||||
switch($this->stran){
|
switch($this->stran){
|
||||||
|
|
||||||
@ -180,35 +175,35 @@ class DisplayController{
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
/*case 'register':
|
/*case 'register':
|
||||||
if(!$virtual_domain)
|
if(!isVirtual())
|
||||||
$this->displayRegisterPage();
|
$this->displayRegisterPage();
|
||||||
else
|
else
|
||||||
$this->displayFrontPage();
|
$this->displayFrontPage();
|
||||||
break;*/
|
break;*/
|
||||||
|
|
||||||
case 'register_confirm':
|
case 'register_confirm':
|
||||||
if(!$virtual_domain)
|
if(!isVirtual())
|
||||||
$this->displayRegisterPageConfirm();
|
$this->displayRegisterPageConfirm();
|
||||||
else
|
else
|
||||||
$this->displayFrontPage();
|
$this->displayFrontPage();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'register_email':
|
case 'register_email':
|
||||||
if(!$virtual_domain)
|
if(!isVirtual())
|
||||||
$this->displayRegisterPageEmail();
|
$this->displayRegisterPageEmail();
|
||||||
else
|
else
|
||||||
$this->displayFrontPage();
|
$this->displayFrontPage();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'unregister':
|
case 'unregister':
|
||||||
if(!$virtual_domain)
|
if(!isVirtual())
|
||||||
$this->displayUnregisterPage();
|
$this->displayUnregisterPage();
|
||||||
else
|
else
|
||||||
$this->displayFrontPage();
|
$this->displayFrontPage();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'unregister_confirm':
|
case 'unregister_confirm':
|
||||||
if(!$virtual_domain)
|
if(!isVirtual())
|
||||||
$this->displayUnregisterPageConfirm();
|
$this->displayUnregisterPageConfirm();
|
||||||
else
|
else
|
||||||
$this->displayFrontPage();
|
$this->displayFrontPage();
|
||||||
@ -236,17 +231,14 @@ class DisplayController{
|
|||||||
|
|
||||||
// Izris footerja
|
// Izris footerja
|
||||||
public function displayFooter(){
|
public function displayFooter(){
|
||||||
global $virtual_domain;
|
|
||||||
global $lang;
|
global $lang;
|
||||||
global $app_settings;
|
|
||||||
global $aai_instalacija;
|
|
||||||
|
|
||||||
|
|
||||||
// Stolpec 1
|
// Stolpec 1
|
||||||
echo '<div class="col">';
|
echo '<div class="col">';
|
||||||
echo ' <h2>'.$lang['simple_footer_about'].'</h2>';
|
echo ' <h2>'.$lang['simple_footer_about'].'</h2>';
|
||||||
echo ' <span>'.$lang['simple_footer_about_1ka'].'</span>';
|
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_faq'].'</span>';
|
||||||
echo ' <span>'.$lang['simple_footer_about_general'].'</span>';
|
echo ' <span>'.$lang['simple_footer_about_general'].'</span>';
|
||||||
echo ' <span>'.$lang['simple_footer_about_privacy'].'</span>';
|
echo ' <span>'.$lang['simple_footer_about_privacy'].'</span>';
|
||||||
@ -262,9 +254,9 @@ class DisplayController{
|
|||||||
// Stolpec 2
|
// Stolpec 2
|
||||||
echo '<div class="col">';
|
echo '<div class="col">';
|
||||||
echo ' <h2>'.$lang['simple_footer_company'].'</h2>';
|
echo ' <h2>'.$lang['simple_footer_company'].'</h2>';
|
||||||
echo ' <span class="semi-bold">'.$app_settings['owner'].'</span>';
|
echo ' <span class="semi-bold">'.AppSettings::getInstance()->getSetting('app_settings-owner').'</span>';
|
||||||
echo ' <span><a href="mailto:'.$app_settings['admin_email'].'">'.$app_settings['admin_email'].'</a></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="'.$app_settings['owner_website'].'" target="_blank">'.$app_settings['owner_website'].'</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>';
|
echo '</div>';
|
||||||
|
|
||||||
|
|
||||||
@ -272,7 +264,7 @@ class DisplayController{
|
|||||||
echo '<div class="col">';
|
echo '<div class="col">';
|
||||||
|
|
||||||
// Logotipa FDV in CDI - samo pri virtualkah
|
// Logotipa FDV in CDI - samo pri virtualkah
|
||||||
if($virtual_domain || $aai_instalacija){
|
if(isVirtual() || isAAI()){
|
||||||
echo '<div class="logo_holder">';
|
echo '<div class="logo_holder">';
|
||||||
echo ' <img src="'.$site_url.'/public/img/logo/fdv.png">';
|
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 ' <img src="'.$site_url.'/public/img/logo/cdi_'.($this->lang_id != 1 ? 'eng' : 'slo').'.png">';
|
||||||
@ -285,10 +277,9 @@ class DisplayController{
|
|||||||
|
|
||||||
// Izris prve strani
|
// Izris prve strani
|
||||||
private function displayFrontPage(){
|
private function displayFrontPage(){
|
||||||
global $aai_instalacija;
|
|
||||||
|
|
||||||
// AAI
|
// AAI
|
||||||
if($aai_instalacija)
|
if(isAAI())
|
||||||
$this->displayFrontPageFormAAI();
|
$this->displayFrontPageFormAAI();
|
||||||
else
|
else
|
||||||
$this->displayFrontPageForm();
|
$this->displayFrontPageForm();
|
||||||
@ -298,18 +289,16 @@ class DisplayController{
|
|||||||
private function displayFrontPageForm(){
|
private function displayFrontPageForm(){
|
||||||
global $lang;
|
global $lang;
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $app_settings;
|
|
||||||
global $virtual_domain;
|
|
||||||
|
|
||||||
|
|
||||||
echo '<div class="app_title">'.$app_settings['app_name'].'</div>';
|
echo '<div class="app_title">'.AppSettings::getInstance()->getSetting('app_settings-app_name').'</div>';
|
||||||
|
|
||||||
|
|
||||||
// WHITE BOX FOR LOGIN / REGISTRATION
|
// 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
|
// Tabs - samo pri lastni instalaciji, pri virtualkah nimamo registracije
|
||||||
if($virtual_domain){
|
if(isVirtual()){
|
||||||
echo ' <div class="tabs">';
|
echo ' <div class="tabs">';
|
||||||
echo ' <div class="tab full_width">'.$lang['login_short'].'</div>';
|
echo ' <div class="tab full_width">'.$lang['login_short'].'</div>';
|
||||||
echo ' </div>';
|
echo ' </div>';
|
||||||
@ -323,10 +312,10 @@ class DisplayController{
|
|||||||
|
|
||||||
// SKB ima blokirano prijavo za vse ipje razen svojega
|
// SKB ima blokirano prijavo za vse ipje razen svojega
|
||||||
$ip = $_SERVER['REMOTE_ADDR'];
|
$ip = $_SERVER['REMOTE_ADDR'];
|
||||||
if(isset($app_settings['admin_allow_only_ip'])
|
$admin_allow_only_ip = AppSettings::getInstance()->getSetting('app_limits-admin_allow_only_ip');
|
||||||
&& $app_settings['admin_allow_only_ip'] != ''
|
if($admin_allow_only_ip !== false
|
||||||
&& !empty($app_settings['admin_allow_only_ip'])
|
&& !empty($admin_allow_only_ip)
|
||||||
&& !in_array($ip, $app_settings['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>';
|
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>';
|
||||||
}
|
}
|
||||||
@ -347,7 +336,7 @@ class DisplayController{
|
|||||||
|
|
||||||
// APP SUBTITLE
|
// APP SUBTITLE
|
||||||
echo '<div class="app_subtitle">';
|
echo '<div class="app_subtitle">';
|
||||||
if($virtual_domain)
|
if(isVirtual())
|
||||||
echo $lang['app_virtual_domain'];
|
echo $lang['app_virtual_domain'];
|
||||||
else
|
else
|
||||||
echo $lang['app_installation'];
|
echo $lang['app_installation'];
|
||||||
@ -358,14 +347,13 @@ class DisplayController{
|
|||||||
private function displayFrontPageFormAAI(){
|
private function displayFrontPageFormAAI(){
|
||||||
global $lang;
|
global $lang;
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
|
|
||||||
// WHITE BOX FOR LOGIN / REGISTRATION
|
// WHITE BOX FOR LOGIN / REGISTRATION
|
||||||
echo '<div class="landing_page_window">';
|
echo '<div class="landing_page_window">';
|
||||||
|
|
||||||
// APP TITLE - aai
|
// APP TITLE - aai
|
||||||
echo '<div class="app_title" style="text-transform: initial;">'.$app_settings['app_name'].'</div>';
|
echo '<div class="app_title" style="text-transform: initial;">'.AppSettings::getInstance()->getSetting('app_settings-app_name').'</div>';
|
||||||
|
|
||||||
// AAI logo
|
// AAI logo
|
||||||
//echo '<div class="arnes_logo"><img src="'.$site_url.'/public/img/logo/arnes_logo.png"></div>';
|
//echo '<div class="arnes_logo"><img src="'.$site_url.'/public/img/logo/arnes_logo.png"></div>';
|
||||||
@ -447,8 +435,6 @@ class DisplayController{
|
|||||||
private function displayFrontPageRegistration(){
|
private function displayFrontPageRegistration(){
|
||||||
global $lang;
|
global $lang;
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $secret_captcha;
|
|
||||||
global $recaptcha_sitekey;
|
|
||||||
|
|
||||||
if(!isset($_GET['a']) || $_GET['a'] != 'register'){
|
if(!isset($_GET['a']) || $_GET['a'] != 'register'){
|
||||||
$email = '';
|
$email = '';
|
||||||
@ -493,8 +479,8 @@ class DisplayController{
|
|||||||
echo ' <input class="regfield '.(isset($error['ime']) ? 'red' : '').'" id="ime" name="ime" value="'.$ime.'" placeholder="'.$lang['cms_register_user_nickname'].'" type="text">';
|
echo ' <input class="regfield '.(isset($error['ime']) ? 'red' : '').'" id="ime" name="ime" value="'.$ime.'" placeholder="'.$lang['cms_register_user_nickname'].'" type="text">';
|
||||||
|
|
||||||
// RECAPTCHA
|
// RECAPTCHA
|
||||||
if($secret_captcha != '' && $recaptcha_sitekey != '')
|
if(AppSettings::getInstance()->getSetting('google-secret_captcha') !== false && AppSettings::getInstance()->getSetting('google-recaptcha_sitekey') !== false)
|
||||||
echo ' <div class="g-recaptcha" data-sitekey="'.$recaptcha_sitekey.'" '.(isset($_GET['invalid_recaptcha']) ? ' style="border:1px red solid"' : '').'></div>';
|
echo ' <div class="g-recaptcha" data-sitekey="'.AppSettings::getInstance()->getSetting('google-recaptcha_sitekey').'" '.(isset($_GET['invalid_recaptcha']) ? ' style="border:1px red solid"' : '').'></div>';
|
||||||
|
|
||||||
// Geslo
|
// Geslo
|
||||||
echo ' <label for="p1" '.(isset($error['password']) ? 'class="red"' : '').'>'.$lang['login_password'].':</label>';
|
echo ' <label for="p1" '.(isset($error['password']) ? 'class="red"' : '').'>'.$lang['login_password'].':</label>';
|
||||||
@ -653,8 +639,6 @@ class DisplayController{
|
|||||||
private function displayRegisterPage(){
|
private function displayRegisterPage(){
|
||||||
global $lang;
|
global $lang;
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $secret_captcha;
|
|
||||||
global $recaptcha_sitekey;
|
|
||||||
|
|
||||||
// Pogledamo ce imamo kaksen error v GET-u
|
// Pogledamo ce imamo kaksen error v GET-u
|
||||||
$error = false;
|
$error = false;
|
||||||
@ -693,8 +677,8 @@ class DisplayController{
|
|||||||
echo ' <input class="regfield" id="ime" name="ime" value="'.$ime.'" placeholder="'.$lang['cms_register_user_nickname'].'" type="text"></div>';
|
echo ' <input class="regfield" id="ime" name="ime" value="'.$ime.'" placeholder="'.$lang['cms_register_user_nickname'].'" type="text"></div>';
|
||||||
|
|
||||||
// RECAPTCHA
|
// RECAPTCHA
|
||||||
if($secret_captcha != '' && $recaptcha_sitekey != '')
|
if(AppSettings::getInstance()->getSetting('google-secret_captcha') !== false && AppSettings::getInstance()->getSetting('google-recaptcha_sitekey') !== false)
|
||||||
echo '<div class="g-recaptcha" data-sitekey="'.$recaptcha_sitekey.'" '.(isset($_GET['invalid_recaptcha']) ? ' style="border:1px red solid"' : '').'></div>';
|
echo '<div class="g-recaptcha" data-sitekey="'.AppSettings::getInstance()->getSetting('google-recaptcha_sitekey').'" '.(isset($_GET['invalid_recaptcha']) ? ' style="border:1px red solid"' : '').'></div>';
|
||||||
|
|
||||||
// Geslo
|
// 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 ' <div class="form_row '.(isset($_GET['pass_mismatch']) || isset($_GET['pass_complex']) ? ' red' : '').'"><span class="label"><label for="geslo">'.$lang['login_password'].':</label></span>';
|
||||||
@ -785,7 +769,6 @@ class DisplayController{
|
|||||||
global $lang;
|
global $lang;
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $confirm_registration;
|
|
||||||
|
|
||||||
// Ce nimamo poslanega emaila preusmerimo nazaj na prvo stran registracije
|
// Ce nimamo poslanega emaila preusmerimo nazaj na prvo stran registracije
|
||||||
if(empty($_GET['e'])){
|
if(empty($_GET['e'])){
|
||||||
@ -801,7 +784,7 @@ class DisplayController{
|
|||||||
echo ' <h1>'.$lang['user_confirm_h'].'</h1>';
|
echo ' <h1>'.$lang['user_confirm_h'].'</h1>';
|
||||||
|
|
||||||
// Ce iammo vklopljeno potrjevanje s strani admina je text drugacen
|
// 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>';
|
echo ' <p>'.str_replace("SFMAIL", $email, $lang['user_confirm_p_admin']).'</p>';
|
||||||
else
|
else
|
||||||
echo ' <p>'.str_replace("SFMAIL", $email, $lang['user_confirm_p']).'</p>';
|
echo ' <p>'.str_replace("SFMAIL", $email, $lang['user_confirm_p']).'</p>';
|
||||||
@ -977,10 +960,9 @@ class DisplayController{
|
|||||||
// Cookie notice
|
// Cookie notice
|
||||||
public function displayCookieNotice(){
|
public function displayCookieNotice(){
|
||||||
global $lang;
|
global $lang;
|
||||||
global $aai_instalacija;
|
|
||||||
global $cookie_domain;
|
global $cookie_domain;
|
||||||
|
|
||||||
if(!$aai_instalacija){
|
if(!isAAI()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
/********** BODY **********/
|
/********** BODY **********/
|
||||||
echo '<body class="'.($_GET['a'] == '' ? 'landing_page' : $_GET['a']).'">';
|
echo '<body class="'.($_GET['a'] == '' ? 'landing_page' : $_GET['a']).'">';
|
||||||
|
|
||||||
echo '<div id="content" '.($aai_instalacija ? 'class="aai"' : '').'>';
|
echo '<div id="content" '.(isAAI() ? 'class="aai"' : '').'>';
|
||||||
|
|
||||||
|
|
||||||
// Glava
|
// Glava
|
||||||
@ -46,7 +46,6 @@
|
|||||||
|
|
||||||
|
|
||||||
// Vsebina strani
|
// Vsebina strani
|
||||||
global $aai_instalacija;
|
|
||||||
echo '<div id="main">';
|
echo '<div id="main">';
|
||||||
|
|
||||||
echo '<div class="main_content">';
|
echo '<div class="main_content">';
|
||||||
|
608
function.php
608
function.php
@ -26,9 +26,7 @@ if (!function_exists('apache_request_headers')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
// Osnovne nastavitve instalacije (path, sql baza)
|
||||||
* Osnovne nastavitve instalacije (path, sql baza)
|
|
||||||
*/
|
|
||||||
include('settings.php');
|
include('settings.php');
|
||||||
|
|
||||||
// overridi za kopije
|
// overridi za kopije
|
||||||
@ -42,41 +40,24 @@ if (getenv('apache_keep_domain') != '') $keep_domain = getenv('apache_keep_domai
|
|||||||
if (getenv('apache_facebook_appid') != '') $facebook_appid = getenv('apache_facebook_appid');
|
if (getenv('apache_facebook_appid') != '') $facebook_appid = getenv('apache_facebook_appid');
|
||||||
if (getenv('apache_facebook_appsecret') != '') $facebook_appsecret = getenv('apache_facebook_appsecret');
|
if (getenv('apache_facebook_appsecret') != '') $facebook_appsecret = getenv('apache_facebook_appsecret');
|
||||||
|
|
||||||
|
|
||||||
if ($pass_salt == "") die ("Please set unique pass_salt in settings.php!");
|
if ($pass_salt == "") die ("Please set unique pass_salt in settings.php!");
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Dodatne opcijske nastavitve
|
|
||||||
* Če se ne potrebujejo ni potrebno da datoteka obstaja
|
|
||||||
*/
|
|
||||||
if(file_exists($site_path.'settings_optional.php')){
|
|
||||||
include $site_path.'settings_optional.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// igramo se z jezikom...
|
// igramo se z jezikom...
|
||||||
if (isset ($_GET['overridelang']) && is_numeric($_GET['overridelang'])) {
|
if (isset ($_GET['overridelang']) && is_numeric($_GET['overridelang'])) {
|
||||||
$_SESSION['overridelang'] = $_GET['overridelang'];
|
$_SESSION['overridelang'] = $_GET['overridelang'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (is_file($site_path . 'install')) die ("Please, finish instalation with removing 'install/' folder.");
|
// Nastavimo site_url v session
|
||||||
|
|
||||||
// Aplication type -- tip aplikacije
|
|
||||||
$aplication_type = 1; // 1 - navadna z backupom
|
|
||||||
// 2 - arhivska
|
|
||||||
// 3 - navadna brez backupa
|
|
||||||
|
|
||||||
// Za 1 je treba spremeniti pot v /admin/backup.php
|
|
||||||
// Za 2 je treba spremeniti pot v /admin/install.php
|
|
||||||
|
|
||||||
$_SESSION['site_url'] = $site_url;
|
$_SESSION['site_url'] = $site_url;
|
||||||
|
|
||||||
|
|
||||||
|
// Povezemo z bazo
|
||||||
if (!$connect_db = mysqli_connect($mysql_server, $mysql_username, $mysql_password, $mysql_database_name)) {
|
if (!$connect_db = mysqli_connect($mysql_server, $mysql_username, $mysql_password, $mysql_database_name)) {
|
||||||
die ('Please try again later [ERR: DB])');
|
die ('Please try again later [ERR: DB])');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// To je ostanek sispleta in verjetno ne sme biti več prisotno?
|
// To je ostanek sispleta in verjetno ne sme biti več prisotno?
|
||||||
//sisplet_query("SET character_set_results=latin1");
|
//sisplet_query("SET character_set_results=latin1");
|
||||||
|
|
||||||
@ -201,7 +182,7 @@ if (isset($_COOKIE)) {
|
|||||||
// SQL INJECT CHECK END
|
// SQL INJECT CHECK END
|
||||||
|
|
||||||
|
|
||||||
// Pohendlamo language
|
// POHENDLAMO LANGUAGE
|
||||||
unset ($lang);
|
unset ($lang);
|
||||||
|
|
||||||
if (isset ($_SESSION['overridelang']) && is_numeric($_SESSION['overridelang'])) {
|
if (isset ($_SESSION['overridelang']) && is_numeric($_SESSION['overridelang'])) {
|
||||||
@ -219,8 +200,7 @@ if (!isset ($lang)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Preberemo uid uporabnika
|
// NASTAVIMO TIP UPRABNIKA
|
||||||
// Uporabi global admin_type namesto da klices login 100x!
|
|
||||||
$admin_type = login();
|
$admin_type = login();
|
||||||
|
|
||||||
if ($admin_type > -1) {
|
if ($admin_type > -1) {
|
||||||
@ -229,7 +209,8 @@ if ($admin_type > -1) {
|
|||||||
if (mysqli_num_rows($result) > 0) {
|
if (mysqli_num_rows($result) > 0) {
|
||||||
$r = mysqli_fetch_row($result);
|
$r = mysqli_fetch_row($result);
|
||||||
$global_user_id = $r[0];
|
$global_user_id = $r[0];
|
||||||
} elseif (isset ($_COOKIE['ME'])) {
|
}
|
||||||
|
elseif (isset ($_COOKIE['ME'])) {
|
||||||
$db_meta_exists = mysqli_select_db($GLOBALS['connect_db'], "meta");
|
$db_meta_exists = mysqli_select_db($GLOBALS['connect_db'], "meta");
|
||||||
if ($db_meta_exists)
|
if ($db_meta_exists)
|
||||||
$result = sisplet_query("SELECT aid FROM administratorji WHERE email='" . base64_decode($_COOKIE['uid']) . "'");
|
$result = sisplet_query("SELECT aid FROM administratorji WHERE email='" . base64_decode($_COOKIE['uid']) . "'");
|
||||||
@ -242,95 +223,39 @@ if ($admin_type > -1) {
|
|||||||
}
|
}
|
||||||
mysqli_select_db($GLOBALS['connect_db'], $mysql_database_name);
|
mysqli_select_db($GLOBALS['connect_db'], $mysql_database_name);
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$global_user_id = 0;
|
$global_user_id = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Preverimo ce je spremenljivka countable (zaradi ogromno warningov v kodi, kjer se counta prazno spremenljivko)
|
|
||||||
if (!function_exists('is_countable')) {
|
|
||||||
function is_countable($var) {
|
|
||||||
return (is_array($var) || $var instanceof Countable);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Preverimo klike na minuto pri izpolnjevanju anekte da se ne zapolni sql
|
|
||||||
if(!checkClicksPerMinute()){
|
|
||||||
global $site_url;
|
|
||||||
|
|
||||||
$refresh_every = 5;
|
|
||||||
|
|
||||||
echo '<!DOCTYPE html>';
|
|
||||||
echo '<html>';
|
|
||||||
|
|
||||||
echo '<head>';
|
|
||||||
echo ' <title>Server Limit Reached</title>';
|
|
||||||
echo ' <meta http-equiv="refresh" content="'.$refresh_every.'" />';
|
|
||||||
echo ' <meta name="viewport" content="width=device-width, initial-scale=1.0" />';
|
|
||||||
|
|
||||||
echo ' <style>
|
|
||||||
body{
|
|
||||||
display: flex;
|
|
||||||
align-content: center;
|
|
||||||
height: 90vh;
|
|
||||||
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-content: center;
|
|
||||||
}
|
|
||||||
.main{
|
|
||||||
max-width: 1200px;
|
|
||||||
margin: 50px auto;
|
|
||||||
padding: 0 20px;
|
|
||||||
|
|
||||||
font-family: Montserrat, Arial, Sans-Serif !important;
|
|
||||||
color: #505050;
|
|
||||||
}
|
|
||||||
h1{
|
|
||||||
color: #1e88e5;
|
|
||||||
text-align: center;
|
|
||||||
margin: 30px 0;
|
|
||||||
}
|
|
||||||
hr{
|
|
||||||
margin: 50px 0;
|
|
||||||
|
|
||||||
border: 0;
|
|
||||||
border-top: 1px solid #ddeffd;
|
|
||||||
}
|
|
||||||
.loading{
|
|
||||||
margin: 50px 0;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
img{
|
|
||||||
width: 80px;
|
|
||||||
height: 80px;
|
|
||||||
}
|
|
||||||
</style>';
|
|
||||||
echo '</head>';
|
|
||||||
|
|
||||||
echo '<body><div class="main">';
|
|
||||||
echo ' <div class="loading"><img src="'.$site_url.'/public/img/icons/spinner.gif" /></div>';
|
|
||||||
echo ' <h1>Dosežena omejitev strežnika</h1>';
|
|
||||||
echo ' <h3>Prosimo, počakajte nekaj trenutkov. Trenutno je doseženo maksimalno število vnosov ankete na minuto.</h3>';
|
|
||||||
echo ' <hr>';
|
|
||||||
echo ' <h1>Server Limit Reached</h1>';
|
|
||||||
echo ' <h3>Please wait a few moments. Currently, the maximum number of survey entries per minute has been reached.</h3>';
|
|
||||||
echo '</div></body>';
|
|
||||||
|
|
||||||
echo '</html>';
|
|
||||||
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Preverimo tip hierarhije
|
// Preverimo tip hierarhije
|
||||||
$hierarhija_type = preveriTipHierarhije();
|
$hierarhija_type = preveriTipHierarhije();
|
||||||
|
|
||||||
|
|
||||||
|
// Dodatni includi (nastavitve aplikacije in omejitve anket)
|
||||||
|
require_once('admin/survey/classes/class.AppSettings.php');
|
||||||
|
require_once('admin/survey/classes/class.SurveyCheck.php');
|
||||||
|
|
||||||
|
// Preverimo klike na minuto pri izpolnjevanju anekte da se ne zapolni sql
|
||||||
|
if(isset($_GET['anketa']) && $_GET['anketa'] > 0){
|
||||||
|
$survey_check = new SurveyCheck($_GET['anketa']);
|
||||||
|
$survey_check->checkClicksPerMinute();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******* SPLOSNE FUNKCIJE *******/
|
/******* SPLOSNE FUNKCIJE *******/
|
||||||
|
|
||||||
|
// Preverimo ce je spremenljivka countable (zaradi ogromno warningov v kodi, kjer se counta prazno spremenljivko)
|
||||||
|
if (!function_exists('is_countable')) {
|
||||||
|
function is_countable($var) {
|
||||||
|
return (is_array($var) || $var instanceof Countable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Skrajsa string, in ga odreze lepo za besedo in ne kar vmes :)
|
// Skrajsa string, in ga odreze lepo za besedo in ne kar vmes :)
|
||||||
function skrajsaj($string, $dolzina)
|
function skrajsaj($string, $dolzina)
|
||||||
{
|
{
|
||||||
@ -496,131 +421,6 @@ function redirect($to)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function DrawDate($Unformatted, $Type, $To = 0)
|
|
||||||
{
|
|
||||||
$datum = $Unformatted;
|
|
||||||
|
|
||||||
SWITCH ($Type) {
|
|
||||||
CASE 0:
|
|
||||||
$Clean = "";
|
|
||||||
break;
|
|
||||||
|
|
||||||
CASE 1:
|
|
||||||
$Clean = "<span>" . $datum[8] . $datum[9] . "." . $datum[5] . $datum[6] . "</span>";
|
|
||||||
break;
|
|
||||||
|
|
||||||
CASE 2:
|
|
||||||
$Clean = "<span>" . $datum[8] . $datum[9] . "." . $datum[5] . $datum[6] . "." . $datum[2] . $datum[3] . "</span>";
|
|
||||||
break;
|
|
||||||
|
|
||||||
CASE 3:
|
|
||||||
$Clean = "<span>" . $datum[8] . $datum[9] . "." . $datum[5] . $datum[6] . "." . $datum[0] . $datum[1] . $datum[2] . $datum[3] . "</span>";
|
|
||||||
break;
|
|
||||||
|
|
||||||
CASE 4:
|
|
||||||
$Mes = $datum[5] . $datum[6];
|
|
||||||
if ($Mes == "01") $M = "Jan";
|
|
||||||
elseif ($Mes == "02") $M = "Feb";
|
|
||||||
elseif ($Mes == "03") $M = "Mar";
|
|
||||||
elseif ($Mes == "04") $M = "Apr";
|
|
||||||
elseif ($Mes == "05") $M = "May";
|
|
||||||
elseif ($Mes == "06") $M = "Jun";
|
|
||||||
elseif ($Mes == "07") $M = "Jul";
|
|
||||||
elseif ($Mes == "08") $M = "Aug";
|
|
||||||
elseif ($Mes == "09") $M = "Sep";
|
|
||||||
elseif ($Mes == "10") $M = "Oct";
|
|
||||||
elseif ($Mes == "11") $M = "Nov";
|
|
||||||
elseif ($Mes == "12") $M = "Dec";
|
|
||||||
|
|
||||||
$Clean = "<span>" . $M . " " . $datum[8] . $datum[9] . "</span>";
|
|
||||||
break;
|
|
||||||
|
|
||||||
CASE 5:
|
|
||||||
$Mes = $datum[5] . $datum[6];
|
|
||||||
if ($Mes == "01") $M = "Jan";
|
|
||||||
elseif ($Mes == "02") $M = "Feb";
|
|
||||||
elseif ($Mes == "03") $M = "Mar";
|
|
||||||
elseif ($Mes == "04") $M = "Apr";
|
|
||||||
elseif ($Mes == "05") $M = "May";
|
|
||||||
elseif ($Mes == "06") $M = "Jun";
|
|
||||||
elseif ($Mes == "07") $M = "Jul";
|
|
||||||
elseif ($Mes == "08") $M = "Aug";
|
|
||||||
elseif ($Mes == "09") $M = "Sep";
|
|
||||||
elseif ($Mes == "10") $M = "Oct";
|
|
||||||
elseif ($Mes == "11") $M = "Nov";
|
|
||||||
elseif ($Mes == "12") $M = "Dec";
|
|
||||||
|
|
||||||
$Clean = "<span>" . $M . " " . $datum[8] . $datum[9] . " " . $datum[0] . $datum[1] . $datum[2] . $datum[3] . "</span>";
|
|
||||||
break;
|
|
||||||
|
|
||||||
CASE 6:
|
|
||||||
$MesA = $Unformatted[5] . $Unformatted[6];
|
|
||||||
if ($MesA == "01") $MA = "Jan";
|
|
||||||
elseif ($MesA == "02") $MA = "Feb";
|
|
||||||
elseif ($MesA == "03") $MA = "Mar";
|
|
||||||
elseif ($MesA == "04") $MA = "Apr";
|
|
||||||
elseif ($MesA == "05") $MA = "May";
|
|
||||||
elseif ($MesA == "06") $MA = "Jun";
|
|
||||||
elseif ($MesA == "07") $MA = "Jul";
|
|
||||||
elseif ($MesA == "08") $MA = "Aug";
|
|
||||||
elseif ($MesA == "09") $MA = "Sep";
|
|
||||||
elseif ($MesA == "10") $MA = "Oct";
|
|
||||||
elseif ($MesA == "11") $MA = "Nov";
|
|
||||||
elseif ($MesA == "12") $MA = "Dec";
|
|
||||||
|
|
||||||
$MesB = $Unformatted[5] . $Unformatted[6];
|
|
||||||
if ($MesB == "01") $MB = "Jan";
|
|
||||||
elseif ($MesB == "02") $MB = "Feb";
|
|
||||||
elseif ($MesB == "03") $MB = "Mar";
|
|
||||||
elseif ($MesB == "04") $MB = "Apr";
|
|
||||||
elseif ($MesB == "05") $MB = "May";
|
|
||||||
elseif ($MesB == "06") $MB = "Jun";
|
|
||||||
elseif ($MesB == "07") $MB = "Jul";
|
|
||||||
elseif ($MesB == "08") $MB = "Aug";
|
|
||||||
elseif ($MesB == "09") $MB = "Sep";
|
|
||||||
elseif ($MesB == "10") $MB = "Oct";
|
|
||||||
elseif ($MesB == "11") $MB = "Nov";
|
|
||||||
elseif ($MesB == "12") $MB = "Dec";
|
|
||||||
|
|
||||||
|
|
||||||
$Clean = "<span>" . $MA . " " . $Unformatted[8] . $Unformatted[9] . "-" . $MB . $To[8] . $To[9] . ", " . $To[0] . $To[1] . $To[2] . $To[3] . "</span>";
|
|
||||||
break;
|
|
||||||
|
|
||||||
CASE 7:
|
|
||||||
$Clean = "<span>" . $datum[5] . $datum[6] . "/" . $datum[8] . $datum[9] . "</span>";
|
|
||||||
break;
|
|
||||||
|
|
||||||
CASE 8:
|
|
||||||
$Clean = "<span>" . $datum[5] . $datum[6] . "/" . $datum[8] . $datum[9] . "/" . $datum[0] . $datum[1] . $datum[2] . $datum[3] . "</span>";
|
|
||||||
break;
|
|
||||||
|
|
||||||
CASE 12:
|
|
||||||
$Mes = $datum[5] . $datum[6];
|
|
||||||
if ($Mes == "01") $M = "Jan";
|
|
||||||
elseif ($Mes == "02") $M = "Feb";
|
|
||||||
elseif ($Mes == "03") $M = "Mar";
|
|
||||||
elseif ($Mes == "04") $M = "Apr";
|
|
||||||
elseif ($Mes == "05") $M = "May";
|
|
||||||
elseif ($Mes == "06") $M = "Jun";
|
|
||||||
elseif ($Mes == "07") $M = "Jul";
|
|
||||||
elseif ($Mes == "08") $M = "Aug";
|
|
||||||
elseif ($Mes == "09") $M = "Sep";
|
|
||||||
elseif ($Mes == "10") $M = "Oct";
|
|
||||||
elseif ($Mes == "11") $M = "Nov";
|
|
||||||
elseif ($Mes == "12") $M = "Dec";
|
|
||||||
|
|
||||||
//$Clean = "<div class=\"date_box\">".$M."<span>".$datum[8].$datum[9]."</span>".$datum[0].$datum[1].$datum[2].$datum[3]."</div>";
|
|
||||||
$Clean = "<div class=\"date_box\">" . $M . "<span>" . $datum[8] . $datum[9] . "</span></div>";
|
|
||||||
break;
|
|
||||||
|
|
||||||
DEFAULT:
|
|
||||||
$Clean = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
return $Clean;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function hack()
|
function hack()
|
||||||
{
|
{
|
||||||
die ("HACK ATTEMPT, BYE");
|
die ("HACK ATTEMPT, BYE");
|
||||||
@ -636,193 +436,6 @@ function CleanXSS($w)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function str_replace_once($search, $replace, $subject)
|
|
||||||
{
|
|
||||||
$firstChar = strpos($subject, $search);
|
|
||||||
|
|
||||||
if ($firstChar !== false) {
|
|
||||||
$beforeStr = substr($subject, 0, $firstChar);
|
|
||||||
$afterStr = substr($subject, $firstChar + strlen($search));
|
|
||||||
return $beforeStr . $replace . $afterStr;
|
|
||||||
} else {
|
|
||||||
return $subject;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function GetHtaccessPath($NiceLink)
|
|
||||||
{
|
|
||||||
global $site_url;
|
|
||||||
global $site_path;
|
|
||||||
|
|
||||||
// lep link je http://url/NEKAJ/dalje
|
|
||||||
// zanima te NEKAJ
|
|
||||||
|
|
||||||
$nl = str_replace($site_url, "", $NiceLink);
|
|
||||||
$KAJ = substr($nl, 0, strpos($nl, "/"));
|
|
||||||
$nl = substr($nl, (strpos($nl, "/") + 1));
|
|
||||||
|
|
||||||
if (!is_dir($site_path . str_replace("/", "", $KAJ))) {
|
|
||||||
mkdir($site_path . str_replace("/", "", $KAJ));
|
|
||||||
|
|
||||||
$fh = fopen($site_path . str_replace("/", "", $KAJ) . '/.htaccess', 'a');
|
|
||||||
$stringData = "RewriteEngine On " . "\n\n";
|
|
||||||
fwrite($fh, $stringData);
|
|
||||||
fclose($fh);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $KAJ . "|" . $nl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// NE POZABI PODATI DIREKTORIJA IZ KJER NAJ ODSTRANI!!!!
|
|
||||||
// brez prvega slasha.
|
|
||||||
function RemoveNiceLink($what, $dir)
|
|
||||||
{
|
|
||||||
|
|
||||||
global $site_path;
|
|
||||||
|
|
||||||
exec('cat ' . $site_path . $dir . '.htaccess | grep -v "' . $what . '&%{QUERY_STRING}" > ' . $site_path . $dir . 'zacasno');
|
|
||||||
exec('mv -f ' . $site_path . $dir . 'zacasno ' . $site_path . $dir . '.htaccess');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Odstrani celo drevo lepih linkov
|
|
||||||
// Primerno za brisanje drevesa navigacij ipd.
|
|
||||||
// povej mu da ves kaj delas (gl. parametre)
|
|
||||||
function RemoveNiceLinkRecursive($what, $check)
|
|
||||||
{
|
|
||||||
global $site_path;
|
|
||||||
global $site_url;
|
|
||||||
|
|
||||||
if ($check != "YES_I_AM_SURE") return;
|
|
||||||
|
|
||||||
else {
|
|
||||||
// Noter dobis cel lep link.
|
|
||||||
// odstrani mu site_url in poglej prvi direktorij
|
|
||||||
$whole = $what;
|
|
||||||
$what = str_replace($site_url, "", $what);
|
|
||||||
$slash = strpos($what, "/");
|
|
||||||
$dir = substr($what, 0, $slash);
|
|
||||||
$what = substr($what, $slash + 1);
|
|
||||||
|
|
||||||
exec('cat ' . $site_path . $dir . '/.htaccess | grep -v "\^' . $what . '" | grep -v "' . $whole . '" > ' . $site_path . $dir . '/zacasno');
|
|
||||||
exec('mv -f ' . $site_path . $dir . '/zacasno ' . $site_path . $dir . '/.htaccess');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function AddRedirect($what, $where)
|
|
||||||
{
|
|
||||||
global $site_path;
|
|
||||||
global $site_url;
|
|
||||||
|
|
||||||
// popravi, naj preveri ce je noter kaka crka a-zA-Z0-9
|
|
||||||
// Noter morajo biti vsaj tri crke in stevilke, sicer ne bomo delali!!
|
|
||||||
|
|
||||||
if ($what != $where && $what != "" && $where != "") {
|
|
||||||
// Najprej poglej direktorije!!!!!
|
|
||||||
|
|
||||||
$path_what = explode("|", GetHtaccessPath($what));
|
|
||||||
$path_where = explode("|", GetHtaccessPath($where));
|
|
||||||
|
|
||||||
if (strpos($path_what[1], "//") !== false || strpos($path_where[1], "//") !== false) return;
|
|
||||||
|
|
||||||
// Odstrani obratnega da ne bos naredil endless loop!!!
|
|
||||||
exec('cat ' . $site_path . $path_where[0] . '/.htaccess | grep -v "Redirect ' . str_replace($site_url, "/", $where) . '" > ' . $site_path . $path_where[0] . '/zacasno');
|
|
||||||
exec('mv -f ' . $site_path . $path_where[0] . '/zacasno ' . $site_path . $path_where[0] . '/.htaccess');
|
|
||||||
|
|
||||||
$what = str_replace($site_url, "/", $what);
|
|
||||||
|
|
||||||
$fh = fopen($site_path . $path_what[0] . '/.htaccess', 'a');
|
|
||||||
$stringData = "Redirect " . $what . "\t\t\t$where" . "\n";
|
|
||||||
fwrite($fh, $stringData);
|
|
||||||
fclose($fh);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function CleanNiceLinkText($what)
|
|
||||||
{
|
|
||||||
$what = iconv("ISO-8859-2", "YU//TRANSLIT", $what);
|
|
||||||
$what = str_replace("š", "s", $what);
|
|
||||||
$what = str_replace("Š", "S", $what);
|
|
||||||
$what = str_replace("[", "S", $what);
|
|
||||||
$what = str_replace("{", "s", $what);
|
|
||||||
$what = str_replace("^", "C", $what);
|
|
||||||
$what = str_replace("~", "c", $what);
|
|
||||||
$what = str_replace("`", "z", $what);
|
|
||||||
$what = str_replace("@", "Z", $what);
|
|
||||||
|
|
||||||
// %
|
|
||||||
$what = str_replace("%", "", $what);
|
|
||||||
|
|
||||||
$what = str_replace(""", "_", $what);
|
|
||||||
|
|
||||||
$what = str_replace(" ", "_", $what);
|
|
||||||
$what = preg_replace("/[^a-zA-Z0-9_\/]/", "", $what);
|
|
||||||
|
|
||||||
return $what;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vrne true ce so v tekstu vec kot MIN a-z,A-Z,0-1
|
|
||||||
// Uporabljas da ne dobis praznih lepih linkov.
|
|
||||||
function ValidNiceLink($str, $min = 3)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (strlen(CleanNiceLinkText($str)) >= $min) return true;
|
|
||||||
else return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function browser_info($agent = null)
|
|
||||||
{
|
|
||||||
// Declare known browsers to look for
|
|
||||||
$known = array('msie', 'firefox', 'safari', 'webkit', 'opera', 'netscape', 'konqueror', 'gecko');
|
|
||||||
|
|
||||||
// Clean up agent and build regex that matches phrases for known browsers
|
|
||||||
// (e.g. "Firefox/2.0" or "MSIE 6.0" (This only matches the major and minor
|
|
||||||
// version numbers. E.g. "2.0.0.6" is parsed as simply "2.0"
|
|
||||||
|
|
||||||
$agent = strtolower($agent ? $agent : $_SERVER['HTTP_USER_AGENT']);
|
|
||||||
$pattern = '#(?<browser>' . join('|', $known) . ')[/ ]+(?<version>[0-9]+?)#';
|
|
||||||
|
|
||||||
// Find all phrases (or return empty array if none found)
|
|
||||||
if (!preg_match_all($pattern, $agent, $matches)) return array();
|
|
||||||
|
|
||||||
// Since some UAs have more than one phrase (e.g Firefox has a Gecko phrase,
|
|
||||||
// Opera 7,8 have a MSIE phrase), use the last one found (the right-most one
|
|
||||||
// in the UA). That's usually the most correct.
|
|
||||||
$i = count($matches['browser']) - 1;
|
|
||||||
return array(0 => $matches['browser'][$i], 1 => $matches['version'][$i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
function GenerateRandomCode($len = 3)
|
|
||||||
{
|
|
||||||
$RandomId = md5(uniqid(time()));
|
|
||||||
$confirm_chars = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9');
|
|
||||||
list($usec, $sec) = explode(' ', microtime());
|
|
||||||
mt_srand($sec * $usec);
|
|
||||||
$max_chars = count($confirm_chars) - 1;
|
|
||||||
$code = '';
|
|
||||||
|
|
||||||
for ($i = 0; $i < 3; $i++) {
|
|
||||||
$code .= $confirm_chars[mt_rand(0, $max_chars)];
|
|
||||||
}
|
|
||||||
|
|
||||||
// shrani kodo v bazo, ob tem izbrisi kode, starejse od 10 minut (600 sekund)
|
|
||||||
$cas = time();
|
|
||||||
$casb = time() - 600;
|
|
||||||
|
|
||||||
$headers = apache_request_headers();
|
|
||||||
if (array_key_exists('X-Forwarded-For', $headers)) {
|
|
||||||
$hostname = $headers['X-Forwarded-For'];
|
|
||||||
} else {
|
|
||||||
$hostname = $_SERVER["REMOTE_ADDR"];
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = sisplet_query("DELETE FROM registers WHERE lasttime<$casb");
|
|
||||||
$result = sisplet_query("INSERT INTO registers (ip, lasttime, handle, code) VALUES ('$hostname', '$cas', '$RandomId', '$code')");
|
|
||||||
|
|
||||||
return $RandomId;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function GetIP()
|
function GetIP()
|
||||||
{
|
{
|
||||||
$headers = apache_request_headers();
|
$headers = apache_request_headers();
|
||||||
@ -836,77 +449,6 @@ function GetIP()
|
|||||||
return $_SERVER["REMOTE_ADDR"];
|
return $_SERVER["REMOTE_ADDR"];
|
||||||
}
|
}
|
||||||
|
|
||||||
function CZSToSearch($what)
|
|
||||||
{
|
|
||||||
|
|
||||||
$originali = array("š", "&Scaron", "[", "{", "}", "]", "^", "~", "`", "@", "Č", "č", "Ž", "ž", "'", "č", "ž", "š", "Č", "Ž", "Š");
|
|
||||||
$zamenjave = array("s", "S", "S", "s", "c", "C", "C", "c", "z", "Z", "C", "c", "Z", "z", "", "c", "z", "s", "C", "Z", "S");
|
|
||||||
|
|
||||||
$what = iconv("ISO-8859-2", "YU//TRANSLIT", $what);
|
|
||||||
$what = str_replace($originali, $zamenjave, $what);
|
|
||||||
/*
|
|
||||||
$what = str_replace ("š", "s", $what);
|
|
||||||
$what = str_replace ("Š", "S", $what);
|
|
||||||
$what = str_replace ("[", "S", $what);
|
|
||||||
$what = str_replace ("{", "s", $what);
|
|
||||||
$what = str_replace ("}", "c", $what);
|
|
||||||
$what = str_replace ("]", "C", $what);
|
|
||||||
$what = str_replace ("^", "C", $what);
|
|
||||||
$what = str_replace ("~", "c", $what);
|
|
||||||
$what = str_replace ("`", "z", $what);
|
|
||||||
$what = str_replace ("@", "Z", $what);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// narekovaji
|
|
||||||
$what = str_replace ("'", "", $what);
|
|
||||||
*/
|
|
||||||
|
|
||||||
return $what;
|
|
||||||
}
|
|
||||||
|
|
||||||
function UlCounter($text)
|
|
||||||
{
|
|
||||||
// enostavno ob urejanju vsebine spremeni /uploadi/editor v /ul
|
|
||||||
// /ul naj bo Rewrite na /uploadi/counter.php!
|
|
||||||
|
|
||||||
return str_replace($site_url . 'uploadi/editor/', $site_url . '/ul/', $text);
|
|
||||||
}
|
|
||||||
|
|
||||||
function str_lreplace($search, $replace, $subject)
|
|
||||||
{
|
|
||||||
$pos = strrpos($subject, $search);
|
|
||||||
|
|
||||||
if ($pos === false) {
|
|
||||||
return $subject;
|
|
||||||
} else {
|
|
||||||
return substr_replace($subject, $replace, $pos, strlen($search));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_post_request($url, $data, $optional_headers = null)
|
|
||||||
{
|
|
||||||
$params = array('http' => array('method' => 'POST', 'content' => $data));
|
|
||||||
|
|
||||||
if ($optional_headers !== null) {
|
|
||||||
$params['http']['header'] = $optional_headers;
|
|
||||||
}
|
|
||||||
|
|
||||||
$ctx = stream_context_create($params);
|
|
||||||
$fp = @fopen($url, 'rb', false, $ctx);
|
|
||||||
|
|
||||||
if (!$fp) {
|
|
||||||
throw new Exception("Napaka s postanjem na $url, $php_errormsg");
|
|
||||||
}
|
|
||||||
|
|
||||||
$response = @stream_get_contents($fp);
|
|
||||||
if ($response === false) {
|
|
||||||
throw new Exception("Napaka s prebiranjem podatkov iz $url, $php_errormsg");
|
|
||||||
}
|
|
||||||
|
|
||||||
return $response;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Zakodira get parametre urlja v serializiran array z funkcijo base64_encode
|
/* Zakodira get parametre urlja v serializiran array z funkcijo base64_encode
|
||||||
* Tako da se iz urlja ne vidi direkt parametrov ankete
|
* Tako da se iz urlja ne vidi direkt parametrov ankete
|
||||||
* se uporablja za izvoz.php
|
* se uporablja za izvoz.php
|
||||||
@ -1116,9 +658,10 @@ function unikatenEmail($email = null){
|
|||||||
|
|
||||||
// Funkcija za debug
|
// Funkcija za debug
|
||||||
function isDebug(){
|
function isDebug(){
|
||||||
global $admin_type, $debug, $site_domain;
|
global $admin_type, $site_domain;
|
||||||
|
|
||||||
if(isset($debug) && $debug > 0){
|
if(AppSettings::getInstance()->getSetting('debug') === true){
|
||||||
|
|
||||||
if ($admin_type == 0 || in_array($site_domain, ['test.1ka.si', 'localhost', '1ka.test'])) {
|
if ($admin_type == 0 || in_array($site_domain, ['test.1ka.si', 'localhost', '1ka.test'])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1127,20 +670,24 @@ function isDebug(){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// Funkcija za tip instalacije - lastna instalacija
|
||||||
* Počasno nalaganje polja iz baze
|
function isLastnaInstalacija(){
|
||||||
*
|
return (AppSettings::getInstance()->getSetting('installation_type') === '0') ? true : false;
|
||||||
* Funkcija naredi poizvedbo in vse rezultate shrani v polje, kar manj obremenjuje RAM
|
}
|
||||||
*
|
|
||||||
* @param $query
|
// Funkcija za tip instalacije - WWW
|
||||||
* @return \Generator
|
function isWWW(){
|
||||||
*/
|
return (AppSettings::getInstance()->getSetting('installation_type') === '1') ? true : false;
|
||||||
function lazyLoadSqlArray($query)
|
}
|
||||||
{
|
|
||||||
$polje = [];
|
// Funkcija za tip instalacije - AAI
|
||||||
while($row = mysqli_fetch_assoc($query)){
|
function isAAI(){
|
||||||
yield $polje[] = $row;
|
return (AppSettings::getInstance()->getSetting('installation_type') === '2') ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Funkcija za tip instalacije - virtual domain
|
||||||
|
function isVirtual(){
|
||||||
|
return (AppSettings::getInstance()->getSetting('installation_type') === '3') ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1199,57 +746,4 @@ function root_dir($file = null)
|
|||||||
return __DIR__ .'/'. $file;
|
return __DIR__ .'/'. $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Pri izpolnjevanju ankete preverimo stevilo klikov na minuto - ce jih je prevec, respondenta zavrnemo, drugace se lahko sql zafila in streznik ni vec odziven
|
|
||||||
function checkClicksPerMinute(){
|
|
||||||
global $app_limits;
|
|
||||||
|
|
||||||
// Ce maximum na minuto ni nastavljen ignoriramo limit
|
|
||||||
if(!isset($app_limits['clicks_per_minute_limit']) || $app_limits['clicks_per_minute_limit'] == 0)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// Preverimo ce gre za izpolnjevanje ankete
|
|
||||||
if($_SERVER["SCRIPT_NAME"] != '/main/survey/index.php')
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// Preverimo ce gre za prvi prihod na doloceno stran ankete in ne na prvo stran
|
|
||||||
if(isset($_GET['grupa']))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// Preverimo ce je id ankete ustrezno nastavljen
|
|
||||||
if(!isset($_GET['anketa']) || $_GET['anketa'] <= 0)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
|
|
||||||
$click_time = time();
|
|
||||||
|
|
||||||
$sql = sisplet_query("SELECT click_count, click_time FROM srv_clicks WHERE ank_id='".$_GET['anketa']."'");
|
|
||||||
if (mysqli_num_rows($sql) > 0) {
|
|
||||||
|
|
||||||
list($click_count, $first_click_time) = mysqli_fetch_array($sql);
|
|
||||||
|
|
||||||
// Ce nismo znotraj minute vse resetiramo in pustimo naprej
|
|
||||||
if($click_time - $first_click_time > 60){
|
|
||||||
$sqlI = sisplet_query("UPDATE srv_clicks SET click_count='1', click_time='".$click_time."' WHERE ank_id='".$_GET['anketa']."'");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Click count je ok - pustimo naprej
|
|
||||||
if($click_count < $app_limits['clicks_per_minute_limit']){
|
|
||||||
$sqlI = sisplet_query("UPDATE srv_clicks SET click_count=click_count+1 WHERE ank_id='".$_GET['anketa']."'");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// Click count je previsok - ZAVRNEMO
|
|
||||||
else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$sqlI = sisplet_query("INSERT INTO srv_clicks (ank_id, click_count, click_time) VALUES ('".$_GET['anketa']."', '1', '".$click_time."')");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
@ -224,9 +224,7 @@ class Profile {
|
|||||||
function GoogleLogin () {
|
function GoogleLogin () {
|
||||||
|
|
||||||
require_once ('../function/JWT.php');
|
require_once ('../function/JWT.php');
|
||||||
|
|
||||||
global $google_login_client_id;
|
|
||||||
global $google_login_client_secret;
|
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $lang;
|
global $lang;
|
||||||
global $proxy;
|
global $proxy;
|
||||||
@ -240,8 +238,8 @@ class Profile {
|
|||||||
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'content' => http_build_query(array(
|
'content' => http_build_query(array(
|
||||||
'client_id' => $google_login_client_id,
|
'client_id' => AppSettings::getInstance()->getSetting('google-login_client_id'),
|
||||||
'client_secret' => $google_login_client_secret,
|
'client_secret' => AppSettings::getInstance()->getSetting('google-login_client_secret'),
|
||||||
'code' => $oauth2_code,
|
'code' => $oauth2_code,
|
||||||
'grant_type' => 'authorization_code',
|
'grant_type' => 'authorization_code',
|
||||||
'redirect_uri' => $site_url .'utils/google-oauth2.php',
|
'redirect_uri' => $site_url .'utils/google-oauth2.php',
|
||||||
@ -258,8 +256,8 @@ class Profile {
|
|||||||
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'content' => http_build_query(array(
|
'content' => http_build_query(array(
|
||||||
'client_id' => $google_login_client_id,
|
'client_id' => AppSettings::getInstance()->getSetting('google-login_client_id'),
|
||||||
'client_secret' => $google_login_client_secret,
|
'client_secret' => AppSettings::getInstance()->getSetting('google-login_client_secret'),
|
||||||
'code' => $oauth2_code,
|
'code' => $oauth2_code,
|
||||||
'grant_type' => 'authorization_code',
|
'grant_type' => 'authorization_code',
|
||||||
'redirect_uri' => $site_url .'utils/google-oauth2.php',
|
'redirect_uri' => $site_url .'utils/google-oauth2.php',
|
||||||
|
@ -17,6 +17,7 @@ use SurveyAdvancedParadataLog;
|
|||||||
use SurveySetting;
|
use SurveySetting;
|
||||||
use MailAdapter;
|
use MailAdapter;
|
||||||
use GDPR;
|
use GDPR;
|
||||||
|
use AppSettings;
|
||||||
|
|
||||||
|
|
||||||
class AjaxController extends Controller
|
class AjaxController extends Controller
|
||||||
@ -494,7 +495,6 @@ class AjaxController extends Controller
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function ajax_captcha(){
|
public function ajax_captcha(){
|
||||||
global $secret_captcha;
|
|
||||||
|
|
||||||
$text = strtoupper($_GET['text']);
|
$text = strtoupper($_GET['text']);
|
||||||
$code = $_GET['code'];
|
$code = $_GET['code'];
|
||||||
@ -502,7 +502,7 @@ class AjaxController extends Controller
|
|||||||
$usr_id = $_GET['usr_id'];
|
$usr_id = $_GET['usr_id'];
|
||||||
|
|
||||||
$recaptchaResponse = $_POST['g-recaptcha-response'];
|
$recaptchaResponse = $_POST['g-recaptcha-response'];
|
||||||
$request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secret_captcha."&response=".$recaptchaResponse);
|
$request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".AppSettings::getInstance()->getSetting('google-secret_captcha')."&response=".$recaptchaResponse);
|
||||||
|
|
||||||
// zdaj pa zabeleži mail (pred pošiljanjem)
|
// zdaj pa zabeleži mail (pred pošiljanjem)
|
||||||
// zdaj pa še v bazi tistih ki so se ročno dodali
|
// zdaj pa še v bazi tistih ki so se ročno dodali
|
||||||
|
@ -30,6 +30,7 @@ use SurveyGorenje;
|
|||||||
use SurveyNIJZ;
|
use SurveyNIJZ;
|
||||||
use GDPR;
|
use GDPR;
|
||||||
use UserAccess;
|
use UserAccess;
|
||||||
|
use AppSettings;
|
||||||
|
|
||||||
|
|
||||||
class BodyController extends Controller
|
class BodyController extends Controller
|
||||||
@ -395,14 +396,13 @@ class BodyController extends Controller
|
|||||||
|
|
||||||
// Ce imamo staticen uvod in preverjanje s captcho
|
// Ce imamo staticen uvod in preverjanje s captcho
|
||||||
if($row['intro_static'] == 2){
|
if($row['intro_static'] == 2){
|
||||||
global $recaptcha_sitekey;
|
|
||||||
|
|
||||||
$captcha_error = (isset($_GET['captcha_error']) && $_GET['captcha_error'] == 1) ? true : false;
|
$captcha_error = (isset($_GET['captcha_error']) && $_GET['captcha_error'] == 1) ? true : false;
|
||||||
|
|
||||||
echo '<br />';
|
echo '<br />';
|
||||||
|
|
||||||
echo '<p>';
|
echo '<p>';
|
||||||
echo '<div class="g-recaptcha" data-sitekey="' .$recaptcha_sitekey .'"></div>';
|
echo '<div class="g-recaptcha" data-sitekey="'.AppSettings::getInstance()->getSetting('google-recaptcha_sitekey').'"></div>';
|
||||||
echo '</p>';
|
echo '</p>';
|
||||||
|
|
||||||
if($captcha_error){
|
if($captcha_error){
|
||||||
@ -657,7 +657,6 @@ class BodyController extends Controller
|
|||||||
global $lang;
|
global $lang;
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
Header::getInstance()->displaySistemske();
|
Header::getInstance()->displaySistemske();
|
||||||
|
|
||||||
@ -838,7 +837,7 @@ class BodyController extends Controller
|
|||||||
$panel_settings = $sp->getPanelSettings();
|
$panel_settings = $sp->getPanelSettings();
|
||||||
|
|
||||||
// Posebno samo za ipanel - Izraelski projekt
|
// Posebno samo za ipanel - Izraelski projekt
|
||||||
if($app_settings['app_name'] == 'www.1ka.si' && (get('anketa') == '232992' || get('anketa') == '232795' || get('anketa') == '248217' || get('anketa') == '248757' || get('anketa') == '248762')){
|
if(AppSettings::getInstance()->getSetting('app_settings-app_name') == 'www.1ka.si' && (get('anketa') == '232992' || get('anketa') == '232795' || get('anketa') == '248217' || get('anketa') == '248757' || get('anketa') == '248762')){
|
||||||
|
|
||||||
// Pridobimo id panelista ki je bil shranjen na zacetku resevanja v sistemsko spremenljivko
|
// Pridobimo id panelista ki je bil shranjen na zacetku resevanja v sistemsko spremenljivko
|
||||||
$sqlP = sisplet_query("SELECT d.*, s.variable FROM srv_data_text".get('db_table')." d, srv_spremenljivka s, srv_grupa g
|
$sqlP = sisplet_query("SELECT d.*, s.variable FROM srv_data_text".get('db_table')." d, srv_spremenljivka s, srv_grupa g
|
||||||
@ -954,8 +953,8 @@ class BodyController extends Controller
|
|||||||
|
|
||||||
|
|
||||||
// URL na katerega skocimo ce se zapre okno - pogledamo ce imamo nastavljen custom url (settings_optional.php)
|
// URL na katerega skocimo ce se zapre okno - pogledamo ce imamo nastavljen custom url (settings_optional.php)
|
||||||
if(isset($app_settings['survey_finish_url']) && $app_settings['survey_finish_url'] != '')
|
if(AppSettings::getInstance()->getSetting('app_settings-survey_finish_url') !== false)
|
||||||
$close_url = $app_settings['survey_finish_url'];
|
$close_url = AppSettings::getInstance()->getSetting('app_settings-survey_finish_url');
|
||||||
else
|
else
|
||||||
$close_url = 'https://www.1ka.si/';
|
$close_url = 'https://www.1ka.si/';
|
||||||
|
|
||||||
@ -1272,7 +1271,6 @@ class BodyController extends Controller
|
|||||||
* @desc prikaze konec ankete
|
* @desc prikaze konec ankete
|
||||||
*/
|
*/
|
||||||
public function displayKonecGlasovanje(){
|
public function displayKonecGlasovanje(){
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
echo '<script>var srv_meta_anketa_id = ' . get('anketa') . ';</script>';
|
echo '<script>var srv_meta_anketa_id = ' . get('anketa') . ';</script>';
|
||||||
|
|
||||||
@ -1296,8 +1294,8 @@ class BodyController extends Controller
|
|||||||
|
|
||||||
|
|
||||||
// URL na katerega skocimo ce se zapre okno - pogledamo ce imamo nastavljen custom url (settings_optional.php)
|
// URL na katerega skocimo ce se zapre okno - pogledamo ce imamo nastavljen custom url (settings_optional.php)
|
||||||
if(isset($app_settings['survey_finish_url']) && $app_settings['survey_finish_url'] != '')
|
if(AppSettings::getInstance()->getSetting('app_settings-survey_finish_url') !== false)
|
||||||
$close_url = $app_settings['survey_finish_url'];
|
$close_url = AppSettings::getInstance()->getSetting('app_settings-survey_finish_url');
|
||||||
else
|
else
|
||||||
$close_url = 'https://www.1ka.si/';
|
$close_url = 'https://www.1ka.si/';
|
||||||
|
|
||||||
@ -1916,7 +1914,7 @@ class BodyController extends Controller
|
|||||||
|
|
||||||
|
|
||||||
public function displayFooterNote(){
|
public function displayFooterNote(){
|
||||||
global $mysql_database_name, $app_settings;
|
global $mysql_database_name;
|
||||||
|
|
||||||
$row = SurveyInfo::getInstance()->getSurveyRow();
|
$row = SurveyInfo::getInstance()->getSurveyRow();
|
||||||
|
|
||||||
@ -1928,9 +1926,8 @@ class BodyController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Custom footer
|
// Custom footer
|
||||||
if(isset($app_settings['footer_survey_custom']) && $app_settings['footer_survey_custom'] == 1){
|
if(AppSettings::getInstance()->getSetting('app_settings-footer_survey_custom') !== false){
|
||||||
|
echo '<p>'.AppSettings::getInstance()->getSetting('app_settings-footer_survey_text').'</p>';
|
||||||
echo '<p>'.$app_settings['footer_survey_text'].'</p>';
|
|
||||||
}
|
}
|
||||||
// Default footer
|
// Default footer
|
||||||
else{
|
else{
|
||||||
|
@ -15,6 +15,7 @@ use SurveyInfo;
|
|||||||
use SurveyMissingValues;
|
use SurveyMissingValues;
|
||||||
use Common;
|
use Common;
|
||||||
use Mobile_Detect;
|
use Mobile_Detect;
|
||||||
|
use AppSettings;
|
||||||
|
|
||||||
|
|
||||||
class CheckController extends Controller
|
class CheckController extends Controller
|
||||||
@ -681,8 +682,7 @@ class CheckController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function check_captcha()
|
public function check_captcha()
|
||||||
{
|
{
|
||||||
global $secret_captcha;
|
|
||||||
|
|
||||||
// Ce urejamo podatke v admin vmesniku ne preverjamo nicesar
|
// Ce urejamo podatke v admin vmesniku ne preverjamo nicesar
|
||||||
if(isset($_GET['t']) && $_GET['t'] == 'postprocess' || get('grupa') == '0' || get('grupa') == ''){
|
if(isset($_GET['t']) && $_GET['t'] == 'postprocess' || get('grupa') == '0' || get('grupa') == ''){
|
||||||
return;
|
return;
|
||||||
@ -696,7 +696,7 @@ class CheckController extends Controller
|
|||||||
|
|
||||||
if ($captcha == 1) {
|
if ($captcha == 1) {
|
||||||
$recaptchaResponse = $_POST['g-recaptcha-response'];
|
$recaptchaResponse = $_POST['g-recaptcha-response'];
|
||||||
$request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secret_captcha."&response=".$recaptchaResponse);
|
$request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".AppSettings::getInstance()->getSetting('google-secret_captcha')."&response=".$recaptchaResponse);
|
||||||
|
|
||||||
// zdaj pa zabeleži mail (pred pošiljanjem)
|
// zdaj pa zabeleži mail (pred pošiljanjem)
|
||||||
// zdaj pa še v bazi tistih ki so se ročno dodali
|
// zdaj pa še v bazi tistih ki so se ročno dodali
|
||||||
@ -716,10 +716,9 @@ class CheckController extends Controller
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function check_captcha_intro(){
|
public function check_captcha_intro(){
|
||||||
global $secret_captcha;
|
|
||||||
|
|
||||||
$recaptchaResponse = $_POST['g-recaptcha-response'];
|
$recaptchaResponse = $_POST['g-recaptcha-response'];
|
||||||
$request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secret_captcha."&response=".$recaptchaResponse);
|
$request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".AppSettings::getInstance()->getSetting('google-secret_captcha')."&response=".$recaptchaResponse);
|
||||||
|
|
||||||
if(strstr($request,"true")){
|
if(strstr($request,"true")){
|
||||||
//
|
//
|
||||||
|
@ -15,6 +15,7 @@ use SurveyAdvancedParadataLog;
|
|||||||
use SurveyInfo;
|
use SurveyInfo;
|
||||||
use SurveyThemeEditor;
|
use SurveyThemeEditor;
|
||||||
use SurveyPanel;
|
use SurveyPanel;
|
||||||
|
use AppSettings;
|
||||||
|
|
||||||
class HeaderController extends Controller
|
class HeaderController extends Controller
|
||||||
{
|
{
|
||||||
@ -149,8 +150,6 @@ class HeaderController extends Controller
|
|||||||
* @desc zgenereira header
|
* @desc zgenereira header
|
||||||
*/
|
*/
|
||||||
public function header(){
|
public function header(){
|
||||||
global $app_settings;
|
|
||||||
|
|
||||||
|
|
||||||
// preprecimo caching - tudi s klikom na gumb nazaj!
|
// preprecimo caching - tudi s klikom na gumb nazaj!
|
||||||
header("Last-Modified: " . gmdate("D, j M Y H:i:s") . " GMT");
|
header("Last-Modified: " . gmdate("D, j M Y H:i:s") . " GMT");
|
||||||
@ -168,8 +167,8 @@ class HeaderController extends Controller
|
|||||||
$rowv = mysqli_fetch_array($sqlv);
|
$rowv = mysqli_fetch_array($sqlv);
|
||||||
|
|
||||||
// Custom header title
|
// Custom header title
|
||||||
if(isset($app_settings['head_title_custom']) && $app_settings['head_title_custom'] == 1){
|
if(AppSettings::getInstance()->getSetting('app_settings-head_title_custom')){
|
||||||
echo '<title>'.strip_tags(Helper::getInstance()->displayAkronim(0)).' - '.$app_settings['head_title_text'].'</title>' . "\n";
|
echo '<title>'.strip_tags(Helper::getInstance()->displayAkronim(0)).' - '.AppSettings::getInstance()->getSetting('app_settings-head_title_text').'</title>' . "\n";
|
||||||
}
|
}
|
||||||
// Default header title
|
// Default header title
|
||||||
else{
|
else{
|
||||||
|
@ -21,6 +21,7 @@ use SurveySetting;
|
|||||||
use SurveySlideshow;
|
use SurveySlideshow;
|
||||||
use Common;
|
use Common;
|
||||||
use SurveyPanel;
|
use SurveyPanel;
|
||||||
|
use AppSettings;
|
||||||
|
|
||||||
class JsController extends Controller
|
class JsController extends Controller
|
||||||
{
|
{
|
||||||
@ -64,7 +65,6 @@ class JsController extends Controller
|
|||||||
{
|
{
|
||||||
global $lang;
|
global $lang;
|
||||||
global $site_url;
|
global $site_url;
|
||||||
global $secret_captcha;
|
|
||||||
global $admin_type;
|
global $admin_type;
|
||||||
|
|
||||||
// Dodaten text pri alertu ce smo v testnem vnosu
|
// Dodaten text pri alertu ce smo v testnem vnosu
|
||||||
|
@ -21,6 +21,7 @@ use App\Controllers\LanguageController as Language;
|
|||||||
use App\Controllers\Vprasanja\SystemVariableController as SystemVariable;
|
use App\Controllers\Vprasanja\SystemVariableController as SystemVariable;
|
||||||
use App\Models\Model;
|
use App\Models\Model;
|
||||||
use enkaParameters;
|
use enkaParameters;
|
||||||
|
use AppSettings;
|
||||||
|
|
||||||
class TextController extends Controller
|
class TextController extends Controller
|
||||||
{
|
{
|
||||||
@ -480,7 +481,6 @@ class TextController extends Controller
|
|||||||
************************************************/
|
************************************************/
|
||||||
public function textbox($spremenljivka, $oblika)
|
public function textbox($spremenljivka, $oblika)
|
||||||
{
|
{
|
||||||
global $recaptcha_sitekey;
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
$row = Model::select_from_srv_spremenljivka($spremenljivka);
|
$row = Model::select_from_srv_spremenljivka($spremenljivka);
|
||||||
@ -575,7 +575,7 @@ class TextController extends Controller
|
|||||||
$captcha = ($spremenljivkaParams->get('captcha') ? $spremenljivkaParams->get('captcha') : 0);
|
$captcha = ($spremenljivkaParams->get('captcha') ? $spremenljivkaParams->get('captcha') : 0);
|
||||||
|
|
||||||
if ($captcha == 1) {
|
if ($captcha == 1) {
|
||||||
echo '<div class="g-recaptcha" data-sitekey="' .$recaptcha_sitekey .'"></div>';
|
echo '<div class="g-recaptcha" data-sitekey="'.AppSettings::getInstance()->getSetting('google-recaptcha_sitekey').'"></div>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$char_counter_events = $limit ? 'charCounter(this);' : '';
|
$char_counter_events = $limit ? 'charCounter(this);' : '';
|
||||||
|
@ -1,165 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
// Debuging - 0 ali 1, ali imamo debug vključen (privzeto je izključen)
|
|
||||||
$debug = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// Ce gre za virtualno domeno
|
|
||||||
$virtual_domain = false;
|
|
||||||
|
|
||||||
// Ce gre za lastno instalacijo
|
|
||||||
$lastna_instalacija = false;
|
|
||||||
|
|
||||||
// Ce gre za aai instalacijo
|
|
||||||
$aai_instalacija = false;
|
|
||||||
|
|
||||||
|
|
||||||
/* DODATNE NASTAVITVE APLIKACIJE ZA LASTNE NAMESTITVE */
|
|
||||||
$app_settings = array(
|
|
||||||
'app_name' => '', // Ime aplikacije
|
|
||||||
'admin_email' => '', // Email administratorja aplikacije (gdpr zahtevki, kontakt, potrditev registracije...)
|
|
||||||
'owner' => '', // Ime lastnika aplikacije (podjetje...)
|
|
||||||
'owner_website' => '', // Spletna stran lastnika aplikacije (podjetje...)
|
|
||||||
|
|
||||||
'footer_custom' => 0, // Custom ali default footer
|
|
||||||
'footer_text' => '', // Text v footerju
|
|
||||||
'footer_survey_custom' => 0, // Custom ali default footer ankete
|
|
||||||
'footer_survey_text' => '', // Text v footerju ankete
|
|
||||||
|
|
||||||
'email_signature_custom' => 0, // Custom ali default podpis v emailih
|
|
||||||
'email_signature_text' => '', // Podpis v emailih
|
|
||||||
|
|
||||||
'survey_finish_url' => '', // Skok na url po koncani anketi (ce je prazno se uporabi default www.1ka.si)
|
|
||||||
|
|
||||||
'admin_allow_only_ip' => '', // Dovolimo dostop do admina samo dolocenim ip-jem (array ip-jev)
|
|
||||||
|
|
||||||
'export_type' => 'old', // Uporaba novih ("new") / novih samo za admine ("new_admin") / starih ("old") izvozov
|
|
||||||
|
|
||||||
'commercial_packages' => false // Ce so vklopljeni komercialni paketi
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/* OMEJITVE APLIKACIJE */
|
|
||||||
$app_limits = array(
|
|
||||||
|
|
||||||
// Max stevilo klikov na doloceno anketo (izpolnjevanje) v eni minuti (zascita, da se streznik ne sesuje) (ce je 0 ni limita)
|
|
||||||
'clicks_per_minute_limit' => 200,
|
|
||||||
|
|
||||||
// Max stevilo vprasanj v anketi
|
|
||||||
'question_count_limit' => 0,
|
|
||||||
|
|
||||||
// Max stevilo vprasanj v anketi
|
|
||||||
'response_count_limit' => 0,
|
|
||||||
|
|
||||||
// Max stevilo poslanih vabil v anketi
|
|
||||||
'invitation_count_limit' => 0
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Nastavitev email streznika za posiljanje mailov
|
|
||||||
$email_server_settings = array(
|
|
||||||
'SMTPFrom' => '', // polje "from" pri posiljanju
|
|
||||||
'SMTPFromNice' => '', // izpisano ime posiljatelja
|
|
||||||
'SMTPReplyTo' => '', // polje "reply to" pri posiljanju
|
|
||||||
|
|
||||||
'SMTPHost' => '', // smtp streznik za posiljanje
|
|
||||||
'SMTPPort' => '', // št. porta
|
|
||||||
'SMTPSecure' => '', // tls ali ssl
|
|
||||||
'SMTPAuth' => 1, // 1 oz. 0
|
|
||||||
'SMTPUsername' => '', // username za smtp streznik
|
|
||||||
'SMTPPassword' => '' // geslo za smtp streznik
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Email streznik, ki se uporablja pri posiljanju emailov iz posamezne ankete
|
|
||||||
* - TRUE - emaili iz ankete se posiljajo preko istega streznika kot splosni emaili
|
|
||||||
* - FALSE (default) - pri vsaki anketi je potrebno posebej vnesti smtp streznik
|
|
||||||
*/
|
|
||||||
$email_server_fromSurvey = false;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* DODATNE NASTAVITVE APLIKACIJE ZA ADMINISTRATORJE */
|
|
||||||
// Po registraciji je lahko uporabnik neaktiven (banan) in ga mora administrator inštalacije še ročno potrditi (dobi na mail obvestilo o registraciji)
|
|
||||||
$confirm_registration = 0;
|
|
||||||
$confirm_registration_admin = $app_settings['admin_email'];
|
|
||||||
|
|
||||||
// Dodatna opcijska nastavitev, kam se pošlje email GDPR zahtevka za izbris (administratir instalacije)
|
|
||||||
$gdpr_admin_email = $app_settings['admin_email'];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* DODATNE FUNKCIONALNOSTI APLIKACIJE */
|
|
||||||
// Google reCaptcha - potrebno za delovanje recaptche pri registraciji in tipa vprašanja "captcha" v anketi
|
|
||||||
$recaptcha_sitekey = '';
|
|
||||||
$secret_captcha = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Google login podatki za prijavo v 1KO
|
|
||||||
* Pridobi API: https://developers.google.com/identity/sign-in/web
|
|
||||||
* Pregled vseh API-jev: https://console.developers.google.com/apis
|
|
||||||
*/
|
|
||||||
$google_login_client_id = '';
|
|
||||||
$google_login_client_secret = '';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Google maps - potrebno za delovanje tipa vprašanja "lokacija"
|
|
||||||
* Google's API key (CREATE YOUR OWN!) needed when working with Google Maps
|
|
||||||
* Instructions to get API key: https://developers.google.com/maps/documentation/javascript/get-api-key
|
|
||||||
* APIs need to be enabled: Google Maps JavaScript API, Google Maps Geocoding API, Google Places API Web Service
|
|
||||||
*/
|
|
||||||
$google_maps_API_key = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Facebook developer api - potrebno za delovanje prijave in registracije s FB računom
|
|
||||||
* Uporabi jscript include iz 1ka-grey header.php v svojem skinu
|
|
||||||
*/
|
|
||||||
$facebook_appid = '';
|
|
||||||
$facebook_appsecret = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Potrebno za delovanje modula "maza"
|
|
||||||
* Firebase Cloud Messaging server key is needed to work with module "Mobile aplication for respondents"
|
|
||||||
* NextPinMainToken and password is needed to work with NextPin API
|
|
||||||
*/
|
|
||||||
$FCM_server_key = '';
|
|
||||||
$APP_special_login_key = '';
|
|
||||||
$NextPinMainToken = '';
|
|
||||||
$NextPinMainPassword = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Nastavitve hierarhije
|
|
||||||
*/
|
|
||||||
$hierarhija_folder_id = ''; // Skupna mapa iz knjižnice za SA ankete
|
|
||||||
$hierarhija_default_id = ''; // privzeta SA anketa
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Squalo API za vabila
|
|
||||||
*/
|
|
||||||
$squalo_user = '';
|
|
||||||
$squalo_key = '';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* PLACEVANJE */
|
|
||||||
/**
|
|
||||||
* Izdajanje racunov preko cebelice
|
|
||||||
*/
|
|
||||||
$cebelica_api = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Stripe za placevanje s kreditno kartico
|
|
||||||
*/
|
|
||||||
$stripe_key = '';
|
|
||||||
$stripe_secret = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Placevanje s paypalom
|
|
||||||
*/
|
|
||||||
$paypal_account = '';
|
|
||||||
$paypal_client_id = '';
|
|
||||||
$paypal_secret = '';
|
|
@ -9544,3 +9544,27 @@ UPDATE misc SET value='21.08.30' WHERE what="version";
|
|||||||
UPDATE srv_survey_list SET updated='1';
|
UPDATE srv_survey_list SET updated='1';
|
||||||
|
|
||||||
UPDATE misc SET value='21.09.20' WHERE what="version";
|
UPDATE misc SET value='21.09.20' WHERE what="version";
|
||||||
|
|
||||||
|
## Ciscenje tabele "misc"
|
||||||
|
DELETE FROM misc WHERE NOT (
|
||||||
|
what LIKE '%version%'
|
||||||
|
OR what LIKE '%drupal version%'
|
||||||
|
OR what LIKE '%mobileApp_version%'
|
||||||
|
OR what LIKE '%SurveyLang_admin%'
|
||||||
|
OR what LIKE '%SurveyLang_resp%'
|
||||||
|
OR what LIKE '%SurveyDostop%'
|
||||||
|
OR what LIKE '%SurveyForum%'
|
||||||
|
OR what LIKE '%SurveyCookie%'
|
||||||
|
OR what LIKE '%CookieLife%'
|
||||||
|
);
|
||||||
|
|
||||||
|
## Nova tabela z nastavitvami aplikacije - SEM SE PRENESE VSE IZ settings_optional.php
|
||||||
|
CREATE TABLE app_settings(
|
||||||
|
what VARCHAR(100) CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||||
|
domain VARCHAR(100) CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||||
|
value TEXT CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||||
|
UNIQUE KEY (what, domain)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
UPDATE misc SET value='21.09.21' WHERE what="version";
|
||||||
|
|
||||||
|
266
utils/1kaUtils/app_settings_copy.php
Normal file
266
utils/1kaUtils/app_settings_copy.php
Normal file
@ -0,0 +1,266 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* prenese nastavitve aplikacije iz settings_optional.php v sql bazo
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
ini_set('display_errors', '1');
|
||||||
|
ini_set('display_startup_errors', '1');
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
|
|
||||||
|
include_once('../../function.php');
|
||||||
|
include_once('../../vendor/autoload.php');
|
||||||
|
include_once('../../settings_optional.php');
|
||||||
|
|
||||||
|
|
||||||
|
global $site_domain;
|
||||||
|
|
||||||
|
|
||||||
|
// Debuging - 0 ali 1, ali imamo debug vključen (privzeto je izključen)
|
||||||
|
global $debug;
|
||||||
|
$sql = sisplet_query("INSERT INTO app_settings SET value='".$debug."', domain='".$site_domain."', what='debug'");
|
||||||
|
|
||||||
|
|
||||||
|
// tip instalacije (lastna - 0, www - 1, aai - 2, virtualka - 3)
|
||||||
|
global $virtual_domain;
|
||||||
|
global $lastna_instalacija;
|
||||||
|
global $aai_instalacija;
|
||||||
|
|
||||||
|
if($virtual_domain)
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='3', domain='".$site_domain."', what='installation_type'");
|
||||||
|
elseif($lastna_instalacija)
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='0', domain='".$site_domain."', what='installation_type'");
|
||||||
|
elseif($aai_instalacija)
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='2', domain='".$site_domain."', what='installation_type'");
|
||||||
|
else
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='1', domain='".$site_domain."', what='installation_type'");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* DODATNE NASTAVITVE APLIKACIJE ZA LASTNE NAMESTITVE */
|
||||||
|
global $app_settings;
|
||||||
|
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['app_name']."', domain='".$site_domain."', what='app_settings-app_name'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['admin_email']."', domain='".$site_domain."', what='app_settings-admin_email'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['owner']."', domain='".$site_domain."', what='app_settings-owner'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['owner_website']."', domain='".$site_domain."', what='app_settings-owner_website'");
|
||||||
|
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['footer_custom']."', domain='".$site_domain."', what='app_settings-footer_custom'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['footer_text']."', domain='".$site_domain."', what='app_settings-footer_text'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['footer_survey_custom']."', domain='".$site_domain."', what='app_settings-footer_survey_custom'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['footer_survey_text']."', domain='".$site_domain."', what='app_settings-footer_survey_text'");
|
||||||
|
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['email_signature_custom']."', domain='".$site_domain."', what='app_settings-email_signature_custom'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['email_signature_text']."', domain='".$site_domain."', what='app_settings-email_signature_text'");
|
||||||
|
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['survey_finish_url']."', domain='".$site_domain."', what='app_settings-survey_finish_url'");
|
||||||
|
|
||||||
|
//sisplet_query("INSERT INTO app_settings SET value='".$app_settings['admin_allow_only_ip']."', domain='".$site_domain."', what='app_settings-admin_allow_only_ip'");
|
||||||
|
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['export_type']."', domain='".$site_domain."', what='app_settings-export_type'");
|
||||||
|
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_settings['commercial_packages']."', domain='".$site_domain."', what='app_settings-commercial_packages'");
|
||||||
|
|
||||||
|
|
||||||
|
/* OMEJITVE APLIKACIJE */
|
||||||
|
global $app_limits;
|
||||||
|
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_limits['clicks_per_minute_limit']."', domain='".$site_domain."', what='app_limits-clicks_per_minute_limit'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_limits['question_count_limit']."', domain='".$site_domain."', what='app_limits-question_count_limit'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_limits['response_count_limit']."', domain='".$site_domain."', what='app_limits-response_count_limit'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$app_limits['invitation_count_limit']."', domain='".$site_domain."', what='app_limits-invitation_count_limit'");
|
||||||
|
|
||||||
|
$admin_allow_only_ip_string = expolde(',', $app_settings['admin_allow_only_ip']);
|
||||||
|
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$admin_allow_only_ip_string."', domain='".$site_domain."', what='app_limits-admin_allow_only_ip'"); // !!!!
|
||||||
|
|
||||||
|
|
||||||
|
// Nastavitev email streznika za posiljanje mailov
|
||||||
|
global $email_server_settings;
|
||||||
|
global $email_server_fromSurvey;
|
||||||
|
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['SMTPFrom']."', domain='".$site_domain."', what='email_server_settings-SMTPFrom'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['SMTPFromNice']."', domain='".$site_domain."', what='email_server_settings-SMTPFromNice'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['SMTPReplyTo']."', domain='".$site_domain."', what='email_server_settings-SMTPReplyTo'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['SMTPHost']."', domain='".$site_domain."', what='email_server_settings-SMTPHost'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['SMTPPort']."', domain='".$site_domain."', what='email_server_settings-SMTPPort'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['SMTPSecure']."', domain='".$site_domain."', what='email_server_settings-SMTPSecure'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['SMTPAuth']."', domain='".$site_domain."', what='email_server_settings-SMTPAuth'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['SMTPUsername']."', domain='".$site_domain."', what='email_server_settings-SMTPUsername'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['SMTPPassword']."', domain='".$site_domain."', what='email_server_settings-SMTPPassword'");
|
||||||
|
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_fromSurvey."', domain='".$site_domain."', what='email_server_fromSurvey'");
|
||||||
|
|
||||||
|
if(isset($email_server_settings['secondary_mail'])){
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['secondary_mail']['SMTPFrom']."', domain='".$site_domain."', what='email_server_settings-secondary_mail-SMTPFrom'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['secondary_mail']['SMTPFromNice']."', domain='".$site_domain."', what='email_server_settings-secondary_mail-SMTPFromNice'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['secondary_mail']['SMTPReplyTo']."', domain='".$site_domain."', what='email_server_settings-secondary_mail-SMTPReplyTo'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['secondary_mail']['SMTPHost']."', domain='".$site_domain."', what='email_server_settings-secondary_mail-SMTPHost'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['secondary_mail']['SMTPPort']."', domain='".$site_domain."', what='email_server_settings-secondary_mail-SMTPPort'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['secondary_mail']['SMTPSecure']."', domain='".$site_domain."', what='email_server_settings-secondary_mail-SMTPSecure'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['secondary_mail']['SMTPAuth']."', domain='".$site_domain."', what='email_server_settings-secondary_mail-SMTPAuth'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['secondary_mail']['SMTPUsername']."', domain='".$site_domain."', what='email_server_settings-secondary_mail-SMTPUsername'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['secondary_mail']['SMTPPassword']."', domain='".$site_domain."', what='email_server_settings-secondary_mail-SMTPPassword'");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($email_server_settings['payments_mail'])){
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['payments_mail']['SMTPFrom']."', domain='".$site_domain."', what='email_server_settings-payments_mail-SMTPFrom'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['payments_mail']['SMTPFromNice']."', domain='".$site_domain."', what='email_server_settings-payments_mail-SMTPFromNice'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['payments_mail']['SMTPReplyTo']."', domain='".$site_domain."', what='email_server_settings-payments_mail-SMTPReplyTo'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['payments_mail']['SMTPHost']."', domain='".$site_domain."', what='email_server_settings-payments_mail-SMTPHost'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['payments_mail']['SMTPPort']."', domain='".$site_domain."', what='email_server_settings-payments_mail-SMTPPort'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['payments_mail']['SMTPSecure']."', domain='".$site_domain."', what='email_server_settings-payments_mail-SMTPSecure'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['payments_mail']['SMTPAuth']."', domain='".$site_domain."', what='email_server_settings-payments_mail-SMTPAuth'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['payments_mail']['SMTPUsername']."', domain='".$site_domain."', what='email_server_settings-payments_mail-SMTPUsername'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$email_server_settings['payments_mail']['SMTPPassword']."', domain='".$site_domain."', what='email_server_settings-payments_mail-SMTPPassword'");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* DODATNE NASTAVITVE APLIKACIJE ZA ADMINISTRATORJE */
|
||||||
|
global $confirm_registration;
|
||||||
|
global $confirm_registration_admin;
|
||||||
|
global $gdpr_admin_email;
|
||||||
|
|
||||||
|
$confirm_registration_admin_string = expolde(',', $confirm_registration_admin);
|
||||||
|
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$confirm_registration."', domain='".$site_domain."', what='confirm_registration'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$confirm_registration_admin_string."', domain='".$site_domain."', what='confirm_registration_admin'");
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$gdpr_admin_email."', domain='".$site_domain."', what='gdpr_admin_email'");
|
||||||
|
|
||||||
|
|
||||||
|
/* METAADMINI - opcijsko */
|
||||||
|
/*
|
||||||
|
// WWW - vvasja@gmail.com - 100, peter.h1203@gmail.com - 12611, 1ka.techsupport - 72253
|
||||||
|
$meta_admin_ids = array('100', '12611', '72253');
|
||||||
|
|
||||||
|
// VIRTUALKE - vvasja@gmail.com - 100, peter.h1203@gmail.com - 12611, 1ka.techsupport - 49089
|
||||||
|
$meta_admin_ids = array('100', '12611', '49089');
|
||||||
|
|
||||||
|
// AAI - Manca Jeras - 13147, Klavdija Mezek - 1417
|
||||||
|
$meta_admin_ids = array('1417', '13147');
|
||||||
|
|
||||||
|
// LOCALHOST
|
||||||
|
$meta_admin_ids = array('1046');
|
||||||
|
*/
|
||||||
|
global $meta_admin_ids;
|
||||||
|
|
||||||
|
$meta_admin_ids_string = expolde(',', $meta_admin_ids);
|
||||||
|
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$meta_admin_ids_string."', domain='".$site_domain."', what='meta_admin_ids'");
|
||||||
|
|
||||||
|
|
||||||
|
/* DODATNE FUNKCIONALNOSTI APLIKACIJE - GOOGLE */
|
||||||
|
global $recaptcha_sitekey;
|
||||||
|
global $secret_captcha;
|
||||||
|
global $google_login_client_id;
|
||||||
|
global $google_login_client_secret;
|
||||||
|
global $google_maps_API_key;
|
||||||
|
|
||||||
|
if($recaptcha_sitekey != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$recaptcha_sitekey."', domain='".$site_domain."', what='google-recaptcha_sitekey'");
|
||||||
|
if($secret_captcha != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$secret_captcha."', domain='".$site_domain."', what='google-secret_captcha'");
|
||||||
|
if($google_login_client_id != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$google_login_client_id."', domain='".$site_domain."', what='google-login_client_id'");
|
||||||
|
if($google_login_client_secret != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$google_login_client_secret."', domain='".$site_domain."', what='google-login_client_secret'");
|
||||||
|
if($google_maps_API_key != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$google_maps_API_key."', domain='".$site_domain."', what='google-maps_API_key'");
|
||||||
|
|
||||||
|
|
||||||
|
/* DODATNE FUNKCIONALNOSTI APLIKACIJE - FB */
|
||||||
|
global $facebook_appid;
|
||||||
|
global $facebook_appsecret;
|
||||||
|
|
||||||
|
if($facebook_appid != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$facebook_appid."', domain='".$site_domain."', what='facebook-appid'");
|
||||||
|
if($facebook_appid != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$facebook_appsecret."', domain='".$site_domain."', what='facebook-appsecret'");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Potrebno za delovanje modula "maza"
|
||||||
|
* Firebase Cloud Messaging server key is needed to work with module "Mobile aplication for respondents"
|
||||||
|
* NextPinMainToken and password is needed to work with NextPin API
|
||||||
|
*/
|
||||||
|
global $FCM_server_key;
|
||||||
|
global $APP_special_login_key;
|
||||||
|
global $NextPinMainToken;
|
||||||
|
global $NextPinMainPassword;
|
||||||
|
|
||||||
|
if($FCM_server_key != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$FCM_server_key."', domain='".$site_domain."', what='maza-FCM_server_key'");
|
||||||
|
if($APP_special_login_key != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$APP_special_login_key."', domain='".$site_domain."', what='maza-APP_special_login_key'");
|
||||||
|
if($NextPinMainToken != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$NextPinMainToken."', domain='".$site_domain."', what='maza-NextPinMainToken'");
|
||||||
|
if($NextPinMainPassword != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$NextPinMainPassword."', domain='".$site_domain."', what='maza-NextPinMainPassword'");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Nastavitve hierarhije
|
||||||
|
*/
|
||||||
|
global $hierarhija_folder_id;
|
||||||
|
global $hierarhija_default_id;
|
||||||
|
|
||||||
|
if($hierarhija_folder_id != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$hierarhija_folder_id."', domain='".$site_domain."', what='hierarhija-folder_id'");
|
||||||
|
if($hierarhija_default_id != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$hierarhija_default_id."', domain='".$site_domain."', what='hierarhija-default_id'");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Squalo API za vabila
|
||||||
|
*/
|
||||||
|
global $squalo_user;
|
||||||
|
global $squalo_key;
|
||||||
|
|
||||||
|
if($squalo_user != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$squalo_user."', domain='".$site_domain."', what='squalo-user'");
|
||||||
|
if($squalo_key != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$squalo_key."', domain='".$site_domain."', what='squalo-key'");
|
||||||
|
|
||||||
|
|
||||||
|
/* PLACEVANJE */
|
||||||
|
/**
|
||||||
|
* Izdajanje racunov preko cebelice
|
||||||
|
*/
|
||||||
|
global $cebelica_api;
|
||||||
|
|
||||||
|
if($cebelica_api != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$cebelica_api."', domain='".$site_domain."', what='cebelica_api'");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stripe za placevanje s kreditno kartico
|
||||||
|
*/
|
||||||
|
global $stripe_key;
|
||||||
|
global $stripe_secret;
|
||||||
|
|
||||||
|
if($stripe_key != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$stripe_key."', domain='".$site_domain."', what='stripe-key'");
|
||||||
|
if($stripe_secret != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$stripe_secret."', domain='".$site_domain."', what='stripe-secret'");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Placevanje s paypalom
|
||||||
|
*/
|
||||||
|
global $paypal_account;
|
||||||
|
global $paypal_client_id;
|
||||||
|
global $paypal_secret;
|
||||||
|
|
||||||
|
if($paypal_account != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$paypal_account."', domain='".$site_domain."', what='paypal-account'");
|
||||||
|
if($paypal_client_id != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$paypal_client_id."', domain='".$site_domain."', what='paypal-client_id'");
|
||||||
|
if($paypal_secret != '')
|
||||||
|
sisplet_query("INSERT INTO app_settings SET value='".$paypal_secret."', domain='".$site_domain."', what='paypal-secret'");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
@ -16,8 +16,7 @@
|
|||||||
|
|
||||||
/*** TRGOVINA ***/
|
/*** TRGOVINA ***/
|
||||||
|
|
||||||
global $app_settings;
|
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === false){
|
||||||
if(isset($app_settings['commercial_packages']) && $app_settings['commercial_packages'] == true){
|
|
||||||
|
|
||||||
$unc = new UserNarocilaCron();
|
$unc = new UserNarocilaCron();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user