mirror of
https://github.com/debauchee/barrier.git
synced 2026-07-17 03:20:40 +08:00
Only send notify request on wizard finish #4932
This commit is contained in:
@@ -74,11 +74,11 @@ QString CoreInterface::checkSubscription()
|
||||
return run(args);
|
||||
}
|
||||
|
||||
QString CoreInterface::notifyActivation(const QString& action)
|
||||
QString CoreInterface::notifyActivation(const QString& identity)
|
||||
{
|
||||
QStringList args("--notify-activation");
|
||||
|
||||
QString input(action + ":" + hash(getFirstMacAddress()));
|
||||
QString input(identity + ":" + hash(getFirstMacAddress()));
|
||||
QString os= getOSInformation();
|
||||
if (!os.isEmpty()) {
|
||||
input.append(":").append(os);
|
||||
|
||||
@@ -31,6 +31,6 @@ public:
|
||||
QString getSubscriptionFilename();
|
||||
QString activateSerial(const QString& serial);
|
||||
QString checkSubscription();
|
||||
QString notifyActivation(const QString& action);
|
||||
QString notifyActivation(const QString& identity);
|
||||
QString run(const QStringList& args, const QString& input = "");
|
||||
};
|
||||
|
||||
@@ -211,6 +211,9 @@ void SetupWizard::accept()
|
||||
QString hashResult = hash(hashSrc);
|
||||
appConfig.setUserToken(hashResult);
|
||||
appConfig.setEdition(m_Edition);
|
||||
|
||||
CoreInterface coreInterface;
|
||||
coreInterface.notifyActivation("login:" + m_pLineEditEmail->text());
|
||||
}
|
||||
|
||||
if (m_pRadioButtonSubscription->isChecked())
|
||||
@@ -218,13 +221,13 @@ void SetupWizard::accept()
|
||||
appConfig.setSerialKey(m_pLineEditSerialKey->text());
|
||||
|
||||
CoreInterface coreInterface;
|
||||
coreInterface.notifyActivation("serial");
|
||||
coreInterface.notifyActivation("serial:" + m_pLineEditSerialKey->text());
|
||||
}
|
||||
|
||||
if (m_pRadioButtonSkip->isChecked())
|
||||
{
|
||||
CoreInterface coreInterface;
|
||||
coreInterface.notifyActivation("skip");
|
||||
coreInterface.notifyActivation("skip:unknown");
|
||||
}
|
||||
|
||||
m_MainWindow.setEdition(m_Edition);
|
||||
@@ -251,6 +254,10 @@ void SetupWizard::reject()
|
||||
m_MainWindow.open();
|
||||
}
|
||||
|
||||
// treat cancel as skip
|
||||
CoreInterface coreInterface;
|
||||
coreInterface.notifyActivation("skip:unknown");
|
||||
|
||||
QWizard::reject();
|
||||
}
|
||||
|
||||
|
||||
@@ -94,12 +94,7 @@ QString WebClient::request(
|
||||
{
|
||||
QStringList args("--login-auth");
|
||||
// hash password in case it contains interesting chars.
|
||||
QString credentials(email + ":" + hash(password) + ":" + hash(getFirstMacAddress()));
|
||||
QString os= getOSInformation();
|
||||
if (!os.isEmpty()) {
|
||||
credentials.append(":").append(os);
|
||||
}
|
||||
credentials.append("\n");
|
||||
QString credentials(email + ":" + hash(password) + "\n");
|
||||
|
||||
return m_CoreInterface.run(args, credentials);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user