add normal user restrictions

This commit is contained in:
2020-05-26 18:48:31 +02:00
parent b0c78dde76
commit df772fec57
4 changed files with 18 additions and 0 deletions

View File

@@ -19,6 +19,17 @@ std::string msql_acces::get_passwd(std::string username){
return ret;
}
bool msql_acces::get_admin(std::string username){
sql::PreparedStatement *pstmt = con->prepareStatement("select admin from users where username=?");
pstmt->setString(1,username);
sql::ResultSet *res = pstmt->executeQuery();
bool ret=false;
while(res->next())
ret = res->getBoolean("admin");
delete res;
return ret;
}
std::list<std::string> msql_acces::get_pinfo(){
sql::PreparedStatement *pstmt =
con->prepareStatement("select packages.name, packages.created, packages.uses, users.username "