X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/3556f24564ddfe6fee1fb12bc8b976b9b4c0b5df..29e9a2de0b45893850bbf56ee38e7fd235a6df15:/projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp?ds=sidebyside diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp deleted file mode 100644 index de28eaba..00000000 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Author : Maxim Mamontov - */ - -#include "parser_user_info.h" - -#include "stg/users.h" -#include "stg/user.h" -#include "stg/common.h" - -#include // strcasecmp - -int PARSER_USER_INFO::ParseStart(void * /*data*/, const char *el, const char **attr) -{ -login.clear(); -if (strcasecmp(el, "GetUserInfo") != 0) - return -1; - -if (!attr[0] || !attr[1] || strcasecmp(attr[0], "login") != 0) - return -1; - -login = attr[1]; -return 0; -} - -int PARSER_USER_INFO::ParseEnd(void * /*data*/, const char *el) -{ -if (strcasecmp(el, "GetUserInfo") != 0) - return -1; - -CreateAnswer(); -return 0; -} - -void PARSER_USER_INFO::CreateAnswer() -{ -CONST_USER_PTR u; -if (users->FindByName(login, &u)) - { - answer = ""; - return; - } - -answer = "GetAuthorizedModificationTime()) + "\"" + - " lastDisconnectTime=\"" + x2str(u->GetConnectedModificationTime()) + "\"" + - " connected=\"" + (u->GetConnected() ? "true" : "false") + "\"" + - " lastDisconnectReason=\"" + u->GetLastDisconnectReason() + "\">"; -std::vector list(u->GetAuthorizers()); -for (std::vector::const_iterator it = list.begin(); it != list.end(); ++it) - answer += ""; -answer += ""; -}