Skip to content

Commit

Permalink
some other refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
amin0_000 committed Sep 22, 2014
1 parent f1d1181 commit 085071e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
10 changes: 6 additions & 4 deletions license-manager/client-side/sample-plugin/slm-sample-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

// This is the secret key for API authentication. You configured it in the settings menu of the license manager plugin.
define('YOUR_SPECIAL_SECRET_KEY', '541fbfb9d49ba6.45466831'); //Rename this constant name so it is specific to your plugin or theme.
//
// This is the URL where API query request will be sent to. This should be the URL of the site where you have installed the main license manager plugin
define('YOUR_LICENSE_SERVER_URL', 'http://www.your-site.com'); //Rename this constant name so it is specific to your plugin or theme.

// This is the URL where API query request will be sent to. This should be the URL of the site where you have installed the main license manager plugin. Get this value from the integration help page.
define('YOUR_LICENSE_SERVER_URL', 'http://localhost:81/wp/wp7'); //Rename this constant name so it is specific to your plugin or theme.

// This is a value that will be recorded in the license manager data so you can identify licenses for this item/product.
define('YOUR_ITEM_REFERENCE', 'My First Plugin'); //Rename this constant name so it is specific to your plugin or theme.

Expand Down Expand Up @@ -47,11 +48,12 @@ function sample_license_management_page() {
echo "Unexpected Error! The query returned with an error.";
}

var_dump($response);
// License data.
$license_data = json_decode(wp_remote_retrieve_body($response));

// TODO - Do something with it.

var_dump($license_data);

}
?>
Expand Down
16 changes: 9 additions & 7 deletions license-manager/menu/lic_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ function wp_lic_mgr_settings_menu() {
}

function wp_lic_mgr_general_settings() {

if (isset($_POST['info_update'])) {

update_option('wp_lic_mgr_reg_secret_key', (string) $_POST["wp_lic_mgr_reg_secret_key"]);
update_option('wp_lic_mgr_key_prefix', (string) $_POST["wp_lic_mgr_key_prefix"]);
if (is_numeric($_POST["wp_lic_mgr_max_num_domain"]))
if (is_numeric($_POST["wp_lic_mgr_max_num_domain"])) {
update_option('wp_lic_mgr_max_num_domain', (string) $_POST["wp_lic_mgr_max_num_domain"]);
}
update_option('wp_lic_mgr_verification_secret_key', (string) $_POST["wp_lic_mgr_verification_secret_key"]);
//update_option('eStore_enable_wishlist_int', ($_POST['eStore_enable_wishlist_int']=='1') ? '1':'' );
}
Expand All @@ -30,8 +33,7 @@ function wp_lic_mgr_general_settings() {
$secret_verification_key = uniqid('', true);
}
?>
<p>For information, updates and detailed documentation, please visit the <a href="http://www.tipsandtricks-hq.com" target="_blank">WP License Manager Documentation Site</a> or
The main plugin page <a href="http://www.tipsandtricks-hq.com/" target="_blank">WP License Manager</a></p>
<p>For information, updates and detailed documentation, please visit the <a href="http://www.tipsandtricks-hq.com" target="_blank">License Manager Documentation</a> page.</p>

<div class="postbox">
<h3><label for="title">Quick Usage Guide</label></h3>
Expand All @@ -42,7 +44,7 @@ function wp_lic_mgr_general_settings() {
<p>3. Integrate the real time online key verification part.</p>
</div></div>

<form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
<form method="post" action="">

<div class="postbox">
<h3><label for="title">General License Manager Settings</label></h3>
Expand All @@ -51,19 +53,19 @@ function wp_lic_mgr_general_settings() {

<tr valign="top">
<th scope="row">Secret Key for License Creation</th>
<td><input type="text" name="wp_lic_mgr_reg_secret_key" value="<?php echo $secret_key; ?>" size="30" />
<td><input type="text" name="wp_lic_mgr_reg_secret_key" value="<?php echo $secret_key; ?>" size="40" />
<br />This secret key will be used to authenticate any license creation request. You can change it with something random.</td>
</tr>

<tr valign="top">
<th scope="row">License Key Prefix</th>
<td><input type="text" name="wp_lic_mgr_key_prefix" value="<?php echo get_option('wp_lic_mgr_key_prefix'); ?>" size="30" />
<td><input type="text" name="wp_lic_mgr_key_prefix" value="<?php echo get_option('wp_lic_mgr_key_prefix'); ?>" size="440" />
<br />You can optionaly specify a prefix for the license keys. This prefix will be added to the uniquely generated license keys.</td>
</tr>

<tr valign="top">
<th scope="row">Secret Key for License Verification Requests</th>
<td><input type="text" name="wp_lic_mgr_verification_secret_key" value="<?php echo $secret_verification_key; ?>" size="30" />
<td><input type="text" name="wp_lic_mgr_verification_secret_key" value="<?php echo $secret_verification_key; ?>" size="40" />
<br />This secret key will be used to authenticate any license verification request from customer's site. Important! Do not change this value once your customers start to use your product(s)!</td>
</tr>
<tr valign="top">
Expand Down
3 changes: 2 additions & 1 deletion license-manager/slm_installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
)ENGINE=MyISAM DEFAULT CHARSET=utf8;";
dbDelta($ld_tbl_sql);

// Add default options
update_option("wp_lic_mgr_db_version", WP_LICENSE_MANAGER_DB_VERSION);

// Add default options

0 comments on commit 085071e

Please sign in to comment.