Esempio n. 1
0
 // Track state changes of the auth object.
 void AuthStateChanged(object sender, System.EventArgs eventArgs)
 {
     Firebase.Auth.FirebaseAuth senderAuth = sender as Firebase.Auth.FirebaseAuth;
     Firebase.Auth.FirebaseUser user       = null;
     if (senderAuth != null)
     {
         userByAuth.TryGetValue(senderAuth.App.Name, out user);
     }
     if (senderAuth == auth && senderAuth.CurrentUser != user)
     {
         bool signedIn = user != senderAuth.CurrentUser && senderAuth.CurrentUser != null;
         if (!signedIn && user != null)
         {
             DebugLog("Signed out " + user.UserId);
             //user is logged out, load login screen
             //SceneManager.LoadSceneAsync("scene_01");
         }
         user = senderAuth.CurrentUser;
         userByAuth[senderAuth.App.Name] = user;
         if (signedIn)
         {
             DebugLog("Signed in " + user.UserId);
             displayName = user.DisplayName ?? "";
             DisplayDetailedUserInfo(user, 1);
         }
     }
 }
Esempio n. 2
0
        // GET api/users
        public IEnumerable <User> Get()
        {
            var x   = new Userdb().getUsers().ToArray();
            var xml = new XElement("Users", x.Select(s => new XElement("foo", s.username)));

            xml.Save(HttpContext.Current.Server.MapPath("/kekekkekr.xml"));
            return(x);
        }
        public static User ToUser(this Userdb self)
        {
            User user = ComponentFactory.CreateWithId <User>(self.Id);

            user.Account     = self.account;
            user.Password    = self.password;
            user.phonenumber = self.phonenumber;
            user.playerids   = self.playerids;
            user.createdate  = self.createdate;
            return(user);
        }
        public static Userdb ToUserdb(this User self)
        {
            Userdb userdb = ComponentFactory.CreateWithId <Userdb>(self.Id);

            userdb.account     = self.Account;
            userdb.password    = self.Password;
            userdb.phonenumber = self.phonenumber;
            userdb.playerids   = self.playerids;
            userdb.createdate  = DateTime.Now.ToString("yyyyMMdd HH:mm:ss");
            return(userdb);
        }
