示例#1
0
 public HiPOSHelper()
 {
     if (string.IsNullOrEmpty(siteSettings.HiPOSAppId))
     {
         string siteUrl = siteSettings.SiteUrl;
         string str2    = string.Empty;
         if (siteUrl.IndexOf("http") < 0)
         {
             str2 = "http://" + siteSettings.SiteUrl + "/API/HiPOSAPI.ashx?action=auth";
         }
         else
         {
             str2 = siteSettings.SiteUrl + "/API/HiPOSAPI.ashx?action=auth";
         }
         AuthResult auth = AuthApi.GetAuth(siteUrl, str2);
         if (auth.error != null)
         {
             throw new Exception(auth.error.message);
         }
         siteSettings = SettingsManager.GetMasterSettings();
         AccessTokenContainer.Register(siteSettings.HiPOSAppId, siteSettings.HiPOSAppSecret);
     }
     else
     {
         AccessTokenContainer.Register(siteSettings.HiPOSAppId, siteSettings.HiPOSAppSecret);
     }
 }
示例#2
0
 public AuthResult GetAuth(string hostname, string notify_url)
 {
     return(AuthApi.GetAuth(hostname, notify_url));
 }