mirror of
https://github.com/deskflow/deskflow.git
synced 2026-07-01 21:02:39 +08:00
Add decoded serial key into the request
This commit is contained in:
parent
8dff01bc24
commit
0e18c89416
@ -77,6 +77,7 @@ QByteArray LicenseRegistry::getRequestData() const
|
||||
const SerialKey key(m_config.serialKey().toStdString());
|
||||
data["email"] = key.getEmail().c_str();
|
||||
data["key"] = key.toString().c_str();
|
||||
data["key_decoded"] = key.getDecodedKey().c_str();
|
||||
|
||||
data["is_server"] = m_config.getServerGroupChecked();
|
||||
|
||||
|
||||
@ -161,3 +161,9 @@ SerialKey::getEmail() const
|
||||
{
|
||||
return m_data.email;
|
||||
}
|
||||
|
||||
const std::string&
|
||||
SerialKey::getDecodedKey() const
|
||||
{
|
||||
return m_data.key_decoded;
|
||||
}
|
||||
|
||||
@ -40,6 +40,7 @@ public:
|
||||
const std::string& getEmail() const;
|
||||
Edition edition() const;
|
||||
const std::string& toString() const;
|
||||
const std::string& getDecodedKey() const;
|
||||
|
||||
private:
|
||||
SerialKeyData m_data;
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
*/
|
||||
struct SerialKeyData {
|
||||
std::string key; // Encoded serial key as a string
|
||||
std::string key_decoded; // Decoded serial key
|
||||
std::string email; // Email from the serial key
|
||||
SerialKeyEdition edition; // Serial key edition
|
||||
SerialKeyType keyType; // Serial key type
|
||||
|
||||
@ -23,6 +23,12 @@ SerialKeyParser::setKey(const std::string& key)
|
||||
m_data.key = key;
|
||||
}
|
||||
|
||||
void
|
||||
SerialKeyParser::setDecodedKey(const std::string& key)
|
||||
{
|
||||
m_data.key_decoded = key;
|
||||
}
|
||||
|
||||
void
|
||||
SerialKeyParser::setEmail(const std::string& email)
|
||||
{
|
||||
@ -97,11 +103,13 @@ SerialKeyParser::parse(const std::string& plainSerial)
|
||||
|
||||
if ((parts.size() == 8) && (parts.at(0).find("v1") != std::string::npos)) {
|
||||
setKey(plainSerial);
|
||||
setDecodedKey(key);
|
||||
parseV1(parts);
|
||||
valid = true;
|
||||
}
|
||||
else if ((parts.size() == 9) && (parts.at(0).find("v2") != std::string::npos)) {
|
||||
setKey(plainSerial);
|
||||
setDecodedKey(key);
|
||||
parseV2(parts);
|
||||
valid = true;
|
||||
}
|
||||
|
||||
@ -46,6 +46,12 @@ public:
|
||||
*/
|
||||
void setKey(const std::string& key);
|
||||
|
||||
/**
|
||||
* @brief setKey setter to set decoded key
|
||||
* @param key decoded serial key
|
||||
*/
|
||||
void setDecodedKey(const std::string& key);
|
||||
|
||||
/**
|
||||
* @brief setEmail setter to set encoded email
|
||||
* @param email encoded email from the key
|
||||
|
||||
Loading…
Reference in New Issue
Block a user