Exemplo n.º 1
0
static BOOL OccupyLocationControl (HWND hwnd)
/*
	Function:
		Fills the location drop down box with the location names.

	Parameters:
		hwnd	- Handle to the dialog window.

	Returns:
		TRUE if successful.
*/
{
	HWND hwndCtl = GetDlgItem (hwnd, IDC_LOCATIONS);
	int hNode;
	int err;
	BOOL bSystem;
	char szObject[MAXOBJECTNAME];
   char szFilter[MAXOBJECTNAME];
   LPUCHAR aparents[MAXPLEVEL];
	LPTABLEPARAMS lptbl = GetDlgProp(hwnd);

	ZEROINIT(aparents);
	ZEROINIT(szObject);
	ZEROINIT(szFilter);

	aparents[0] = lptbl->DBName;

	hNode = GetCurMdiNodeHandle();
	bSystem = GetSystemFlag ();

	err = DOMGetFirstObject(hNode,
									OT_LOCATION,
									0,
									aparents,
									TRUE,
									NULL,
									szObject,
									NULL,
									NULL);

	while (err == RES_SUCCESS)
	{
      BOOL bOK;
      if (DOMLocationUsageAccepted(hNode,szObject,LOCATIONDATABASE,&bOK)==
          RES_SUCCESS && bOK) {
		   CAListBox_AddString(hwndCtl, szObject);
      }
		err = DOMGetNextObject (szObject, szFilter, NULL);
	}

	return TRUE;
}
Exemplo n.º 2
0
static BOOL OccupyCddsControl (HWND hwnd)
/*
   Function:
      Fills the CDDS number in list box.

   Parameters:
      hwnd   - Handle to the dialog window.

   Returns:
      TRUE if successful.
*/
{
   int hNode;
   UCHAR buffilter[MAXOBJECTNAME];
   UCHAR CddsName[MAXOBJECTNAME];
   LPUCHAR parentstrings [MAXPLEVEL];
   BOOL bSystem=FALSE;
   int ListErr;
   int err;
   BOOL bRetVal = TRUE;
   HWND hwndCtl = GetDlgItem (hwnd, IDC_CDDSNUMBER);
   LPRECONCILER lpdb  = GetDlgProp(hwnd);

   ZEROINIT (CddsName);
   hNode = GetCurMdiNodeHandle();
   parentstrings [0] = lpdb->DBName;
   
   CAListBox_ResetContent(hwndCtl);

   err = DOMGetFirstObject(hNode,
                           OT_REPLIC_CDDS,
                           1,
                           parentstrings,
                           bSystem,
                           NULL,
                           CddsName,
                           NULL,
                           NULL );
   
   while (err == RES_SUCCESS)
   {
     ListErr=CAListBox_AddString(hwndCtl, CddsName );
     if (ListErr == LB_ERR || ListErr == LB_ERRSPACE)
       bRetVal=FALSE;
     err = DOMGetNextObject (CddsName, buffilter, NULL);
   }

   return bRetVal;
}
Exemplo n.º 3
0
static void HandleUnknounObject (HWND hwnd)
{
   char message [100];
   HWND hwndGrantees    = GetDlgItem (hwnd, IDC_REVOKE_TABLE_GRANTEES);
   LPREVOKEPARAMS lprevoke = GetDlgProp (hwnd);
   HWND hwndLabel = GetDlgItem (hwnd, IDC_REVOKE_TABLE_LRGDG);  
   ShowWindow (GetDlgItem (hwnd, IDC_REVOKE_TABLE_USER  ), SW_HIDE);
   ShowWindow (GetDlgItem (hwnd, IDC_REVOKE_TABLE_GROUP ), SW_HIDE);
   ShowWindow (GetDlgItem (hwnd, IDC_REVOKE_TABLE_ROLE  ), SW_HIDE);
   ShowWindow (GetDlgItem (hwnd, IDC_REVOKE_TABLE_PUBLIC), SW_HIDE);

   LoadString    (hResource, (UINT)IDS_I_RG_on_DG, message, sizeof(message));
   SetWindowText (hwndLabel, message);
   ShowWindow (hwndLabel, SW_SHOW);
   CAListBox_AddString   (hwndGrantees, lprevoke->PreselectGrantee);
   CAListBox_SelectString(hwndGrantees, -1, lprevoke->PreselectGrantee); 
}
Exemplo n.º 4
0
static void FillGrantedUsers (HWND hwndCtl, LPREVOKEPARAMS lprevoke, int objectToFind)
{
   int     hdl, ires, gtype;
   BOOL    bwsystem;
   char    buf [MAXOBJECTNAME];
   char    buffilter [MAXOBJECTNAME];
   char    bufwithparent [MAXOBJECTNAME];
   LPUCHAR parentstrings [MAXPLEVEL];
   LPDOMDATA lpDomData =GetCurLpDomData ();

   ZEROINIT (buf);
   ZEROINIT (buffilter);
   hdl      = GetCurMdiNodeHandle ();
   bwsystem = GetSystemFlag ();
   
   if (!lpDomData)
       return;

   parentstrings [0] = lprevoke->DBName;   // Database name
   if (lprevoke->ObjectType != OT_VIEW)
       parentstrings [1] = StringWithOwner ((LPTSTR)Quote4DisplayIfNeeded(lprevoke->PreselectObject),
                                            lprevoke->PreselectObjectOwner, bufwithparent);
   else
       parentstrings [1] = StringWithOwner ((LPTSTR)Quote4DisplayIfNeeded(lprevoke->PreselectObject),
                                            lprevoke->PreselectObjectOwner, bufwithparent);

   ires = DOMGetFirstObject (hdl, objectToFind, 2, parentstrings, bwsystem, NULL, buf, NULL, NULL);
   while (ires == RES_SUCCESS)
   {
       gtype = DBA_GetObjectType  (buf, lpDomData);
       if (gtype == lprevoke->GranteeType)
       {
           CAListBox_AddString (hwndCtl, buf);
       }
       ires  = DOMGetNextObject (buf, buffilter, NULL);
   }
}
Exemplo n.º 5
0
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{

   LPSECURITYALARMPARAMS lpsecurity   = (LPSECURITYALARMPARAMS)lParam;
   HWND hwndUsers    = GetDlgItem (hwnd, IDC_SALARM_BYUSER );
   HWND hwndDB       = GetDlgItem (hwnd, IDC_SALARM_ONTABLE);
   HWND hwndDBE      = GetDlgItem (hwnd, IDC_SALARM_DBEVENT);
   HWND hwndCaptionDB= GetDlgItem (hwnd, IDC_SALARM_STATIC_DB);

   char szFormat [100];
   char szTitle  [180];

   if (!AllocDlgProp (hwnd, lpsecurity))
       return FALSE;

   bNoDisplayMessageDB = FALSE;
   //
   // force catolist.dll to load
   //
   CATOListDummy();

   if (lpsecurity->bInstallLevel) {
      SetWindowText (hwndCaptionDB, "On:");
      //"Create Security Alarm on Current Installation on %s"
      wsprintf (szTitle, ResourceString(IDS_F_CREATE_SECURITY),
                GetVirtNodeName ( GetCurMdiNodeHandle ()));
   }
   else {
      LoadString (hResource, (UINT)IDS_T_CREATE_SECURITY, szFormat, sizeof (szFormat));
      wsprintf (szTitle, szFormat,
                GetVirtNodeName ( GetCurMdiNodeHandle ()),
                lpsecurity->DBName);

   }


   
   SetWindowText (hwnd, szTitle);

   Edit_LimitText (GetDlgItem (hwnd, IDC_SALARM_DBEVENT_TEXT), MAXOBJECTNAME-1);
   ZEROINIT (szSecurityDBEvent);
   LoadString (hResource, (UINT)IDS_I_NODBEVENT, szSecurityDBEvent, sizeof (szSecurityDBEvent));

   //
   // Set the default to user
   //
   Button_SetCheck (GetDlgItem (hwnd, IDC_SALARM_USER), TRUE);

   //
   // Get the available users names and insert them into the CA list box 
   // 

   CAListBoxFillUsers (hwndUsers);

   //
   // Get the available DB names and insert them into the table list 
   // 
   if (lpsecurity->bInstallLevel) {
       char * pcurinst = ResourceString(IDS_CURRENT_INSTALLATION);
       CAListBox_AddString   (hwndDB,pcurinst);
       CAListBox_SelectString(hwndDB,-1,pcurinst);
       lpsecurity->iObjectType = OT_VIRTNODE;
       EnableWindow(hwndDB,FALSE);
       EnableWindow(hwndDBE,FALSE);
   }
   else  {
       CAListBoxFillDatabases (hwndDB);
       lpsecurity->iObjectType = OT_DATABASE;
   }

   if (!lpsecurity->bInstallLevel &&
       !ComboBoxFillDBevents (hwndDBE, "iidbdb"))
   {
       ComboBoxDestroyItemData (hwndDBE);
       return FALSE;
   }

   {
       int   k;
       char* buffowner;

       k = ComboBox_AddString (hwndDBE, szSecurityDBEvent);
       buffowner = ESL_AllocMem (x_strlen (szSecurityDBEvent) +1);
       x_strcpy (buffowner, szSecurityDBEvent);
       ComboBox_SetItemData (hwndDBE, k, buffowner);
       ComboBox_SelectString(hwndDBE, -1, szSecurityDBEvent);
       EnableControl (hwnd, FALSE);
   }

   PreCheckItem (hwnd);
   EnableDisableOKButton (hwnd);
   //
   // The value 9039 is defined in MAINMFC.H but is not accessible from this file:
   lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT (lpsecurity->bInstallLevel? 9039: (UINT)IDD_SECURITY_ALARM2));

   richCenterDialog (hwnd);
   return TRUE;
}