public void createSSAEktronMember(string PIN) { //try //{ Dictionary<string, string> UserDetails = loginSSA.GetUsersDetails(PIN); UserManager Usermanager = new UserManager(); CustomAttributeList attrList = new CustomAttributeList(); CustomAttribute timeZone = new CustomAttribute(); timeZone.Name = "Time Zone"; timeZone.Value = "Eastern Standard Time"; attrList.Add(timeZone); UserData newUserdata = new UserData() { Username = PIN, Password = EktronMemberDefaultPassword, FirstName = UserDetails["FirstName"], LastName = UserDetails["LastName"], DisplayName = UserDetails["DisplayName"], Email = UserDetails["Email"], CustomProperties = attrList, // IsMemberShip = true }; if (Ektron.Cms.Framework.Context.UserContextService.Current.IsLoggedIn) { Usermanager.Add(newUserdata); // add user to group MSBA Members UserGroupManager UserGroupmanager = new UserGroupManager(); //Add a User to a UserGroup UserGroupmanager.AddUser(1, newUserdata.Id); } }
protected void Page_Load(object sender, System.EventArgs e) { rssHostUrl = apiContent.RequestInformationRef.HostUrl; if (Request.QueryString["id"] != "" && Request.QueryString["type"] != "" && Request.QueryString["page"] != "") { try { Response.ContentType = "text/xml"; Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.Expires = -1; if ((string) (Strings.Trim(Request.QueryString["type"]).ToLower()) == "board") { rssType = ThreadedDiscussionObjectType.board; } else if ((string) (Strings.Trim(Request.QueryString["type"]).ToLower()) == "forum") { rssType = ThreadedDiscussionObjectType.forum; } // "topic" else { rssType = ThreadedDiscussionObjectType.topic; } if (! (Request.QueryString["groupid"] == null) && Request.QueryString["groupid"] != "") { groupID = Convert.ToInt64(Request.QueryString["groupid"]); } rssID = Convert.ToInt64(Request.QueryString["id"]); rssURLpath = EkFunctions.HtmlEncode(Request.QueryString["page"]); if ((apiContent.RequestInformationRef.HttpsProtocol.ToLower() == "on") && (apiContent.RequestInformationRef.HostSSLPort != "80")) { if (!(apiContent.RequestInformationRef.HostSSLPort == "443")) { rssHostUrl = apiContent.RequestInformationRef.HostUrl + ":" + apiContent.RequestInformationRef.HostSSLPort; } } else { if (!((apiContent.RequestInformationRef.HostPort == "80") || (apiContent.RequestInformationRef.HostPort == "443"))) { rssHostUrl = apiContent.RequestInformationRef.HostUrl + ":" + apiContent.RequestInformationRef.HostPort; } } sType = System.Enum.GetName(typeof(ThreadedDiscussionObjectType), rssType); if (groupID != -1) { Ektron.Cms.CustomAttributeList grpIdList = new CustomAttributeList(); grpIdList.Add(groupID.ToString()); Response.Write(apiContent.RenderThreadedDiscussionRSS(rssID, sType, rssURLpath, rssHostUrl, grpIdList)); } else { Response.Write(apiContent.RenderThreadedDiscussionRSS(rssID, sType, rssURLpath, rssHostUrl, null)); } } catch (Exception ex) { Utilities.ShowError(ex.Message); } } }