Ejemplo n.º 1
0
        public IUser GetUserDetailsByNickname(string nickname, string sessionID, ISession sessionHandler)
        {
            try
            {
                sysLog.Info("Request: UserByNickname - Requested User: '******'");

                IUser user = null;

                UserHandler privateUserHandler = HandlerHelper.getPrivateUserHandler(privateXmlRpcUrl, sessionID);
                XmlRpcStruct[] userStruct = privateUserHandler.Details(); //Filter is niet nodig, deze wordt samengesteld in de backend adhv sessie
                if (userStruct.Length > 0)
                    user = new User(userStruct[0]);

                return user;
            }
            catch(Exception e)
            {
                if (e.Message.Contains(corruptSession) || e.Message.Contains(invalidSession))
                    sessionHandler.handleSessionTimeout();
                else
                    sysLog.Error("Error when requesting user", e);

                return null;
            }
        }
Ejemplo n.º 2
0
        /******************************************************
         * USERS
         ******************************************************/
        public void CreateUser(int id, string nickname, string password, string email, bool isAdmin, string lastname, string firstname, DateTime regTime,
            long rrn, int points, double startAmount, double cash)
        {
            try
            {
                sysLog.Info("Request: CreateUser - Userdata: ID=" + id + " NICKNAME=" + nickname + " EMAIL= " + email
                            + " LASTNAME= " + lastname + " FIRSTNAME= " + firstname + " REGTIME= " + regTime + " RRN= " + rrn);

                User user = new User(id, nickname, password, email, isAdmin, lastname, firstname, regTime, rrn, points, startAmount, cash);
                XmlRpcStruct userStruct = user.toStruct();
                publicUserHandler.Create(userStruct);
            }
            catch (Exception e)
            {
                sysLog.Error("Eror when creating user: ", e);

                throw e; //Verderwerpen naar Membershipklasse
            }
        }