public ActionResult Register()
        {
            // ensure users can register
            var registrationSettings = _orchardServices.WorkContext.CurrentSite.As <RegistrationSettingsPart>();

            if (!registrationSettings.UsersCanRegister)
            {
                return(HttpNotFound());
            }

            ViewData["PasswordLength"] = MinPasswordLength;

            var shape = _orchardServices.New.Register();

            var user = _orchardServices.ContentManager.New("User");

            if (user != null && !_frontEndProfileService.UserHasNoProfilePart(user.As <IUser>()))
            {
                shape.UserProfile = _frontEndProfileService.BuildFrontEndShape(
                    _contentManager.BuildEditor(user),
                    _frontEndProfileService.MayAllowPartEdit,
                    _frontEndProfileService.MayAllowFieldEdit);
            }

            return(new ShapeResult(this, shape));
        }
Beispiel #2
0
        public ActionResult Index(string username)
        {
            IUser user = _membershipService.GetUser(username);

            if (user == null ||
                _frontEndProfileService.UserHasNoProfilePart(user) ||
                !Services.Authorizer.Authorize(Permissions.ViewProfiles, user, null))
            {
                return(HttpNotFound());
            }

            dynamic shape = _frontEndProfileService.BuildFrontEndShape(
                _contentManager.BuildDisplay(user, "", ""), //since the result of BuildDisplay is dynamic I have to do the ugly thing below
                _frontEndProfileService.MayAllowPartDisplay,
                _frontEndProfileService.MayAllowFieldDisplay);

            return(View((object)shape));
        }