2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2005-08-05 22:00:19 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2005-08-05 22:00:19 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
2005-08-05 22:00:19 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2005-08-05 22:00:19 +00:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2005-08-05 22:00:19 +00:00
|
|
|
|
2017-04-08 06:54:49 +00:00
|
|
|
#ifndef BOINC_ACCT_SETUP_H
|
|
|
|
#define BOINC_ACCT_SETUP_H
|
2005-08-05 22:00:19 +00:00
|
|
|
|
2005-08-06 19:20:26 +00:00
|
|
|
#include "error_numbers.h"
|
2017-11-02 21:08:05 +00:00
|
|
|
#include "project_list.h"
|
|
|
|
#include "gui_http.h"
|
2005-08-05 22:00:19 +00:00
|
|
|
|
2005-08-06 19:20:26 +00:00
|
|
|
struct ACCOUNT_IN {
|
|
|
|
std::string url;
|
|
|
|
std::string email_addr;
|
2010-04-01 05:54:29 +00:00
|
|
|
// the account identifier (user name or email addr)
|
2005-08-06 19:20:26 +00:00
|
|
|
std::string user_name;
|
2010-04-01 05:54:29 +00:00
|
|
|
// the suggested friendly name for the user during account creation.
|
2010-03-30 17:46:09 +00:00
|
|
|
std::string team_name;
|
2005-08-06 19:20:26 +00:00
|
|
|
std::string passwd_hash;
|
2016-02-19 15:40:49 +00:00
|
|
|
std::string server_cookie;
|
2014-11-19 07:11:27 +00:00
|
|
|
bool ldap_auth;
|
2016-02-19 15:40:49 +00:00
|
|
|
bool server_assigned_cookie;
|
2018-10-25 20:55:26 +00:00
|
|
|
bool consented_to_terms;
|
2005-08-05 22:00:19 +00:00
|
|
|
|
2011-08-21 11:18:08 +00:00
|
|
|
void parse(XML_PARSER&);
|
2005-08-05 22:00:19 +00:00
|
|
|
};
|
|
|
|
|
2005-08-06 19:20:26 +00:00
|
|
|
struct GET_PROJECT_CONFIG_OP: public GUI_HTTP_OP {
|
|
|
|
std::string reply;
|
|
|
|
int error_num;
|
2005-08-05 22:00:19 +00:00
|
|
|
|
2007-09-27 21:03:15 +00:00
|
|
|
GET_PROJECT_CONFIG_OP(GUI_HTTP* p){
|
|
|
|
error_num = BOINC_SUCCESS;
|
|
|
|
gui_http = p;
|
|
|
|
}
|
2005-08-11 17:41:08 +00:00
|
|
|
virtual ~GET_PROJECT_CONFIG_OP(){}
|
2011-02-19 03:32:26 +00:00
|
|
|
int do_rpc(std::string url);
|
2006-02-14 21:20:43 +00:00
|
|
|
virtual void handle_reply(int http_op_retval);
|
2005-08-05 22:00:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct LOOKUP_ACCOUNT_OP: public GUI_HTTP_OP {
|
2005-08-06 19:20:26 +00:00
|
|
|
std::string reply;
|
|
|
|
int error_num;
|
2005-08-05 22:00:19 +00:00
|
|
|
|
2007-09-27 21:28:32 +00:00
|
|
|
LOOKUP_ACCOUNT_OP(GUI_HTTP* p){
|
|
|
|
error_num = BOINC_SUCCESS;
|
|
|
|
gui_http = p;
|
|
|
|
}
|
2005-08-11 17:41:08 +00:00
|
|
|
virtual ~LOOKUP_ACCOUNT_OP(){}
|
2005-08-05 22:00:19 +00:00
|
|
|
int do_rpc(ACCOUNT_IN&);
|
2006-02-14 21:20:43 +00:00
|
|
|
virtual void handle_reply(int http_op_retval);
|
2005-08-05 22:00:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CREATE_ACCOUNT_OP: public GUI_HTTP_OP {
|
2005-08-06 19:20:26 +00:00
|
|
|
std::string reply;
|
|
|
|
int error_num;
|
2005-08-05 22:00:19 +00:00
|
|
|
|
2007-09-27 21:28:32 +00:00
|
|
|
CREATE_ACCOUNT_OP(GUI_HTTP* p){
|
|
|
|
error_num = BOINC_SUCCESS;
|
|
|
|
gui_http = p;
|
|
|
|
}
|
2005-08-11 17:41:08 +00:00
|
|
|
virtual ~CREATE_ACCOUNT_OP(){}
|
2018-10-25 20:55:26 +00:00
|
|
|
int do_rpc(ACCOUNT_IN&, std::string rpc_client_name);
|
2006-02-14 21:20:43 +00:00
|
|
|
virtual void handle_reply(int http_op_retval);
|
2005-08-06 19:20:26 +00:00
|
|
|
};
|
|
|
|
|
2007-03-04 02:30:48 +00:00
|
|
|
struct GET_PROJECT_LIST_OP: public GUI_HTTP_OP {
|
|
|
|
int error_num;
|
|
|
|
|
2007-09-27 21:28:32 +00:00
|
|
|
GET_PROJECT_LIST_OP(GUI_HTTP* p){
|
|
|
|
error_num = BOINC_SUCCESS;
|
|
|
|
gui_http = p;
|
|
|
|
}
|
2007-03-04 02:30:48 +00:00
|
|
|
virtual ~GET_PROJECT_LIST_OP(){}
|
|
|
|
int do_rpc();
|
|
|
|
virtual void handle_reply(int http_op_retval);
|
|
|
|
};
|
|
|
|
|
2017-11-02 21:08:05 +00:00
|
|
|
struct LOOKUP_LOGIN_TOKEN_OP: public GUI_HTTP_OP {
|
|
|
|
int error_num;
|
|
|
|
PROJECT_LIST_ITEM* pli;
|
|
|
|
|
|
|
|
LOOKUP_LOGIN_TOKEN_OP(GUI_HTTP* p){
|
|
|
|
error_num = BOINC_SUCCESS;
|
|
|
|
gui_http = p;
|
|
|
|
}
|
|
|
|
virtual ~LOOKUP_LOGIN_TOKEN_OP(){}
|
2017-11-03 20:59:53 +00:00
|
|
|
int do_rpc(PROJECT_LIST_ITEM*, int user_id, const char* login_token);
|
2017-11-02 21:08:05 +00:00
|
|
|
virtual void handle_reply(int http_op_retval);
|
|
|
|
};
|
|
|
|
|
2005-08-13 03:19:22 +00:00
|
|
|
struct PROJECT_ATTACH {
|
|
|
|
int error_num;
|
2005-09-28 05:47:14 +00:00
|
|
|
std::vector<std::string> messages;
|
2015-10-20 13:05:21 +00:00
|
|
|
PROJECT_ATTACH() {
|
|
|
|
error_num = 0;
|
|
|
|
messages.clear();
|
|
|
|
}
|
2005-08-13 03:19:22 +00:00
|
|
|
};
|
|
|
|
|
2005-08-06 18:12:35 +00:00
|
|
|
#endif
|