Beispiel #1
0
void Group_ShowCreate (HWND hParent)
{
   LPCREATEGROUPDLG lpp = New (CREATEGROUPDLG);
   memset (lpp, 0x00, sizeof(CREATEGROUPDLG));
   memcpy (&lpp->Advanced, &gr.CreateGroup, sizeof(GROUPPROPINFO));
   lpp->Advanced.pMembers = NULL;
   lpp->Advanced.pGroupsOwner = NULL;

   (void)ModalDialogParam (IDD_NEWGROUP, hParent, (DLGPROC)Group_Create_DlgProc, (LPARAM)lpp);

   if (lpp->Advanced.pMembers)
      asc_AsidListFree (&lpp->Advanced.pMembers);
   if (lpp->Advanced.pGroupsOwner)
      asc_AsidListFree (&lpp->Advanced.pGroupsOwner);
   Delete (lpp);
}
Beispiel #2
0
void Main_SetMenus (void)
{
   HMENU hm = GetMenu (g.hMain);
   LPASIDLIST pSel = Display_GetSelectedList();

   Main_SetViewMenus (hm);

   // Fix the Operations In Progress entry
   //
   CheckMenu (hm, M_ACTIONS, gr.fShowActions);

   // Fix the CellProperties and Edit.* menu items. Many get disabled if there
   // is no selection
   //
   BOOL fEnable = (pSel && pSel->cEntries) ? TRUE : FALSE;
   EnableMenu (hm, M_DELETE, fEnable);
   EnableMenu (hm, M_REFRESH, fEnable);
   EnableMenu (hm, M_MEMBERSHIP, fEnable);
   EnableMenu (hm, M_PROPERTIES, fEnable);

   if ((fEnable = (pSel && (pSel->cEntries == 1))) == TRUE)
      {
      // Make sure it's a group
      ASOBJTYPE Type;
      if (!asc_ObjectTypeGet_Fast (g.idClient, g.idCell, pSel->aEntries[0].idObject, &Type))
         fEnable = FALSE;
      else if (Type != TYPE_GROUP)
         fEnable = FALSE;
      }

   EnableMenu (hm, M_RENAME, fEnable);

   if (pSel)
      asc_AsidListFree (&pSel);
}
Beispiel #3
0
void EnumeratePrincipalsRemotely (LPBROWSEDIALOGPARAMS pbdp, UINT_PTR idClient)
{
   ULONG status;

   // Open the relevant cell
   //
   ASID idCell;
   if (asc_CellOpen (idClient, (PVOID)pbdp->hCreds, pbdp->szThreadCell, AFSADMSVR_SCOPE_USERS, &idCell, &status))
   {
      // Obtain a list of ASIDs from the admin server, each representing
      // a principal which we want to show.
      //
      LPASIDLIST pAsidList;
      if (asc_ObjectFindMultiple (idClient, idCell, TYPE_USER, NULL, NULL, &pAsidList, &status))
      {
         if (pAsidList)
         {
            // Obtain rudimentary properties (e.g., their names) for these ASIDs
            //
            LPASOBJPROPLIST pPropList;
            if (asc_ObjectPropertiesGetMultiple (idClient, GET_RUDIMENTARY_DATA, idCell, pAsidList, &pPropList, &status))
            {
               if (pPropList)
               {
                  // Use the information in {pPropList} to populate the display
                  //
                  for (size_t iEntry = 0; iEntry < pPropList->cEntries; ++iEntry)
                  {
                     LPTSTR pszName;
                     if ((pszName = CloneString (pPropList->aEntries[ iEntry ].ObjectProperties.szName)) != NULL)
                     {
                        PostMessage (pbdp->hDlg, WM_FOUNDNAME, 0, (LPARAM)pszName);
                        // pszName freed by DlgProc_Browse when it receives the message
                     }
                  }

                  asc_ObjPropListFree (&pPropList);
               }
            }

            asc_AsidListFree (&pAsidList);
         }
      }

      asc_CellClose (idClient, idCell, &status);
   }
}
Beispiel #4
0
EXPORTED BOOL ADMINAPI AfsAppLib_asc_AsidListFree (LPASIDLIST *ppList)
{
   return asc_AsidListFree (ppList);
}