public Configuration()
        {
            // Initialize form base components
            InitializeComponent();

            m_logger = log4net.LogManager.GetLogger("pGina.Plugin.krb5Plugin");

            // Get the GUID for this plugin and grab the currently stored Kerberos realm
            Guid    m_uuid     = new Guid("16E22B15-4116-4FA4-9BB2-57D54BF61A43");
            dynamic m_settings = new pGina.Shared.Settings.pGinaDynamicSettings(m_uuid);

            // Currently set krb realm from the registry settings for this plugin
            currentRealmText.Text = m_settings.Realm;
        }
Exemplo n.º 2
0
        /// <summary>
        /// If the current plugin path is the default for pGina 3.1.6 and earlier,
        /// update it for later versions.
        /// </summary>
        private static void UpdatePluginPath()
        {
            m_logger.Debug("Checking plugin path to see if it needs to be updated.");
            string pluginsBaseDir =
                string.Format(@"{0}\Plugins",
                              Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

            dynamic settings = new pGina.Shared.Settings.pGinaDynamicSettings();

            string[] pluginDirs = settings.PluginDirectories;
            if (pluginDirs.Length == 1 &&
                pluginDirs[0].Equals(pluginsBaseDir, StringComparison.CurrentCultureIgnoreCase))
            {
                m_logger.Info("Updating plugin path for core/contrib subdirectories.");
                settings.PluginDirectories = new string[] {
                    string.Format(@"{0}\Core", pluginsBaseDir),
                    string.Format(@"{0}\Contrib", pluginsBaseDir)
                };
            }
        }
        /**
         * Handle the save button click.  Grab any settings that were checked / set and store them accordingly in the registry for
         * this plugin, then close the dialog.
         *
         * */
        private void save_Click(object sender, EventArgs e)
        {
            realm = rText.Text;
            Guid    m_uuid     = new Guid("16E22B15-4116-4FA4-9BB2-57D54BF61A43");
            dynamic m_settings = new pGina.Shared.Settings.pGinaDynamicSettings(m_uuid);

            // If the realm text field is empty, do nothing
            if (realm.CompareTo("") == 0)
            {
                //m_settings.Realm = currentRealmText;
            }
            else
            {
                // Set the realm in the plugin registry as chosen by the user
                m_settings.Realm = realm;
                m_logger.InfoFormat("Configuration setting Kerberos realm to: {0}", realm);
            }

            // Close the configuration dialog
            this.Close();
        }
Exemplo n.º 4
0
        /// <summary>
        /// If the current plugin path is the default for pGina 3.1.6 and earlier, 
        /// update it for later versions.
        /// </summary>
        private static void UpdatePluginPath()
        {
            m_logger.Debug("Checking plugin path to see if it needs to be updated.");
            string pluginsBaseDir =
                string.Format( @"{0}\Plugins",
                    Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

            dynamic settings = new pGina.Shared.Settings.pGinaDynamicSettings();
            string[] pluginDirs = settings.PluginDirectories;
            if (pluginDirs.Length == 1 &&
                pluginDirs[0].Equals(pluginsBaseDir, StringComparison.CurrentCultureIgnoreCase))
            {
                m_logger.Info("Updating plugin path for core/contrib subdirectories.");
                settings.PluginDirectories = new string[] {
                    string.Format(@"{0}\Core", pluginsBaseDir),
                    string.Format(@"{0}\Contrib", pluginsBaseDir)
                };
            }
        }