Admin manager header file. More...
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
Go to the source code of this file.
Data Structures | |
struct | Admin |
Admin structure. More... | |
Macros | |
#define | MAX_USERNAME_LENGTH 20 |
Maximum username length. | |
#define | MAX_PASSWORD_LENGTH 20 |
Maximum password length. | |
Typedefs | |
typedef struct Admin | Admin |
Functions | |||||||||||||||||||||||
saveAdminCredentials | |||||||||||||||||||||||
Save admin credentials to file This function saves the linkedlist data from
| |||||||||||||||||||||||
void | saveAdminCredentials (void) | ||||||||||||||||||||||
loadAdminCredentials | |||||||||||||||||||||||
Load admin credentials from file This function loads the admin credentials from the file
| |||||||||||||||||||||||
void | loadAdminCredentials (void) | ||||||||||||||||||||||
adminExists | |||||||||||||||||||||||
Check if admin exists This function traverses the
| |||||||||||||||||||||||
bool | adminExists (const char *username) | ||||||||||||||||||||||
validateAdmin | |||||||||||||||||||||||
Validate admin credentials This function traverses the
| |||||||||||||||||||||||
bool | validateAdmin (const char *username, const char *password) | ||||||||||||||||||||||
addAdmin | |||||||||||||||||||||||
Add admin This function adds a new admin to the
| |||||||||||||||||||||||
bool | addAdmin (const char *username, const char *password, const char *currentAdminUsername, const char *currentAdminPassword) | ||||||||||||||||||||||
deleteAdmin | |||||||||||||||||||||||
Delete admin This function deletes an admin from the
| |||||||||||||||||||||||
bool | deleteAdmin (const char *username, const char *currentAdminUsername, const char *currentAdminPassword) | ||||||||||||||||||||||
changeAdminPassword | |||||||||||||||||||||||
Change admin password This function changes the password of an admin in the
| |||||||||||||||||||||||
bool | changeAdminPassword (const char *username, const char *oldPassword, const char *newPassword) | ||||||||||||||||||||||
displayAdmin | |||||||||||||||||||||||
Display all admins This function displays all admins in the
| |||||||||||||||||||||||
void | displayAdmin (void) | ||||||||||||||||||||||
freeAdmin | |||||||||||||||||||||||
Free admin list This function frees the memory allocated for the
| |||||||||||||||||||||||
void | freeAdmin (void) | ||||||||||||||||||||||
Admin manager header file.
This file contains the declarations of the functions and structures for the admin manager module.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition in file admin_manager.h.
#define MAX_PASSWORD_LENGTH 20 |
Maximum password length.
This macro defines the maximum length of the password.
Definition at line 53 of file admin_manager.h.
#define MAX_USERNAME_LENGTH 20 |
Maximum username length.
This macro defines the maximum length of the username.
Definition at line 46 of file admin_manager.h.
bool addAdmin | ( | const char * | username, |
const char * | password, | ||
const char * | currentAdminUsername, | ||
const char * | currentAdminPassword ) |
Definition at line 240 of file admin_manager.c.
bool adminExists | ( | const char * | username | ) |
Definition at line 151 of file admin_manager.c.
bool changeAdminPassword | ( | const char * | username, |
const char * | oldPassword, | ||
const char * | newPassword ) |
Definition at line 380 of file admin_manager.c.
bool deleteAdmin | ( | const char * | username, |
const char * | currentAdminUsername, | ||
const char * | currentAdminPassword ) |
Definition at line 306 of file admin_manager.c.
void displayAdmin | ( | void | ) |
Definition at line 422 of file admin_manager.c.
void freeAdmin | ( | void | ) |
Definition at line 441 of file admin_manager.c.
void loadAdminCredentials | ( | void | ) |
Definition at line 96 of file admin_manager.c.
void saveAdminCredentials | ( | void | ) |
Definition at line 54 of file admin_manager.c.
bool validateAdmin | ( | const char * | username, |
const char * | password ) |
Definition at line 190 of file admin_manager.c.