Exemplo n.º 1
0
        public static bool add(
            string user,
            string passwd,
            NameValueCollection info,
            out string reason,
            string oldpass)
        {
            if (Vuser.total > 5 && Vuser.total > MyKey.ulimit_max())
            {
                reason = "Sorry license user limit reached";
                return(false);
            }
            if (!Vuser.valid_user(user, out reason))
            {
                return(false);
            }
            User user1 = UserDb.lookup(user);
            bool flag  = UserDb.add(user, passwd, info, user1 == null ? "" : user1.passwd, out reason);

            if (flag && user1 == null)
            {
                Vuser.total_add(1);
            }
            return(flag);
        }
Exemplo n.º 2
0
        public static bool delete(string user)
        {
            bool flag = UserDb.delete(user);

            if (flag)
            {
                Vuser.total_add(-1);
            }
            return(flag);
        }