ClienteTFG
Public Member Functions | List of all members
session_manager Class Reference

Public Member Functions

 session_manager (conexion *con)
 session_manager Object that manage the session, and gide on it More...
 
bool loggin (std::string username, std::string passwd)
 loggin Loggin function More...
 
bool admin ()
 admin Get user privileges More...
 
int install_command (std::string package)
 install_command Send name of the package to build More...
 
int remove_command (std::string package)
 remove_command Send name of the package to remove More...
 
std::list< std::string > get_packages_info ()
 get_packages_info Get all packages information More...
 
std::list< std::string > get_users_info ()
 get_users_info Get all users username and privileges More...
 
void create_user (std::string username, std::string password, bool admin)
 create_user Create a new user More...
 
void remove_user (std::string username)
 remove_user Remove a created user More...
 

Constructor & Destructor Documentation

◆ session_manager()

session_manager::session_manager ( conexion con)

session_manager Object that manage the session, and gide on it

Parameters
conConexion of the session

Member Function Documentation

◆ admin()

bool session_manager::admin ( )

admin Get user privileges

Returns
true if the admin can manage other users, false if not

◆ create_user()

void session_manager::create_user ( std::string  username,
std::string  password,
bool  admin 
)

create_user Create a new user

Parameters
usernameUsername for a new user
passwordPassword for a new user
adminPrivileges of a new user

◆ get_packages_info()

std::list< std::string > session_manager::get_packages_info ( )

get_packages_info Get all packages information

Returns
List of strings that contains all package information. Every package have the information separated with the sepacial character ":"

◆ get_users_info()

std::list< std::string > session_manager::get_users_info ( )

get_users_info Get all users username and privileges

Returns
List of strings that contains all users information. Every users have the username first, and after separated with a ":" a t or a f, t if they have privileges or f if not

◆ install_command()

int session_manager::install_command ( std::string  package)

install_command Send name of the package to build

Parameters
packageName of the package
Returns
positive if it is build well, or negative if not

◆ loggin()

bool session_manager::loggin ( std::string  username,
std::string  passwd 
)

loggin Loggin function

Parameters
usernameUsername to try to start session
passwdPassword to the user
Returns
True if the username have these password, false if not or the user not exists

◆ remove_command()

int session_manager::remove_command ( std::string  package)

remove_command Send name of the package to remove

Parameters
packageName of the package
Returns
positive if it is removed well, or negative if not

◆ remove_user()

void session_manager::remove_user ( std::string  username)

remove_user Remove a created user

Parameters
usernameName of these

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