*Backed out changeset 3be01fb200a5
--HG-- branch : trunk
This commit is contained in:
@@ -17,11 +17,15 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _ACCMGR_H
|
||||
#define _ACCMGR_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "Common.h"
|
||||
#include "Policies/Singleton.h"
|
||||
|
||||
enum AccountOpResult
|
||||
{
|
||||
AOR_OK,
|
||||
@@ -31,23 +35,29 @@ enum AccountOpResult
|
||||
AOR_NAME_NOT_EXIST,
|
||||
AOR_DB_INTERNAL_ERROR
|
||||
};
|
||||
|
||||
#define MAX_ACCOUNT_STR 16
|
||||
|
||||
class AccountMgr
|
||||
{
|
||||
public:
|
||||
AccountMgr();
|
||||
~AccountMgr();
|
||||
|
||||
AccountOpResult CreateAccount(std::string username, std::string password);
|
||||
AccountOpResult DeleteAccount(uint32 accid);
|
||||
AccountOpResult ChangeUsername(uint32 accid, std::string new_uname, std::string new_passwd);
|
||||
AccountOpResult ChangePassword(uint32 accid, std::string new_passwd);
|
||||
bool CheckPassword(uint32 accid, std::string passwd);
|
||||
|
||||
uint32 GetId(std::string username);
|
||||
uint32 GetSecurity(uint32 acc_id);
|
||||
bool GetName(uint32 acc_id, std::string &name);
|
||||
std::string CalculateShaPassHash(std::string& name, std::string& password);
|
||||
|
||||
static bool normalizeString(std::string& utf8str);
|
||||
};
|
||||
|
||||
#define accmgr Trinity::Singleton<AccountMgr>::Instance()
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user