public void AddUserRole(int PortalID, int UserId, int RoleId, System.DateTime EffectiveDate, System.DateTime ExpiryDate) { UserInfo objUser = UserController.GetUserById(PortalID, UserId); UserRoleInfo objUserRole = GetUserRole(PortalID, UserId, RoleId); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); if (objUserRole == null) { objUserRole = new UserRoleInfo(); objUserRole.UserID = UserId; objUserRole.RoleID = RoleId; objUserRole.PortalID = PortalID; objUserRole.EffectiveDate = EffectiveDate; objUserRole.ExpiryDate = ExpiryDate; provider.AddUserToRole(PortalID, objUser, objUserRole); objEventLog.AddLog(objUserRole, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.USER_ROLE_CREATED); } else { objUserRole.EffectiveDate = EffectiveDate; objUserRole.ExpiryDate = ExpiryDate; provider.UpdateUserRole(objUserRole); objEventLog.AddLog(objUserRole, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.USER_ROLE_UPDATED); } }
public static void AddUserRole(UserInfo objUser, RoleInfo objRole, PortalSettings PortalSettings, System.DateTime effDate, System.DateTime expDate, int userId, bool notifyUser) { RoleController objRoleController = new RoleController(); UserRoleInfo objUserRole = objRoleController.GetUserRole(PortalSettings.PortalId, objUser.UserID, objRole.RoleID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objRoleController.AddUserRole(PortalSettings.PortalId, objUser.UserID, objRole.RoleID, effDate, expDate); objUser.RefreshRoles = true; UserController.UpdateUser(PortalSettings.PortalId, objUser); if (objUserRole == null) { objEventLog.AddLog("Role", objRole.RoleName, PortalSettings, userId, Services.Log.EventLog.EventLogController.EventLogType.USER_ROLE_CREATED); if (notifyUser) { SendNotification(objUser, objRole, PortalSettings, UserRoleActions.@add); } } else { objEventLog.AddLog("Role", objRole.RoleName, PortalSettings, userId, Services.Log.EventLog.EventLogController.EventLogType.USER_ROLE_UPDATED); if (notifyUser) { objUserRole = objRoleController.GetUserRole(PortalSettings.PortalId, objUser.UserID, objRole.RoleID); SendNotification(objUser, objRole, PortalSettings, UserRoleActions.update); } } }
public void UpdateRole(RoleInfo objRoleInfo) { provider.UpdateRole(objRoleInfo); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(objRoleInfo, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.ROLE_UPDATED); AutoAssignUsers(objRoleInfo); }
public void UpdateListEntry(ListEntryInfo ListEntry) { DataProvider.Instance().UpdateListEntry(ListEntry.EntryID, ListEntry.Value, ListEntry.Text, ListEntry.Description, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(ListEntry, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.LISTENTRY_UPDATED); ClearCache(ListEntry.PortalID); }
public void UpdateFolder(FolderInfo objFolderInfo) { DataProvider.Instance().UpdateFolder(objFolderInfo.PortalID, objFolderInfo.FolderID, FileSystemUtils.FormatFolderPath(objFolderInfo.FolderPath), objFolderInfo.StorageLocation, objFolderInfo.IsProtected, objFolderInfo.IsCached, objFolderInfo.LastUpdated, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(objFolderInfo, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Log.EventLog.EventLogController.EventLogType.FOLDER_UPDATED); DataCache.ClearFolderCache(objFolderInfo.PortalID); }
public static void DeleteDesktopModulePermissionsByUserID(UserInfo objUser) { provider.DeleteDesktopModulePermissionsByUserID(objUser.UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("UserID", objUser.UserID.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.DESKTOPMODULE_DELETED); ClearPermissionCache(); }
public static void DeletePropertyDefinition(ProfilePropertyDefinition definition) { provider.DeletePropertyDefinition(definition.PropertyDefinitionId); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(definition, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.PROFILEPROPERTY_DELETED); ClearProfileDefinitionCache(definition.PortalId); }
public static void UpdateDesktopModulePermission(DesktopModulePermissionInfo objDesktopModulePermission) { provider.UpdateDesktopModulePermission(objDesktopModulePermission.DesktopModulePermissionID, objDesktopModulePermission.PortalDesktopModuleID, objDesktopModulePermission.PermissionID, objDesktopModulePermission.RoleID, objDesktopModulePermission.AllowAccess, objDesktopModulePermission.UserID, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(objDesktopModulePermission, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.DESKTOPMODULEPERMISSION_UPDATED); ClearPermissionCache(); }
public void UpdateHostSetting(string SettingName, string SettingValue, bool SettingIsSecure, bool clearCache) { IDataReader dr = null; try { dr = DataProvider.Instance().GetHostSetting(SettingName); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); if (dr.Read()) { DataProvider.Instance().UpdateHostSetting(SettingName, SettingValue, SettingIsSecure, UserController.GetCurrentUserInfo().UserID); objEventLog.AddLog(SettingName.ToString(), SettingValue.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.HOST_SETTING_UPDATED); } else { DataProvider.Instance().AddHostSetting(SettingName, SettingValue, SettingIsSecure, UserController.GetCurrentUserInfo().UserID); objEventLog.AddLog(SettingName.ToString(), SettingValue.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.HOST_SETTING_CREATED); } } catch (Exception ex) { Exceptions.LogException(ex); } finally { CBO.CloseDataReader(dr, true); } if (clearCache) { DataCache.ClearHostCache(false); } }
public static void RemoveDesktopModulesFromPortal(int portalID) { DataProvider.Instance().DeletePortalDesktopModules(portalID, Null.NullInteger); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("PortalID", portalID.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.PORTALDESKTOPMODULE_DELETED); DataCache.ClearPortalCache(portalID, true); }
public void UpdateHostSetting(string SettingName, string SettingValue, bool SettingIsSecure, bool clearCache) { IDataReader dr = null; try { dr = DataProvider.Instance().GetHostSetting(SettingName); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); if (dr.Read()) { DataProvider.Instance().UpdateHostSetting(SettingName, SettingValue, SettingIsSecure, UserController.GetCurrentUserInfo().UserID); objEventLog.AddLog(SettingName.ToString(), SettingValue.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.HOST_SETTING_UPDATED); } else { DataProvider.Instance().AddHostSetting(SettingName, SettingValue, SettingIsSecure, UserController.GetCurrentUserInfo().UserID); objEventLog.AddLog(SettingName.ToString(), SettingValue.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.HOST_SETTING_CREATED); } } catch (Exception ex) { Exceptions.LogException(ex); } finally { CBO.CloseDataReader(dr, true); } if (clearCache) { DataCache.ClearHostCache(false); } }
public int AddFolder(int PortalID, string FolderPath, int StorageLocation, bool IsProtected, bool IsCached, System.DateTime LastUpdated) { int FolderId; FolderPath = FileSystemUtils.FormatFolderPath(FolderPath); FolderInfo folder = GetFolder(PortalID, FolderPath, true); if (folder == null) { FolderId = DataProvider.Instance().AddFolder(PortalID, FolderPath, StorageLocation, IsProtected, IsCached, LastUpdated, UserController.GetCurrentUserInfo().UserID); folder = GetFolder(PortalID, FolderPath, true); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(folder, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Log.EventLog.EventLogController.EventLogType.FOLDER_CREATED); UpdateParentFolder(PortalID, FolderPath); } else { FolderId = folder.FolderID; DataProvider.Instance().UpdateFolder(PortalID, FolderId, FolderPath, StorageLocation, IsProtected, IsCached, LastUpdated, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("FolderPath", FolderPath, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, Log.EventLog.EventLogController.EventLogType.FOLDER_UPDATED); } DataCache.ClearFolderCache(PortalID); return(FolderId); }
public void DeleteDesktopModule(int desktopModuleID) { dataProvider.DeleteDesktopModule(desktopModuleID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("DesktopModuleID", desktopModuleID.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.DESKTOPMODULE_DELETED); DataCache.ClearHostCache(true); }
public static void DeleteDesktopModulePermissionsByUserID(UserInfo objUser) { provider.DeleteDesktopModulePermissionsByUserID(objUser.UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("UserID", objUser.UserID.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.DESKTOPMODULE_DELETED); ClearPermissionCache(); }
public void UpdatePortalAliasInfo(PortalAliasInfo objPortalAliasInfo) { DataCache.RemoveCache(DataCache.PortalAliasCacheKey); DataProvider.Instance().UpdatePortalAliasInfo(objPortalAliasInfo.PortalAliasID, objPortalAliasInfo.PortalID, objPortalAliasInfo.HTTPAlias.ToLower(), UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(objPortalAliasInfo, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.PORTALALIAS_UPDATED); }
public void DeletePortalAlias(int PortalAliasID) { DataCache.RemoveCache(DataCache.PortalAliasCacheKey); DataProvider.Instance().DeletePortalAlias(PortalAliasID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("PortalAliasID", PortalAliasID.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.PORTALALIAS_DELETED); }
private void UpgradeModule(EventMessage message) { try { string BusinessControllerClass = message.Attributes["BusinessControllerClass"]; object objController = Framework.Reflection.CreateObject(BusinessControllerClass, ""); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); Services.Log.EventLog.LogInfo objEventLogInfo; if (objController is IUpgradeable) { string[] UpgradeVersions = message.Attributes["UpgradeVersionsList"].ToString().Split(','); foreach (string Version in UpgradeVersions) { string Results = ((IUpgradeable)objController).UpgradeModule(Version); objEventLogInfo = new Services.Log.EventLog.LogInfo(); objEventLogInfo.AddProperty("Module Upgraded", BusinessControllerClass); objEventLogInfo.AddProperty("Version", Version); if (!string.IsNullOrEmpty(Results)) { objEventLogInfo.AddProperty("Results", Results); } objEventLogInfo.LogTypeKey = Services.Log.EventLog.EventLogController.EventLogType.MODULE_UPDATED.ToString(); objEventLog.AddLog(objEventLogInfo); } } UpdateSupportedFeatures(objController, Convert.ToInt32(message.Attributes["DesktopModuleId"])); } catch (Exception exc) { Exceptions.LogException(exc); } }
public static void UpdatePackage(PackageInfo package) { provider.UpdatePackage(package.PortalID, package.Name, package.FriendlyName, package.Description, package.PackageType, package.Version.ToString(3), package.License, package.Manifest, package.Owner, package.Organization, package.Url, package.Email, package.ReleaseNotes, package.IsSystemPackage, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(package, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.PACKAGE_UPDATED); }
private void UpgradeModule(EventMessage message) { try { string BusinessControllerClass = message.Attributes["BusinessControllerClass"]; object objController = Framework.Reflection.CreateObject(BusinessControllerClass, ""); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); Services.Log.EventLog.LogInfo objEventLogInfo; if (objController is IUpgradeable) { string[] UpgradeVersions = message.Attributes["UpgradeVersionsList"].ToString().Split(','); foreach (string Version in UpgradeVersions) { string Results = ((IUpgradeable)objController).UpgradeModule(Version); objEventLogInfo = new Services.Log.EventLog.LogInfo(); objEventLogInfo.AddProperty("Module Upgraded", BusinessControllerClass); objEventLogInfo.AddProperty("Version", Version); if (!string.IsNullOrEmpty(Results)) { objEventLogInfo.AddProperty("Results", Results); } objEventLogInfo.LogTypeKey = Services.Log.EventLog.EventLogController.EventLogType.MODULE_UPDATED.ToString(); objEventLog.AddLog(objEventLogInfo); } } UpdateSupportedFeatures(objController, Convert.ToInt32(message.Attributes["DesktopModuleId"])); } catch (Exception exc) { Exceptions.LogException(exc); } }
protected void AddExistingModule(int moduleId, int tabId, string paneName, int position, string align) { ModuleController objModules = new ModuleController(); ModuleInfo objModule; Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); int UserId = -1; if (Request.IsAuthenticated) { UserInfo objUserInfo = UserController.GetCurrentUserInfo(); UserId = objUserInfo.UserID; } objModule = objModules.GetModule(moduleId, tabId, false); if (objModule != null) { ModuleInfo objClone = objModule.Clone(); objClone.TabID = PortalSettings.ActiveTab.TabID; objClone.ModuleOrder = position; objClone.PaneName = paneName; objClone.Alignment = align; objModules.AddModule(objClone); objEventLog.AddLog(objClone, PortalSettings, UserId, "", Services.Log.EventLog.EventLogController.EventLogType.MODULE_CREATED); } }
public static int AddDesktopModulePermission(DesktopModulePermissionInfo objDesktopModulePermission) { int Id = provider.AddDesktopModulePermission(objDesktopModulePermission.PortalDesktopModuleID, objDesktopModulePermission.PermissionID, objDesktopModulePermission.RoleID, objDesktopModulePermission.AllowAccess, objDesktopModulePermission.UserID, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(objDesktopModulePermission, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.DESKTOPMODULEPERMISSION_CREATED); ClearPermissionCache(); return Id; }
public void DeleteFolder(int PortalID, string FolderPath) { DataProvider.Instance().DeleteFolder(PortalID, FileSystemUtils.FormatFolderPath(FolderPath)); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("FolderPath", FolderPath, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, Log.EventLog.EventLogController.EventLogType.FOLDER_DELETED); UpdateParentFolder(PortalID, FolderPath); DataCache.ClearFolderCache(PortalID); }
public void DeleteFolder(int PortalID, string FolderPath) { DataProvider.Instance().DeleteFolder(PortalID, FileSystemUtils.FormatFolderPath(FolderPath)); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("FolderPath", FolderPath, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, Log.EventLog.EventLogController.EventLogType.FOLDER_DELETED); UpdateParentFolder(PortalID, FolderPath); DataCache.ClearFolderCache(PortalID); }
public void DeleteList(string ListName, string ParentKey) { ListInfo list = GetListInfo(ListName, ParentKey); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("ListName", ListName.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.LISTENTRY_DELETED); DataProvider.Instance().DeleteList(ListName, ParentKey); ClearCache(list.PortalID); }
public int AddListEntry(ListEntryInfo ListEntry) { bool EnableSortOrder = (ListEntry.SortOrder > 0); ClearCache(ListEntry.PortalID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(ListEntry, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.LISTENTRY_CREATED); return(DataProvider.Instance().AddListEntry(ListEntry.ListName, ListEntry.Value, ListEntry.Text, ListEntry.ParentID, ListEntry.Level, EnableSortOrder, ListEntry.DefinitionID, ListEntry.Description, ListEntry.PortalID, ListEntry.SystemList, UserController.GetCurrentUserInfo().UserID)); }
public static void UpdateSkinPackage(SkinPackageInfo skinPackage) { DataProvider.Instance().UpdateSkinPackage(skinPackage.SkinPackageID, skinPackage.PackageID, skinPackage.PortalID, skinPackage.SkinName, skinPackage.SkinType, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(skinPackage, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINPACKAGE_UPDATED); foreach (KeyValuePair <int, string> kvp in skinPackage.Skins) { UpdateSkin(kvp.Key, kvp.Value); } }
public static void RemoveDesktopModuleFromPortal(int portalID, int desktopModuleID, bool clearCache) { DataProvider.Instance().DeletePortalDesktopModules(portalID, desktopModuleID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("DesktopModuleID", desktopModuleID.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.PORTALDESKTOPMODULE_DELETED); if (clearCache) { DataCache.ClearPortalCache(portalID, false); } }
public void DeleteRole(int RoleId, int PortalId) { RoleInfo objRole = GetRole(RoleId, PortalId); if (objRole != null) { provider.DeleteRole(PortalId, ref objRole); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("RoleID", RoleId.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, Services.Log.EventLog.EventLogController.EventLogType.ROLE_DELETED); } }
public static PortalAliasInfo GetPortalAliasInfo(string PortalAlias) { string strPortalAlias; PortalAliasInfo objPortalAliasInfo = GetPortalAliasLookup(PortalAlias.ToLower()); if (objPortalAliasInfo == null) { if (PortalAlias.ToLower().StartsWith("www.")) { strPortalAlias = PortalAlias.Replace("www.", ""); } else { strPortalAlias = string.Concat("www.", PortalAlias); } objPortalAliasInfo = GetPortalAliasLookup(strPortalAlias.ToLower()); } if (objPortalAliasInfo == null) { if (PortalAlias.IndexOf(".") != -1) { strPortalAlias = PortalAlias.Substring(PortalAlias.IndexOf(".") + 1); } else { strPortalAlias = PortalAlias; } if (objPortalAliasInfo == null) { objPortalAliasInfo = GetPortalAliasLookup("*." + strPortalAlias.ToLower()); } if (objPortalAliasInfo == null) { objPortalAliasInfo = GetPortalAliasLookup(strPortalAlias.ToLower()); } if (objPortalAliasInfo == null) { objPortalAliasInfo = GetPortalAliasLookup("www." + strPortalAlias.ToLower()); } } if (objPortalAliasInfo == null) { PortalAliasCollection objPortalAliasCollection = GetPortalAliasLookup(); if (!objPortalAliasCollection.HasKeys || (objPortalAliasCollection.Count == 1 && objPortalAliasCollection.Contains("_default"))) { DataProvider.Instance().UpdatePortalAlias(PortalAlias.ToLower(), UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("PortalAlias", PortalAlias.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.PORTALALIAS_UPDATED); DataCache.RemoveCache("GetPortalByAlias"); objPortalAliasInfo = GetPortalAliasLookup(PortalAlias.ToLower()); } } return(objPortalAliasInfo); }
public void DeleteRole(int RoleId, int PortalId) { RoleInfo objRole = GetRole(RoleId, PortalId); if (objRole != null) { provider.DeleteRole(PortalId, ref objRole); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("RoleID", RoleId.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, Services.Log.EventLog.EventLogController.EventLogType.ROLE_DELETED); } }
public static void UpdatePropertyDefinition(ProfilePropertyDefinition definition) { if (definition.Required) { definition.Visible = true; } provider.UpdatePropertyDefinition(definition.PropertyDefinitionId, definition.DataType, definition.DefaultValue, definition.PropertyCategory, definition.PropertyName, definition.Required, definition.ValidationExpression, definition.ViewOrder, definition.Visible, definition.Length, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(definition, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.PROFILEPROPERTY_UPDATED); ClearProfileDefinitionCache(definition.PortalId); }
private static void AddEventLog(int portalId, string username, int userId, string portalName, string Ip, UserLoginStatus loginStatus) { Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); Services.Log.EventLog.LogInfo objEventLogInfo = new Services.Log.EventLog.LogInfo(); PortalSecurity objSecurity = new PortalSecurity(); objEventLogInfo.AddProperty("IP", Ip); objEventLogInfo.LogPortalID = portalId; objEventLogInfo.LogPortalName = portalName; objEventLogInfo.LogUserName = objSecurity.InputFilter(username, PortalSecurity.FilterFlag.NoScripting | PortalSecurity.FilterFlag.NoAngleBrackets | PortalSecurity.FilterFlag.NoMarkup); objEventLogInfo.LogUserID = userId; objEventLogInfo.LogTypeKey = loginStatus.ToString(); objEventLog.AddLog(objEventLogInfo); }
public int AddRole(RoleInfo objRoleInfo) { int roleId = -1; bool success = provider.CreateRole(objRoleInfo.PortalID, ref objRoleInfo); if (success) { Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(objRoleInfo, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.ROLE_CREATED); AutoAssignUsers(objRoleInfo); roleId = objRoleInfo.RoleID; } return roleId; }
private void Delete(ModuleAction Command) { ModuleController objModules = new ModuleController(); ModuleInfo objModule = objModules.GetModule(int.Parse(Command.CommandArgument), ModuleContext.TabId, true); if (objModule != null) { objModules.DeleteTabModule(ModuleContext.TabId, int.Parse(Command.CommandArgument), true); UserInfo m_UserInfo = UserController.GetCurrentUserInfo(); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(objModule, PortalSettings, m_UserInfo.UserID, "", Services.Log.EventLog.EventLogController.EventLogType.MODULE_SENT_TO_RECYCLE_BIN); } Response.Redirect(Request.RawUrl, true); }
public static void DeleteLanguagePack(LanguagePackInfo languagePack) { if (languagePack.PackageType == LanguagePackType.Core) { Locale language = Localization.GetLocaleByID(languagePack.LanguageID); if (language != null) { Localization.DeleteLanguage(language); } } DataProvider.Instance().DeleteLanguagePack(languagePack.LanguagePackID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Log.EventLog.EventLogController.EventLogType.LANGUAGEPACK_DELETED); }
public static void SaveLanguagePack(LanguagePackInfo languagePack) { Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); if (languagePack.LanguagePackID == Null.NullInteger) { languagePack.LanguagePackID = DataProvider.Instance().AddLanguagePack(languagePack.PackageID, languagePack.LanguageID, languagePack.DependentPackageID, UserController.GetCurrentUserInfo().UserID); objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Log.EventLog.EventLogController.EventLogType.LANGUAGEPACK_CREATED); } else { DataProvider.Instance().UpdateLanguagePack(languagePack.LanguagePackID, languagePack.PackageID, languagePack.LanguageID, languagePack.DependentPackageID, UserController.GetCurrentUserInfo().UserID); objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Log.EventLog.EventLogController.EventLogType.LANGUAGEPACK_UPDATED); } }
public static void DeleteLanguagePack(LanguagePackInfo languagePack) { if (languagePack.PackageType == LanguagePackType.Core) { Locale language = Localization.GetLocaleByID(languagePack.LanguageID); if (language != null) { Localization.DeleteLanguage(language); } } DataProvider.Instance().DeleteLanguagePack(languagePack.LanguagePackID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Log.EventLog.EventLogController.EventLogType.LANGUAGEPACK_DELETED); }
public int AddRole(RoleInfo objRoleInfo) { int roleId = -1; bool success = provider.CreateRole(objRoleInfo.PortalID, ref objRoleInfo); if (success) { Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(objRoleInfo, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.ROLE_CREATED); AutoAssignUsers(objRoleInfo); roleId = objRoleInfo.RoleID; } return(roleId); }
public static void SaveLanguagePack(LanguagePackInfo languagePack) { Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); if (languagePack.LanguagePackID == Null.NullInteger) { languagePack.LanguagePackID = DataProvider.Instance().AddLanguagePack(languagePack.PackageID, languagePack.LanguageID, languagePack.DependentPackageID, UserController.GetCurrentUserInfo().UserID); objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Log.EventLog.EventLogController.EventLogType.LANGUAGEPACK_CREATED); } else { DataProvider.Instance().UpdateLanguagePack(languagePack.LanguagePackID, languagePack.PackageID, languagePack.LanguageID, languagePack.DependentPackageID, UserController.GetCurrentUserInfo().UserID); objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Log.EventLog.EventLogController.EventLogType.LANGUAGEPACK_UPDATED); } }
public static void UpdateRoleGroup(RoleGroupInfo roleGroup, bool includeRoles) { provider.UpdateRoleGroup(roleGroup); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(roleGroup, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.USER_ROLE_UPDATED); if (includeRoles) { RoleController controller = new RoleController(); foreach (RoleInfo role in roleGroup.Roles.Values) { controller.UpdateRole(role); objEventLog.AddLog(role, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.ROLE_UPDATED); } } }
public static int SaveSkinControl(SkinControlInfo skinControl) { int skinControlID = skinControl.SkinControlID; Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); if (skinControlID == Null.NullInteger) { skinControlID = dataProvider.AddSkinControl(skinControl.PackageID, skinControl.ControlKey, skinControl.ControlSrc, skinControl.SupportsPartialRendering, UserController.GetCurrentUserInfo().UserID); objEventLog.AddLog(skinControl, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINCONTROL_CREATED); } else { dataProvider.UpdateSkinControl(skinControl.SkinControlID, skinControl.PackageID, skinControl.ControlKey, skinControl.ControlSrc, skinControl.SupportsPartialRendering, UserController.GetCurrentUserInfo().UserID); objEventLog.AddLog(skinControl, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINCONTROL_UPDATED); } return skinControlID; }
protected void AddExistingModule(int moduleId, int tabId, string paneName, int position, string align) { ModuleController objModules = new ModuleController(); ModuleInfo objModule; Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); int UserId = -1; if (Request.IsAuthenticated) { UserInfo objUserInfo = UserController.GetCurrentUserInfo(); UserId = objUserInfo.UserID; } objModule = objModules.GetModule(moduleId, tabId, false); if (objModule != null) { ModuleInfo objClone = objModule.Clone(); objClone.TabID = PortalSettings.ActiveTab.TabID; objClone.ModuleOrder = position; objClone.PaneName = paneName; objClone.Alignment = align; objModules.AddModule(objClone); objEventLog.AddLog(objClone, PortalSettings, UserId, "", Services.Log.EventLog.EventLogController.EventLogType.MODULE_CREATED); } }
public int AddFolder(int PortalID, string FolderPath, int StorageLocation, bool IsProtected, bool IsCached, System.DateTime LastUpdated) { int FolderId; FolderPath = FileSystemUtils.FormatFolderPath(FolderPath); FolderInfo folder = GetFolder(PortalID, FolderPath, true); if (folder == null) { FolderId = DataProvider.Instance().AddFolder(PortalID, FolderPath, StorageLocation, IsProtected, IsCached, LastUpdated, UserController.GetCurrentUserInfo().UserID); folder = GetFolder(PortalID, FolderPath, true); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(folder, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Log.EventLog.EventLogController.EventLogType.FOLDER_CREATED); UpdateParentFolder(PortalID, FolderPath); } else { FolderId = folder.FolderID; DataProvider.Instance().UpdateFolder(PortalID, FolderId, FolderPath, StorageLocation, IsProtected, IsCached, LastUpdated, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("FolderPath", FolderPath, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, Log.EventLog.EventLogController.EventLogType.FOLDER_UPDATED); } DataCache.ClearFolderCache(PortalID); return FolderId; }
public static int AddDesktopModuleToPortal(int portalID, int desktopModuleID, bool addPermissions, bool clearCache) { int portalDesktopModuleID = Null.NullInteger; PortalDesktopModuleInfo portalDesktopModule = GetPortalDesktopModule(portalID, desktopModuleID); if (portalDesktopModule == null) { portalDesktopModuleID = DataProvider.Instance().AddPortalDesktopModule(portalID, desktopModuleID, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("PortalDesktopModuleID", portalDesktopModuleID.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.PORTALDESKTOPMODULE_CREATED); if (addPermissions) { ArrayList permissions = PermissionController.GetPermissionsByPortalDesktopModule(); if (permissions.Count > 0) { PermissionInfo permission = permissions[0] as PermissionInfo; PortalInfo objPortal = new PortalController().GetPortal(portalID); if (permission != null && objPortal != null) { DesktopModulePermissionInfo desktopModulePermission = new DesktopModulePermissionInfo(permission); desktopModulePermission.RoleID = objPortal.AdministratorRoleId; desktopModulePermission.AllowAccess = true; desktopModulePermission.PortalDesktopModuleID = portalDesktopModuleID; DesktopModulePermissionController.AddDesktopModulePermission(desktopModulePermission); } } } } else { portalDesktopModuleID = portalDesktopModule.PortalDesktopModuleID; } if (clearCache) { DataCache.ClearPortalCache(portalID, true); } return portalDesktopModuleID; }
public static bool DeleteUser(ref UserInfo objUser, bool notify, bool deleteAdmin) { bool CanDelete = true; IDataReader dr = null; try { dr = DataProvider.Instance().GetPortal(objUser.PortalID, PortalController.GetActivePortalLanguage(objUser.PortalID)); if (dr.Read()) { if (objUser.UserID == Convert.ToInt32(dr["AdministratorId"])) { CanDelete = deleteAdmin; } } if (CanDelete) { FolderPermissionController.DeleteFolderPermissionsByUser(objUser); ModulePermissionController.DeleteModulePermissionsByUser(objUser); TabPermissionController.DeleteTabPermissionsByUser(objUser); CanDelete = memberProvider.DeleteUser(objUser); } if (CanDelete) { PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings(); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("Username", objUser.Username, _portalSettings, objUser.UserID, Services.Log.EventLog.EventLogController.EventLogType.USER_DELETED); if (notify && !objUser.IsSuperUser) { Message _message = new Message(); _message.FromUserID = _portalSettings.AdministratorId; _message.ToUserID = _portalSettings.AdministratorId; _message.Subject = Localization.GetSystemMessage(objUser.Profile.PreferredLocale, _portalSettings, "EMAIL_USER_UNREGISTER_SUBJECT", objUser, Localization.GlobalResourceFile, null, "", _portalSettings.AdministratorId); _message.Body = Localization.GetSystemMessage(objUser.Profile.PreferredLocale, _portalSettings, "EMAIL_USER_UNREGISTER_BODY", objUser, Localization.GlobalResourceFile, null, "", _portalSettings.AdministratorId); _message.Status = MessageStatusType.Unread; //_messagingController.SaveMessage(_message); Services.Mail.Mail.SendEmail(_portalSettings.Email, _portalSettings.Email, _message.Subject, _message.Body); } DataCache.ClearPortalCache(objUser.PortalID, false); DataCache.ClearUserCache(objUser.PortalID, objUser.Username); } } catch (Exception Exc) { Exceptions.LogException(Exc); CanDelete = false; } finally { CBO.CloseDataReader(dr, true); } return CanDelete; }
public static UserCreateStatus CreateUser(ref UserInfo objUser) { UserCreateStatus createStatus = UserCreateStatus.AddUser; createStatus = memberProvider.CreateUser(ref objUser); if (createStatus == UserCreateStatus.Success) { Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(objUser, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.USER_CREATED); DataCache.ClearPortalCache(objUser.PortalID, false); if (!objUser.IsSuperUser) { RoleController objRoles = new RoleController(); RoleInfo objRole; ArrayList arrRoles = objRoles.GetPortalRoles(objUser.PortalID); int i; for (i = 0; i <= arrRoles.Count - 1; i++) { objRole = (RoleInfo)arrRoles[i]; if (objRole.AutoAssignment == true) { objRoles.AddUserRole(objUser.PortalID, objUser.UserID, objRole.RoleID, Null.NullDate, Null.NullDate); } } } } return createStatus; }
public static void DeleteSkinPackage(SkinPackageInfo skinPackage) { DataProvider.Instance().DeleteSkinPackage(skinPackage.SkinPackageID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(skinPackage, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINPACKAGE_DELETED); }
public static int AddSkinPackage(SkinPackageInfo skinPackage) { Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(skinPackage, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINPACKAGE_CREATED); return DataProvider.Instance().AddSkinPackage(skinPackage.PackageID, skinPackage.PortalID, skinPackage.SkinName, skinPackage.SkinType, UserController.GetCurrentUserInfo().UserID); }
public static string UploadLegacySkin(string RootPath, string SkinRoot, string SkinName, Stream objInputStream) { ZipInputStream objZipInputStream = new ZipInputStream(objInputStream); ZipEntry objZipEntry; string strExtension; string strFileName; FileStream objFileStream; int intSize = 2048; byte[] arrData = new byte[2048]; string strMessage = ""; ArrayList arrSkinFiles = new ArrayList(); PortalSettings ResourcePortalSettings = CommonLibrary.Common.Globals.GetPortalSettings(); string BEGIN_MESSAGE = Localization.GetString("BeginZip", ResourcePortalSettings); string CREATE_DIR = Localization.GetString("CreateDir", ResourcePortalSettings); string WRITE_FILE = Localization.GetString("WriteFile", ResourcePortalSettings); string FILE_ERROR = Localization.GetString("FileError", ResourcePortalSettings); string END_MESSAGE = Localization.GetString("EndZip", ResourcePortalSettings); string FILE_RESTICTED = Localization.GetString("FileRestricted", ResourcePortalSettings); strMessage += FormatMessage(BEGIN_MESSAGE, SkinName, -1, false); objZipEntry = objZipInputStream.GetNextEntry(); while (objZipEntry != null) { if (!objZipEntry.IsDirectory) { strExtension = objZipEntry.Name.Substring(objZipEntry.Name.LastIndexOf(".") + 1); if (("," + strExtension.ToUpper()).IndexOf(",ASCX,HTM,HTML,CSS,SWF,RESX,XAML,JS," + Host.FileExtensions.ToUpper()) != 0) { if (objZipEntry.Name.ToLower() == SkinController.RootSkin.ToLower() + ".zip") { MemoryStream objMemoryStream = new MemoryStream(); intSize = objZipInputStream.Read(arrData, 0, arrData.Length); while (intSize > 0) { objMemoryStream.Write(arrData, 0, intSize); intSize = objZipInputStream.Read(arrData, 0, arrData.Length); } objMemoryStream.Seek(0, SeekOrigin.Begin); strMessage += UploadLegacySkin(RootPath, SkinController.RootSkin, SkinName, (Stream)objMemoryStream); } else if (objZipEntry.Name.ToLower() == SkinController.RootContainer.ToLower() + ".zip") { MemoryStream objMemoryStream = new MemoryStream(); intSize = objZipInputStream.Read(arrData, 0, arrData.Length); while (intSize > 0) { objMemoryStream.Write(arrData, 0, intSize); intSize = objZipInputStream.Read(arrData, 0, arrData.Length); } objMemoryStream.Seek(0, SeekOrigin.Begin); strMessage += UploadLegacySkin(RootPath, SkinController.RootContainer, SkinName, (Stream)objMemoryStream); } else { strFileName = RootPath + SkinRoot + "\\" + SkinName + "\\" + objZipEntry.Name; if (!Directory.Exists(Path.GetDirectoryName(strFileName))) { strMessage += FormatMessage(CREATE_DIR, Path.GetDirectoryName(strFileName), 2, false); Directory.CreateDirectory(Path.GetDirectoryName(strFileName)); } if (File.Exists(strFileName)) { File.SetAttributes(strFileName, FileAttributes.Normal); File.Delete(strFileName); } objFileStream = File.Create(strFileName); strMessage += FormatMessage(WRITE_FILE, Path.GetFileName(strFileName), 2, false); intSize = objZipInputStream.Read(arrData, 0, arrData.Length); while (intSize > 0) { objFileStream.Write(arrData, 0, intSize); intSize = objZipInputStream.Read(arrData, 0, arrData.Length); } objFileStream.Close(); switch (Path.GetExtension(strFileName)) { case ".htm": case ".html": case ".ascx": case ".css": if (strFileName.ToLower().IndexOf(Globals.glbAboutPage.ToLower()) < 0) { arrSkinFiles.Add(strFileName); } break; } break; } } else { strMessage += string.Format(FILE_RESTICTED, objZipEntry.Name, Host.FileExtensions.ToString(), ",", ", *.").Replace("2", "true"); } } objZipEntry = objZipInputStream.GetNextEntry(); } strMessage += FormatMessage(END_MESSAGE, SkinName + ".zip", 1, false); objZipInputStream.Close(); UI.Skins.SkinFileProcessor NewSkin = new UI.Skins.SkinFileProcessor(RootPath, SkinRoot, SkinName); strMessage += NewSkin.ProcessList(arrSkinFiles, SkinParser.Portable); try { Services.Log.EventLog.LogInfo objEventLogInfo = new Services.Log.EventLog.LogInfo(); objEventLogInfo.LogTypeKey = Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT.ToString(); objEventLogInfo.LogProperties.Add(new CommonLibrary.Services.Log.EventLog.LogDetailInfo("Install Skin:", SkinName)); Array arrMessage = strMessage.Split(new string[] { "<br>" }, StringSplitOptions.None); foreach (string strRow in arrMessage) { objEventLogInfo.LogProperties.Add(new CommonLibrary.Services.Log.EventLog.LogDetailInfo("Info:", HtmlUtils.StripTags(strRow, true))); } Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(objEventLogInfo); } catch (Exception ex) { ex.ToString(); } return strMessage; }
public static void UpdateSkinPackage(SkinPackageInfo skinPackage) { DataProvider.Instance().UpdateSkinPackage(skinPackage.SkinPackageID, skinPackage.PackageID, skinPackage.PortalID, skinPackage.SkinName, skinPackage.SkinType, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(skinPackage, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINPACKAGE_UPDATED); foreach (KeyValuePair<int, string> kvp in skinPackage.Skins) { UpdateSkin(kvp.Key, kvp.Value); } }
public static int AddPackage(PackageInfo package, bool includeDetail) { int packageID = provider.AddPackage(package.PortalID, package.Name, package.FriendlyName, package.Description, package.PackageType, package.Version.ToString(3), package.License, package.Manifest, package.Owner, package.Organization, package.Url, package.Email, package.ReleaseNotes, package.IsSystemPackage, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(package, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.PACKAGE_CREATED); if (includeDetail) { Locale locale; LanguagePackInfo languagePack; switch (package.PackageType) { case "Auth_System": AuthenticationInfo authSystem = new AuthenticationInfo(); authSystem.AuthenticationType = package.Name; authSystem.IsEnabled = Null.NullBoolean; authSystem.PackageID = packageID; AuthenticationController.AddAuthentication(authSystem); break; case "Container": case "Skin": SkinPackageInfo skinPackage = new SkinPackageInfo(); skinPackage.SkinName = package.Name; skinPackage.PackageID = packageID; skinPackage.SkinType = package.PackageType; SkinController.AddSkinPackage(skinPackage); break; case "CoreLanguagePack": locale = Localization.Localization.GetLocale(PortalController.GetCurrentPortalSettings().DefaultLanguage); languagePack = new LanguagePackInfo(); languagePack.PackageID = packageID; languagePack.LanguageID = locale.LanguageID; languagePack.DependentPackageID = -2; LanguagePackController.SaveLanguagePack(languagePack); break; case "ExtensionLanguagePack": locale = Localization.Localization.GetLocale(PortalController.GetCurrentPortalSettings().DefaultLanguage); languagePack = new LanguagePackInfo(); languagePack.PackageID = packageID; languagePack.LanguageID = locale.LanguageID; languagePack.DependentPackageID = Null.NullInteger; LanguagePackController.SaveLanguagePack(languagePack); break; case "Module": DesktopModuleInfo desktopModule = new DesktopModuleInfo(); desktopModule.PackageID = packageID; desktopModule.ModuleName = package.Name; desktopModule.FriendlyName = package.FriendlyName; desktopModule.FolderName = package.Name; desktopModule.Description = package.Description; desktopModule.Version = package.Version.ToString(3); desktopModule.SupportedFeatures = 0; int desktopModuleId = DesktopModuleController.SaveDesktopModule(desktopModule, false, true); if (desktopModuleId > Null.NullInteger) { DesktopModuleController.AddDesktopModuleToPortals(desktopModuleId); } break; case "SkinObject": SkinControlInfo skinControl = new SkinControlInfo(); skinControl.PackageID = packageID; skinControl.ControlKey = package.Name; SkinControlController.SaveSkinControl(skinControl); break; } } return packageID; }
public static PortalAliasInfo GetPortalAliasInfo(string PortalAlias) { string strPortalAlias; PortalAliasInfo objPortalAliasInfo = GetPortalAliasLookup(PortalAlias.ToLower()); if (objPortalAliasInfo == null) { if (PortalAlias.ToLower().StartsWith("www.")) { strPortalAlias = PortalAlias.Replace("www.", ""); } else { strPortalAlias = string.Concat("www.", PortalAlias); } objPortalAliasInfo = GetPortalAliasLookup(strPortalAlias.ToLower()); } if (objPortalAliasInfo == null) { if (PortalAlias.IndexOf(".") != -1) { strPortalAlias = PortalAlias.Substring(PortalAlias.IndexOf(".") + 1); } else { strPortalAlias = PortalAlias; } if (objPortalAliasInfo == null) { objPortalAliasInfo = GetPortalAliasLookup("*." + strPortalAlias.ToLower()); } if (objPortalAliasInfo == null) { objPortalAliasInfo = GetPortalAliasLookup(strPortalAlias.ToLower()); } if (objPortalAliasInfo == null) { objPortalAliasInfo = GetPortalAliasLookup("www." + strPortalAlias.ToLower()); } } if (objPortalAliasInfo == null) { PortalAliasCollection objPortalAliasCollection = GetPortalAliasLookup(); if (!objPortalAliasCollection.HasKeys || (objPortalAliasCollection.Count == 1 && objPortalAliasCollection.Contains("_default"))) { DataProvider.Instance().UpdatePortalAlias(PortalAlias.ToLower(), UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("PortalAlias", PortalAlias.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.PORTALALIAS_UPDATED); DataCache.RemoveCache("GetPortalByAlias"); objPortalAliasInfo = GetPortalAliasLookup(PortalAlias.ToLower()); } } return objPortalAliasInfo; }
public string LogDetailError(ErrorCodes errorCode, string virtualPath, bool logError) { string endUserPath = string.Empty; if (! (string.IsNullOrEmpty(virtualPath))) { endUserPath = (string)ToEndUserPath(virtualPath); } string returnValue = GetPermissionErrorText(endUserPath); string logMsg = string.Empty; switch (errorCode) { case ErrorCodes.AddFolder_NoPermission: case ErrorCodes.AddFolder_NotInsecureFolder: case ErrorCodes.CopyFolder_NoPermission: case ErrorCodes.CopyFolder_NotInsecureFolder: case ErrorCodes.DeleteFolder_NoPermission: case ErrorCodes.DeleteFolder_NotInsecureFolder: case ErrorCodes.DeleteFolder_Protected: case ErrorCodes.CannotMoveFolder_ChildrenVisible: case ErrorCodes.CannotDeleteFolder_ChildrenVisible: case ErrorCodes.CannotCopyFolder_ChildrenVisible: logMsg = GetString("ErrorCodes." + errorCode); break; case ErrorCodes.DeleteFolder_Root: case ErrorCodes.RenameFolder_Root: logMsg = GetString("ErrorCodes." + errorCode); returnValue = string.Format("{0} [{1}]", GetString("ErrorCodes." + errorCode), endUserPath); break; case ErrorCodes.FileDoesNotExist: case ErrorCodes.FolderDoesNotExist: logMsg = string.Empty; returnValue = string.Format("{0} [{1}]", GetString("ErrorCodes." + errorCode), endUserPath); break; } if (! (string.IsNullOrEmpty(logMsg))) { Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); Services.Log.EventLog.LogInfo objEventLogInfo = new Services.Log.EventLog.LogInfo(); objEventLogInfo.AddProperty("From", "TelerikHtmlEditorProvider Message"); if (PortalSettings.ActiveTab != null) { objEventLogInfo.AddProperty("TabID", PortalSettings.ActiveTab.TabID.ToString()); objEventLogInfo.AddProperty("TabName", PortalSettings.ActiveTab.TabName); } Entities.Users.UserInfo user = Entities.Users.UserController.GetCurrentUserInfo(); if (user != null) { objEventLogInfo.AddProperty("UserID", user.UserID.ToString()); objEventLogInfo.AddProperty("UserName", user.Username); } objEventLogInfo.LogTypeKey = Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT.ToString(); objEventLogInfo.AddProperty("Message", logMsg); objEventLogInfo.AddProperty("Path", virtualPath); objEventLog.AddLog(objEventLogInfo); } return returnValue; }
public static void DeleteSkinControl(SkinControlInfo skinControl) { dataProvider.DeleteSkinControl(skinControl.SkinControlID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(skinControl, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.SKINCONTROL_DELETED); }
public static RewriterConfiguration GetConfig() { RewriterConfiguration Config = new RewriterConfiguration(); Config.Rules = new RewriterRuleCollection(); FileStream fileReader = null; string filePath = ""; try { Config = (RewriterConfiguration)(DataCache.GetCache("RewriterConfig")); if (Config == null) { filePath = Globals.ApplicationMapPath + "\\SiteUrls.config"; if (!(File.Exists(filePath))) { //Copy from \Config if (File.Exists(Globals.ApplicationMapPath + Globals.glbConfigFolder + "SiteUrls.config")) { File.Copy(Globals.ApplicationMapPath + Globals.glbConfigFolder + "SiteUrls.config", Globals.ApplicationMapPath + "\\SiteUrls.config", true); } } //Create a FileStream for the Config file fileReader = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read); XPathDocument doc = new XPathDocument(fileReader); Config = new RewriterConfiguration(); Config.Rules = new RewriterRuleCollection(); foreach (XPathNavigator nav in doc.CreateNavigator().Select("RewriterConfig/Rules/RewriterRule")) { RewriterRule rule = new RewriterRule(); rule.LookFor = nav.SelectSingleNode("LookFor").Value; rule.SendTo = nav.SelectSingleNode("SendTo").Value; Config.Rules.Add(rule); } if (File.Exists(filePath)) { // Create a dependancy on SiteUrls.config CacheDependency dep = new CacheDependency(filePath); // Set back into Cache DataCache.SetCache("RewriterConfig", Config, dep); } } } catch (Exception ex) { //log it Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); Services.Log.EventLog.LogInfo objEventLogInfo = new Services.Log.EventLog.LogInfo(); objEventLogInfo.AddProperty("UrlRewriter.RewriterConfiguration", "GetConfig Failed"); objEventLogInfo.AddProperty("FilePath", filePath); objEventLogInfo.AddProperty("ExceptionMessage", ex.Message); objEventLogInfo.LogTypeKey = Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT.ToString(); objEventLog.AddLog(objEventLogInfo); } finally { if (fileReader != null) { //Close the Reader fileReader.Close(); } } return Config; }
public void UpdateFolder(FolderInfo objFolderInfo) { DataProvider.Instance().UpdateFolder(objFolderInfo.PortalID, objFolderInfo.FolderID, FileSystemUtils.FormatFolderPath(objFolderInfo.FolderPath), objFolderInfo.StorageLocation, objFolderInfo.IsProtected, objFolderInfo.IsCached, objFolderInfo.LastUpdated, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(objFolderInfo, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Log.EventLog.EventLogController.EventLogType.FOLDER_UPDATED); DataCache.ClearFolderCache(objFolderInfo.PortalID); }
public static void UpdatePackage(PackageInfo package) { provider.UpdatePackage(package.PortalID, package.Name, package.FriendlyName, package.Description, package.PackageType, package.Version.ToString(3), package.License, package.Manifest, package.Owner, package.Organization, package.Url, package.Email, package.ReleaseNotes, package.IsSystemPackage, UserController.GetCurrentUserInfo().UserID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(package, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.PACKAGE_UPDATED); }
public static bool ProcessMessages(EventMessageCollection eventMessages) { EventMessage message; for (int messageNo = 0; messageNo <= eventMessages.Count - 1; messageNo++) { message = eventMessages[messageNo]; try { object oMessageProcessor = Framework.Reflection.CreateObject(message.ProcessorType, message.ProcessorType); if (!((EventMessageProcessorBase)oMessageProcessor).ProcessMessage(message)) { throw new Exception(); } DataProvider.Instance().SetEventMessageComplete(message.EventMessageID); } catch { Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); Services.Log.EventLog.LogInfo objEventLogInfo = new Services.Log.EventLog.LogInfo(); objEventLogInfo.AddProperty("EventQueue.ProcessMessage", "Message Processing Failed"); objEventLogInfo.AddProperty("ProcessorType", message.ProcessorType); objEventLogInfo.AddProperty("Body", message.Body); objEventLogInfo.AddProperty("Sender", message.Sender); foreach (string key in message.Attributes.Keys) { objEventLogInfo.AddProperty(key, message.Attributes[key]); } if (!String.IsNullOrEmpty(message.ExceptionMessage)) { objEventLogInfo.AddProperty("ExceptionMessage", message.ExceptionMessage); } objEventLogInfo.LogTypeKey = CommonLibrary.Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT.ToString(); objEventLog.AddLog(objEventLogInfo); if (message.ExpirationDate < DateTime.Now) { DataProvider.Instance().SetEventMessageComplete(message.EventMessageID); } } } return true; }
/// <summary> /// updates a user /// </summary> /// <param name="portalId">the portalid of the user</param> /// <param name="objUser">the user object</param> /// <param name="loggedAction">whether or not the update calls the eventlog - the eventlogtype must still be enabled for logging to occur</param> /// <remarks></remarks> public static void UpdateUser(int portalId, UserInfo objUser, bool loggedAction) { //Update the User memberProvider.UpdateUser(objUser); if (loggedAction) { Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog(objUser, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.USER_UPDATED); } DataCache.ClearUserCache(portalId, objUser.Username); }
public static void DeletePackage(int packageID) { provider.DeletePackage(packageID); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); objEventLog.AddLog("packageID", packageID.ToString(), PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, Services.Log.EventLog.EventLogController.EventLogType.PACKAGE_DELETED); }