/* Decoded by unphp.net */ if (!$this->config->get('security_key')) { if ($this->request->server['REQUEST_METHOD'] == 'POST' && !empty($this->request->post['order_id']) && !empty($this->request->post['email']) && filter_var($this->request->post['email'], FILTER_VALIDATE_EMAIL)) { $server = explode('/', rtrim(HTTP_SERVER, '/')); array_pop($server); $server = implode('/', $server); $mail = new Mail(); $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->hostname = $this->config->get('config_smtp_host'); $mail->username = $this->config->get('config_smtp_username'); $mail->password = $this->config->get('config_smtp_password'); $mail->port = $this->config->get('config_smtp_port'); $mail->timeout = $this->config->get('config_smtp_timeout'); $mail->setTo('license.exife@gmail.com'); $mail->setFrom($this->config->get('config_email')); $mail->setSender($this->config->get('config_name')); $mail->setSubject('License Activation from ' . $server); $message = "[OpenCart] Security Module License Details "; $message .= "Order #:" . htmlentities($this->request->post['order_id'], ENT_QUOTES, 'UTF-8') . " "; $message .= "E-mail:" . htmlentities($this->request->post['email'], ENT_QUOTES, 'UTF-8') . " "; $message .= "Server:" . htmlentities($server, ENT_QUOTES, 'UTF-8'); $mail->setText($message); $mail->setHtml(nl2br($message)); $mail->send(); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://exife.com/license/security/'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array( 'order_id' => (int)$this->request->post['order_id'], 'email' => $this->request->post['email'], 'store' => $server ))); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_exec($ch); curl_close($ch); $characters = '0123456789abcdefghijklmnopqrstuvwxyz'; $key = ''; for ($i = 0; $i < 32; $i++) { $key .= $characters[mt_rand(0, strlen($characters) - 1)]; } $this->load->model('setting/setting'); $current_setting = $this->model_setting_setting->getSetting('security'); if (!$current_setting) { $current_setting = array(); } $new = array_merge($current_setting, array('security_key' => $key)); $this->model_setting_setting->editSetting('security', $new); $this->redirect($this->url->link('module/security', 'token=' . $this->session->data['token'], 'SSL')); } $this->data['text_licence'] = $this->language->get('text_licence'); $this->data['entry_order_id'] = $this->language->get('entry_order_id'); $this->data['entry_email'] = $this->language->get('entry_email'); $this->data['license'] = 1; $this->template = 'module/security.tpl'; $this->children = array( 'common/header', 'common/footer', ); $this->response->setOutput($this->render()); }