Esempio n. 1
0
        /// <summary>
        /// Return user object from a name
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public core.SystemUser getUser(string user)
        {
            core.SystemUser lv      = new core.SystemUser("null", "");
            int             current = 0;

            lock (GlobalUsers)
            {
                foreach (core.SystemUser b in GlobalUsers)
                {
                    core.RegexCheck id = new core.RegexCheck(b.name, user);
                    if (id.IsMatch() == 1)
                    {
                        if (getLevel(b.level) > current)
                        {
                            current = getLevel(b.level);
                            lv      = b;
                        }
                    }
                }
            }
            lock (Users)
            {
                foreach (core.SystemUser b in Users)
                {
                    core.RegexCheck id = new core.RegexCheck(b.name, user);
                    if (id.IsMatch() == 1)
                    {
                        if (getLevel(b.level) > current)
                        {
                            current = getLevel(b.level);
                            lv      = b;
                        }
                    }
                }
            }
            return(lv);
        }
Esempio n. 2
0
 /// <summary>
 /// Return user object from a name
 /// </summary>
 /// <param name="user"></param>
 /// <returns></returns>
 public core.SystemUser getUser(string user)
 {
     core.SystemUser lv = new core.SystemUser("null", "");
     int current = 0;
     lock (GlobalUsers)
     {
         foreach (core.SystemUser b in GlobalUsers)
         {
             core.RegexCheck id = new core.RegexCheck(b.name, user);
             if (id.IsMatch() == 1)
             {
                 if (getLevel(b.level) > current)
                 {
                     current = getLevel(b.level);
                     lv = b;
                 }
             }
         }
     }
     lock (Users)
     {
         foreach (core.SystemUser b in Users)
         {
             core.RegexCheck id = new core.RegexCheck(b.name, user);
             if (id.IsMatch() == 1)
             {
                 if (getLevel(b.level) > current)
                 {
                     current = getLevel(b.level);
                     lv = b;
                 }
             }
         }
     }
     return lv;
 }