public static bool AddUserToGroup(Guid usrid, Guid groupid) { bool res = false; XmlDocument xmlDoc = GetSecurityConfig(); XmlNodeList nodeList = xmlDoc.SelectNodes("/Security/Groups/Group[@ID='" + groupid.ToString() + "']"); if (nodeList.Count == 1) { XmlNode group = nodeList[0]; XmlNode users = group.SelectNodes("Users")[0]; XmlNode user = xmlDoc.CreateNode(XmlNodeType.Element, "User", ""); XmlAttribute att_usrid = xmlDoc.CreateAttribute("ID"); att_usrid.InnerText = usrid.ToString(); user.Attributes.Append(att_usrid); users.AppendChild(user); xmlDoc.Save(DCServer.MapPath("~") + DCSiteUrls.GetPath_ZecurityConfigurationPath()); res = true; } return(res); }
public static void CreateUserFolder(MembershipUser user, UsersDataEntity userdata) { if (user != null && userdata != null) { if (user.IsApproved && UsersDataFactory.IsSubSubSiteOwner(userdata.UserType)) { string subSiteFolder = DCSiteUrls.GetPath_SubSiteUploadFolder(user.UserName); string subSiteFolderPhysicalPath = DCServer.MapPath(subSiteFolder); if (!Directory.Exists(subSiteFolderPhysicalPath)) { string subSiteEmptyFolderPhysicalPath = DCServer.MapPath(DCSiteUrls.GetPath_DefaultSubSiteFolder()); DirectoryInfo diSource = new DirectoryInfo(subSiteEmptyFolderPhysicalPath); DirectoryInfo diTarget = new DirectoryInfo(subSiteFolderPhysicalPath); DcDirectoryManager.CopyAll(diSource, diTarget); } } else { // Create msg folder string folder = DCSiteUrls.GetPath_UserDataDirectory(userdata.OwnerName, userdata.ModuleTypeID, userdata.CategoryID, userdata.UserProfileID); string folderPhysicalPath = DCServer.MapPath(folder); if (!Directory.Exists(folderPhysicalPath)) { string defaultFolder = DCSiteUrls.GetPath_DefaultUserDataFolder(); string defaultFolderPhysicalPath = DCServer.MapPath(defaultFolder); DirectoryInfo diSource = new DirectoryInfo(defaultFolderPhysicalPath); DirectoryInfo diTarget = new DirectoryInfo(folderPhysicalPath); DcDirectoryManager.CopyAll(diSource, diTarget); } } } }
//------------------------------------------ #endregion #region ---------------IPhotoable-------------- public string GetPhotoPath(PhotoTypes photo) { if (((string)_PhotoExtension).Length > 0) { string photoName = ItemsFactory.CreateItemsPhotoName(_ItemID); string photoPath = DCSiteUrls.GetPath_ItemsPhotoNormalThumbs(OwnerName, ModuleTypeID, CategoryID, ItemID) + photoName; switch (photo) { case PhotoTypes.Original: photoPath = DCSiteUrls.GetPath_ItemsPhotoOriginals(OwnerName, ModuleTypeID, CategoryID, ItemID) + Photo; break; case PhotoTypes.Thumb: photoPath = DCSiteUrls.GetPath_ItemsPhotoNormalThumbs(OwnerName, ModuleTypeID, CategoryID, ItemID) + photoName + MoversFW.Thumbs.thumbnailExetnsion; break; case PhotoTypes.Big: photoPath = DCSiteUrls.GetPath_ItemsPhotoBigThumbs(OwnerName, ModuleTypeID, CategoryID, ItemID) + photoName + MoversFW.Thumbs.thumbnailExetnsion; break; default: photoPath = DCSiteUrls.GetPath_ItemsPhotoNormalThumbs(OwnerName, ModuleTypeID, CategoryID, ItemID) + photoName + MoversFW.Thumbs.thumbnailExetnsion; break; } return(photoPath); } else { return(SiteDesign.NoPhotoPath); } }
/// <summary> /// Creates ItemCategories object by calling ItemCategories data provider create method. /// <example>[Example]bool status=ItemCategoriesFactory.Create(itemCategoriesObject);.</example> /// </summary> /// <param name="itemCategoriesObject">The ItemCategories object.</param> /// <returns>Status of create operation.</returns> public static ExecuteCommandStatus Create(ItemCategoriesEntity category, ItemsModulesOptions currentModule) { //Insert user name------------------------------------------ string username = ""; if (HttpContext.Current.User.Identity.IsAuthenticated) { username = HttpContext.Current.User.Identity.Name; category.InsertUserName = username; } //---------------------------------------------------------- ExecuteCommandStatus status = ItemCategoriesSqlDataPrvider.Instance.Create(category, currentModule); //------------------------------------- if (status == ExecuteCommandStatus.Done) { string folder = DCSiteUrls.GetPath_ItemCategoriesDirectory(category.OwnerName, category.ModuleTypeID, category.CategoryID); string folderPhysicalPath = DCServer.MapPath(folder); if (!Directory.Exists(folderPhysicalPath)) { string defaultFolder = DCSiteUrls.GetPath_DefaultCategoryFolder(); string defaultFolderPhysicalPath = DCServer.MapPath(defaultFolder); DirectoryInfo diSource = new DirectoryInfo(defaultFolderPhysicalPath); DirectoryInfo diTarget = new DirectoryInfo(folderPhysicalPath); DcDirectoryManager.CopyAll(diSource, diTarget); } } //------------------------------------- return(status); }
public static void DeleteUserFolder(MembershipUser user, UsersDataEntity userdata) { if (user != null && userdata != null) { if (user.IsApproved && UsersDataFactory.IsSubSubSiteOwner(userdata.UserType)) { string subSiteFolder = DCSiteUrls.GetPath_SubSiteUploadFolder(user.UserName); string subSiteFolderPhysicalPath = DCServer.MapPath(subSiteFolder); if (Directory.Exists(subSiteFolderPhysicalPath)) { DirectoryInfo dir = new DirectoryInfo(subSiteFolderPhysicalPath); DcDirectoryManager.DeletDirectory(dir); } } else { string folder = DCSiteUrls.GetPath_UserDataDirectory(userdata.OwnerName, userdata.ModuleTypeID, userdata.CategoryID, userdata.UserProfileID); string folderPhysicalPath = DCServer.MapPath(folder); if (Directory.Exists(folderPhysicalPath)) { DirectoryInfo dir = new DirectoryInfo(folderPhysicalPath); DcDirectoryManager.DeletDirectory(dir); } } } }
//----------------------------------------------- //Page_Load //----------------------------------------------- public void Page_Load(object sender, System.EventArgs e) { //------------------------------------------------- currentModule = ItemsModulesOptions.GetType(ModuleTypeID); siteUrls = DCSiteUrls.Instance; //------------------------------------------------- //Prepaare user control CatchControls(); Prepare(); //------------------------------------------------- lblResult.Text = ""; //--------------------------------------------------------- //Load Cart //--------------------------------------------------------- if (Session["Cart"] == null) { Session["Cart"] = new List <ItemsOrdersDetailsModel>(); } CartList = (List <ItemsOrdersDetailsModel>)Session["Cart"]; //--------------------------------------------------------- if (!IsPostBack) { LoadData(); } }
/// <summary> /// Creates Messages object by calling Messages data provider create method. /// <example>[Example]bool status=MessagesFactory.Create(msg);.</example> /// </summary> /// <param name="msg">The Messages object.</param> /// <returns>Status of create operation.</returns> public static bool Create(MessagesEntity msg, bool createMsgFolder) { //Insert user name------------------------------------------ string username = ""; if (HttpContext.Current.User.Identity.IsAuthenticated) { username = HttpContext.Current.User.Identity.Name; msg.InsertUserName = username; } //---------------------------------------------------------- bool status = MessagesSqlDataPrvider.Instance.Create(msg); //------------------------------------- if (status && createMsgFolder) { // Create msg folder string folder = DCSiteUrls.GetPath_MessagesDirectory(msg.OwnerName, msg.ModuleTypeID, msg.CategoryID, msg.MessageID); string folderPhysicalPath = DCServer.MapPath(folder); if (!Directory.Exists(folderPhysicalPath)) { string defaultFolder = DCSiteUrls.GetPath_DefaultMessageFolder(); string defaultFolderPhysicalPath = DCServer.MapPath(defaultFolder); DirectoryInfo diSource = new DirectoryInfo(defaultFolderPhysicalPath); DirectoryInfo diTarget = new DirectoryInfo(folderPhysicalPath); DcDirectoryManager.CopyAll(diSource, diTarget); } } //------------------------------------- return(status); }
//--------------------------------------------------------------- #region ---------------SaveFiles--------------- //----------------------------------------------- //SaveFiles //----------------------------------------------- protected void SaveFiles(UsersDataEntity UserDataObject) { #region Save uploaded photo //Photo----------------------------- if (fuPhoto.HasFile) { //if has an old photo if (!string.IsNullOrEmpty(oldPhotoExtension)) { //Delete old original photo File.Delete(DCServer.MapPath(DCSiteUrls.GetPath_UserDataPhotoOriginals(UserDataObject.OwnerName, UserDataObject.ModuleTypeID, UserDataObject.CategoryID, UserDataObject.UserProfileID)) + UsersDataFactory.CreateUserPhotoName(UserDataObject.UserProfileID) + oldPhotoExtension); //Delete old Thumbnails File.Delete(DCServer.MapPath(DCSiteUrls.GetPath_UserDataPhotoNormalThumbs(UserDataObject.OwnerName, UserDataObject.ModuleTypeID, UserDataObject.CategoryID, UserDataObject.UserProfileID)) + UsersDataFactory.CreateUserPhotoName(UserDataObject.UserProfileID) + MoversFW.Thumbs.thumbnailExetnsion); File.Delete(DCServer.MapPath(DCSiteUrls.GetPath_UserDataPhotoBigThumbs(UserDataObject.OwnerName, UserDataObject.ModuleTypeID, UserDataObject.CategoryID, UserDataObject.UserProfileID)) + UsersDataFactory.CreateUserPhotoName(UserDataObject.UserProfileID) + MoversFW.Thumbs.thumbnailExetnsion); } //------------------------------------------------ //Save new original photo fuPhoto.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_UserDataPhotoOriginals(UserDataObject.OwnerName, UserDataObject.ModuleTypeID, UserDataObject.CategoryID, UserDataObject.UserProfileID)) + UserDataObject.Photo); //Create new thumbnails MoversFW.Thumbs.CreateThumb(DCSiteUrls.GetPath_UserDataPhotoNormalThumbs(UserDataObject.OwnerName, UserDataObject.ModuleTypeID, UserDataObject.CategoryID, UserDataObject.UserProfileID), UsersDataFactory.CreateUserPhotoName(UserDataObject.UserProfileID), fuPhoto.PostedFile, SiteSettings.Photos_NormalThumnailWidth, SiteSettings.Photos_NormalThumnailHeight); MoversFW.Thumbs.CreateThumb(DCSiteUrls.GetPath_UserDataPhotoBigThumbs(UserDataObject.OwnerName, UserDataObject.ModuleTypeID, UserDataObject.CategoryID, UserDataObject.UserProfileID), UsersDataFactory.CreateUserPhotoName(UserDataObject.UserProfileID), fuPhoto.PostedFile, SiteSettings.Photos_BigThumnailWidth, SiteSettings.Photos_BigThumnailHeight); } //------------------------------------------------ #endregion }
public static void DeleteAllModules() { XmlDocument xmlDoc = GetSecurityConfig(); XmlNode commonParent = xmlDoc.SelectSingleNode("/Security/Modules"); commonParent.RemoveAll(); xmlDoc.Save(DCServer.MapPath("~") + DCSiteUrls.GetPath_ZecurityConfigurationPath()); }
//--------------------------------------- public void ProcessRequest(HttpContext context) { /* * // Check to see if the specified HTML file actual exists and serve it if so.. * String strReqPath = context.Server.MapPath(context.Request.AppRelativeCurrentExecutionFilePath); * if (File.Exists(strReqPath)) * { * context.Response.WriteFile(strReqPath); * context.Response.End(); * return; * } * * // Record the original request PathInfo and QueryString information to handle graceful postbacks * context.Items[ORIGINAL_PATHINFO] = context.Request.PathInfo; * context.Items[ORIGINAL_QUERIES] = context.Request.QueryString.ToString(); * * // Map the friendly URL to the back-end one.. * String strVirtualPath = ""; * String strQueryString = ""; * MapFriendlyUrl(context, out strVirtualPath, out strQueryString); * if (strVirtualPath.Length > 0) * { * foreach (string strOriginalQuery in context.Request.QueryString.Keys) * { * // To ensure that any query strings passed in the original request are preserved, we append these * // to the new query string now, taking care not to add any keys which have been rewritten during the handler.. * if (strQueryString.ToLower().IndexOf(strOriginalQuery.ToLower() + "=") < 0) * { * strQueryString += string.Format("{0}{1}={2}", ((strQueryString.Length > 0) ? "&" : ""), strOriginalQuery, context.Request.QueryString[strOriginalQuery]); * } * } * * // Apply the required query strings to the request * context.RewritePath(context.Request.Path, string.Empty, strQueryString); * // Now get a page handler for the ASPX page required, using this context. * Page aspxHandler = (Page)PageParser.GetCompiledPageInstance(strVirtualPath, context.Server.MapPath(strVirtualPath), context); * // Execute the handler.. * aspxHandler.PreRenderComplete += new EventHandler(AspxPage_PreRenderComplete); * aspxHandler.ProcessRequest(context); * } * else * { * // No mapping was found - emit a 404 response. * context.Response.StatusCode = 404; * context.Response.ContentType = "text/plain"; * context.Response.Write("Page Not Found"); * context.Response.End(); * }*/ string newPath = Context.Request.RawUrl; HandleCurrentLanguage(); DCMetaBuilder.InisializeMetaTags(); DCSiteUrls urls = DCSiteUrls.Instance; urls.ReWriteUrl(); }
//------------------------------------------ #endregion #region --------------GetSiteDeparmentsPhotoOriginal-------------- public static string GetSiteDeparmentsPhotoOriginal(object DepartmentID, object photoExtension, object ownerName) { if (photoExtension.ToString().Length > 0) { return(DCSiteUrls.GetPath_SiteDeparmentsPhotoBigThumbs((string)ownerName) + CreateSiteDeparmentsPhotoName((int)DepartmentID) + photoExtension.ToString()); } else { return(SiteDesign.NoPhotoPath); } }
//-------------------------------------------- #endregion #region --------------GetItemCategoriesPhotoBigThumbnail-------------- public static string GetItemCategoriesPhotoBigThumbnail(object CategoryID, object photoExtension, object ownerName, object ModuleTypeID) { if (photoExtension.ToString().Length > 0) { return(DCSiteUrls.GetPath_ItemCategoriesPhotoBigThumbs((string)ownerName, (int)ModuleTypeID, (int)CategoryID) + CreateItemCategoriesPhotoName((int)CategoryID) + MoversFW.Thumbs.thumbnailExetnsion); } else { return(SiteDesign.NoPhotoPath); } }
//------------------------------------------ #endregion #region --------------GetUserPhotoOriginal-------------- public static string GetUserPhotoOriginal(object UserProfileID, object photoExtension, object ownerName, object ModuleTypeID, object CategoryID) { if (photoExtension.ToString().Length > 0) { return(DCSiteUrls.GetPath_UserDataPhotoOriginals((string)ownerName, (int)ModuleTypeID, (int)CategoryID, (int)UserProfileID) + CreateUserPhotoName((int)UserProfileID) + photoExtension); } else { return(SiteDesign.NoPhotoPath); } }
//----------------------------------------------- #endregion #region ---------------LoadData--------------- //----------------------------------------------- //LoadData //----------------------------------------------- protected void LoadData() { if (MoversFW.Components.UrlManager.ChechIsValidIntegerParameter("id")) { int departmentID = Convert.ToInt32(Request.QueryString["id"]); SiteDeparmentsEntity siteDepartment = SiteDeparmentsFactory.GetObject(departmentID, Languages.Unknowen); if (siteDepartment != null) { //txtTitle.Text = siteDepartment.Title; //txtShortDescription.Text = siteDepartment.ShortDescription; if (trParents.Visible) { ddlParents.SelectedValue = siteDepartment.ParentID.ToString(); } //------------------------------- txtUrl.Text = siteDepartment.Url; //------------------------------- ddlRelatedModuleTypeID.SelectedValue = siteDepartment.RelatedModuleTypeID.ToString(); //------------------------------- if (siteDepartment.RelatedPageID > 0) { Load_ddlRelatedPageID(); trDeletePhoto.Visible = true; siteDepartment.RelatedPageID = Convert.ToInt32(ddlRelatedPageID.SelectedValue); } //------------------------------- LoadDetails(siteDepartment); //------------------------------- cbIsAvailable.Checked = siteDepartment.IsAvailable; if (!string.IsNullOrEmpty(siteDepartment.PhotoExtension)) { imgPhoto.ImageUrl = DCSiteUrls.GetPath_SiteDeparmentsPhotoNormalThumbs(siteDepartment.OwnerName) + siteDepartment.NormalPhotoThumbs; ancor.HRef = DCSiteUrls.GetPath_SiteDeparmentsPhotoBigThumbs(siteDepartment.OwnerName) + siteDepartment.BigPhotoThumbs; //imgPhoto.AlternateText = siteDepartment.Title; } else { trPhotoPreview.Visible = false; } //------------------------------------------ //------------------------------------------ } else { Response.Redirect("default.aspx"); } } else { Response.Redirect("default.aspx"); } }
public static void RemoveUserFromAllgroups(Guid id) { XmlDocument xmlDoc = GetSecurityConfig(); XmlNodeList nodeList = xmlDoc.SelectNodes("/Security/Groups/Group/Users/User[@ID='" + id.ToString() + "']"); foreach (XmlNode user in nodeList) { XmlNode parentnode = user.ParentNode; parentnode.RemoveChild(user); } xmlDoc.Save(DCServer.MapPath("~") + DCSiteUrls.GetPath_ZecurityConfigurationPath()); }
void context_BeginRequest(object sender, EventArgs e) { string newPath = Context.Request.RawUrl; HandleCurrentLanguage(); DCMetaBuilder.InisializeMetaTags(); DCSiteUrls urls = DCSiteUrls.Instance; urls.ReWriteUrl(); //DCCMSNameSpace.SubSiteHandler.IncreaseSubSiteVisites(); //RewriteUrl(); }
public string GetPhotoPath(PhotoTypes photo) { if (_FileExtension.Length > 0) { string photoName = GetPhotoName(photo); string path = DCSiteUrls.GetPath_ItemsFiles(OwnerName, ModuleTypeID, CategoryID, ItemID) + photoName; string realPath = string.Format(path, ItemID.ToString()); return(realPath); } else { return(SiteDesign.NoPhotoPath); } }
/* * public string GetFileName() * { * return Files.GetFileName(_FileExtension, File, FileIdentifre, _FileID); * } */ public string GetFilePath() { if (_FileExtension.Length > 0) { string FileName = File; string path = DCSiteUrls.GetPath_ItemsFiles(OwnerName, ModuleTypeID, CategoryID, ItemID) + FileName; string realPath = string.Format(path, ItemID.ToString()); return(realPath); } else { return(""); } }
//-------------------------------------------------------- #endregion #region ---------------SaveFiles--------------- //----------------------------------------------- //SaveFiles //----------------------------------------------- protected void SaveFiles(ItemCategoriesEntity itemCategoriesObject) { #region Save uploaded photo //Photo----------------------------- if (fuPhoto.HasFile) { //------------------------------------------------ //Save new original photo fuPhoto.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_ItemCategoriesPhotoOriginals(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID)) + itemCategoriesObject.Photo); //Create new thumbnails MoversFW.Thumbs.CreateThumb(DCSiteUrls.GetPath_ItemCategoriesPhotoNormalThumbs(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID), ItemCategoriesFactory.CreateItemCategoriesPhotoName(itemCategoriesObject.CategoryID), fuPhoto.PostedFile, SiteSettings.Photos_NormalThumnailWidth, SiteSettings.Photos_NormalThumnailHeight); MoversFW.Thumbs.CreateThumb(DCSiteUrls.GetPath_ItemCategoriesPhotoBigThumbs(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID), ItemCategoriesFactory.CreateItemCategoriesPhotoName(itemCategoriesObject.CategoryID), fuPhoto.PostedFile, SiteSettings.Photos_BigThumnailWidth, SiteSettings.Photos_BigThumnailHeight); //------------------------------------------------------- } #endregion #region Save uploaded file //File----------------------------- if (fuFile.HasFile) { //Save new original file fuFile.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_ItemCategoriesFiles(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID)) + itemCategoriesObject.File); } #endregion #region Save uploaded video //Video----------------------------- if (fuVideo.HasFile) { fuVideo.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_ItemCategoriesFiles(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID)) + itemCategoriesObject.Video); } #endregion #region Save uploaded audio //Audio----------------------------- if (fuAudio.HasFile) { fuAudio.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_ItemCategoriesFiles(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID)) + itemCategoriesObject.Audio); } #endregion #region Save uploaded photo2 //------------------------------------------------------------------------------------- //Photo2----------------------------- if (fuPhoto2.HasFile) { fuPhoto2.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_ItemCategoriesFiles(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID)) + itemCategoriesObject.Photo2); } #endregion }
//------------------------------------------------------- #region ---------------Page_Load--------------- //----------------------------------------------- //Page_Load //----------------------------------------------- private void Page_Load(object sender, System.EventArgs e) { currentModule = UsersDataGlobalOptions.GetType(ModuleTypeID); siteUrls = DCSiteUrls.Instance; //------------------------------------------------- //Prepaare user control CatchControls(); Prepare(); //------------------------------------------------- if (!IsPostBack) { PrepareBuffer(); LoadData(); } }
public static string GetPhotoPath(PhotoTypes photo, object _PhotoID, object _photoExtension, object ownerName, object ModuleTypeID, object CategoryID, object ItemID) { if (((string)_photoExtension).Length > 0) { string photoName = Photos.GetPhotoName((string)_photoExtension, photo, FileIdentifre, (int)_PhotoID); string path = DCSiteUrls.GetPath_ItemsFiles((string)ownerName, (int)ModuleTypeID, (int)CategoryID, (int)ItemID) + photoName; string realPath = string.Format(path, _PhotoID.ToString()); return(realPath); } else { return(SiteDesign.NoPhotoPath); } }
//-------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------- public static void AddAttatchPath(List <string> attachments, FileUpload fuAttach) { if (fuAttach.HasFile) { string attachmentDir = DCServer.MapPath(DCSiteUrls.GetPath_MailList_AttachmentDir()); string fileName = fuAttach.PostedFile.FileName; string filePath = attachmentDir + fileName; if (File.Exists(filePath)) { File.Delete(filePath); } fuAttach.SaveAs(filePath); attachments.Add(filePath); } }
//-------------------------------------------------------- #endregion public string GetSubSiteFolderSize(object identifire) { string text = ""; long folderSize = 0; string folderPath = DCSiteUrls.GetPath_SubSiteUploadFolder((string)identifire); string folderPathPhysicalPath = DCServer.MapPath(folderPath); if (Directory.Exists(folderPathPhysicalPath)) { DirectoryInfo dir = new DirectoryInfo(folderPathPhysicalPath); DcDirectoryManager.GetDirectorySize(dir, ref folderSize); text = DcDirectoryManager.CalculateSizeToRead(folderSize); } return(text); }
//------------------------------------------ #endregion #region --------------GetItemsPhotoThumbnail-------------- public static string GetPhotoThumbnail(object photoID, object photoExtension, int width, int height, object ownerName, object ModuleTypeID, object CategoryID, object ItemID) { if (photoExtension.ToString().Length > 0) { string photoName = Photos.GetPhotoName((string)photoExtension, PhotoTypes.Big, ItemsFilesEntity.FileIdentifre, (int)photoID); string path = DCSiteUrls.GetPath_ItemsFiles((string)ownerName, (int)ModuleTypeID, (int)CategoryID, (int)ItemID) + photoName; //return DCSiteUrls.GetPath_ItemsPhotoNormalThumbs ((string)ownerName) + CreateItemsPhotoName((int)itemID) + MoversFW.Thumbs.thumbnailExetnsion; return("/Thumbnails/Maker1.aspx?file=" + path + "&W=" + width + "&H=" + height); } else { return(SiteDesign.NoPhotoPath); } }
//-------------------------------------------------- protected void Page_Load(object sender, EventArgs e) { //--------------------------------------------------- currentModule = ItemsModulesOptions.GetType(ModuleTypeID); siteUrls = DCSiteUrls.Instance; //--------------------------------------------------- //Prepaare user control CatchControls(); Prepare(); //------------------------------------------------- if (!IsPostBack) { LoadData(); } }
//----------------------------------------------- #endregion //------------------------------------------------------- #region ---------------SaveFiles--------------- //----------------------------------------------- //SaveFiles //----------------------------------------------- protected void SaveFiles(UsersDataEntity userdata) { #region Save uploaded photo //Photo----------------------------- if (fuPhoto.HasFile) { //------------------------------------------------ //Save new original photo fuPhoto.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_UserDataPhotoOriginals(userdata.OwnerName, userdata.ModuleTypeID, userdata.CategoryID, userdata.UserProfileID)) + userdata.Photo); //Create new thumbnails MoversFW.Thumbs.CreateThumb(DCSiteUrls.GetPath_UserDataPhotoNormalThumbs(userdata.OwnerName, userdata.ModuleTypeID, userdata.CategoryID, userdata.UserProfileID), UsersDataFactory.CreateUserPhotoName(userdata.UserProfileID), fuPhoto.PostedFile, SiteSettings.Photos_NormalThumnailWidth, SiteSettings.Photos_NormalThumnailHeight); MoversFW.Thumbs.CreateThumb(DCSiteUrls.GetPath_UserDataPhotoBigThumbs(userdata.OwnerName, userdata.ModuleTypeID, userdata.CategoryID, userdata.UserProfileID), UsersDataFactory.CreateUserPhotoName(userdata.UserProfileID), fuPhoto.PostedFile, SiteSettings.Photos_BigThumnailWidth, SiteSettings.Photos_BigThumnailHeight); //------------------------------------------------------- } #endregion }
public static string GetFilePath(object _FileID, object _FileExtension, object ownerName, object ModuleTypeID, object CategoryID, object ItemID) { if (((string)_FileExtension).Length > 0) { string FileName = FileIdentifre + _FileID.ToString() + _FileExtension.ToString(); string path = DCSiteUrls.GetPath_ItemsFiles((string)ownerName, (int)ModuleTypeID, (int)CategoryID, (int)ItemID) + FileName; string realPath = string.Format(path, _FileID.ToString()); return(realPath); } else { //return Files.GetNoFilePath(File); return(""); } }
//----------------------------------------------- #region ---------------Page_Load--------------- //----------------------------------------------- //Page_Load //----------------------------------------------- public void Page_Load(object sender, System.EventArgs e) { //------------------------------------------------- currentModule = MessagesModuleOptions.GetType(ModuleTypeID); siteUrls = DCSiteUrls.Instance; //------------------------------------------------- //Prepaare user control CatchControls(); Prepare(); //------------------------------------------------- lblResult.Text = ""; if (!IsPostBack) { FirstLoad(); } }
public static bool AddGroup(Zecurity.Group group) { bool res = false; XmlDocument xmlDoc = GetSecurityConfig(); XmlNodeList nodeList = xmlDoc.SelectNodes("/Security/Groups/Group[@Name='" + group.Name + "']"); if (nodeList.Count == 0) { //Group Attributes XmlElement xmlNewGroup = xmlDoc.CreateElement("Group"); AddAttribute("ID", group.ID.ToString(), xmlNewGroup); AddAttribute("Name", group.Name, xmlNewGroup); //Adding Permissions if (group.Permissions.Count > 0) { XmlElement xmlPermissions = xmlDoc.CreateElement("Permissions"); foreach (Zecurity.Permission permission in group.Permissions) { XmlElement xmlPermission = xmlDoc.CreateElement("Permission"); AddAttribute("ID", permission.ID.ToString(), xmlPermission); AddAttribute("Path", permission.Path, xmlPermission); AddAttribute("Add", permission.Add.ToString(), xmlPermission); AddAttribute("Edit", permission.Edit.ToString(), xmlPermission); AddAttribute("Delete", permission.Delete.ToString(), xmlPermission); AddAttribute("Trusted", permission.Trusted.ToString(), xmlPermission); AddAttribute("Name", permission.Name, xmlPermission); xmlPermissions.AppendChild(xmlPermission); } xmlNewGroup.AppendChild(xmlPermissions); } //Preparing for Users XmlElement xmlUsers = xmlDoc.CreateElement("Users"); xmlNewGroup.AppendChild(xmlUsers); XmlNode commonParent = xmlDoc.SelectSingleNode("/Security/Groups"); commonParent.AppendChild(xmlNewGroup); xmlDoc.Save(DCServer.MapPath("~") + DCSiteUrls.GetPath_ZecurityConfigurationPath()); res = true; } return(res); }
//------------------------------------------------------- #region ---------------Page_Load--------------- //----------------------------------------------- //Page_Load //----------------------------------------------- private void Page_Load(object sender, System.EventArgs e) { currentModule = UsersDataGlobalOptions.GetType(ModuleTypeID); siteUrls = DCSiteUrls.Instance; //------------------------------------------------- //Prepaare user control CatchControls(); Prepare(); //------------------------------------------------- lblResult.Text = ""; if (!IsPostBack) { PagerManager.PrepareUserPager(pager); pager.Visible = false; LoadData(); } }