2014-09-08 15:54:52 +00:00
|
|
|
#include "user.h"
|
|
|
|
|
2014-09-17 01:08:38 +00:00
|
|
|
/**
|
|
|
|
* @brief user::user Constructor
|
|
|
|
* @param username user name
|
|
|
|
* @param password password
|
|
|
|
*/
|
|
|
|
user::user(QString username,QString password) : hashedPassword(""),userID(""), influenceCourseOnly(false)
|
2014-09-08 15:54:52 +00:00
|
|
|
{
|
|
|
|
this->username = username;
|
|
|
|
this->password = password;
|
|
|
|
}
|
2014-09-17 01:08:38 +00:00
|
|
|
|
2014-09-08 15:54:52 +00:00
|
|
|
user::~user()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-09-17 01:08:38 +00:00
|
|
|
/**
|
|
|
|
* @brief user::setInfluenceCourseOnly
|
|
|
|
* @param status show only courses with influnce?
|
|
|
|
*/
|
2014-09-08 15:54:52 +00:00
|
|
|
void user::setInfluenceCourseOnly(bool status)
|
|
|
|
{
|
|
|
|
this->influenceCourseOnly = status;
|
|
|
|
}
|
2014-09-17 01:08:38 +00:00
|
|
|
/**
|
|
|
|
* @brief user::getInfluenceCourseOnly
|
|
|
|
* @return if user wants to show only influence courses
|
|
|
|
*/
|
2014-09-08 15:54:52 +00:00
|
|
|
bool user::getInfluenceCourseOnly() const
|
|
|
|
{
|
|
|
|
return this->influenceCourseOnly;
|
|
|
|
}
|
2014-09-17 01:08:38 +00:00
|
|
|
/**
|
|
|
|
* @brief user::setUsername
|
|
|
|
* @param username given username to change to
|
|
|
|
*/
|
|
|
|
void user::setUsername(QString& username)
|
|
|
|
{
|
|
|
|
this->username = username;
|
2014-09-08 15:54:52 +00:00
|
|
|
}
|
2014-09-17 01:08:38 +00:00
|
|
|
/**
|
|
|
|
* @brief user::setPassword
|
|
|
|
* @param password given password to change to
|
|
|
|
*/
|
|
|
|
void user::setPassword(QString& password)
|
|
|
|
{
|
|
|
|
this->password = password;
|
2014-09-08 15:54:52 +00:00
|
|
|
}
|
2014-09-17 01:08:38 +00:00
|
|
|
/**
|
|
|
|
* @brief user::setUserID
|
|
|
|
* @param ID given ID from html
|
|
|
|
*/
|
|
|
|
void user::setUserID(QString& ID)
|
2014-09-08 15:54:52 +00:00
|
|
|
{
|
|
|
|
this->userID = ID;
|
|
|
|
}
|
2014-09-17 01:08:38 +00:00
|
|
|
/**
|
|
|
|
* @brief user::setHashedPassword
|
|
|
|
* @param hashpass given hashed password given from html
|
|
|
|
*/
|
|
|
|
void user::setHashedPassword(QString& hashpass)
|
2014-09-08 15:54:52 +00:00
|
|
|
{
|
|
|
|
this->hashedPassword = hashpass;
|
|
|
|
}
|
2014-09-17 01:08:38 +00:00
|
|
|
/**
|
|
|
|
* @brief user::get*
|
|
|
|
* @return getters
|
|
|
|
*/
|
|
|
|
QString user::getPassword() const { return password; }
|
|
|
|
QString user::getUsername() const { return username; }
|
|
|
|
QString user::getUserID() const { return userID; }
|
|
|
|
QString user::getHashedPassword() const { return hashedPassword; }
|