Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
iv::diamar::UserProfile Class Referencefinal

#include <UserProfile.hpp>

Classes

struct  DefaultPasswords
 
struct  DefaultValues
 
struct  Keys
 
struct  LoginAttemptsProperties
 
struct  PasswordProperties
 

Public Member Functions

 UserProfile ()
 
 UserProfile (const iv::diamar::eUserProfileType &type, const bool &enabled=false)
 
 UserProfile (const UserProfile &userProfile)
 
 UserProfile (UserProfile &&other) noexcept=delete
 
 ~UserProfile ()
 
UserProfileoperator= (const UserProfile &other)=delete
 
UserProfileoperator= (UserProfile &&other) noexcept=delete
 
bool load (const iv::file::xml::node &nodeProfile)
 
bool save (iv::file::xml::node &nodeProfile) const
 
void update (const UserProfile &other)
 
void blockUser () const
 
void unBlockUser () const
 
iv::diamar::eUserProfileType getType () const
 
std::string getPassword () const
 
std::string getDecipheredPassword () const
 
iv::types::milliseconds getMaxTimeInProfile () const
 Get how much time the user can be logged in in seconds.
 
uint32_t getRemainingLoginAttempts () const
 
void getRemainingBlockTime (uint32_t &hoursLeft, uint32_t &minutesLeft, uint32_t &secondsLeft) const
 
std::string getRemainingBlockTimeStr () const
 
std::string getTypeStr () const
 
std::string getIconUser () const
 
void setActive (bool isActive)
 
void setPassword (const std::string &newPassword, bool mustBeChanged)
 
bool canPermitAlarmAck () const
 
bool canChangePassword (std::string *reasonMsg) const
 
bool hasPermissionAccessControl (iv::model::eShipArea areaStationAlarm) const
 
bool hasPermissionAck (iv::model::eShipArea areaShip) const
 
bool hasPermissionChangeParameters (iv::model::eShipArea areaShip, iv::channels::eChannelArea areaStationAlarm) const
 
bool hasPermissionChangeVariablesOnline (iv::model::eShipArea areaShip) const
 
bool isEnabled () const
 
bool isRoot () const
 
bool isPasswordCorrect (const std::string &password) const
 
bool mustChangePassword () const
 
bool isPasswordExpired () const
 
bool isNotifiedAlarm (iv::model::eShipArea areaShip, uint64_t areaStationAlarm) const
 
bool isNotifiedByZoneRepeaters (iv::model::eShipArea areaShip, iv::model::eShipArea typeZoneRepeater) const
 
bool shouldBeNotifiedForPasswordChange (iv::types::timestamp &remainingTime) const
 
void setPasswordAndMaxTime (iv::diamar::eUserProfileType type)
 
bool isBlocked () const
 
void resetFailedLoginAttemptsCounter () const
 
void registerSuccessfulLoginAttempt () const
 
void registerFailedLoginAttempt () const
 
void registerLoginAttemptInBlockedProfile () const
 

Static Public Member Functions

static iv::diamar::eUserProfileType getProfileUserInArea (iv::model::eShipArea area)
 
static iv::diamar::eUserProfileType getProfileUserInAreaWithAccess (iv::model::eShipArea area)
 

Public Attributes

bool m_enabled
 
iv::diamar::eUserProfileType m_type
 
std::string m_password
 
iv::types::milliseconds m_maxTimeInProfile
 
std::unique_ptr< PasswordPropertiesm_passwordProperties
 
std::unique_ptr< LoginAttemptsPropertiesm_loginAttemptsProperties
 

Constructor & Destructor Documentation

◆ UserProfile() [1/4]

iv::diamar::UserProfile::UserProfile ( )

◆ UserProfile() [2/4]

iv::diamar::UserProfile::UserProfile ( const iv::diamar::eUserProfileType & type,
const bool & enabled = false )
explicit

◆ UserProfile() [3/4]

iv::diamar::UserProfile::UserProfile ( const UserProfile & userProfile)

◆ UserProfile() [4/4]

iv::diamar::UserProfile::UserProfile ( UserProfile && other)
deletenoexcept

◆ ~UserProfile()

iv::diamar::UserProfile::~UserProfile ( )
default

Member Function Documentation

◆ blockUser()

void iv::diamar::UserProfile::blockUser ( ) const

◆ canChangePassword()

bool iv::diamar::UserProfile::canChangePassword ( std::string * reasonMsg) const
nodiscard

◆ canPermitAlarmAck()

bool iv::diamar::UserProfile::canPermitAlarmAck ( ) const
nodiscard

◆ getDecipheredPassword()

std::string iv::diamar::UserProfile::getDecipheredPassword ( ) const
nodiscard

◆ getIconUser()

std::string iv::diamar::UserProfile::getIconUser ( ) const
nodiscard

◆ getMaxTimeInProfile()

iv::types::milliseconds iv::diamar::UserProfile::getMaxTimeInProfile ( ) const
nodiscard

Get how much time the user can be logged in in seconds.

Returns
The time in seconds.

◆ getPassword()

std::string iv::diamar::UserProfile::getPassword ( ) const
nodiscard

◆ getProfileUserInArea()

iv::diamar::eUserProfileType iv::diamar::UserProfile::getProfileUserInArea ( iv::model::eShipArea area)
static

