Support groupfolder scan
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#include "usermanager.h"
|
||||
|
||||
std::vector<std::string> splitLogFile(const std::string& input, char delimiter = '|')
|
||||
std::vector<std::string> splitString(const std::string& str, char delimiter = '|')
|
||||
{
|
||||
std::vector<std::string> ret;
|
||||
std::stringstream ss(input);
|
||||
std::stringstream ss(str);
|
||||
std::string token;
|
||||
|
||||
while (std::getline(ss, token, delimiter)) {
|
||||
@@ -11,4 +11,14 @@ std::vector<std::string> splitLogFile(const std::string& input, char delimiter =
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string userManager::getScanCommandFromUser(const std::string &user)
|
||||
{
|
||||
if (user.find("__groupfolder") != std::string::npos)
|
||||
{
|
||||
return std::string(SCAN_CMD_GRP) + splitString(user, '/').back();
|
||||
}
|
||||
|
||||
return std::string(SCAN_CMD_USR) + user;
|
||||
}
|
||||
Reference in New Issue
Block a user