function create_log($user_name) { $row = get_option('purchase_key'); $purchase_key = isset($row->values) ? $row->values : '1'; $row = get_option('item_id'); $item_id = isset($row->values) ? $row->values : '2'; $domain = base_url(); if (!strpos('-' . $domain, "http://localhost/")) { //set POST variables $url = get_author_url() . 'admin/verify/checkproductkey'; $fields = array('purchase_key' => urlencode($purchase_key), 'item_id' => urlencode($item_id), 'domain' => urlencode($domain), 'item' => 'realcon'); $fields_string = ''; //url-ify the data for the POST foreach ($fields as $key => $value) { $fields_string .= $key . '=' . $value . '&'; } rtrim($fields_string, '&'); //print_r($fields); //print $fields_string;exit; //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, count($fields)); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); //execute post $result = curl_exec($ch); curl_close($ch); $CI = get_instance(); if ($result != 1) { $CI->session->set_flashdata('msg', '<div class="alert alert-danger">Please verify your purchase.</div>'); redirect(site_url('admin/purchase/regdomain')); } } }
public function addkey() { if ($this->input->post('form_key') == $this->session->userdata('form_key')) { //set POST variables $url = get_author_url() . 'admin/verify/checkpurchasekey'; $fields = array('purchase_key' => urlencode($this->input->post('purchase_key')), 'item_id' => urlencode($this->input->post('item_id')), 'domain' => urlencode($this->input->post('domain')), 'item' => 'realcon'); $fields_string = ''; //url-ify the data for the POST foreach ($fields as $key => $value) { $fields_string .= $key . '=' . $value . '&'; } rtrim($fields_string, '&'); //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, count($fields)); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); //execute post $result = curl_exec($ch); curl_close($ch); if ($result == 1) { add_option('purchase_key', $this->input->post('purchase_key')); add_option('item_id', $this->input->post('item_id')); $this->session->set_flashdata('msg', '<div class="alert alert-success">Purchase code verified. Please login now</div>'); redirect(site_url('admin/auth/')); } else { $this->session->set_flashdata('msg', '<div class="alert alert-danger">Puchase code or item id is not valid. Please try again.</div>'); redirect(site_url('admin/purchase/regdomain')); } } }
public function addkey() { if ($this->input->post('form_key') == $this->session->userdata('form_key')) { //set POST variables $url = get_author_url() . 'admin/verify/checkpurchasekey'; $fields = array('purchase_key' => urlencode($this->input->post('purchase_key')), 'item_id' => urlencode($this->input->post('item_id')), 'domain' => urlencode($this->input->post('domain')), 'item' => 'NuggPlug'); $fields_string = ''; //url-ify the data for the POST foreach ($fields as $key => $value) { $fields_string .= $key . '=' . $value . '&'; } rtrim($fields_string, '&'); //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, count($fields)); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); //execute post $result = curl_exec($ch); curl_close($ch); if ($result === '1') { $this->load->helper('file'); $data = md5(urlencode($this->input->post('purchase_key')) . '-' . urlencode($this->input->post('item_id')) . '-' . urlencode($this->input->post('domain'))); if (!write_file('./dbc_config/local-data.conf', $data)) { echo 'Unable to write the file'; $this->session->set_flashdata('msg', '<div class="alert alert-danger">Unable to write the file ROOT/dbc_config/local-data.conf</div>'); redirect(site_url('admin/auth/')); } add_option('purchase_key', $this->input->post('purchase_key')); add_option('item_id', $this->input->post('item_id')); $this->session->set_flashdata('msg', '<div class="alert alert-success">Purchase code verified. Please login now</div>'); redirect(site_url('admin/auth/')); } elseif ($result === '0') { $this->session->set_flashdata('msg', '<div class="alert alert-danger">Puchase code or item id is not valid. Please try again.</div>'); redirect(site_url('admin/auth/')); } else { $this->session->set_flashdata('msg', '<div class="alert alert-danger">Failed to connect with nuggplug.</div>'); redirect(site_url('admin/auth/')); } } }
<?php $file = './dbc_config/config.xml'; $xmlstr = file_get_contents($file); $xml = simplexml_load_string($xmlstr); $config = $xml->xpath('//config'); $current_version = $config[0]->version; $current_version = explode('.', $current_version); if ($config[0]->is_installed == 'yes' && $this->uri->segment(2) != 'complete') { $status = json_decode(@file_get_contents(get_author_url() . 'admin/verify/checkversion/whiz')); } if (isset($status->version)) { $version = $status->version; $avl_version = explode('.', $version); if ($avl_version[0] > $current_version[0] || $avl_version[0] == $current_version[0] && $avl_version[1] > $current_version[1] || $avl_version[0] == $current_version[0] && $avl_version[1] == $current_version[1] && $avl_version[2] > $current_version[2]) { echo '<div class="alert alert-info">Version ' . $version . ' is now available. Get it <a href="' . $status->update_url . '">Here</a></div>'; } } ?> <style> .marker-label, .marker-icon { z-index: 99; position: absolute; display: block; margin-top: -37px; margin-left: -14px; width: 30px; height: 30px;