'.$lang['install_settings_title'].''; echo '

'.$lang['install_settings_text'].'


'; echo '
'; // SEGMENT 1 - app_settings echo '
'; $this->displaySettingsApp(); echo '
'; // SEGMENT 2 - email echo '
'; $this->displaySettingsEmail(); echo '
'; // SEGMENT 3 - google echo '
'; $this->displaySettingsGoogle(); echo '
'; // SEGMENT 3 - subscribe echo '
'; $this->displaySettingsSubscribe(); echo '
'; // Submit echo '
'; echo ' '; echo ' '; echo '
'; echo '
'; // Skrijemo nepotrebna text polja echo ''; } private function displaySettingsApp(){ global $lang; global $app_settings; echo '

'.$lang['install_settings_app_title'].'

'; // Ime aplikacije echo '
'; echo '
'.$lang['install_settings_app_name'].':
'; echo '
'; echo '
'; // Admin email echo '
'; echo '
'.$lang['install_settings_admin_email'].':
'; echo '
'; echo '
'; // Owner echo '
'; echo '
'.$lang['install_settings_owner'].':
'; echo '
'; echo '
'; // Owner website echo '
'; echo '
'.$lang['install_settings_owner_website'].':
'; echo '
'; echo '
'; // Custom head title echo '
'; echo '
'.$lang['install_settings_head_title_custom'].':
'; echo '
'; echo ' '; echo ' '; echo '
'; echo '
'; // Custom head title text echo '
'; echo '
'.$lang['install_settings_head_title_text'].':
'; echo '
'; echo '
'; // Custom foooter echo ''; // Custom footer text echo ''; // Custom survey foooter echo ''; // Custom footer survey text echo ''; // Custom email sig echo '
'; echo '
'.$lang['install_settings_email_signature_custom'].':
'; echo '
'; echo ' '; echo ' '; echo '
'; echo '
'; // Custom email sig text echo '
'; echo '
'.$lang['install_settings_email_signature_text'].':
'; echo '
'; echo '
'; // Survey finish url echo '
'; echo '
'.$lang['install_settings_survey_finish_url'].':
'; echo '
'; echo '
'; // Export type echo '
'; echo '
'.$lang['install_settings_export_type'].':
'; echo '
'; echo ' '; echo ' '; echo '
'; echo '
'; // confirm_registration echo '
'; echo '
'.$lang['install_settings_confirm_registration'].':
'; echo '
'; echo ' getSetting('confirm_registration') ? 'checked="checked"' : '').'>'; echo ' getSetting('confirm_registration') ? 'checked="checked"' : '').'>'; echo '
'; echo '
'; } private function displaySettingsEmail(){ global $lang; global $email_server_settings; echo '

'.$lang['install_settings_email_title'].'

'; // Email SMTPFrom echo '
'; echo '
'.$lang['install_settings_SMTPFrom'].':
'; echo '
'; echo '
'; // Email SMTPFromNice echo '
'; echo '
'.$lang['install_settings_SMTPFromNice'].':
'; echo '
'; echo '
'; // Email SMTPReplyTo echo '
'; echo '
'.$lang['install_settings_SMTPReplyTo'].':
'; echo '
'; echo '
'; // Email SMTPHost echo '
'; echo '
'.$lang['install_settings_SMTPHost'].':
'; echo '
'; echo '
'; // Email SMTPPort echo '
'; echo '
'.$lang['install_settings_SMTPPort'].':
'; echo '
'; echo '
'; // Email SMTPAuth echo '
'; echo '
'.$lang['install_settings_SMTPAuth'].':
'; echo '
'; echo ' '; echo ' '; echo '
'; echo '
'; // Email SMTPSecure echo '
'; echo '
'.$lang['install_settings_SMTPSecure'].':
'; echo '
'; echo ' '; echo ' '; echo ' '; echo '
'; echo '
'; // Email SMTPUsername echo '
'; echo '
'.$lang['install_settings_SMTPUsername'].':
'; echo '
'; echo '
'; // Email SMTPPassword echo '
'; echo '
'.$lang['install_settings_SMTPPassword'].':
'; echo '
'; echo '
'; } private function displaySettingsGoogle(){ global $lang; global $google_maps_API_key; echo '

