Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
Update create a license via the seller api
Browse files Browse the repository at this point in the history
  • Loading branch information
Its-Networking committed Jan 11, 2024
1 parent d1037c2 commit c4d6293
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions includes/misc/license.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ function createLicense($amount, $mask, $duration, $level, $note, $expiry = null,
for ($i = 0; $i < $amount; $i++) {
$license = license_masking($mask, $letters);

if (token\ModifyUserToken($license, "License") === "failed") {
return "failure";
if (token\ModifyUserToken($license, "License", null, null, $secret ?? $_SESSION["app"]) === "failed") {
return "failure";
}
$query = mysql\query("INSERT INTO `keys` (`key`, `note`, `expires`, `status`, `level`, `genby`, `gendate`, `app`) VALUES (?, NULLIF(?, ''), ?, 'Not Used', ?, ?, ?, ?)", [$license, $note, $duration, $level, $owner ?? $_SESSION['username'], time(), $secret ?? $_SESSION['app']]);
$licenses[] = $license;
Expand Down
4 changes: 2 additions & 2 deletions includes/misc/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ function add($username, $sub, $expiry, $secret = null, $password = null)
cache\purge('KeyAuthUsers:' . ($secret ?? $_SESSION['app']));
cache\purge('KeyAuthUser:' . ($secret ?? $_SESSION['app']) . ':' . $username);
}
if (token\ModifyUserToken($username, "User") === "failed") { return "failure"; }
return 'success';
if (token\ModifyUserToken($username, "User", null, null, $secret ?? $_SESSION["app"]) === "failed") {
return "failure";
} else {
return 'failure';
}
Expand Down

0 comments on commit c4d6293

Please sign in to comment.