1#ifndef IV_SRC_MODEL_DIAMAR_USERPROFILE_HPP_
2#define IV_SRC_MODEL_DIAMAR_USERPROFILE_HPP_
8#include "model/enums.hpp"
9#include "model/structs.hpp"
65 void setPassword(
const std::string &newPassword,
bool mustBeChanged);
78 [[nodiscard]]
bool isRoot()
const;
121 static constexpr std::string_view
enabled {
"Enabled"};
122 static constexpr std::string_view
type {
"Type"};
123 static constexpr std::string_view
password {
"Password"};
124 static constexpr std::string_view
maxTime {
"MaxTime"};
130 static constexpr std::string
string {};
Definition MonotonicTimer.hpp:12
Definition UserProfile.hpp:17
void setActive(bool isActive)
Definition UserProfile.cpp:240
void registerSuccessfulLoginAttempt() const
Definition UserProfile.cpp:696
bool isPasswordExpired() const
Definition UserProfile.cpp:467
bool hasPermissionChangeVariablesOnline(iv::model::eShipArea areaShip) const
Definition UserProfile.cpp:386
iv::types::milliseconds m_maxTimeInProfile
Definition UserProfile.hpp:103
bool isNotifiedAlarm(iv::model::eShipArea areaShip, uint64_t areaStationAlarm) const
Definition UserProfile.cpp:488
uint32_t getRemainingLoginAttempts() const
Definition UserProfile.cpp:166
std::string getIconUser() const
Definition UserProfile.cpp:202
bool m_enabled
Definition UserProfile.hpp:99
UserProfile & operator=(UserProfile &&other) noexcept=delete
UserProfile(UserProfile &&other) noexcept=delete
iv::diamar::eUserProfileType getType() const
Definition UserProfile.cpp:142
bool isEnabled() const
Definition UserProfile.cpp:440
bool mustChangePassword() const
Definition UserProfile.cpp:455
iv::types::milliseconds getMaxTimeInProfile() const
Get how much time the user can be logged in in seconds.
Definition UserProfile.cpp:161
UserProfile & operator=(const UserProfile &other)=delete
std::string m_password
Definition UserProfile.hpp:102
static iv::diamar::eUserProfileType getProfileUserInArea(iv::model::eShipArea area)
Definition UserProfile.cpp:13
std::string getRemainingBlockTimeStr() const
Definition UserProfile.cpp:184
bool isNotifiedByZoneRepeaters(iv::model::eShipArea areaShip, iv::model::eShipArea typeZoneRepeater) const
Definition UserProfile.cpp:520
bool save(iv::file::xml::node &nodeProfile) const
Definition UserProfile.cpp:108
bool hasPermissionAck(iv::model::eShipArea areaShip) const
Definition UserProfile.cpp:351
void setPasswordAndMaxTime(iv::diamar::eUserProfileType type)
Definition UserProfile.cpp:577
void registerFailedLoginAttempt() const
Definition UserProfile.cpp:707
bool canPermitAlarmAck() const
Definition UserProfile.cpp:252
bool load(const iv::file::xml::node &nodeProfile)
Definition UserProfile.cpp:79
bool isPasswordCorrect(const std::string &password) const
Definition UserProfile.cpp:450
bool isRoot() const
Definition UserProfile.cpp:445
bool hasPermissionAccessControl(iv::model::eShipArea areaStationAlarm) const
Definition UserProfile.cpp:302
bool isBlocked() const
Definition UserProfile.cpp:618
std::string getTypeStr() const
Definition UserProfile.cpp:197
std::unique_ptr< PasswordProperties > m_passwordProperties
Definition UserProfile.hpp:105
void update(const UserProfile &other)
Definition UserProfile.cpp:121
static iv::diamar::eUserProfileType getProfileUserInAreaWithAccess(iv::model::eShipArea area)
Definition UserProfile.cpp:31
bool hasPermissionChangeParameters(iv::model::eShipArea areaShip, iv::channels::eChannelArea areaStationAlarm) const
Definition UserProfile.cpp:630
std::string getDecipheredPassword() const
Definition UserProfile.cpp:152
std::string getPassword() const
Definition UserProfile.cpp:147
UserProfile()
Definition UserProfile.cpp:49
bool canChangePassword(std::string *reasonMsg) const
Definition UserProfile.cpp:257
bool shouldBeNotifiedForPasswordChange(iv::types::timestamp &remainingTime) const
Definition UserProfile.cpp:554
void blockUser() const
Definition UserProfile.cpp:129
void setPassword(const std::string &newPassword, bool mustBeChanged)
Definition UserProfile.cpp:245
void unBlockUser() const
Definition UserProfile.cpp:137
void getRemainingBlockTime(uint32_t &hoursLeft, uint32_t &minutesLeft, uint32_t &secondsLeft) const
Definition UserProfile.cpp:173
std::unique_ptr< LoginAttemptsProperties > m_loginAttemptsProperties
Definition UserProfile.hpp:107
void registerLoginAttemptInBlockedProfile() const
Definition UserProfile.cpp:725
iv::diamar::eUserProfileType m_type
Definition UserProfile.hpp:101
void resetFailedLoginAttemptsCounter() const
Definition UserProfile.cpp:687
Definition xmlFile.hpp:15
eChannelArea
Definition enums.hpp:55
Definition DataLoggerManager.cpp:10
eUserProfileType
Definition enums.hpp:34
eShipArea
Definition enums.hpp:11
uint64_t timestamp
Definition types.hpp:21
uint64_t milliseconds
Definition types.hpp:22
Definition UserProfile.hpp:111
static constexpr std::string DeckManagementPassword
Definition UserProfile.hpp:115
static constexpr std::string DeckAdvancedManagementPassword
Definition UserProfile.hpp:113
static constexpr std::string EngineAdvancedManagementPassword
Definition UserProfile.hpp:112
static constexpr std::string EngineManagementPassword
Definition UserProfile.hpp:114
static constexpr std::string RootPassword
Definition UserProfile.hpp:117
static constexpr std::string MonitorPassword
Definition UserProfile.hpp:116
Definition UserProfile.hpp:129
static constexpr std::string_view userProfileType
Definition UserProfile.hpp:131
Definition UserProfile.hpp:120
static constexpr std::string_view type
Definition UserProfile.hpp:122
static constexpr std::string_view enabled
Definition UserProfile.hpp:121
static constexpr std::string_view maxTime
Definition UserProfile.hpp:124
static constexpr std::string_view passwordMustBeChanged
Definition UserProfile.hpp:125
static constexpr std::string_view passwordLastUpdated
Definition UserProfile.hpp:126
static constexpr std::string_view password
Definition UserProfile.hpp:123
Definition UserProfile.hpp:29
iv::core::MonotonicTimer blockTimer
Definition UserProfile.hpp:30
uint32_t unsuccessfulLoginAttempts
Definition UserProfile.hpp:31
Definition UserProfile.hpp:23
bool mustBeChanged
Definition UserProfile.hpp:24
iv::types::timestamp lastUpdated
Definition UserProfile.hpp:25