Esempio n. 5
0
 public bool SaveUser(User oUsr)
 {
     try
     {
         Userdb oDb = new Userdb();
         return(oDb.SaveUser(oUsr));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 6
0
 public bool EmailCheck(string Email)
 {
     try
     {
         Userdb oDb = new Userdb();
         return(oDb.EmailCheck(Email));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 7
0
 public bool ValidateUser(string Email, string Password)
 {
     try
     {
         Userdb oDb = new Userdb();
         return(oDb.ValidateUser(Email, Password));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        void SaveUser(User[] users)
        {
            DBProxyComponent dBProxy = Game.Scene.GetComponent <DBProxyComponent>();

            foreach (User tem in users)
            {
                Userdb userdb = ComponentFactory.CreateWithId <Userdb>(tem.Id);
                userdb.account     = tem.Account;
                userdb.password    = tem.Password;
                userdb.phonenumber = tem.phonenumber;
                userdb.createdate  = DateTime.Now.ToString("yyyyMMdd HH:mm:ss");

                dBProxy.Save(userdb).Coroutine();
            }
        }
Esempio n. 9
0
 // When the app starts, check to make sure that we have
 // the required dependencies to use Firebase, and if not,
 // add them if possible.
 public void Start()
 {
     user = GameObject.FindGameObjectWithTag("userinfo").GetComponent <Userdb>();
     Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
         dependencyStatus = task.Result;
         if (dependencyStatus == Firebase.DependencyStatus.Available)
         {
             InitializeFirebase();
         }
         else
         {
             Debug.LogError(
                 "Could not resolve all Firebase dependencies: " + dependencyStatus);
         }
     });
 }
Esempio n. 10
0
        // POST api/users
        public User Post([FromBody] Provider value)
        {
            //Authenticate user
            if (value.role == null)
            {
                var user = new Userdb(value);
                return(user.validateUser());
            }

            if (new Userdb().addUser(value))
            {
                return(value);
            }

            return(null);
        }
Esempio n. 11
0
    // Use this for initialization
    void Start()
    {
        pos = this.GetComponent <RectTransform>();
        db  = GameObject.FindGameObjectWithTag("userinfo").GetComponent <Userdb>();
        string numb = name.Substring(name.Length - 1, 1);

        myNumber = int.Parse(numb);
        me       = db.settings[myNumber];

        if (me == false)
        {
            pos.anchoredPosition = new Vector2(50, pos.anchoredPosition.y);
        }
        else
        {
            pos.anchoredPosition = new Vector2(123.6f, pos.anchoredPosition.y);
        }
    }
Esempio n. 12
0
    // Use this for initialization
    void Start()
    {
        data           = GameObject.FindGameObjectWithTag("userinfo").GetComponent <Userdb>();
        this.Exp_Value = GetComponent <Text>();

        if (gameObject.name == "Name")
        {
            this.Exp_Value.text = data.userName;
        }
        else if (gameObject.name == "Level")
        {
            this.Exp_Value.text = "Level: " + data.userLevel.ToString();
        }
        else if (gameObject.name == "Exp Fill Bar")
        {
            this.Exp_Value.text = data.userEXP + "/" + data.maxEXP.ToString();
            GameObject.Find("Level Bar Fill").GetComponent <Image>().fillAmount = (float)data.userEXP / (float)data.maxEXP;
        }
    }
Esempio n. 13
0
        public DataSet GetUser()
        {
            Userdb oDb = new Userdb();

            return(oDb.GetUser());
        }
Esempio n. 14
0
 public LinkHubMembershipProvider()
 {
     db = new Userdb();
 }
Esempio n. 15
0
 public LinkHubRoleProvider()
 {
     db = new Userdb();
 }
Esempio n. 16
0
 public UserBs()
 {
     objDB = new Userdb();
 }
Esempio n. 17
0
        public ActionResult ImportUsers(int serverlogin, string conn, HttpPostedFileBase file)
        {
            byte   result = 1;
            string msg    = null;

            Person p   = null;
            Userdb udb = null;

            if (serverlogin == 1)
            {
                udb      = new Userdb();
                udb.Auth = 1;
                udb.Conn = conn;
            }

            long total = 0;

            try
            {
                int    n   = 0;
                string fio = null;

                AccessMembershipProvider ap = (AccessMembershipProvider)Membership.Provider;
                XDocument xd = XDocument.Load(file.InputStream);
                IEnumerable <XElement> elements = xd.Descendants("Users");
                total = elements.Count();

                ThreadContext.Properties["user"] = User.Identity.Name;

                foreach (var u in elements)
                {
                    p       = new Person();
                    p.Bases = new List <Userdb>();
                    p.Roles = new List <string>()
                    {
                        "READER"
                    };
                    p.IsApproved = 1;

                    p.Login = u.Element("Name").Value;
                    System.Diagnostics.Debug.WriteLine(p.Login);

                    fio = u.Element("FullName").Value;
                    if (!string.IsNullOrEmpty(fio))
                    {
                        int pos = fio.IndexOf(' ');
                        if (pos != -1)
                        {
                            p.LastName = fio.Substring(0, pos++);

                            string[] arr = fio.Substring(pos).Split(new char[] { '.', ' ' }, StringSplitOptions.RemoveEmptyEntries);
                            if (arr.Length > 0)
                            {
                                p.FirstName = arr[0];

                                if (arr.Length > 1)
                                {
                                    p.MiddleName = arr[1];
                                }
                            }
                        }
                        else
                        {
                            p.LastName = p.FirstName = fio;
                        }
                    }

                    if (serverlogin == 1)
                    {
                        p.ServerLogin = 1;
                        p.Bases.Add(udb);
                    }
                    else
                    {
                        p.Password = "******";
                    }

                    p.Id = db.SingleOrDefault <int>("SELECT u.id FROM qb_users u WHERE u.login = @0", p.Login);

                    try
                    {
                        if (p.Id != 0)
                        {
                            Membership.Provider.UpdateUser(p.Id, p);
                        }
                        else
                        {
                            Membership.Provider.CreateUserAndAccount(p);
                        }

                        n++;
                        System.Diagnostics.Debug.WriteLine(n);

                        #if DEBUG
                        if (n == 2)
                        {
                            break;
                        }
                        #endif
                    }
                    catch (MembershipCreateUserException e)
                    {
                        log.Info("Импорт " + p.Login + ". " + e.Message);
                    }
                }
                msg = n.ToString();

                Response.RemoveOutputCacheItem("/Admin/GetUser");
                Response.RemoveOutputCacheItem("/Admin/GetUsers");
            }
            catch (Exception e)
            {
                msg    = e.Message;
                result = 0;
            }

            string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { success = result, message = msg, total = total });
            return(Content(json));
        }
Esempio n. 18
0
 public UserBs()
 {
     objdb = new Userdb();
 }
Esempio n. 19
0
 // Use this for initialization
 void Start()
 {
     userInfo      = GameObject.FindGameObjectWithTag("userinfo").GetComponent <Userdb>();
     credit.text   = userInfo.credits.ToString();
     diamonds.text = userInfo.diamonds.ToString();
 }
 public groundprojectRoleProvider()
 {
     db = new Userdb();
 }
 public groundprojectMembershipProvider()
 {
     db = new Userdb();
 }