◆ getProfileUserInAreaWithAccess()

iv::diamar::eUserProfileType iv::diamar::UserProfile::getProfileUserInAreaWithAccess ( iv::model::eShipArea area)
static

◆ getRemainingBlockTime()

void iv::diamar::UserProfile::getRemainingBlockTime ( uint32_t & hoursLeft,
uint32_t & minutesLeft,
uint32_t & secondsLeft ) const

◆ getRemainingBlockTimeStr()

std::string iv::diamar::UserProfile::getRemainingBlockTimeStr ( ) const
nodiscard

◆ getRemainingLoginAttempts()

uint32_t iv::diamar::UserProfile::getRemainingLoginAttempts ( ) const
nodiscard

◆ getType()

iv::diamar::eUserProfileType iv::diamar::UserProfile::getType ( ) const
nodiscard

◆ getTypeStr()

std::string iv::diamar::UserProfile::getTypeStr ( ) const
nodiscard

◆ hasPermissionAccessControl()

bool iv::diamar::UserProfile::hasPermissionAccessControl ( iv::model::eShipArea areaStationAlarm) const
nodiscard

◆ hasPermissionAck()

bool iv::diamar::UserProfile::hasPermissionAck ( iv::model::eShipArea areaShip) const
nodiscard

◆ hasPermissionChangeParameters()

bool iv::diamar::UserProfile::hasPermissionChangeParameters ( iv::model::eShipArea areaShip,
iv::channels::eChannelArea areaStationAlarm ) const
nodiscard

◆ hasPermissionChangeVariablesOnline()

bool iv::diamar::UserProfile::hasPermissionChangeVariablesOnline ( iv::model::eShipArea areaShip) const
nodiscard

◆ isBlocked()

bool iv::diamar::UserProfile::isBlocked ( ) const
nodiscard

◆ isEnabled()

bool iv::diamar::UserProfile::isEnabled ( ) const
nodiscard

◆ isNotifiedAlarm()

bool iv::diamar::UserProfile::isNotifiedAlarm ( iv::model::eShipArea areaShip,
uint64_t areaStationAlarm ) const
nodiscard

◆ isNotifiedByZoneRepeaters()

bool iv::diamar::UserProfile::isNotifiedByZoneRepeaters ( iv::model::eShipArea areaShip,
iv::model::eShipArea typeZoneRepeater ) const
nodiscard

◆ isPasswordCorrect()

bool iv::diamar::UserProfile::isPasswordCorrect ( const std::string & password) const
nodiscard

◆ isPasswordExpired()

bool iv::diamar::UserProfile::isPasswordExpired ( ) const
nodiscard

◆ isRoot()

bool iv::diamar::UserProfile::isRoot ( ) const
nodiscard

◆ load()

bool iv::diamar::UserProfile::load ( const iv::file::xml::node & nodeProfile)

◆ mustChangePassword()

bool iv::diamar::UserProfile::mustChangePassword ( ) const
nodiscard

◆ operator=() [1/2]

UserProfile & iv::diamar::UserProfile::operator= ( const UserProfile & other)
delete

◆ operator=() [2/2]

UserProfile & iv::diamar::UserProfile::operator= ( UserProfile && other)
deletenoexcept

◆ registerFailedLoginAttempt()

void iv::diamar::UserProfile::registerFailedLoginAttempt ( ) const

◆ registerLoginAttemptInBlockedProfile()

void iv::diamar::UserProfile::registerLoginAttemptInBlockedProfile ( ) const

◆ registerSuccessfulLoginAttempt()

void iv::diamar::UserProfile::registerSuccessfulLoginAttempt ( ) const

◆ resetFailedLoginAttemptsCounter()

void iv::diamar::UserProfile::resetFailedLoginAttemptsCounter ( ) const

◆ save()

bool iv::diamar::UserProfile::save ( iv::file::xml::node & nodeProfile) const

◆ setActive()

void iv::diamar::UserProfile::setActive ( bool isActive)

◆ setPassword()

void iv::diamar::UserProfile::setPassword ( const std::string & newPassword,
bool mustBeChanged )

◆ setPasswordAndMaxTime()

void iv::diamar::UserProfile::setPasswordAndMaxTime ( iv::diamar::eUserProfileType type)

◆ shouldBeNotifiedForPasswordChange()

bool iv::diamar::UserProfile::shouldBeNotifiedForPasswordChange ( iv::types::timestamp & remainingTime) const
nodiscard

◆ unBlockUser()

void iv::diamar::UserProfile::unBlockUser ( ) const

◆ update()

void iv::diamar::UserProfile::update ( const UserProfile & other)

Member Data Documentation

◆ m_enabled

bool iv::diamar::UserProfile::m_enabled

◆ m_loginAttemptsProperties

std::unique_ptr<LoginAttemptsProperties> iv::diamar::UserProfile::m_loginAttemptsProperties

◆ m_maxTimeInProfile

iv::types::milliseconds iv::diamar::UserProfile::m_maxTimeInProfile

◆ m_password

std::string iv::diamar::UserProfile::m_password

◆ m_passwordProperties

std::unique_ptr<PasswordProperties> iv::diamar::UserProfile::m_passwordProperties

◆ m_type

iv::diamar::eUserProfileType iv::diamar::UserProfile::m_type

The documentation for this class was generated from the following files: