ad suport env variable

This commit is contained in:
2020-06-02 15:21:59 +02:00
parent 3eb5197ba5
commit 44bfd7e606
4 changed files with 18 additions and 1 deletions

View File

@@ -6,6 +6,8 @@ session_manager::session_manager(conexion* con)
this->con=con;
}
bool session_manager::loggin(std::string username, std::string passwd){
this->con->write_string(username);
this->con->write_string(passwd);
@@ -17,6 +19,12 @@ bool session_manager::loggin(std::string username, std::string passwd){
bool session_manager::admin(){
std::string result;
this->con->read_string(result,5);
std::string env;
if(this->con->get_conf()->get_param("env", env)){
this->con->write_string(env);
}else{
this->con->write_string("no");
}
return result=="admin";
}