示例#1
0
        public CE.User getUser(string userName, string password)
        {
            CE.User user = new CE.User();
            DataRow row  = fetch("SELECT * FROM users WHERE login = '******' AND MD5('"
                                 + password + CC.SALT + "' = password");

            if (row == null)
            {
                throw new Exception("User not found");
            }
            user.id     = (int)row["id_user"];
            user.login  = userName;
            user.name   = (string)row["name"];
            user.rights = (int)fetchSingle("SELECT access FROM access_rights WHERE id_user = "******" AND id_project = ", CE.project.id);
            return(user);
        }
示例#2
0
 public CE.User getUser(string userName, string password)
 {
     CE.User user = new CE.User();
     DataRow row = fetch("SELECT * FROM users WHERE login = '******' AND MD5('"
         + password + CC.SALT + "' = password");
     if(row == null) throw new Exception("User not found");
     user.id = (int)row["id_user"];
     user.login = userName;
     user.name = (string)row["name"];
     user.rights = (int)fetchSingle("SELECT access FROM access_rights WHERE id_user = "******" AND id_project = ", CE.project.id);
     return user;
 }