Programatically Check For Admin Settings

Topics: Administration, Core, General
Dec 2, 2011 at 11:10 AM
Edited Dec 2, 2011 at 11:11 AM

Hi,

There is an option Users can create new accounts on the site Under the Admin-> Settings -> Users

Is there any way to check if this option and other options under Admin->Settings->Users are checked or not using Razor/Programatically

Regards

Dec 2, 2011 at 5:00 PM

Yes, you'll see in Orchard.Users/Views/LogOn.cshtml:

@{
    var userCanRegister = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().UsersCanRegister;
    var enableLostPassword = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().EnableLostPassword;
}