152 lines
4.5 KiB
PHP
152 lines
4.5 KiB
PHP
<?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;
|
|
}
|
|
}
|
|
|
|
?>
|