protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Course currentCourse = AngelSession.CurrentAngelSession.Section; ProvisionLink.NavigateUrl = String.Format("{0}ProvisionCourse.aspx?id={1}", cNuggetRoot, currentCourse.CourseId); using (var clientData = new ClientDataProxy()) { List <CourseInfo> courses = new List <CourseInfo>(clientData.GetCourses(Util.GetUserKey(), Util.GetAuthCode())); string panoptoCourseID = ConfigurationVariable.GetValue("PanoptoCourseID", null, null, null, currentCourse.CourseId, null); if (String.IsNullOrEmpty(panoptoCourseID)) { courses.Insert(0, new CourseInfo() { DisplayName = "-- Select an Existing Course --" }); } bool isProvisioned = false; bool canSync = false; // Populate course drop down. CoursesDropDown.Items.Clear(); foreach (CourseInfo course in courses) { ListItem item = new ListItem(course.DisplayName, course.PublicID.ToString()); // Select course if it matches the current Panopto course setting if (course.PublicID.ToString() == panoptoCourseID) { item.Selected = true; } CoursesDropDown.Items.Add(item); // Check for matching external ID indicating the course has already been provisioned if (course.ExternalCourseID == Util.GetExternalCourseID(currentCourse.CourseId)) { isProvisioned = true; // If provisioned course is already selected, show "Sync users" link if (course.PublicID.ToString() == panoptoCourseID) { canSync = true; } } } ProvisionPanel.Visible = (!isProvisioned || canSync); ProvisionLink.Text = canSync ? "Sync Users" : "Add this course to Panopto"; } } }
public ClientDataProxy() { string serverName = ConfigurationVariable.GetValue("PANOPTO_SERVER"); string serviceLocation = String.Format(serviceLocationFormatString, serverName); m_service = new ServiceProxy <IClientDataService>(serviceLocation); }
/// <summary> /// Get auth code for specified payload for use in SSO process. /// </summary> /// <param name="payload">Payload to sign</param> /// <returns>Specified payload signed with app key and hashed with SHA-1.</returns> public static String GetAuthCode(string payload) { // Get the app key setting. string applicationKey = ConfigurationVariable.GetValue(AppKeyVarName); String signedPayload = payload + "|" + applicationKey; String authCode = FormsAuthentication.HashPasswordForStoringInConfigFile(signedPayload, "SHA1").ToUpper(); return(authCode); }
/// <summary> /// Get Panopto "notify" setting from Angel environment variable. /// </summary> public static bool GetNotify() { // Default to "true" if no setting. return(ConfigurationVariable.GetValue(NotificationsVarName) != "false"); }
/// <summary> /// Get Panopto application key setting from Angel environment variable. /// </summary> public static String GetAppKey() { return(ConfigurationVariable.GetValue(AppKeyVarName)); }
/// <summary> /// Get Panopto server name setting from Angel environment variable. /// </summary> public static String GetServerName() { return(ConfigurationVariable.GetValue(ServerVarName)); }
/// <summary> /// Get Angel instance name setting from Angel environment variable. /// </summary> public static String GetInstanceName() { return(ConfigurationVariable.GetValue(InstanceVarName)); }