'.$lang['install_settings_google_title'].'

'; // Google recaptcha_sitekey echo '
'; echo '
'.$lang['install_settings_recaptcha_sitekey'].':
'; echo '
'; echo '
'; // Google secret_captcha echo '
'; echo '
'.$lang['install_settings_secret_captcha'].':
'; echo '
'; echo '
'; // Google google_maps_API_key echo '
'; echo '
'.$lang['install_settings_google_maps_API_key'].':
'; echo '
'; echo '
'; } private function displaySettingsSubscribe(){ global $lang; echo '

'.$lang['install_settings_subscribe_title'].'

'; echo '

'.$lang['install_settings_subscribe_text'].'

'; echo '
'; echo '
'.$lang['install_settings_subscribe_radio'].':
'; echo '
'; echo ' '; echo ' '; echo '
'; echo '
'; } // Shranimo nastavitve v settings_optional.php in redirectamo public function ajaxSubmitSettings(){ $new_content = ' \''.$app_name.'\','.PHP_EOL; $admin_email = isset($_POST['admin_email']) ? $_POST['admin_email'] : ''; $new_content .= ' \'admin_email\' => \''.$admin_email.'\','.PHP_EOL; $owner = isset($_POST['owner']) ? $_POST['owner'] : ''; $new_content .= ' \'owner\' => \''.$owner.'\','.PHP_EOL; $owner_website = isset($_POST['owner_website']) ? $_POST['owner_website'] : ''; $new_content .= ' \'owner_website\' => \''.$owner_website.'\','.PHP_EOL; $head_title_custom = isset($_POST['head_title_custom']) ? $_POST['head_title_custom'] : ''; $new_content .= ' \'head_title_custom\' => \''.$head_title_custom.'\','.PHP_EOL; $head_title_text = isset($_POST['head_title_text']) ? $_POST['head_title_text'] : ''; $new_content .= ' \'head_title_text\' => \''.$head_title_text.'\','.PHP_EOL; $footer_custom = isset($_POST['footer_custom']) ? $_POST['footer_custom'] : ''; $new_content .= ' \'footer_custom\' => \''.$footer_custom.'\','.PHP_EOL; $footer_text = isset($_POST['footer_text']) ? $_POST['footer_text'] : ''; $new_content .= ' \'footer_text\' => \''.$footer_text.'\','.PHP_EOL; $footer_survey_custom = isset($_POST['footer_survey_custom']) ? $_POST['footer_survey_custom'] : ''; $new_content .= ' \'footer_survey_custom\' => \''.$footer_survey_custom.'\','.PHP_EOL; $footer_survey_text = isset($_POST['footer_survey_text']) ? $_POST['footer_survey_text'] : ''; $new_content .= ' \'footer_survey_text\' => \''.$footer_survey_text.'\','.PHP_EOL; $email_signature_custom = isset($_POST['email_signature_custom']) ? $_POST['email_signature_custom'] : ''; $new_content .= ' \'email_signature_custom\' => \''.$email_signature_custom.'\','.PHP_EOL; $email_signature_text = isset($_POST['email_signature_text']) ? $_POST['email_signature_text'] : ''; $new_content .= ' \'email_signature_text\' => \''.$email_signature_text.'\','.PHP_EOL; $survey_finish_url = isset($_POST['survey_finish_url']) ? $_POST['survey_finish_url'] : ''; $new_content .= ' \'survey_finish_url\' => \''.$survey_finish_url.'\','.PHP_EOL; $export_type = isset($_POST['export_type']) ? $_POST['export_type'] : ''; $new_content .= ' \'export_type\' => \''.$export_type.'\','.PHP_EOL; $new_content .= ');'.PHP_EOL.PHP_EOL; // $email_server_settings $new_content .= '$email_server_settings = array('.PHP_EOL; $SMTPFrom = isset($_POST['SMTPFrom']) ? $_POST['SMTPFrom'] : ''; $new_content .= ' \'SMTPFrom\' => \''.$SMTPFrom.'\','.PHP_EOL; $SMTPFromNice = isset($_POST['SMTPFromNice']) ? $_POST['SMTPFromNice'] : ''; $new_content .= ' \'SMTPFromNice\' => \''.$SMTPFromNice.'\','.PHP_EOL; $SMTPReplyTo = isset($_POST['SMTPReplyTo']) ? $_POST['SMTPReplyTo'] : ''; $new_content .= ' \'SMTPReplyTo\' => \''.$SMTPReplyTo.'\','.PHP_EOL; $SMTPHost = isset($_POST['SMTPHost']) ? $_POST['SMTPHost'] : ''; $new_content .= ' \'SMTPHost\' => \''.$SMTPHost.'\','.PHP_EOL; $SMTPPort = isset($_POST['SMTPPort']) ? $_POST['SMTPPort'] : ''; $new_content .= ' \'SMTPPort\' => \''.$SMTPPort.'\','.PHP_EOL; $SMTPSecure = isset($_POST['SMTPSecure']) ? $_POST['SMTPSecure'] : ''; $new_content .= ' \'SMTPSecure\' => \''.$SMTPSecure.'\','.PHP_EOL; $SMTPAuth = isset($_POST['SMTPAuth']) ? $_POST['SMTPAuth'] : ''; $new_content .= ' \'SMTPAuth\' => \''.$SMTPAuth.'\','.PHP_EOL; $SMTPUsername = isset($_POST['SMTPUsername']) ? $_POST['SMTPUsername'] : ''; $new_content .= ' \'SMTPUsername\' => \''.$SMTPUsername.'\','.PHP_EOL; $SMTPPassword = isset($_POST['SMTPPassword']) ? $_POST['SMTPPassword'] : ''; $new_content .= ' \'SMTPPassword\' => \''.$SMTPPassword.'\','.PHP_EOL; $new_content .= ');'.PHP_EOL.PHP_EOL; // Confirm registration, gdpr $confirm_registration = isset($_POST['confirm_registration']) ? $_POST['confirm_registration'] : ''; $new_content .= '$confirm_registration = \''.$confirm_registration.'\';'.PHP_EOL; $confirm_registration_admin = $admin_email; $new_content .= '$confirm_registration_admin = \''.$confirm_registration_admin.'\';'.PHP_EOL; $gdpr_admin_email = $admin_email; $new_content .= '$gdpr_admin_email = \''.$gdpr_admin_email.'\';'.PHP_EOL.PHP_EOL; // Google $recaptcha_sitekey = isset($_POST['recaptcha_sitekey']) ? $_POST['recaptcha_sitekey'] : ''; $new_content .= '$recaptcha_sitekey = \''.$recaptcha_sitekey.'\';'.PHP_EOL; $secret_captcha = isset($_POST['secret_captcha']) ? $_POST['secret_captcha'] : ''; $new_content .= '$secret_captcha = \''.$secret_captcha.'\';'.PHP_EOL; $google_maps_API_key = isset($_POST['google_maps_API_key']) ? $_POST['google_maps_API_key'] : ''; $new_content .= '$google_maps_API_key = \''.$google_maps_API_key.'\';'.PHP_EOL.PHP_EOL; // Zapisemo nov content v settings_optional.php $this->writeSettings($new_content); // Preverimo prijavo na prejemanje obvestil - potem pošljemo obvestilo na www.1ka.si $subscribe = isset($_POST['subscribe']) ? $_POST['subscribe'] : '0'; if($subscribe == '1') $this->sendNotification($app_name, $admin_email); } // Zapisemo nov content v settings_optional.php private function writeSettings($new_content){ $file_handle = fopen("../../settings_optional.php", "w"); fwrite($file_handle, $new_content); fclose($file_handle); } // Pošljemo obvestilo o prijava na obvestila za novo instalacijo private function sendNotification($app_name, $admin_email){ global $site_domain; global $site_url; $parameters = 'site_domain='.urlencode($site_domain); $parameters .= '&site_url='.urlencode($site_url); $parameters .= '&app_name='.urlencode($app_name); $parameters .= '&admin_email='.urlencode($admin_email); //$url = 'http://localhost/utils/1kaUtils/custom_install_notify.php?'.$parameters; $url = 'https://www.1ka.si/utils/1kaUtils/custom_install_notify.php?'.$parameters; // Pripravimo klic $ch = curl_init($url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Izvedemo klic $result = curl_exec($ch); } }