HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.zqgwfu.top/install/controller/3rd_party/maxmind.php
<?php
class Controller3rdPartyMaxmind extends Controller {
	private $error = array();

	public function index() {
		$this->load->language('3rd_party/maxmind');
		
		$this->document->setTitle($this->language->get('heading_title'));

		$this->load->model('3rd_party/maxmind');
		
		if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
			$this->model_3rd_party_maxmind->editSetting('fraud_maxmind', $this->request->post);

			$this->session->data['success'] = $this->language->get('text_success');

			$this->response->redirect($this->url->link('install/step_4'));
		} 
	
		$data['heading_title'] = $this->language->get('heading_title');
		
		$data['text_maxmind'] = $this->language->get('text_maxmind');
		$data['text_signup'] = sprintf($this->language->get('text_signup'), '');

		$data['entry_key'] = $this->language->get('entry_key');
		$data['entry_score'] = $this->language->get('entry_score');
		$data['entry_order_status'] = $this->language->get('entry_order_status');

		$data['help_score'] = $this->language->get('help_score');
		$data['help_order_status'] = $this->language->get('help_order_status');

		$data['button_continue'] = $this->language->get('button_continue');
		$data['button_back'] = $this->language->get('button_back');

		$data['action'] = $this->url->link('3rd_party/maxmind');

		if (isset($this->error['key'])) {
			$data['error_key'] = $this->error['key'];
		} else {
			$data['error_key'] = '';
		}

		if (isset($this->error['score'])) {
			$data['error_score'] = $this->error['score'];
		} else {
			$data['error_score'] = '';
		}

		if (isset($this->request->post['fraud_maxmind_key'])) {
			$data['fraud_maxmind_key'] = $this->request->post['fraud_maxmind_key'];
		} else {
			$data['fraud_maxmind_key'] = '';
		}

		if (isset($this->request->post['fraud_maxmind_score'])) {
			$data['fraud_maxmind_score'] = $this->request->post['fraud_maxmind_score'];
		} else {
			$data['fraud_maxmind_score'] = '80';
		}

		if (isset($this->request->post['maxmind_order_status_id'])) {
			$data['maxmind_order_status_id'] = $this->request->post['maxmind_order_status_id'];
		} else {
			$data['maxmind_order_status_id'] = '';
		}
		
		$data['order_statuses'] = $this->model_3rd_party_maxmind->getOrderStatuses();

		$data['back'] = $this->url->link('install/step_4');

		$data['footer'] = $this->load->controller('common/footer');
		$data['header'] = $this->load->controller('common/header');

		$this->response->setOutput($this->load->view('3rd_party/maxmind', $data));
	}

	private function validate() {
		if (!$this->request->post['fraud_maxmind_key']) {
			$this->error['key'] = $this->language->get('error_key');
		}

		if (!$this->request->post['fraud_maxmind_score'] || (int)$this->request->post['fraud_maxmind_score'] > 100 || (int)$this->request->post['fraud_maxmind_score'] < 0) {
			$this->error['score'] = $this->language->get('error_score');
		}

		return !$this->error;
	}
}