This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Open powershell as admin and execute: | |
New-SelfSignedCertificate -DnsName "fgaau.localtest.me", "fgaau.localtest.me" -CertStoreLocation "Cert:\LocalMachine\My" | |
This will place the certificate under the Intermediate Certification Authorities node (or Personal). | |
Open the Certificates / Local Computer mmc snapin (certlm.msc) and copy the cert from personal to the Trusted Root Certification Authorities. | |
Restart the browser. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Html.Raw(ViewBag.RichText) | |
@if (ViewBag.ImageId != null) | |
{ | |
if (Guid.TryParse(ViewBag.ImageId.ToString(), out Guid imgId)) | |
{ | |
var image = Telerik.Sitefinity.App.WorkWith().Image(imgId).Get(); | |
if (image != null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void ChangeUserPassword(string newPassword, Guid userId) | |
{ | |
var uManager = UserManager.GetManager(); | |
using (new ElevatedModeRegion(uManager)) | |
{ | |
// first reset the user's password - that would gives us the "current" password | |
string tempPass = uManager.ResetPassword(userId, string.Empty); | |
// now that we have the current password, we can change it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var languages = SystemManager.CurrentContext.AppSettings.DefinedFrontendLanguages.ToList(); | |
for (int j = 0; j < languages.Count; j++) | |
{ | |
var lang = languages[j]; | |
try | |
{ | |
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture = lang; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IQueryable<DynamicContent> GetLiveDataItemsForType(this DynamicModuleManager manager, string type) | |
{ | |
Type resolvedType = TypeResolutionService.ResolveType(type); | |
return manager.GetDataItems(resolvedType) | |
.Where(i => i.Status == ContentLifecycleStatus.Live && i.Visible); | |
} | |
.... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void SystemManager_ApplicationStart(object sender, EventArgs e) | |
{ | |
// remove the sf_appPath script from the header | |
EventHub.Subscribe<IPagePreRenderCompleteEvent>(evt => PagePreRenderCompleteEvent(evt)); | |
} | |
private void PagePreRenderCompleteEvent(IPagePreRenderCompleteEvent evt) | |
{ | |
if (!SystemManager.IsDesignMode) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Guid CreateSitefinityUser(AgentModel model, UserRole userRole) | |
{ | |
var uManager = UserManager.GetManager(); | |
var userId = Guid.NewGuid(); | |
try | |
{ | |
using (new ElevatedModeRegion(uManager)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using NCrontab; | |
using System; | |
using Telerik.Sitefinity.Configuration; | |
using Telerik.Sitefinity.Services; | |
namespace SitefinityWebApp.Custom.Helpers | |
{ | |
/// <summary> | |
/// Copied from the internal sitefinity classes | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet] | |
public HttpResponseMessage GetPromos() | |
{ | |
if (ClaimsManager.GetCurrentUserId() == Guid.Empty) | |
{ | |
throw new Exception("You need to authenticate first"); | |
} | |
var manager = DynamicModuleManager.GetManager(); |
NewerOlder