Exemple #1
0
        public static JsonProfile GetProfile(string id)
        {
            if (!Utils.StringIsNullOrWhitespace(id))
            {
                bool canEditRoles;
                if (!CanUserEditProfile(id, out canEditRoles))
                {
                    return(null);
                }

                var pf = AuthorProfile.GetProfile(id);

                if (pf == null)
                {
                    pf              = new AuthorProfile(id);
                    pf.Birthday     = DateTime.Parse("01/01/1900");
                    pf.DisplayName  = id;
                    pf.EmailAddress = Utils.GetUserEmail(id);
                    pf.FirstName    = id;
                    pf.Private      = true;
                    pf.Save();
                }

                return(AuthorProfile.ToJson(id));
            }

            return(null);
        }
Exemple #2
0
        public static JsonProfile GetProfile(string id)
        {
            if (!Utils.StringIsNullOrWhitespace(id))
            {
                bool canEditRoles;
                if (!CanUserEditProfile(id, out canEditRoles))
                {
                    return(null);
                }

                return(AuthorProfile.ToJson(id));
            }

            return(null);
        }