Esempio n. 1
0
        protected override bool OnShowInitializationWizard()
        {
            bizilante.SSO.Helper.SSO sSO = new bizilante.SSO.Helper.SSO();
            sSO.GetSecretServerName();
            WindowsPrincipal windowsPrincipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
            bool             flag             = windowsPrincipal.IsInRole(sSO.SSOAdminGroup);
            bool             flag2            = windowsPrincipal.IsInRole(sSO.AffiliateAppMgrGroup);

            return(flag || flag2);
        }
Esempio n. 2
0
 public static void ValidateServerDatabase(NameValueCollection nameValueArgs)
 {
     Trace.WriteLine("Validating Server and Database parameters...");
     if ((nameValueArgs["Server"] != null) && (nameValueArgs["Server"].Length > 0))
     {
         if ((nameValueArgs["Database"] == null) || (nameValueArgs["Database"].Length == 0))
         {
             throw new CommandLineArgumentException(CommandResources.GetString(CommandResources.ResourceID.DatabaseNotSpecified), "Database", System.Diagnostics.TraceLevel.Error);
         }
     }
     else
     {
         bizilante.SSO.Helper.SSO sso = new bizilante.SSO.Helper.SSO();
         sso.GetSecretServerName();
         nameValueArgs.Set("Server", sso.DBServer);
         if ((nameValueArgs["Database"] == null) || (nameValueArgs["Database"].Length == 0))
         {
             nameValueArgs.Set("Database", sso.DB);
         }
     }
     ValidateServer(nameValueArgs["Server"]);
     ValidateDatabase(nameValueArgs["Database"]);
 }
Esempio n. 3
0
 public ApplicationScopeNode(string applicationName, bool isRootNode)
 {
     if (!ActionsSnapIn.HasSecurityRights)
     {
         bizilante.SSO.Helper.SSO sSO = new bizilante.SSO.Helper.SSO();
         sSO.GetSecretServerName();
         WindowsPrincipal windowsPrincipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
         _ssoAdminResult = windowsPrincipal.IsInRole(sSO.SSOAdminGroup);
         ActionsSnapIn.HasSecurityRights = _ssoAdminResult;
     }
     if (ActionsSnapIn.HasSecurityRights)
     {
         DisplayName = applicationName;
         if (!isRootNode)
         {
             MmcListViewDescription mmcListViewDescription = new MmcListViewDescription();
             mmcListViewDescription.DisplayName = applicationName;
             mmcListViewDescription.ViewType    = typeof(UserListView);
             mmcListViewDescription.Options     = MmcListViewOptions.SingleSelect;
             ViewDescriptions.Add(mmcListViewDescription);
             ViewDescriptions.DefaultIndex = 0;
         }
         ImageIndex         = 0;
         SelectedImageIndex = 0;
         if (DisplayName == "_NewApplication")
         {
             EnabledStandardVerbs = StandardVerbs.Rename;
         }
         Microsoft.ManagementConsole.Action actionExport =
             new Microsoft.ManagementConsole.Action("Export Application", "Exports the Key/Value Pairs for this application", -1, "Export");
         Microsoft.ManagementConsole.Action actionAdd =
             new Microsoft.ManagementConsole.Action("Add Application", "Adds a new Application", -1, "Add_Application");
         Microsoft.ManagementConsole.Action actionAddKvp =
             new Microsoft.ManagementConsole.Action("Add Key Value Pair", "Adds Key Value Pair", -1, "Add_KeyValue");
         Microsoft.ManagementConsole.Action actionDelete =
             new Microsoft.ManagementConsole.Action("Delete Application", "Deletes the Application", -1, "Delete");
         Microsoft.ManagementConsole.Action actionImport =
             new Microsoft.ManagementConsole.Action("Import Application", "Imports the Key/Value Pairs for an Application", -1, "Import");
         ActionsPaneItems.Add(actionAdd);
         if (isRootNode)
         {
             actionExport.Enabled = false;
         }
         else
         {
             actionAdd.Enabled = false;
             ActionsPaneItems.Add(actionAddKvp);
             ActionsPaneItems.Add(actionDelete);
         }
         ActionsPaneItems.Add(actionImport);
         ActionsPaneItems.Add(actionExport);
         return;
     }
     DisplayName = applicationName + " - No Access Rights!";
     if (!isRootNode)
     {
         MmcListViewDescription mmcListViewDescription2 = new MmcListViewDescription();
         mmcListViewDescription2.DisplayName = applicationName + " - No Access Rights!";
         mmcListViewDescription2.Options     = MmcListViewOptions.HideSelection;
         ViewDescriptions.Add(mmcListViewDescription2);
     }
 }