コード例 #1
0
 public HttpResponseMessage UpdateSettings(CasProviderSettings settings)
 {
     try
     {
         CasProviderSettings.SaveSettings("Cas", PortalId, settings);
         return(Request.CreateResponse(HttpStatusCode.OK));
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
     }
 }
コード例 #2
0
        public static void SaveSettings(string service, int portalId, CasProviderSettings settings)
        {
            var config = new CasConfig(service, portalId)
            {
                ServerUrl    = settings.ServerUrl,
                APIKey       = settings.ApiKey,
                APISecret    = settings.ApiSecret,
                AutoRedirect = settings.AutoRedirect,
                Enabled      = settings.Enabled
            };

            CasConfig.UpdateConfig(config);
        }
コード例 #3
0
 public HttpResponseMessage GetSettings()
 {
     try
     {
         var settings = CasProviderSettings.LoadSettings("Cas", PortalId);
         return(Request.CreateResponse(HttpStatusCode.OK, settings));
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
     }
 }