mirror of
https://github.com/arcan1s/queued.git
synced 2025-08-16 21:39:57 +00:00
do not allow get user and task properties w\o auth
This commit is contained in:
@ -102,6 +102,12 @@ QString QueuedEmailNotifyHelper::server() const
|
||||
}
|
||||
|
||||
|
||||
QString QueuedEmailNotifyHelper::token() const
|
||||
{
|
||||
return m_token;
|
||||
}
|
||||
|
||||
|
||||
QString QueuedEmailNotifyHelper::username() const
|
||||
{
|
||||
return m_username;
|
||||
@ -156,6 +162,12 @@ void QueuedEmailNotifyHelper::setSslEnabled(const bool _sslEnabled)
|
||||
}
|
||||
|
||||
|
||||
void QueuedEmailNotifyHelper::setToken(const QString &_token)
|
||||
{
|
||||
m_token = _token;
|
||||
}
|
||||
|
||||
|
||||
void QueuedEmailNotifyHelper::setUsername(const QString &_username)
|
||||
{
|
||||
qCDebug(LOG_PL) << "Set username" << _username;
|
||||
@ -215,14 +227,14 @@ QString QueuedEmailNotifyHelper::getEmail(const long long _id) const
|
||||
{
|
||||
qCDebug(LOG_PL) << "Get email for task ID" << _id;
|
||||
|
||||
auto task = QueuedCoreAdaptor::getTask(_id, "user");
|
||||
auto task = QueuedCoreAdaptor::getTask(_id, "user", token());
|
||||
if (task.type() != Result::Content::Value) {
|
||||
qCWarning(LOG_LIB) << "Could not get task information" << _id;
|
||||
return "";
|
||||
}
|
||||
|
||||
auto userId = task.get().toLongLong();
|
||||
auto user = QueuedCoreAdaptor::getUser(userId, "email");
|
||||
auto user = QueuedCoreAdaptor::getUser(userId, "email", token());
|
||||
if (user.type() != Result::Content::Value) {
|
||||
qCWarning(LOG_LIB) << "Could not get user information" << userId;
|
||||
return "";
|
||||
|
Reference in New Issue
Block a user