public function activate($licenseKey, $domain) { $api_params = array('slm_action' => 'slm_activate', 'secret_key' => $this->api_key, 'license_key' => $licenseKey, 'registered_domain=' => $domain, 'item_reference=' => urlencode($this->product_id)); $query = add_query_arg($api_params, $this->server); $response = wp_remote_get($query, array('timeout' => 20, 'sslverify' => false)); if (is_wp_error($response)) { echo "Unexpected Error! The query returned with an error."; } else { $license_data = json_decode(wp_remote_retrieve_body($response)); if ($license_data->result == 'success') { saveLicense($licenseKey); savedData($license_data); return true; } else { $this->err = $license_data->message; } } return false; }
/*************************** */ /*********USERS****** */ /*************************** */ // case 'addUserExe': // addUserExe(); // break; case 'registerExe': registerExe(); break; case 'editUserExe': editUserExe(); break; /****************LICENSE--------------*/ /****************LICENSE--------------*/ case 'saveLicense': saveLicense(); break; } function loginExe() { $email = trim($_REQUEST['email']); $password = trim($_REQUEST['password']); // Validate data if (validateString($email, 'Empty email or bad email syntax')) { #print "Wrong email"; } if (validateString($password, 'Empty password')) { #print "Wrong password"; } if (errors()) { #print "Errors"; exit(0);
* @link http://www.joomladocman.org */ defined('_JEXEC') or die('Restricted access'); include_once dirname(__FILE__) . '/licenses.html.php'; JArrayHelper::toInteger($cid); switch ($task) { case "edit": $cid = isset($cid[0]) ? $cid[0] : 0; editLicense($option, $cid); break; case "remove": removeLicense($cid, $option); break; case "apply": case "save": saveLicense($option); break; case "cancel": cancelLicense($option); break; case "show": default: showLicenses($option); } function editLicense($option, $uid) { $database = JFactory::getDBO(); // disable the main menu to force user to use buttons $_REQUEST['hidemainmenu'] = 1; $row = new mosDMLicenses($database); $row->load($uid);