summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKAKit/src/User.cc
diff options
context:
space:
mode:
authorAmlal <amlalelmahrouss@icloud.com>2024-12-12 09:01:44 +0100
committerAmlal <amlalelmahrouss@icloud.com>2024-12-12 09:03:35 +0100
commit71ea4e60ed0b30590a48fde31a74b05e3dd14196 (patch)
treecdfccef70e20622ef1e5219e2c58fa6a2f5b30d9 /dev/ZKAKit/src/User.cc
parent5bd5a930755550d4fa7cb48c51aa8f9b9f3e5bae (diff)
NeFS.h: Add new fork types in NeFS specifications.
User.h/User.cc: Did code refactors in the User class. Heap.cc: Also refactored the heap structure. Signed-off-by: Amlal <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKAKit/src/User.cc')
-rw-r--r--dev/ZKAKit/src/User.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/dev/ZKAKit/src/User.cc b/dev/ZKAKit/src/User.cc
index c00048c3..6c4c2a32 100644
--- a/dev/ZKAKit/src/User.cc
+++ b/dev/ZKAKit/src/User.cc
@@ -46,7 +46,7 @@ namespace Kernel
password[i_pass] = cur_chr | (user->IsStdUser() ? kStdUserType : kSuperUserType);
}
- kcout << "Done hashing user password!\r";
+ kcout << "DONE: hashed user password.\r";
return 0;
}
@@ -54,23 +54,23 @@ namespace Kernel
/// @brief User ring constructor.
User::User(const Int32& sel, const Char* userName)
- : fRing((UserRingKind)sel)
+ : mUserRing((UserRingKind)sel)
{
MUST_PASS(sel >= 0);
- rt_copy_memory((VoidPtr)userName, this->fUserName, rt_string_len(userName));
+ rt_copy_memory((VoidPtr)userName, this->mUserName, rt_string_len(userName));
}
/// @brief User ring constructor.
User::User(const UserRingKind& ringKind, const Char* userName)
- : fRing(ringKind)
+ : mUserRing(ringKind)
{
- rt_copy_memory((VoidPtr)userName, this->fUserName, rt_string_len(userName));
+ rt_copy_memory((VoidPtr)userName, this->mUserName, rt_string_len(userName));
}
/// @brief User destructor class.
User::~User() = default;
- Bool User::Save(const UserPublicKey password_to_fill) noexcept
+ Bool User::Save(const usr_public_key_kind password_to_fill) noexcept
{
if (!password_to_fill ||
*password_to_fill == 0)
@@ -96,7 +96,7 @@ namespace Kernel
// then store password.
- rt_copy_memory(password, this->fUserToken, rt_string_len(password_to_fill));
+ rt_copy_memory(password, this->mUserToken, rt_string_len(password_to_fill));
delete[] password;
password = nullptr;
@@ -106,7 +106,7 @@ namespace Kernel
return Yes;
}
- Bool User::Matches(const UserPublicKey password_to_fill) noexcept
+ Bool User::Matches(const usr_public_key_kind password_to_fill) noexcept
{
if (!password_to_fill ||
*password_to_fill)
@@ -133,7 +133,7 @@ namespace Kernel
kcout << "Validating hashed passwords...\r";
// now check if the password matches.
- if (rt_string_cmp(password, this->fUserToken, rt_string_len(this->fUserToken)) == 0)
+ if (rt_string_cmp(password, this->mUserToken, rt_string_len(this->mUserToken)) == 0)
{
kcout << "Password is valid.\r";
return Yes;
@@ -145,24 +145,24 @@ namespace Kernel
Bool User::operator==(const User& lhs)
{
- return lhs.fRing == this->fRing;
+ return lhs.mUserRing == this->mUserRing;
}
Bool User::operator!=(const User& lhs)
{
- return lhs.fRing != this->fRing;
+ return lhs.mUserRing != this->mUserRing;
}
Char* User::Name() noexcept
{
- return this->fUserName;
+ return this->mUserName;
}
/// @brief Returns the user's ring.
/// @return The king of ring the user is attached to.
const UserRingKind& User::Ring() noexcept
{
- return this->fRing;
+ return this->mUserRing;
}
Bool User::IsStdUser() noexcept