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" />';
|
||||
|
||||
// Ce imamo vklopljene komercialne pakete
|
||||
global $app_settings;
|
||||
if($app_settings['commercial_packages']){
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||
$userAccess = UserAccess::getInstance($global_user_id);
|
||||
|
||||
// Ce gre za staro anketo nimamo omejitev
|
||||
@ -264,7 +263,6 @@ class SurveyAdmin
|
||||
global $lang;
|
||||
global $admin_type;
|
||||
global $site_domain;
|
||||
global $aai_instalacija;
|
||||
|
||||
|
||||
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)
|
||||
if($this->anketa == 0){
|
||||
|
||||
global $app_settings;
|
||||
if($app_settings['commercial_packages'] == true){
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||
|
||||
// Preverimo trenuten paket uporabnika
|
||||
$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
|
||||
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))
|
||||
&& User::getInstance()->getSetting($setting='gdpr_agree') == '-1') {
|
||||
if ( ($site_url == 'http://test.1ka.si/'
|
||||
|| isWWW()
|
||||
|| isAAI()
|
||||
|| ($cookie_domain == '.1ka.si' && isVirtual()))
|
||||
&& User::getInstance()->getSetting($setting='gdpr_agree') == '-1'
|
||||
) {
|
||||
|
||||
// Avtomatsko prikazemo po loadu
|
||||
echo '<script>$(document).ready(function(){showGDPRMessage();})</script>';
|
||||
@ -710,9 +711,7 @@ class SurveyAdmin
|
||||
// Priakz footerja
|
||||
private function displayFooter(){
|
||||
global $lang;
|
||||
global $app_settings;
|
||||
global $site_frontend;
|
||||
global $aai_instalacija;
|
||||
global $mysql_database_name;
|
||||
|
||||
|
||||
@ -723,14 +722,14 @@ class SurveyAdmin
|
||||
echo '<div class="footer_left">';
|
||||
|
||||
// Custom footer
|
||||
if(isset($app_settings['footer_custom']) && $app_settings['footer_custom'] == 1){
|
||||
echo $app_settings['footer_text'];
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-footer_custom') !== false){
|
||||
echo AppSettings::getInstance()->getSetting('app_settings-footer_text');
|
||||
}
|
||||
// Default footer
|
||||
else{
|
||||
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>';
|
||||
}
|
||||
|
||||
@ -774,7 +773,7 @@ class SurveyAdmin
|
||||
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>';
|
||||
}
|
||||
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>';
|
||||
}
|
||||
else{
|
||||
@ -877,9 +876,8 @@ class SurveyAdmin
|
||||
|
||||
|
||||
// Gumb za nadgraditev paketa (ce imamo vklopljene pakete in nimamo 3ka paketa)
|
||||
global $app_settings;
|
||||
global $global_user_id;
|
||||
if($app_settings['commercial_packages'] == true){
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||
|
||||
// Preverimo trenuten paket uporabnika
|
||||
$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
|
||||
global $app_settings;
|
||||
if($app_settings['commercial_packages'] == true){
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||
echo '<script> userAccessExport(); </script>';
|
||||
}
|
||||
}
|
||||
|
@ -754,8 +754,7 @@ class SurveyAdminAjax {
|
||||
|
||||
$poslji_email = [];
|
||||
|
||||
global $app_settings;
|
||||
$PageName = $app_settings['app_name'];
|
||||
$PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
|
||||
|
||||
// Pošljemo email na alternativni email in nato še na primarni email samo obvestilo o dodanem emailu
|
||||
$poslji_email['novi'] = [
|
||||
@ -5556,7 +5555,6 @@ class SurveyAdminAjax {
|
||||
function ajax_alert_custom() {
|
||||
global $lang;
|
||||
global $global_user_id;
|
||||
global $app_settings;
|
||||
|
||||
$anketa = $this->anketa;
|
||||
$type = $_POST['type'];
|
||||
|
@ -2684,7 +2684,6 @@ class SurveyAdminSettings {
|
||||
global $lang;
|
||||
global $site_url;
|
||||
global $admin_type;
|
||||
global $app_settings;
|
||||
|
||||
$anketa = $this->anketa;
|
||||
|
||||
@ -4350,22 +4349,20 @@ class SurveyAdminSettings {
|
||||
public function display_add_survey_dostop(){
|
||||
global $lang;
|
||||
global $admin_type;
|
||||
global $app_settings;
|
||||
global $aai_instalacija;
|
||||
|
||||
echo '<p class="bold">';
|
||||
|
||||
// Admini in managerji lahko dodajo dostop komurkoli
|
||||
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
|
||||
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
|
||||
if(isset($aai_instalacija) && $aai_instalacija == true){
|
||||
if(isAAI()){
|
||||
echo $lang['srv_dostop_adduserstxt_aai_more'];
|
||||
}
|
||||
|
||||
@ -8202,7 +8199,6 @@ class SurveyAdminSettings {
|
||||
public function dodajNovegaUporabnika(){
|
||||
global $admin_type;
|
||||
global $lang;
|
||||
global $virtual_domain;
|
||||
|
||||
// admini lahko dodajajo uporabnike, ki jih nato managirajo
|
||||
if($admin_type != 0)
|
||||
@ -8243,14 +8239,13 @@ class SurveyAdminSettings {
|
||||
global $admin_type;
|
||||
global $lang;
|
||||
global $global_user_id;
|
||||
global $virtual_domain;
|
||||
|
||||
// managerji in admini lahko dodajajo uporabnike, ki jih nato managirajo
|
||||
if( !($admin_type == 1 || $admin_type == 0) )
|
||||
return '';
|
||||
|
||||
// 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
|
||||
$managed_accounts_limit = 5;
|
||||
@ -9317,7 +9312,7 @@ class SurveyAdminSettings {
|
||||
}
|
||||
|
||||
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
|
||||
$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
|
||||
if($app_settings['commercial_packages']){
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||
|
||||
echo '<br>';
|
||||
|
||||
@ -9400,7 +9395,7 @@ class SurveyAdminSettings {
|
||||
echo '<br />';
|
||||
|
||||
// AAI nima moznosti spreminjanja imena, priimka, emaila, gesla...
|
||||
if($aai_instalacija){
|
||||
if(isAAI()){
|
||||
echo '<span class="italic">'.$lang['srv_profil_aai_warning'].'</span>';
|
||||
}
|
||||
else{
|
||||
@ -9504,7 +9499,7 @@ class SurveyAdminSettings {
|
||||
|
||||
|
||||
// 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_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
|
||||
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
|
||||
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']);
|
||||
}
|
||||
}
|
||||
|
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:>
|
||||
*/
|
||||
function getFromEmail() {
|
||||
global $global_user_id, $site_domain, $email_server_settings;
|
||||
global $global_user_id, $site_domain;
|
||||
|
||||
if(isset($email_server_settings['SMTPFrom']))
|
||||
$MailFrom = $email_server_settings['SMTPFrom'];
|
||||
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom') !== false)
|
||||
$MailFrom = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom');
|
||||
|
||||
# Če je slučanjo napaka nastavimo info@1ka.si
|
||||
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)
|
||||
public static function getEmailSignature($lang_id = 0){
|
||||
global $lang;
|
||||
global $app_settings;
|
||||
|
||||
if(isset($app_settings['email_signature_custom']) && $app_settings['email_signature_custom'] == 1){
|
||||
$signature = '<br /><br /><br />'.$app_settings['email_signature_text'];
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-email_signature_custom') !== false){
|
||||
$signature = '<br /><br /><br />'.AppSettings::getInstance()->getSetting('app_settings-email_signature_text');
|
||||
}
|
||||
else{
|
||||
|
||||
|
@ -278,7 +278,7 @@ class Dostop {
|
||||
*/
|
||||
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'];
|
||||
$name = $_POST['name'];
|
||||
@ -320,13 +320,13 @@ class Dostop {
|
||||
|
||||
$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">';
|
||||
$out = '<a href="'.$this->page_urls['page_unregister'].'?email='.$email.'">';
|
||||
|
||||
// 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("SFMAIL", $email, $UserContent);
|
||||
@ -339,7 +339,7 @@ class Dostop {
|
||||
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
|
||||
|
||||
// Ce gre slucajno za virtualko
|
||||
if($virtual_domain)
|
||||
if(isVirtual())
|
||||
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
|
||||
|
||||
if ($password2 == "") {
|
||||
@ -683,7 +683,6 @@ class Dostop {
|
||||
global $lang;
|
||||
global $global_user_id;
|
||||
global $admin_type;
|
||||
global $virtual_domain;
|
||||
|
||||
$uid = $_POST['uid'];
|
||||
|
||||
@ -757,7 +756,7 @@ class Dostop {
|
||||
}
|
||||
|
||||
// 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'");
|
||||
|
||||
if (mysqli_num_rows($sqlu) > 0) {
|
||||
@ -768,8 +767,7 @@ class Dostop {
|
||||
echo '</div>';
|
||||
|
||||
// Segment paket
|
||||
global $app_settings;
|
||||
if($app_settings['commercial_packages'] == true){
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||
echo '<div class="segment user_package">';
|
||||
|
||||
$userAccess = UserAccess::getInstance($uid);
|
||||
@ -1510,7 +1508,6 @@ class Dostop {
|
||||
public function ajax_confirm_user_email(){
|
||||
global $pass_salt;
|
||||
global $lang;
|
||||
global $app_settings;
|
||||
|
||||
$uid = (!empty($_POST['uid']) ? $_POST['uid'] : NULL);
|
||||
|
||||
@ -1540,7 +1537,7 @@ class Dostop {
|
||||
// Ce gre slucajno za virutalko
|
||||
$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>';
|
||||
|
||||
// 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
|
||||
public function sendGDPRRequest($request_data){
|
||||
global $lang;
|
||||
global $gdpr_admin_email;
|
||||
global $app_settings;
|
||||
|
||||
$errors = array();
|
||||
|
||||
@ -1635,7 +1633,7 @@ class GDPR{
|
||||
//$MA->addRecipients('dusan.rutnik@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);
|
||||
}
|
||||
else{
|
||||
|
@ -954,9 +954,8 @@ class Library {
|
||||
$hierarhija = (empty($_POST['hierarhija']) ? false : true);
|
||||
|
||||
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) {
|
||||
@ -1030,10 +1029,10 @@ class Library {
|
||||
|
||||
// Če imamo hierarhijo in je privzeta anketa potem preverimo v settings_optional.php
|
||||
if(!empty($_POST['hierarhija']) && $ank_id == 'privzeta'){
|
||||
global $hierarhija_default_id;
|
||||
$ank_id=$hierarhija_default_id;
|
||||
$ank_id = AppSettings::getInstance()->getSetting('hierarhija-default_id');
|
||||
}
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
$API_call = true;
|
||||
}
|
||||
|
||||
|
@ -46,8 +46,6 @@ class NewSurvey{
|
||||
global $lang;
|
||||
global $site_url;
|
||||
global $site_path;
|
||||
global $virtual_domain;
|
||||
global $debug;
|
||||
global $admin_type;
|
||||
|
||||
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>';
|
||||
|
||||
// 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, '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>';
|
||||
|
||||
@ -540,7 +538,6 @@ class NewSurvey{
|
||||
echo '<div class="setting archive" id="hierarhija-opcije-vklopa">';
|
||||
|
||||
if(!empty($_GET['c']) && $_GET['c'] == 'izbira'){
|
||||
global $hierarhija_default_id;
|
||||
|
||||
echo '<h4>'.$lang['srv_hierarchy_intro_select_title'].':</h4>';
|
||||
echo '<div class="izbira">';
|
||||
@ -563,7 +560,7 @@ class NewSurvey{
|
||||
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'].'
|
||||
<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>
|
||||
</a>
|
||||
</label>';
|
||||
|
@ -392,14 +392,14 @@ class Notifications {
|
||||
}
|
||||
|
||||
public function ajax_viewGDPRMessage(){
|
||||
global $lang, $global_user_id, $aai_instalacija;
|
||||
global $lang, $global_user_id;
|
||||
|
||||
echo '<h2>'.$lang['srv_notifications_unread'].'</h2>';
|
||||
|
||||
echo '<ul>';
|
||||
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>';
|
||||
}
|
||||
else{
|
||||
|
@ -15,7 +15,7 @@ class SurveyAktivnost{
|
||||
* @desc prikaze diagnostiko anket
|
||||
*/
|
||||
public function diagnostics() {
|
||||
global $lang, $global_user_id, $admin_type, $app_settings;
|
||||
global $lang, $global_user_id, $admin_type;
|
||||
|
||||
$sum = 0;
|
||||
$sum_survey = 0;
|
||||
@ -53,7 +53,7 @@ class SurveyAktivnost{
|
||||
|
||||
$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_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
|
||||
@ -710,7 +710,7 @@ class SurveyAktivnost{
|
||||
}
|
||||
|
||||
private function diagnostics_show_interval ($t) {
|
||||
global $lang, $app_settings;
|
||||
global $lang;
|
||||
|
||||
echo '<form name="intr" action="index.php" method="get">';
|
||||
echo '<input type="hidden" name="a" value="diagnostics">';
|
||||
@ -727,7 +727,7 @@ class SurveyAktivnost{
|
||||
|
||||
$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_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
|
||||
@ -868,11 +868,10 @@ class SurveyAktivnost{
|
||||
|
||||
// Filter po paketih, ce jih imamo
|
||||
private function diagnostics_get_user_package(){
|
||||
global $app_settings;
|
||||
|
||||
$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_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
|
||||
|
@ -23,22 +23,21 @@ class SurveyCheck {
|
||||
|
||||
// Preverimo stevilo vprasanj v anketi
|
||||
public function checkLimitSpremenljivke(){
|
||||
global $app_limits;
|
||||
|
||||
// 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;
|
||||
|
||||
// Dobimo stevilo vprasanj v anketi
|
||||
$stevilo_vprasanj = SurveyInfo::getInstance()->getSurveyQuestionCount();
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
else{
|
||||
@ -48,10 +47,9 @@ class SurveyCheck {
|
||||
|
||||
// Preverimo stevilo poslanih vabil
|
||||
public function checkLimitVabila(){
|
||||
global $app_limits;
|
||||
|
||||
// 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;
|
||||
|
||||
// Prestejemo poslana vabila
|
||||
@ -64,12 +62,12 @@ class SurveyCheck {
|
||||
$stevilo_vabil = $row['stevilo_vabil'];
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
else{
|
||||
@ -79,22 +77,21 @@ class SurveyCheck {
|
||||
|
||||
// Preverimo stevilo responsov na anketo
|
||||
public function checkLimitResponses(){
|
||||
global $app_limits;
|
||||
|
||||
// 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;
|
||||
|
||||
// Dobimo stevilo odgovorov na anketo
|
||||
$stevilo_odgovorov = SurveyInfo::getInstance()->getSurveyAnswersCount();
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
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...
|
||||
private function sendAlert($alert_type, $count=0){
|
||||
global $site_url;
|
||||
global $lastna_instalacija;
|
||||
|
||||
// Alerta ne posljemo na lastnih instalacijah
|
||||
if($lastna_instalacija)
|
||||
if(isLastnaInstalacija())
|
||||
return;
|
||||
|
||||
switch($alert_type){
|
||||
@ -181,12 +241,19 @@ class SurveyCheck {
|
||||
$title = 'Opozorilo - potencialna phishing anketa';
|
||||
$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;
|
||||
}
|
||||
|
||||
try{
|
||||
$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);
|
||||
}
|
||||
catch (Exception $e){
|
||||
@ -197,6 +264,73 @@ class SurveyCheck {
|
||||
$SL->addMessage(SurveyLog::ERROR, $title.' - anketa '.$this->anketa);
|
||||
$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
|
||||
*/
|
||||
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();
|
||||
|
||||
@ -772,8 +772,7 @@ class SurveyList {
|
||||
}
|
||||
|
||||
# Narocila - samo ce imamo vklopljene pakete
|
||||
global $app_settings;
|
||||
if($app_settings['commercial_packages']){
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||
echo '<li class="spaceBig"> </li>';
|
||||
|
||||
echo '<li>';
|
||||
|
@ -15,7 +15,6 @@ class SurveyTheme {
|
||||
global $site_domain;
|
||||
global $global_user_id;
|
||||
global $admin_type;
|
||||
global $debug;
|
||||
|
||||
$this->sid = $sid;
|
||||
|
||||
@ -67,12 +66,11 @@ class SurveyTheme {
|
||||
12 => 'Embed2.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[15] = 'Fdv.css';
|
||||
$standard_skins[16] = 'Cdi.css';
|
||||
$standard_skins[17] = 'WebSM.css';
|
||||
//}
|
||||
|
||||
$standard_skins[14] = 'Uni.css';
|
||||
$standard_skins[15] = 'Fdv.css';
|
||||
$standard_skins[16] = 'Cdi.css';
|
||||
$standard_skins[17] = 'WebSM.css';
|
||||
|
||||
// Novi safe skini so v loceni skupini
|
||||
$safe_skins = array(
|
||||
@ -96,11 +94,10 @@ class SurveyTheme {
|
||||
5 => 'MobilePurple.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[8] = 'MobileFdv.css';
|
||||
$mobile_skins[9] = 'MobileCdi.css';
|
||||
//}
|
||||
|
||||
$mobile_skins[7] = 'MobileUni.css';
|
||||
$mobile_skins[8] = 'MobileFdv.css';
|
||||
$mobile_skins[9] = 'MobileCdi.css';
|
||||
|
||||
// Safe skini
|
||||
if(in_array($file, $safe_skins)){
|
||||
|
@ -293,7 +293,7 @@ class MobileSurveyAdmin{
|
||||
|
||||
// Izris glavne navigacije v mojih anketah
|
||||
private function displayMenuMySurveysNavigation(){
|
||||
global $lang, $admin_type, $app_settings;
|
||||
global $lang, $admin_type;
|
||||
|
||||
|
||||
# naložimo razred z seznamom anket
|
||||
@ -518,7 +518,7 @@ class MobileSurveyAdmin{
|
||||
|
||||
|
||||
// NAROCILA
|
||||
if($app_settings['commercial_packages']){
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||
|
||||
// placila - samo admini
|
||||
if ($admin_type == '0') {
|
||||
|
@ -71,8 +71,6 @@ class MailAdapter{
|
||||
private function prepareSurveySettings(){
|
||||
global $admin_type;
|
||||
global $mysql_database_name;
|
||||
global $email_server_settings;
|
||||
global $email_server_fromSurvey;
|
||||
|
||||
|
||||
// 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
|
||||
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']['SMTPFromNice'] = $email_server_settings['SMTPFromNice'];
|
||||
$this->settings['1ka']['SMTPHost'] = $email_server_settings['SMTPHost'];
|
||||
$this->settings['1ka']['SMTPPort'] = $email_server_settings['SMTPPort'];
|
||||
$this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom');
|
||||
$this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFromNice');
|
||||
$this->settings['1ka']['SMTPHost'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPHost');
|
||||
$this->settings['1ka']['SMTPPort'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPort');
|
||||
|
||||
if(isset($email_server_settings['SMTPAuth']) && $email_server_settings['SMTPAuth'] == 1){
|
||||
$this->settings['1ka']['SMTPAuth'] = $email_server_settings['SMTPAuth'];
|
||||
$this->settings['1ka']['SMTPUsername'] = $email_server_settings['SMTPUsername'];
|
||||
$this->settings['1ka']['SMTPPassword'] = $email_server_settings['SMTPPassword'];
|
||||
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPAuth') === true){
|
||||
$this->settings['1ka']['SMTPAuth'] = 1;
|
||||
$this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername');
|
||||
$this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPassword');
|
||||
}
|
||||
|
||||
if(isset($email_server_settings['SMTPSecure']))
|
||||
$this->settings['1ka']['SMTPSecure'] = $email_server_settings['SMTPSecure'];
|
||||
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure') !== false)
|
||||
$this->settings['1ka']['SMTPSecure'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure');
|
||||
|
||||
// Pri google smtp je username vedno email
|
||||
if($this->mailMode == 'google')
|
||||
$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)
|
||||
if($this->type == 'invitation' && $admin_type == 0 && isset($email_server_settings['secondary_mail'])){
|
||||
$this->settings['1ka']['SMTPFrom'] = $email_server_settings['secondary_mail']['SMTPFrom'];
|
||||
$this->settings['1ka']['SMTPFromNice'] = $email_server_settings['secondary_mail']['SMTPFromNice'];
|
||||
$this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['secondary_mail']['SMTPReplyTo'];
|
||||
$this->settings['1ka']['SMTPUsername'] = $email_server_settings['secondary_mail']['SMTPUsername'];
|
||||
$this->settings['1ka']['SMTPPassword'] = $email_server_settings['secondary_mail']['SMTPPassword'];
|
||||
if($this->type == 'invitation' && $admin_type == 0 && AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom') !== false){
|
||||
|
||||
$this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom');
|
||||
$this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFromNice');
|
||||
$this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPReplyTo');
|
||||
$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
|
||||
@ -149,20 +148,20 @@ class MailAdapter{
|
||||
else{
|
||||
|
||||
// Nastavimo 1ka smtp
|
||||
$this->settings['1ka']['SMTPFrom'] = $email_server_settings['SMTPFrom'];
|
||||
$this->settings['1ka']['SMTPFromNice'] = $email_server_settings['SMTPFromNice'];
|
||||
$this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['SMTPReplyTo'];
|
||||
$this->settings['1ka']['SMTPHost'] = $email_server_settings['SMTPHost'];
|
||||
$this->settings['1ka']['SMTPPort'] = $email_server_settings['SMTPPort'];
|
||||
$this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom');
|
||||
$this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFromNice');
|
||||
$this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPReplyTo');
|
||||
$this->settings['1ka']['SMTPHost'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPHost');
|
||||
$this->settings['1ka']['SMTPPort'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPort');
|
||||
|
||||
if(isset($email_server_settings['SMTPAuth']) && $email_server_settings['SMTPAuth'] == 1){
|
||||
$this->settings['1ka']['SMTPAuth'] = $email_server_settings['SMTPAuth'];
|
||||
$this->settings['1ka']['SMTPUsername'] = $email_server_settings['SMTPUsername'];
|
||||
$this->settings['1ka']['SMTPPassword'] = $email_server_settings['SMTPPassword'];
|
||||
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPAuth') === true){
|
||||
$this->settings['1ka']['SMTPAuth'] = 1;
|
||||
$this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername');
|
||||
$this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPassword');
|
||||
}
|
||||
|
||||
if(isset($email_server_settings['SMTPSecure']))
|
||||
$this->settings['1ka']['SMTPSecure'] = $email_server_settings['SMTPSecure'];
|
||||
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure') !== false)
|
||||
$this->settings['1ka']['SMTPSecure'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure');
|
||||
|
||||
// Nastavimo default delay
|
||||
$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
|
||||
if($email_server_fromSurvey){
|
||||
if(AppSettings::getInstance()->getSetting('email_server_fromSurvey') === true){
|
||||
$this->prepareGeneralSettings();
|
||||
}
|
||||
else{
|
||||
@ -187,13 +186,13 @@ class MailAdapter{
|
||||
if($this->type == 'invitation'){
|
||||
|
||||
// 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->settings['1ka']['SMTPFrom'] = $email_server_settings['secondary_mail']['SMTPFrom'];
|
||||
$this->settings['1ka']['SMTPFromNice'] = $email_server_settings['secondary_mail']['SMTPFromNice'];
|
||||
$this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['secondary_mail']['SMTPReplyTo'];
|
||||
$this->settings['1ka']['SMTPUsername'] = $email_server_settings['secondary_mail']['SMTPUsername'];
|
||||
$this->settings['1ka']['SMTPPassword'] = $email_server_settings['secondary_mail']['SMTPPassword'];
|
||||
$this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom');
|
||||
$this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFromNice');
|
||||
$this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPReplyTo');
|
||||
$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');
|
||||
}
|
||||
// Drugace je potrebno nastaviti smtp
|
||||
else{
|
||||
@ -211,37 +210,36 @@ class MailAdapter{
|
||||
|
||||
// Pripravimo nastavitve splosnega posiljanja v aplikaciji glede na nastavitve v settings_optional.php
|
||||
private function prepareGeneralSettings(){
|
||||
global $email_server_settings;
|
||||
global $mysql_database_name;
|
||||
|
||||
$this->mailMode = 'smtp';
|
||||
$this->settings['SMTPMailMode'] = 2;
|
||||
|
||||
$this->settings['smtp'] = array(
|
||||
'SMTPFrom' => $email_server_settings['SMTPFrom'],
|
||||
'SMTPFromNice' => $email_server_settings['SMTPFromNice'],
|
||||
'SMTPReplyTo' => $email_server_settings['SMTPReplyTo'],
|
||||
'SMTPFrom' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom'),
|
||||
'SMTPFromNice' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPFromNice'),
|
||||
'SMTPReplyTo' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPReplyTo'),
|
||||
|
||||
'SMTPHost' => $email_server_settings['SMTPHost'],
|
||||
'SMTPPort' => $email_server_settings['SMTPPort']
|
||||
'SMTPHost' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPHost'),
|
||||
'SMTPPort' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPPort')
|
||||
);
|
||||
|
||||
if(isset($email_server_settings['SMTPAuth']) && $email_server_settings['SMTPAuth'] == 1){
|
||||
$this->settings['smtp']['SMTPAuth'] = $email_server_settings['SMTPAuth'];
|
||||
$this->settings['smtp']['SMTPUsername'] = $email_server_settings['SMTPUsername'];
|
||||
$this->settings['smtp']['SMTPPassword'] = $email_server_settings['SMTPPassword'];
|
||||
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPAuth') === true){
|
||||
$this->settings['smtp']['SMTPAuth'] = 1;
|
||||
$this->settings['smtp']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername');
|
||||
$this->settings['smtp']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPassword');
|
||||
}
|
||||
|
||||
if(isset($email_server_settings['SMTPSecure']))
|
||||
$this->settings['smtp']['SMTPSecure'] = $email_server_settings['SMTPSecure'];
|
||||
if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername') !== false)
|
||||
$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)
|
||||
if($this->type == 'payments' && isset($email_server_settings['payments_mail']) && $mysql_database_name == 'real1kasi'){
|
||||
$this->settings['smtp']['SMTPFrom'] = $email_server_settings['payments_mail']['SMTPFrom'];
|
||||
$this->settings['smtp']['SMTPFromNice'] = $email_server_settings['payments_mail']['SMTPFromNice'];
|
||||
$this->settings['smtp']['SMTPReplyTo'] = $email_server_settings['payments_mail']['SMTPReplyTo'];
|
||||
$this->settings['smtp']['SMTPUsername'] = $email_server_settings['payments_mail']['SMTPUsername'];
|
||||
$this->settings['smtp']['SMTPPassword'] = $email_server_settings['payments_mail']['SMTPPassword'];
|
||||
if($this->type == 'payments' && AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPFrom') !== false && $mysql_database_name == 'real1kasi'){
|
||||
$this->settings['smtp']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPFrom');
|
||||
$this->settings['smtp']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPFromNice');
|
||||
$this->settings['smtp']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPReplyTo');
|
||||
$this->settings['smtp']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPUsername');
|
||||
$this->settings['smtp']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPPassword');
|
||||
}
|
||||
|
||||
// Nastavimo default delay
|
||||
@ -709,7 +707,7 @@ class MailAdapter{
|
||||
|
||||
// Pripravimo design emaila
|
||||
private function prepareEmailDesign($content, $heading='', $image='', $button=''){
|
||||
global $lang, $app_settings, $site_domain;
|
||||
global $lang, $site_domain;
|
||||
|
||||
// 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'))){
|
||||
|
@ -7159,8 +7159,7 @@ class SurveyAnalysis {
|
||||
echo '</div>';
|
||||
|
||||
// Javascript s katerim povozimo urlje za izvoze, ki niso na voljo v paketu
|
||||
global $app_settings;
|
||||
if($app_settings['commercial_packages'] == true){
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||
echo '<script> userAccessExport(); </script>';
|
||||
}
|
||||
}
|
||||
|
@ -1526,8 +1526,7 @@ class SurveyBreak
|
||||
echo '</div>';
|
||||
|
||||
// Javascript s katerim povozimo urlje za izvoze, ki niso na voljo v paketu
|
||||
global $app_settings;
|
||||
if($app_settings['commercial_packages'] == true){
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
|
||||
echo '<script> userAccessExport(); </script>';
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ class SurveyAlert
|
||||
* se s pomočjo crontaba zaganja vsak dan samodejno.
|
||||
*/
|
||||
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
|
||||
$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
|
||||
*/
|
||||
static function sendMailActive() {
|
||||
global $lang, $site_url, $site_path, $app_settings;
|
||||
global $lang, $site_url, $site_path;
|
||||
|
||||
// poiščemo vse email naslove
|
||||
// poiscemo e-maile od avtorja in userjev v dostopu
|
||||
@ -368,7 +368,7 @@ class SurveyAlert
|
||||
* Funkcija pošlje emaile ob izbrisu ankete
|
||||
*/
|
||||
static function sendMailDelete() {
|
||||
global $lang, $site_url, $site_path, $app_settings;
|
||||
global $lang, $site_url, $site_path;
|
||||
|
||||
// poiščemo vse email naslove
|
||||
// poiscemo e-maile od avtorja in userjev v dostopu
|
||||
@ -484,7 +484,7 @@ class SurveyAlert
|
||||
}
|
||||
|
||||
static function setDefaultAlertBeforeExpire() {
|
||||
global $lang, $site_url, $site_path, $app_settings;
|
||||
global $lang, $site_url, $site_path;
|
||||
|
||||
$turn_on_alert = false;
|
||||
|
||||
@ -535,7 +535,6 @@ class SurveyAlert
|
||||
static function setDefaultAlertActivation() {
|
||||
global $lang;
|
||||
global $global_user_id;
|
||||
global $app_settings;
|
||||
|
||||
$anketa = self::getSurveyId();
|
||||
|
||||
|
@ -89,7 +89,6 @@ class SurveyInvitationsNew {
|
||||
function action($action) {
|
||||
global $lang;
|
||||
global $site_url;
|
||||
global $app_settings;
|
||||
global $global_user_id;
|
||||
|
||||
$NoNavi = $_POST['noNavi'];
|
||||
@ -2764,7 +2763,7 @@ class SurveyInvitationsNew {
|
||||
}
|
||||
|
||||
function displayNavigation() {
|
||||
global $lang, $admin_type, $global_user_id, $app_settings;
|
||||
global $lang, $admin_type, $global_user_id;
|
||||
|
||||
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
||||
|
||||
@ -3713,7 +3712,7 @@ class SurveyInvitationsNew {
|
||||
|
||||
// Glavno posiljanje mail vabil
|
||||
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);
|
||||
|
||||
@ -3799,7 +3798,7 @@ class SurveyInvitationsNew {
|
||||
$numRows = mysqli_num_rows($sql_query);
|
||||
|
||||
# č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
|
||||
if (!Common::checkModule('gorenje')){
|
||||
@ -6968,7 +6967,7 @@ class SurveyInvitationsNew {
|
||||
}
|
||||
|
||||
function showInvitationStatus() {
|
||||
global $admin_type, $app_settings, $global_user_id;
|
||||
global $admin_type, $global_user_id;
|
||||
|
||||
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
||||
$d = new Dostop();
|
||||
@ -7004,7 +7003,7 @@ class SurveyInvitationsNew {
|
||||
|
||||
// Prikaz statusov posiljanj
|
||||
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');
|
||||
|
||||
@ -7470,7 +7469,7 @@ class SurveyInvitationsNew {
|
||||
|
||||
// Prikaz statusov posiljanj pri volitvah
|
||||
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');
|
||||
|
||||
@ -7610,7 +7609,7 @@ class SurveyInvitationsNew {
|
||||
|
||||
|
||||
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;
|
||||
$_email = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
|
||||
@ -9831,7 +9830,6 @@ class SurveyInvitationsNew {
|
||||
global $admin_type;
|
||||
global $global_user_id;
|
||||
global $mysql_database_name;
|
||||
global $aai_instalacija;
|
||||
|
||||
|
||||
$row = SurveyInfo::getInstance()->getSurveyRow();
|
||||
@ -9886,7 +9884,7 @@ class SurveyInvitationsNew {
|
||||
echo '<span class="bold">'.$lang['srv_email_setting_select_server'].'</span> ';
|
||||
|
||||
// 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 $lang['srv_email_setting_adapter0_aai']. ' </label>';
|
||||
}
|
||||
|
@ -18,12 +18,10 @@ class SqualoApi {
|
||||
|
||||
|
||||
private function executeCall($action, $method, $data){
|
||||
global $squalo_user;
|
||||
global $squalo_key;
|
||||
|
||||
// Add credentials
|
||||
$data['apiUser'] = $squalo_user;
|
||||
$data['apiKey'] = $squalo_key;
|
||||
$data['apiUser'] = AppSettings::getInstance()->getSetting('squalo-user');
|
||||
$data['apiKey'] = AppSettings::getInstance()->getSetting('squalo-key');
|
||||
|
||||
// GET call - set url params
|
||||
if($method == 'GET'){
|
||||
|
@ -38,8 +38,6 @@ class SurveyInvitationsSqualo {
|
||||
private function checkSqualoEnabled(){
|
||||
global $mysql_database_name;
|
||||
global $admin_type;
|
||||
global $squalo_user;
|
||||
global $squalo_key;
|
||||
|
||||
// Zaenkrat imajo squalo samo admini
|
||||
if($admin_type != 0)
|
||||
@ -50,7 +48,7 @@ class SurveyInvitationsSqualo {
|
||||
return false;
|
||||
|
||||
// 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 true;
|
||||
|
@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
|
||||
global $site_url, $global_user_id, $app_settings;
|
||||
global $site_url, $global_user_id;
|
||||
|
||||
$surveySkin = 0;
|
||||
|
||||
@ -85,8 +85,8 @@
|
||||
$rowv = mysqli_fetch_array($sqlv);
|
||||
|
||||
// Custom head title
|
||||
if(isset($app_settings['head_title_custom']) && $app_settings['head_title_custom'] == 1){
|
||||
echo '<title>'.$app_settings['head_title_text'].'</title>' . "\n";
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-head_title_custom')){
|
||||
echo '<title>'.AppSettings::getInstance()->getSetting('app_settings-head_title_text').'</title>' . "\n";
|
||||
}
|
||||
// Default head title
|
||||
else{
|
||||
|
@ -6,7 +6,7 @@ include_once('definition.php');
|
||||
include_once('../../function.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
|
||||
@ -143,11 +143,11 @@ elseif(in_array($_GET['m'], array('pdf_teammeter','pdf_employmeter', 'pdf_evoli'
|
||||
$export_type = 'old';
|
||||
}
|
||||
// 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';
|
||||
}
|
||||
// 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';
|
||||
}
|
||||
else{
|
||||
|
@ -1115,12 +1115,11 @@ class MAZA {
|
||||
* @return type - json result of curl output
|
||||
*/
|
||||
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
|
||||
(
|
||||
'Authorization: key=' . $FCM_server_key,
|
||||
'Authorization: key=' . AppSettings::getInstance()->getSetting('maza-FCM_server_key'),
|
||||
'Content-Type: application/json'
|
||||
);
|
||||
#Send Reponse To FireBase Server
|
||||
@ -1790,16 +1789,14 @@ class MAZA {
|
||||
* @param type $password - passwor to set in nextpin for this user
|
||||
*/
|
||||
public function nextpin_create_user($identifier, $password){
|
||||
#credentials to use nextpin API
|
||||
global $NextPinMainToken;
|
||||
|
||||
#credentials to use nextpin API
|
||||
$fields = array
|
||||
(
|
||||
'username' => $this->nextpin_token_prefix . $identifier,
|
||||
'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(){
|
||||
//global $FCM_server_key;
|
||||
|
||||
$title = $_POST['wpn_title'];
|
||||
$message = $_POST['wpn_message'];
|
||||
|
@ -922,10 +922,9 @@ class HierarhijaAjax
|
||||
public function pridobiVseAnketeKiSoVknjizniciZaHierarhijo()
|
||||
{
|
||||
global $site_url;
|
||||
global $hierarhija_folder_id;
|
||||
|
||||
$ime_mape = sisplet_query("SELECT * FROM srv_library_folder where id='" . $hierarhija_folder_id . "'", "obj")->naslov;
|
||||
$ankete_v_knjiznici = sisplet_query("SELECT * FROM srv_library_anketa WHERE folder='" . $hierarhija_folder_id . "'", "obj");
|
||||
$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='" . AppSettings::getInstance()->getSetting('hierarhija-folder_id') . "'", "obj");
|
||||
|
||||
if (empty($ime_mape) && sizeof($ankete_v_knjiznici) == 0) {
|
||||
echo 'Knjižnica je prazna.';
|
||||
|
@ -32,11 +32,10 @@ class ApiLogin
|
||||
global $site_path;
|
||||
global $site_domain;
|
||||
global $cookie_domain;
|
||||
global $virtual_domain;
|
||||
|
||||
|
||||
// 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_path = getenv('apache_site_path');
|
||||
if (getenv('apache_site_domain') != '') $site_domain = getenv('apache_site_domain');
|
||||
@ -416,16 +415,16 @@ class ApiLogin
|
||||
global $cookie_domain;
|
||||
global $originating_domain;
|
||||
global $keep_domain;
|
||||
global $app_settings;
|
||||
|
||||
|
||||
// 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'];
|
||||
|
||||
// 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]);
|
||||
die();
|
||||
}
|
||||
@ -602,8 +601,6 @@ class ApiLogin
|
||||
{
|
||||
require_once('../../function/JWT.php');
|
||||
|
||||
global $google_login_client_id;
|
||||
global $google_login_client_secret;
|
||||
global $site_url;
|
||||
global $lang;
|
||||
global $proxy;
|
||||
@ -617,8 +614,8 @@ class ApiLogin
|
||||
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
||||
'method' => 'POST',
|
||||
'content' => http_build_query([
|
||||
'client_id' => $google_login_client_id,
|
||||
'client_secret' => $google_login_client_secret,
|
||||
'client_id' => AppSettings::getInstance()->getSetting('google-login_client_id'),
|
||||
'client_secret' => AppSettings::getInstance()->getSetting('google-login_client_secret'),
|
||||
'code' => $oauth2_code,
|
||||
'grant_type' => 'authorization_code',
|
||||
'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",
|
||||
'method' => 'POST',
|
||||
'content' => http_build_query([
|
||||
'client_id' => $google_login_client_id,
|
||||
'client_secret' => $google_login_client_secret,
|
||||
'client_id' => AppSettings::getInstance()->getSetting('google-login_client_id'),
|
||||
'client_secret' => AppSettings::getInstance()->getSetting('google-login_client_secret'),
|
||||
'code' => $oauth2_code,
|
||||
'grant_type' => 'authorization_code',
|
||||
'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
|
||||
private function userLoginFacebook()
|
||||
{
|
||||
global $facebook_appid;
|
||||
global $facebook_appsecret;
|
||||
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);
|
||||
$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 $cookie_domain;
|
||||
global $global_user_id;
|
||||
global $aai_instalacija;
|
||||
|
||||
setcookie('uid', '', time() - 3600, '/', $cookie_domain);
|
||||
setcookie('unam', '', time() - 3600, '/', $cookie_domain);
|
||||
@ -1022,7 +1016,7 @@ class ApiLogin
|
||||
}
|
||||
|
||||
// Ce gre za arnes aai odjavo odjavimo posebej
|
||||
if ($aai_instalacija){
|
||||
if (isAAI()){
|
||||
setcookie("aai", '', time() - 3600, '/', $cookie_domain);
|
||||
header('location: '.$site_url.'/logout_AAI.php?return='.$site_url);
|
||||
die();
|
||||
@ -1035,8 +1029,6 @@ class ApiLogin
|
||||
// Registrira userja v 1ko - vnos podatkov
|
||||
private function userRegister()
|
||||
{
|
||||
global $secret_captcha;
|
||||
|
||||
$error = [];
|
||||
|
||||
$email = (isset($_POST['email'])) ? $_POST['email'] : '';
|
||||
@ -1055,9 +1047,9 @@ class ApiLogin
|
||||
|
||||
|
||||
// Preverimo ReCaptcha
|
||||
if (!empty($secret_captcha)) {
|
||||
if (AppSettings::getInstance()->getSetting('google-secret_captcha') !== false) {
|
||||
$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")) {
|
||||
$error['invalid_recaptcha'] = '1';
|
||||
@ -1265,11 +1257,8 @@ class ApiLogin
|
||||
global $site_url;
|
||||
global $site_path;
|
||||
global $site_domain;
|
||||
global $virtual_domain;
|
||||
global $pass_salt;
|
||||
global $lang;
|
||||
global $confirm_registration;
|
||||
global $app_settings;
|
||||
|
||||
|
||||
$email = (isset($_POST['email']) ? $_POST['email'] : '');
|
||||
@ -1306,7 +1295,7 @@ class ApiLogin
|
||||
$priimek = '';
|
||||
|
||||
// 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;
|
||||
else
|
||||
$status = 1;
|
||||
@ -1337,16 +1326,16 @@ class ApiLogin
|
||||
$Content .= $lang['confirm_user_mail_ignore'];
|
||||
|
||||
// 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!
|
||||
if(isset($confirm_registration) && $confirm_registration == 1){
|
||||
if(AppSettings::getInstance()->getSetting('confirm_registration') === true){
|
||||
|
||||
// Popravimo besedilo emaila
|
||||
$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>';
|
||||
|
||||
@ -1363,7 +1352,7 @@ class ApiLogin
|
||||
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
|
||||
|
||||
// Ce gre slucajno za virutalko
|
||||
if($virtual_domain)
|
||||
if(isVirtual())
|
||||
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
|
||||
|
||||
|
||||
@ -1382,8 +1371,8 @@ class ApiLogin
|
||||
$MA = new MailAdapter(null, 'account');
|
||||
|
||||
// Ce mora admin potrditi, posljemo njemu mail
|
||||
if(isset($confirm_registration) && $confirm_registration == 1){
|
||||
global $confirm_registration_admin;
|
||||
if(AppSettings::getInstance()->getSetting('confirm_registration') === true){
|
||||
$confirm_registration_admin = AppSettings::getInstance()->getSetting('confirm_registration_admin');
|
||||
|
||||
if(is_array($confirm_registration_admin)){
|
||||
// Mail posljemo vsem nastavljenim adminom
|
||||
@ -1428,11 +1417,8 @@ class ApiLogin
|
||||
global $site_url;
|
||||
global $site_path;
|
||||
global $site_domain;
|
||||
global $virtual_domain;
|
||||
global $pass_salt;
|
||||
global $cookie_domain;
|
||||
global $confirm_registration;
|
||||
global $app_settings;
|
||||
|
||||
|
||||
if (!isset ($_GET['code'])) {
|
||||
@ -1462,14 +1448,14 @@ class ApiLogin
|
||||
$pass = $r['pass'];
|
||||
$ime = $r['name'];
|
||||
|
||||
$PageName = $app_settings['app_name'];
|
||||
$PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
|
||||
|
||||
include_once('../../lang/'.$r['lang'].'.php');
|
||||
$Content = $lang['confirm_user_content'];
|
||||
$Subject = $lang['confirm_user_subject'];
|
||||
|
||||
// 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'];
|
||||
}
|
||||
else{
|
||||
@ -1486,7 +1472,7 @@ class ApiLogin
|
||||
$out = '<a href="'.$this->page_urls['page_unregister'].'?email='.$email.'">';
|
||||
|
||||
// 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("SFMAIL", $email, $UserContent);
|
||||
@ -1498,7 +1484,7 @@ class ApiLogin
|
||||
|
||||
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
|
||||
// Ce gre slucajno za virtualko
|
||||
if($virtual_domain)
|
||||
if(isVirtual())
|
||||
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
|
||||
|
||||
if ($geslo2 == "") {
|
||||
@ -1537,7 +1523,7 @@ class ApiLogin
|
||||
}
|
||||
|
||||
// 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
|
||||
$hostname = "";
|
||||
@ -1620,7 +1606,6 @@ class ApiLogin
|
||||
global $lang;
|
||||
global $global_user_id;
|
||||
global $cookie_domain;
|
||||
global $app_settings;
|
||||
|
||||
$email = $global_user_id;
|
||||
|
||||
@ -1642,7 +1627,7 @@ class ApiLogin
|
||||
$result = sisplet_query("SELECT name FROM users WHERE email='$email'");
|
||||
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);
|
||||
if (strlen($ime) > 2) {
|
||||
@ -1715,9 +1700,7 @@ class ApiLogin
|
||||
global $pass_salt;
|
||||
global $site_path;
|
||||
global $site_domain;
|
||||
global $virtual_domain;
|
||||
global $cookie_domain;
|
||||
global $app_settings;
|
||||
|
||||
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'");
|
||||
|
||||
// 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'];
|
||||
|
||||
$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>';
|
||||
|
||||
@ -1804,7 +1787,7 @@ class ApiLogin
|
||||
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
|
||||
|
||||
// Ce gre slucajno za virtualko
|
||||
if($virtual_domain)
|
||||
if(isVirtual())
|
||||
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
|
||||
|
||||
if ($LoginWith == 1) {
|
||||
|
@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
include_once '../../settings.php';
|
||||
include_once '../../settings_optional.php';
|
||||
include_once '../../function.php';
|
||||
include_once '../../vendor/autoload.php';
|
||||
|
||||
@ -11,7 +10,7 @@
|
||||
$login->executeAction($params=array('action'=>'login_facebook'), $data=array());
|
||||
}
|
||||
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){
|
||||
global $site_url;
|
||||
global $lang;
|
||||
global $debug;
|
||||
global $admin_type;
|
||||
|
||||
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>';
|
||||
|
||||
// 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) {
|
||||
echo $update_line.'<br /><br />';
|
||||
|
@ -56,7 +56,6 @@ class DisplaySettings{
|
||||
private function displaySettingsApp(){
|
||||
global $lang;
|
||||
global $app_settings;
|
||||
global $confirm_registration;
|
||||
|
||||
echo '<h3>'.$lang['install_settings_app_title'].'</h3>';
|
||||
|
||||
@ -170,8 +169,8 @@ class DisplaySettings{
|
||||
echo '<div class="settings_item radio">';
|
||||
echo ' <div class="what">'.$lang['install_settings_confirm_registration'].':</div>';
|
||||
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_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_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" '.(AppSettings::getInstance()->getSetting('confirm_registration') ? 'checked="checked"' : '').'><label for="confirm_registration_1">'.$lang['yes'].'</label>';
|
||||
echo ' </div>';
|
||||
echo '</div>';
|
||||
}
|
||||
@ -248,8 +247,6 @@ class DisplaySettings{
|
||||
|
||||
private function displaySettingsGoogle(){
|
||||
global $lang;
|
||||
global $recaptcha_sitekey;
|
||||
global $secret_captcha;
|
||||
global $google_maps_API_key;
|
||||
|
||||
echo '<h3>'.$lang['install_settings_google_title'].'</h3>';
|
||||
@ -257,19 +254,19 @@ class DisplaySettings{
|
||||
// Google recaptcha_sitekey
|
||||
echo '<div class="settings_item text">';
|
||||
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>';
|
||||
|
||||
// Google secret_captcha
|
||||
echo '<div class="settings_item text">';
|
||||
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>';
|
||||
|
||||
// Google google_maps_API_key
|
||||
echo '<div class="settings_item text">';
|
||||
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>';
|
||||
}
|
||||
|
||||
|
@ -120,10 +120,9 @@ class UserAccess{
|
||||
}
|
||||
|
||||
private function __construct($usr_id){
|
||||
global $app_settings;
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
@ -229,13 +228,12 @@ class UserAccess{
|
||||
|
||||
// Preverimo ce ima uporabnik dostop do neke funkcionalnosti
|
||||
public function checkUserAccess($what=''){
|
||||
global $app_settings;
|
||||
global $admin_type;
|
||||
global $global_user_id;
|
||||
global $mysql_database_name;
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
@ -277,11 +275,10 @@ class UserAccess{
|
||||
|
||||
// Vrnemo paket uporabnika
|
||||
public function getPackage(){
|
||||
global $app_settings;
|
||||
global $admin_type;
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
@ -419,7 +419,7 @@ class UserNarocila{
|
||||
|
||||
// Izpisemo seznam vseh narocil - admin
|
||||
public function displayNarocilaTableAdmin(){
|
||||
global $lang, $global_user_id, $app_settings;
|
||||
global $lang, $global_user_id;
|
||||
|
||||
// Admini vidijo vsa narocila
|
||||
$data = $this->getNarocila();
|
||||
@ -492,7 +492,7 @@ class UserNarocila{
|
||||
echo $lang['srv_narocilo_status_'.$data_row['status']];
|
||||
|
||||
// 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 '<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){
|
||||
global $cebelica_api;
|
||||
|
||||
// Api koda za komunikacijo s cebelico
|
||||
define("API_KODA", $cebelica_api);
|
||||
define("API_KODA", AppSettings::getInstance()->getSetting('cebelica_api'));
|
||||
|
||||
if($narocilo_id > 0){
|
||||
|
||||
|
@ -16,7 +16,6 @@ class UserNarocilaCron{
|
||||
|
||||
|
||||
public function __construct(){
|
||||
global $app_settings;
|
||||
|
||||
}
|
||||
|
||||
|
@ -21,10 +21,7 @@ class UserNarocilaPaypal{
|
||||
private $paypal_client;
|
||||
|
||||
|
||||
public function __construct($narocilo_id){
|
||||
global $app_settings;
|
||||
global $paypal_client_id;
|
||||
global $paypal_secret;
|
||||
public function __construct($narocilo_id){
|
||||
global $mysql_database_name;
|
||||
|
||||
if($narocilo_id > 0){
|
||||
@ -43,9 +40,9 @@ class UserNarocilaPaypal{
|
||||
|
||||
// Ustvarimo okolje za paypal
|
||||
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
|
||||
$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);
|
||||
}
|
||||
|
@ -25,11 +25,8 @@ class UserNarocilaStripe{
|
||||
|
||||
|
||||
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){
|
||||
|
||||
|
@ -105,7 +105,7 @@ class UserPlacila{
|
||||
|
||||
// Izpisemo podatke o placilih
|
||||
public function displayPlacila(){
|
||||
global $lang, $global_user_id, $app_settings;
|
||||
global $lang, $global_user_id;
|
||||
|
||||
// Tabela vseh placil
|
||||
$this->displayPlacilaTable();
|
||||
@ -116,13 +116,13 @@ class UserPlacila{
|
||||
echo '</div>';*/
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
// Izpisemo seznam vseh placil
|
||||
public function displayPlacilaTable(){
|
||||
global $lang, $global_user_id, $app_settings;
|
||||
global $lang, $global_user_id;
|
||||
|
||||
// Admini vidijo vsa placila
|
||||
$data = $this->getPlacila();
|
||||
@ -194,7 +194,7 @@ class UserPlacila{
|
||||
// Edit / delete
|
||||
echo '<td>';
|
||||
// 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
|
||||
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(){
|
||||
global $site_url;
|
||||
global $app_settings;
|
||||
global $lang;
|
||||
global $aai_instalacija;
|
||||
|
||||
|
||||
// Google analytics za AAI
|
||||
if(isset($aai_instalacija) && $aai_instalacija == true){
|
||||
if(isAAI()){
|
||||
echo '<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-141542153-2"></script>
|
||||
<script>
|
||||
@ -86,8 +84,8 @@ class DisplayController{
|
||||
echo ' <meta name="revisit-after" content="7">';
|
||||
|
||||
// Custom header title
|
||||
if(isset($app_settings['head_title_custom']) && $app_settings['head_title_custom'] == 1){
|
||||
echo '<title>'.$app_settings['head_title_text'].'</title>' . "\n";
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-head_title_custom')){
|
||||
echo '<title>'.AppSettings::getInstance()->getSetting('app_settings-head_title_text').'</title>' . "\n";
|
||||
}
|
||||
// Default header title
|
||||
else{
|
||||
@ -115,8 +113,6 @@ class DisplayController{
|
||||
public function displayHeader(){
|
||||
global $site_url;
|
||||
global $lang;
|
||||
global $google_login_client_id;
|
||||
global $aai_instalacija;
|
||||
|
||||
|
||||
// Logo v glavi
|
||||
@ -124,7 +120,7 @@ class DisplayController{
|
||||
|
||||
echo ' <a href="'.$site_url.$this->root.'index.php">';
|
||||
echo ' <img src="'.$site_url.'/public/img/logo/1ka_'.($this->lang_id != 1 ? 'eng' : 'slo').'.svg">';
|
||||
if($aai_instalacija){
|
||||
if(isAAI()){
|
||||
echo ' <img src="'.$site_url.'/public/img/logo/arnes_logo.png" style="margin-left:30px;">';
|
||||
}
|
||||
echo ' </a>';
|
||||
@ -163,7 +159,6 @@ class DisplayController{
|
||||
|
||||
// Izris vsebine
|
||||
public function displayMain(){
|
||||
global $virtual_domain;
|
||||
|
||||
switch($this->stran){
|
||||
|
||||
@ -180,35 +175,35 @@ class DisplayController{
|
||||
break;
|
||||
|
||||
/*case 'register':
|
||||
if(!$virtual_domain)
|
||||
if(!isVirtual())
|
||||
$this->displayRegisterPage();
|
||||
else
|
||||
$this->displayFrontPage();
|
||||
break;*/
|
||||
|
||||
case 'register_confirm':
|
||||
if(!$virtual_domain)
|
||||
if(!isVirtual())
|
||||
$this->displayRegisterPageConfirm();
|
||||
else
|
||||
$this->displayFrontPage();
|
||||
break;
|
||||
|
||||
case 'register_email':
|
||||
if(!$virtual_domain)
|
||||
if(!isVirtual())
|
||||
$this->displayRegisterPageEmail();
|
||||
else
|
||||
$this->displayFrontPage();
|
||||
break;
|
||||
|
||||
case 'unregister':
|
||||
if(!$virtual_domain)
|
||||
if(!isVirtual())
|
||||
$this->displayUnregisterPage();
|
||||
else
|
||||
$this->displayFrontPage();
|
||||
break;
|
||||
|
||||
case 'unregister_confirm':
|
||||
if(!$virtual_domain)
|
||||
if(!isVirtual())
|
||||
$this->displayUnregisterPageConfirm();
|
||||
else
|
||||
$this->displayFrontPage();
|
||||
@ -236,17 +231,14 @@ class DisplayController{
|
||||
|
||||
// Izris footerja
|
||||
public function displayFooter(){
|
||||
global $virtual_domain;
|
||||
global $lang;
|
||||
global $app_settings;
|
||||
global $aai_instalacija;
|
||||
|
||||
|
||||
// Stolpec 1
|
||||
echo '<div class="col">';
|
||||
echo ' <h2>'.$lang['simple_footer_about'].'</h2>';
|
||||
echo ' <span>'.$lang['simple_footer_about_1ka'].'</span>';
|
||||
if($aai_instalacija)
|
||||
if(isAAI())
|
||||
echo ' <span>'.$lang['simple_footer_about_faq'].'</span>';
|
||||
echo ' <span>'.$lang['simple_footer_about_general'].'</span>';
|
||||
echo ' <span>'.$lang['simple_footer_about_privacy'].'</span>';
|
||||
@ -262,9 +254,9 @@ class DisplayController{
|
||||
// Stolpec 2
|
||||
echo '<div class="col">';
|
||||
echo ' <h2>'.$lang['simple_footer_company'].'</h2>';
|
||||
echo ' <span class="semi-bold">'.$app_settings['owner'].'</span>';
|
||||
echo ' <span><a href="mailto:'.$app_settings['admin_email'].'">'.$app_settings['admin_email'].'</a></span>';
|
||||
echo ' <span><a href="'.$app_settings['owner_website'].'" target="_blank">'.$app_settings['owner_website'].'</a></span>';
|
||||
echo ' <span class="semi-bold">'.AppSettings::getInstance()->getSetting('app_settings-owner').'</span>';
|
||||
echo ' <span><a href="mailto:'.AppSettings::getInstance()->getSetting('app_settings-admin_email').'">'.AppSettings::getInstance()->getSetting('app_settings-admin_email').'</a></span>';
|
||||
echo ' <span><a href="'.AppSettings::getInstance()->getSetting('app_settings-owner_website').'" target="_blank">'.AppSettings::getInstance()->getSetting('app_settings-owner_website').'</a></span>';
|
||||
echo '</div>';
|
||||
|
||||
|
||||
@ -272,7 +264,7 @@ class DisplayController{
|
||||
echo '<div class="col">';
|
||||
|
||||
// Logotipa FDV in CDI - samo pri virtualkah
|
||||
if($virtual_domain || $aai_instalacija){
|
||||
if(isVirtual() || isAAI()){
|
||||
echo '<div class="logo_holder">';
|
||||
echo ' <img src="'.$site_url.'/public/img/logo/fdv.png">';
|
||||
echo ' <img src="'.$site_url.'/public/img/logo/cdi_'.($this->lang_id != 1 ? 'eng' : 'slo').'.png">';
|
||||
@ -285,10 +277,9 @@ class DisplayController{
|
||||
|
||||
// Izris prve strani
|
||||
private function displayFrontPage(){
|
||||
global $aai_instalacija;
|
||||
|
||||
// AAI
|
||||
if($aai_instalacija)
|
||||
if(isAAI())
|
||||
$this->displayFrontPageFormAAI();
|
||||
else
|
||||
$this->displayFrontPageForm();
|
||||
@ -298,18 +289,16 @@ class DisplayController{
|
||||
private function displayFrontPageForm(){
|
||||
global $lang;
|
||||
global $site_url;
|
||||
global $app_settings;
|
||||
global $virtual_domain;
|
||||
|
||||
|
||||
echo '<div class="app_title">'.$app_settings['app_name'].'</div>';
|
||||
echo '<div class="app_title">'.AppSettings::getInstance()->getSetting('app_settings-app_name').'</div>';
|
||||
|
||||
|
||||
// WHITE BOX FOR LOGIN / REGISTRATION
|
||||
echo '<div class="landing_page_window">';
|
||||
|
||||
// Tabs - samo pri lastni instalaciji, pri virtualkah nimamo registracije
|
||||
if($virtual_domain){
|
||||
if(isVirtual()){
|
||||
echo ' <div class="tabs">';
|
||||
echo ' <div class="tab full_width">'.$lang['login_short'].'</div>';
|
||||
echo ' </div>';
|
||||
@ -323,10 +312,10 @@ class DisplayController{
|
||||
|
||||
// SKB ima blokirano prijavo za vse ipje razen svojega
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
if(isset($app_settings['admin_allow_only_ip'])
|
||||
&& $app_settings['admin_allow_only_ip'] != ''
|
||||
&& !empty($app_settings['admin_allow_only_ip'])
|
||||
&& !in_array($ip, $app_settings['admin_allow_only_ip'])
|
||||
$admin_allow_only_ip = AppSettings::getInstance()->getSetting('app_limits-admin_allow_only_ip');
|
||||
if($admin_allow_only_ip !== false
|
||||
&& !empty($admin_allow_only_ip)
|
||||
&& !in_array($ip, $admin_allow_only_ip)
|
||||
){
|
||||
echo '<div style="padding: 50px; line-height: 30px; text-align: center; font-weight: 600;">Prijava v aplikacijo iz obstoječega IP naslova ('.$ip.') ni mogoča!</div>';
|
||||
}
|
||||
@ -347,7 +336,7 @@ class DisplayController{
|
||||
|
||||
// APP SUBTITLE
|
||||
echo '<div class="app_subtitle">';
|
||||
if($virtual_domain)
|
||||
if(isVirtual())
|
||||
echo $lang['app_virtual_domain'];
|
||||
else
|
||||
echo $lang['app_installation'];
|
||||
@ -358,14 +347,13 @@ class DisplayController{
|
||||
private function displayFrontPageFormAAI(){
|
||||
global $lang;
|
||||
global $site_url;
|
||||
global $app_settings;
|
||||
|
||||
|
||||
// WHITE BOX FOR LOGIN / REGISTRATION
|
||||
echo '<div class="landing_page_window">';
|
||||
|
||||
// APP TITLE - aai
|
||||
echo '<div class="app_title" style="text-transform: initial;">'.$app_settings['app_name'].'</div>';
|
||||
echo '<div class="app_title" style="text-transform: initial;">'.AppSettings::getInstance()->getSetting('app_settings-app_name').'</div>';
|
||||
|
||||
// AAI logo
|
||||
//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(){
|
||||
global $lang;
|
||||
global $site_url;
|
||||
global $secret_captcha;
|
||||
global $recaptcha_sitekey;
|
||||
|
||||
if(!isset($_GET['a']) || $_GET['a'] != 'register'){
|
||||
$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">';
|
||||
|
||||
// RECAPTCHA
|
||||
if($secret_captcha != '' && $recaptcha_sitekey != '')
|
||||
echo ' <div class="g-recaptcha" data-sitekey="'.$recaptcha_sitekey.'" '.(isset($_GET['invalid_recaptcha']) ? ' style="border:1px red solid"' : '').'></div>';
|
||||
if(AppSettings::getInstance()->getSetting('google-secret_captcha') !== false && AppSettings::getInstance()->getSetting('google-recaptcha_sitekey') !== false)
|
||||
echo ' <div class="g-recaptcha" data-sitekey="'.AppSettings::getInstance()->getSetting('google-recaptcha_sitekey').'" '.(isset($_GET['invalid_recaptcha']) ? ' style="border:1px red solid"' : '').'></div>';
|
||||
|
||||
// Geslo
|
||||
echo ' <label for="p1" '.(isset($error['password']) ? 'class="red"' : '').'>'.$lang['login_password'].':</label>';
|
||||
@ -653,8 +639,6 @@ class DisplayController{
|
||||
private function displayRegisterPage(){
|
||||
global $lang;
|
||||
global $site_url;
|
||||
global $secret_captcha;
|
||||
global $recaptcha_sitekey;
|
||||
|
||||
// Pogledamo ce imamo kaksen error v GET-u
|
||||
$error = false;
|
||||
@ -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>';
|
||||
|
||||
// RECAPTCHA
|
||||
if($secret_captcha != '' && $recaptcha_sitekey != '')
|
||||
echo '<div class="g-recaptcha" data-sitekey="'.$recaptcha_sitekey.'" '.(isset($_GET['invalid_recaptcha']) ? ' style="border:1px red solid"' : '').'></div>';
|
||||
if(AppSettings::getInstance()->getSetting('google-secret_captcha') !== false && AppSettings::getInstance()->getSetting('google-recaptcha_sitekey') !== false)
|
||||
echo '<div class="g-recaptcha" data-sitekey="'.AppSettings::getInstance()->getSetting('google-recaptcha_sitekey').'" '.(isset($_GET['invalid_recaptcha']) ? ' style="border:1px red solid"' : '').'></div>';
|
||||
|
||||
// Geslo
|
||||
echo ' <div class="form_row '.(isset($_GET['pass_mismatch']) || isset($_GET['pass_complex']) ? ' red' : '').'"><span class="label"><label for="geslo">'.$lang['login_password'].':</label></span>';
|
||||
@ -785,7 +769,6 @@ class DisplayController{
|
||||
global $lang;
|
||||
global $site_url;
|
||||
global $site_url;
|
||||
global $confirm_registration;
|
||||
|
||||
// Ce nimamo poslanega emaila preusmerimo nazaj na prvo stran registracije
|
||||
if(empty($_GET['e'])){
|
||||
@ -801,7 +784,7 @@ class DisplayController{
|
||||
echo ' <h1>'.$lang['user_confirm_h'].'</h1>';
|
||||
|
||||
// Ce iammo vklopljeno potrjevanje s strani admina je text drugacen
|
||||
if (isset($confirm_registration) && $confirm_registration == 1)
|
||||
if (AppSettings::getInstance()->getSetting('confirm_registration') === true)
|
||||
echo ' <p>'.str_replace("SFMAIL", $email, $lang['user_confirm_p_admin']).'</p>';
|
||||
else
|
||||
echo ' <p>'.str_replace("SFMAIL", $email, $lang['user_confirm_p']).'</p>';
|
||||
@ -977,10 +960,9 @@ class DisplayController{
|
||||
// Cookie notice
|
||||
public function displayCookieNotice(){
|
||||
global $lang;
|
||||
global $aai_instalacija;
|
||||
global $cookie_domain;
|
||||
|
||||
if(!$aai_instalacija){
|
||||
if(!isAAI()){
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
/********** BODY **********/
|
||||
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
|
||||
@ -46,7 +46,6 @@
|
||||
|
||||
|
||||
// Vsebina strani
|
||||
global $aai_instalacija;
|
||||
echo '<div id="main">';
|
||||
|
||||
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');
|
||||
|
||||
// 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_appsecret') != '') $facebook_appsecret = getenv('apache_facebook_appsecret');
|
||||
|
||||
|
||||
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...
|
||||
if (isset ($_GET['overridelang']) && is_numeric($_GET['overridelang'])) {
|
||||
$_SESSION['overridelang'] = $_GET['overridelang'];
|
||||
}
|
||||
|
||||
|
||||
if (is_file($site_path . 'install')) die ("Please, finish instalation with removing 'install/' folder.");
|
||||
|
||||
// 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
|
||||
|
||||
// Nastavimo site_url v session
|
||||
$_SESSION['site_url'] = $site_url;
|
||||
|
||||
|
||||
// Povezemo z bazo
|
||||
if (!$connect_db = mysqli_connect($mysql_server, $mysql_username, $mysql_password, $mysql_database_name)) {
|
||||
die ('Please try again later [ERR: DB])');
|
||||
}
|
||||
|
||||
|
||||
// To je ostanek sispleta in verjetno ne sme biti več prisotno?
|
||||
//sisplet_query("SET character_set_results=latin1");
|
||||
|
||||
@ -201,7 +182,7 @@ if (isset($_COOKIE)) {
|
||||
// SQL INJECT CHECK END
|
||||
|
||||
|
||||
// Pohendlamo language
|
||||
// POHENDLAMO LANGUAGE
|
||||
unset ($lang);
|
||||
|
||||
if (isset ($_SESSION['overridelang']) && is_numeric($_SESSION['overridelang'])) {
|
||||
@ -219,8 +200,7 @@ if (!isset ($lang)) {
|
||||
}
|
||||
|
||||
|
||||
// Preberemo uid uporabnika
|
||||
// Uporabi global admin_type namesto da klices login 100x!
|
||||
// NASTAVIMO TIP UPRABNIKA
|
||||
$admin_type = login();
|
||||
|
||||
if ($admin_type > -1) {
|
||||
@ -229,7 +209,8 @@ if ($admin_type > -1) {
|
||||
if (mysqli_num_rows($result) > 0) {
|
||||
$r = mysqli_fetch_row($result);
|
||||
$global_user_id = $r[0];
|
||||
} elseif (isset ($_COOKIE['ME'])) {
|
||||
}
|
||||
elseif (isset ($_COOKIE['ME'])) {
|
||||
$db_meta_exists = mysqli_select_db($GLOBALS['connect_db'], "meta");
|
||||
if ($db_meta_exists)
|
||||
$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);
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$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
|
||||
$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 *******/
|
||||
|
||||
// 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 :)
|
||||
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()
|
||||
{
|
||||
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()
|
||||
{
|
||||
$headers = apache_request_headers();
|
||||
@ -836,77 +449,6 @@ function GetIP()
|
||||
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
|
||||
* Tako da se iz urlja ne vidi direkt parametrov ankete
|
||||
* se uporablja za izvoz.php
|
||||
@ -1116,9 +658,10 @@ function unikatenEmail($email = null){
|
||||
|
||||
// Funkcija za debug
|
||||
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'])) {
|
||||
return true;
|
||||
}
|
||||
@ -1127,20 +670,24 @@ function isDebug(){
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Počasno nalaganje polja iz baze
|
||||
*
|
||||
* Funkcija naredi poizvedbo in vse rezultate shrani v polje, kar manj obremenjuje RAM
|
||||
*
|
||||
* @param $query
|
||||
* @return \Generator
|
||||
*/
|
||||
function lazyLoadSqlArray($query)
|
||||
{
|
||||
$polje = [];
|
||||
while($row = mysqli_fetch_assoc($query)){
|
||||
yield $polje[] = $row;
|
||||
}
|
||||
// Funkcija za tip instalacije - lastna instalacija
|
||||
function isLastnaInstalacija(){
|
||||
return (AppSettings::getInstance()->getSetting('installation_type') === '0') ? true : false;
|
||||
}
|
||||
|
||||
// Funkcija za tip instalacije - WWW
|
||||
function isWWW(){
|
||||
return (AppSettings::getInstance()->getSetting('installation_type') === '1') ? true : false;
|
||||
}
|
||||
|
||||
// Funkcija za tip instalacije - AAI
|
||||
function isAAI(){
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
// 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 () {
|
||||
|
||||
require_once ('../function/JWT.php');
|
||||
|
||||
global $google_login_client_id;
|
||||
global $google_login_client_secret;
|
||||
|
||||
global $site_url;
|
||||
global $lang;
|
||||
global $proxy;
|
||||
@ -240,8 +238,8 @@ class Profile {
|
||||
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
||||
'method' => 'POST',
|
||||
'content' => http_build_query(array(
|
||||
'client_id' => $google_login_client_id,
|
||||
'client_secret' => $google_login_client_secret,
|
||||
'client_id' => AppSettings::getInstance()->getSetting('google-login_client_id'),
|
||||
'client_secret' => AppSettings::getInstance()->getSetting('google-login_client_secret'),
|
||||
'code' => $oauth2_code,
|
||||
'grant_type' => 'authorization_code',
|
||||
'redirect_uri' => $site_url .'utils/google-oauth2.php',
|
||||
@ -258,8 +256,8 @@ class Profile {
|
||||
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
||||
'method' => 'POST',
|
||||
'content' => http_build_query(array(
|
||||
'client_id' => $google_login_client_id,
|
||||
'client_secret' => $google_login_client_secret,
|
||||
'client_id' => AppSettings::getInstance()->getSetting('google-login_client_id'),
|
||||
'client_secret' => AppSettings::getInstance()->getSetting('google-login_client_secret'),
|
||||
'code' => $oauth2_code,
|
||||
'grant_type' => 'authorization_code',
|
||||
'redirect_uri' => $site_url .'utils/google-oauth2.php',
|
||||
|
@ -17,6 +17,7 @@ use SurveyAdvancedParadataLog;
|
||||
use SurveySetting;
|
||||
use MailAdapter;
|
||||
use GDPR;
|
||||
use AppSettings;
|
||||
|
||||
|
||||
class AjaxController extends Controller
|
||||
@ -494,7 +495,6 @@ class AjaxController extends Controller
|
||||
*
|
||||
*/
|
||||
public function ajax_captcha(){
|
||||
global $secret_captcha;
|
||||
|
||||
$text = strtoupper($_GET['text']);
|
||||
$code = $_GET['code'];
|
||||
@ -502,7 +502,7 @@ class AjaxController extends Controller
|
||||
$usr_id = $_GET['usr_id'];
|
||||
|
||||
$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 še v bazi tistih ki so se ročno dodali
|
||||
|
@ -30,6 +30,7 @@ use SurveyGorenje;
|
||||
use SurveyNIJZ;
|
||||
use GDPR;
|
||||
use UserAccess;
|
||||
use AppSettings;
|
||||
|
||||
|
||||
class BodyController extends Controller
|
||||
@ -395,14 +396,13 @@ class BodyController extends Controller
|
||||
|
||||
// Ce imamo staticen uvod in preverjanje s captcho
|
||||
if($row['intro_static'] == 2){
|
||||
global $recaptcha_sitekey;
|
||||
|
||||
$captcha_error = (isset($_GET['captcha_error']) && $_GET['captcha_error'] == 1) ? true : false;
|
||||
|
||||
echo '<br />';
|
||||
|
||||
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>';
|
||||
|
||||
if($captcha_error){
|
||||
@ -657,7 +657,6 @@ class BodyController extends Controller
|
||||
global $lang;
|
||||
global $admin_type;
|
||||
global $site_url;
|
||||
global $app_settings;
|
||||
|
||||
Header::getInstance()->displaySistemske();
|
||||
|
||||
@ -838,7 +837,7 @@ class BodyController extends Controller
|
||||
$panel_settings = $sp->getPanelSettings();
|
||||
|
||||
// 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
|
||||
$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)
|
||||
if(isset($app_settings['survey_finish_url']) && $app_settings['survey_finish_url'] != '')
|
||||
$close_url = $app_settings['survey_finish_url'];
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-survey_finish_url') !== false)
|
||||
$close_url = AppSettings::getInstance()->getSetting('app_settings-survey_finish_url');
|
||||
else
|
||||
$close_url = 'https://www.1ka.si/';
|
||||
|
||||
@ -1272,7 +1271,6 @@ class BodyController extends Controller
|
||||
* @desc prikaze konec ankete
|
||||
*/
|
||||
public function displayKonecGlasovanje(){
|
||||
global $app_settings;
|
||||
|
||||
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)
|
||||
if(isset($app_settings['survey_finish_url']) && $app_settings['survey_finish_url'] != '')
|
||||
$close_url = $app_settings['survey_finish_url'];
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-survey_finish_url') !== false)
|
||||
$close_url = AppSettings::getInstance()->getSetting('app_settings-survey_finish_url');
|
||||
else
|
||||
$close_url = 'https://www.1ka.si/';
|
||||
|
||||
@ -1916,7 +1914,7 @@ class BodyController extends Controller
|
||||
|
||||
|
||||
public function displayFooterNote(){
|
||||
global $mysql_database_name, $app_settings;
|
||||
global $mysql_database_name;
|
||||
|
||||
$row = SurveyInfo::getInstance()->getSurveyRow();
|
||||
|
||||
@ -1928,9 +1926,8 @@ class BodyController extends Controller
|
||||
}
|
||||
|
||||
// Custom footer
|
||||
if(isset($app_settings['footer_survey_custom']) && $app_settings['footer_survey_custom'] == 1){
|
||||
|
||||
echo '<p>'.$app_settings['footer_survey_text'].'</p>';
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-footer_survey_custom') !== false){
|
||||
echo '<p>'.AppSettings::getInstance()->getSetting('app_settings-footer_survey_text').'</p>';
|
||||
}
|
||||
// Default footer
|
||||
else{
|
||||
|
@ -15,6 +15,7 @@ use SurveyInfo;
|
||||
use SurveyMissingValues;
|
||||
use Common;
|
||||
use Mobile_Detect;
|
||||
use AppSettings;
|
||||
|
||||
|
||||
class CheckController extends Controller
|
||||
@ -681,8 +682,7 @@ class CheckController extends Controller
|
||||
*/
|
||||
public function check_captcha()
|
||||
{
|
||||
global $secret_captcha;
|
||||
|
||||
|
||||
// Ce urejamo podatke v admin vmesniku ne preverjamo nicesar
|
||||
if(isset($_GET['t']) && $_GET['t'] == 'postprocess' || get('grupa') == '0' || get('grupa') == ''){
|
||||
return;
|
||||
@ -696,7 +696,7 @@ class CheckController extends Controller
|
||||
|
||||
if ($captcha == 1) {
|
||||
$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 še v bazi tistih ki so se ročno dodali
|
||||
@ -716,10 +716,9 @@ class CheckController extends Controller
|
||||
*
|
||||
*/
|
||||
public function check_captcha_intro(){
|
||||
global $secret_captcha;
|
||||
|
||||
$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")){
|
||||
//
|
||||
|
@ -15,6 +15,7 @@ use SurveyAdvancedParadataLog;
|
||||
use SurveyInfo;
|
||||
use SurveyThemeEditor;
|
||||
use SurveyPanel;
|
||||
use AppSettings;
|
||||
|
||||
class HeaderController extends Controller
|
||||
{
|
||||
@ -149,8 +150,6 @@ class HeaderController extends Controller
|
||||
* @desc zgenereira header
|
||||
*/
|
||||
public function header(){
|
||||
global $app_settings;
|
||||
|
||||
|
||||
// preprecimo caching - tudi s klikom na gumb nazaj!
|
||||
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);
|
||||
|
||||
// Custom header title
|
||||
if(isset($app_settings['head_title_custom']) && $app_settings['head_title_custom'] == 1){
|
||||
echo '<title>'.strip_tags(Helper::getInstance()->displayAkronim(0)).' - '.$app_settings['head_title_text'].'</title>' . "\n";
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-head_title_custom')){
|
||||
echo '<title>'.strip_tags(Helper::getInstance()->displayAkronim(0)).' - '.AppSettings::getInstance()->getSetting('app_settings-head_title_text').'</title>' . "\n";
|
||||
}
|
||||
// Default header title
|
||||
else{
|
||||
|
@ -21,6 +21,7 @@ use SurveySetting;
|
||||
use SurveySlideshow;
|
||||
use Common;
|
||||
use SurveyPanel;
|
||||
use AppSettings;
|
||||
|
||||
class JsController extends Controller
|
||||
{
|
||||
@ -64,7 +65,6 @@ class JsController extends Controller
|
||||
{
|
||||
global $lang;
|
||||
global $site_url;
|
||||
global $secret_captcha;
|
||||
global $admin_type;
|
||||
|
||||
// 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\Models\Model;
|
||||
use enkaParameters;
|
||||
use AppSettings;
|
||||
|
||||
class TextController extends Controller
|
||||
{
|
||||
@ -480,7 +481,6 @@ class TextController extends Controller
|
||||
************************************************/
|
||||
public function textbox($spremenljivka, $oblika)
|
||||
{
|
||||
global $recaptcha_sitekey;
|
||||
global $lang;
|
||||
|
||||
$row = Model::select_from_srv_spremenljivka($spremenljivka);
|
||||
@ -575,7 +575,7 @@ class TextController extends Controller
|
||||
$captcha = ($spremenljivkaParams->get('captcha') ? $spremenljivkaParams->get('captcha') : 0);
|
||||
|
||||
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 {
|
||||
$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 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 ***/
|
||||
|
||||
global $app_settings;
|
||||
if(isset($app_settings['commercial_packages']) && $app_settings['commercial_packages'] == true){
|
||||
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === false){
|
||||
|
||||
$unc = new UserNarocilaCron();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user