2005-08-05 22:00:19 +00:00
|
|
|
// Berkeley Open Infrastructure for Network Computing
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2005 University of California
|
|
|
|
//
|
|
|
|
// This 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 2.1 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This software 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 Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// To view the GNU Lesser General Public License visit
|
|
|
|
// http://www.gnu.org/copyleft/lesser.html
|
|
|
|
// or write to the Free Software Foundation, Inc.,
|
|
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
|
|
|
#ifndef _ACCT_SETUP_H_
|
|
|
|
#define _ACCT_SETUP_H_
|
|
|
|
|
|
|
|
#include "gui_http.h"
|
2005-08-06 19:20:26 +00:00
|
|
|
#include "error_numbers.h"
|
2005-08-05 22:00:19 +00:00
|
|
|
|
2005-09-27 23:55:20 +00:00
|
|
|
// represents the contents of project_info.xml
|
2005-09-22 08:46:51 +00:00
|
|
|
//
|
|
|
|
struct PROJECT_INIT {
|
|
|
|
char url[256];
|
|
|
|
char name[256];
|
|
|
|
char account_key[256];
|
|
|
|
|
|
|
|
PROJECT_INIT();
|
|
|
|
int init();
|
|
|
|
int remove();
|
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
2005-08-06 19:20:26 +00:00
|
|
|
struct ACCOUNT_IN {
|
|
|
|
std::string url;
|
|
|
|
std::string email_addr;
|
2006-02-02 08:33:23 +00:00
|
|
|
// this is the account identifier. on systems that use
|
|
|
|
// usernames it is the username, on systems that use
|
|
|
|
// email addresses it is an email address for the user.
|
2005-08-06 19:20:26 +00:00
|
|
|
std::string user_name;
|
2006-02-02 08:33:23 +00:00
|
|
|
// this is the suggested friendly name for the user
|
|
|
|
// during account creation.
|
2005-08-06 19:20:26 +00:00
|
|
|
std::string passwd_hash;
|
2005-08-05 22:00:19 +00:00
|
|
|
|
2005-08-06 19:20:26 +00:00
|
|
|
void parse(char*);
|
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(){}
|
2005-08-06 19:20:26 +00:00
|
|
|
int do_rpc(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(){}
|
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-06 19:20:26 +00:00
|
|
|
};
|
|
|
|
|
2005-11-10 06:03:39 +00:00
|
|
|
struct GET_CURRENT_VERSION_OP: public GUI_HTTP_OP {
|
|
|
|
int error_num;
|
|
|
|
|
2007-09-27 21:28:32 +00:00
|
|
|
GET_CURRENT_VERSION_OP(GUI_HTTP* p){
|
|
|
|
error_num = BOINC_SUCCESS;
|
|
|
|
gui_http = p;
|
|
|
|
}
|
2005-11-10 06:03:39 +00:00
|
|
|
virtual ~GET_CURRENT_VERSION_OP(){}
|
|
|
|
int do_rpc();
|
2006-02-14 21:20:43 +00:00
|
|
|
virtual void handle_reply(int http_op_retval);
|
2005-11-10 06:03:39 +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);
|
|
|
|
};
|
|
|
|
|
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;
|
2005-08-13 03:19:22 +00:00
|
|
|
};
|
|
|
|
|
2005-08-06 18:12:35 +00:00
|
|
|
#endif
|