Пример #1
0
 public override void SaveSettings(OpenIdSettingsInfo settings)
 {
     DbCommand storedProcCommand = database.GetStoredProcCommand("aspnet_OpenIdSettings_Save");
     database.AddInParameter(storedProcCommand, "OpenIdType", DbType.String, settings.OpenIdType.ToLower());
     database.AddInParameter(storedProcCommand, "Name", DbType.String, settings.Name);
     database.AddInParameter(storedProcCommand, "Description", DbType.String, settings.Description);
     database.AddInParameter(storedProcCommand, "Settings", DbType.String, settings.Settings);
     database.ExecuteNonQuery(storedProcCommand);
 }
Пример #2
0
 public override void SaveSettings(OpenIdSettingsInfo settings)
 {
     DbCommand storedProcCommand = database.GetStoredProcCommand("distro_OpenIdSettings_Save");
     database.AddInParameter(storedProcCommand, "OpenIdType", DbType.String, settings.OpenIdType.ToLower());
     database.AddInParameter(storedProcCommand, "Name", DbType.String, settings.Name);
     database.AddInParameter(storedProcCommand, "Description", DbType.String, settings.Description);
     database.AddInParameter(storedProcCommand, "Settings", DbType.String, settings.Settings);
     database.AddInParameter(storedProcCommand, "UserId", DbType.Int32, HiContext.Current.User.UserId);
     database.ExecuteNonQuery(storedProcCommand);
 }
Пример #3
0
 public static OpenIdSettingsInfo PopulateOpenIdSettings(IDataReader reader)
 {
     OpenIdSettingsInfo info2 = new OpenIdSettingsInfo();
     info2.OpenIdType = (string) reader["OpenIdType"];
     info2.Name = (string) reader["Name"];
     info2.Settings = (string) reader["Settings"];
     OpenIdSettingsInfo info = info2;
     if (reader["Description"] != DBNull.Value)
     {
         info.Description = (string) reader["Description"];
     }
     return info;
 }
Пример #4
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     ConfigData data;
     if (ValidateValues(out data))
     {
         OpenIdSettingsInfo settings = new OpenIdSettingsInfo();
         settings.Name = txtName.Text.Trim();
         settings.Description = fcContent.Text;
         settings.OpenIdType = openIdType;
         settings.Settings = Cryptographer.Encrypt(data.SettingsXml);
         SubSiteOpenIdHelper.SaveSettings(settings);
         Response.Redirect("openidservices.aspx");
     }
 }
Пример #5
0
 public override OpenIdSettingsInfo GetOpenIdSettings(string openIdType)
 {
     OpenIdSettingsInfo info = null;
     DbCommand sqlStringCommand = database.GetSqlStringCommand("SELECT * FROM aspnet_OpenIdSettings WHERE LOWER(OpenIdType)=LOWER(@OpenIdType)");
     database.AddInParameter(sqlStringCommand, "OpenIdType", DbType.String, openIdType.ToLower());
     using (IDataReader reader = database.ExecuteReader(sqlStringCommand))
     {
         if (!reader.Read())
         {
             return info;
         }
         OpenIdSettingsInfo info2 = new OpenIdSettingsInfo();
         info2.OpenIdType = openIdType;
         info2.Name = (string)reader["Name"];
         info2.Settings = (string)reader["Settings"];
         info = info2;
         if (reader["Description"] != DBNull.Value)
         {
             info.Description = (string)reader["Description"];
         }
     }
     return info;
 }
Пример #6
0
 public static void SaveSettings(OpenIdSettingsInfo settings)
 {
     OpenIdProvider.Instance().SaveSettings(settings);
 }
Пример #7
0
 public abstract void SaveSettings(OpenIdSettingsInfo settings);