Example #1
0
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
    HWND hwndUser = GetDlgItem (hwnd, IDC_USR2GRP_USERBOX);
    LPGROUPUSERPARAMS lpusr2grp   = (LPGROUPUSERPARAMS)lParam;
    char szTitle  [MAX_TITLEBAR_LEN];
    char szFormat [150];

    if (!AllocDlgProp (hwnd, lpusr2grp))
        return FALSE;
    //
    // force catolist.dll to load
    //
    CATOListDummy();

    LoadString (hResource, (UINT)IDS_T_USR2GRP, szFormat, sizeof (szFormat));
    wsprintf   (
        szTitle,
        szFormat,
        lpusr2grp->GroupName,
        GetVirtNodeName ( GetCurMdiNodeHandle ()));

    SetWindowText (hwnd, szTitle);
    ComboBoxFillUsers (hwndUser);
    EnableDisableOKButton (hwnd);
    lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_USR2GRP));

    richCenterDialog (hwnd);
    return TRUE;
}
Example #2
0
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
   char    szFormat [100];
   char    szTitle  [MAX_TITLEBAR_LEN];

   LPLOCATEPARAMS lplocate = (LPLOCATEPARAMS)lParam;

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

   LoadString (hResource, (UINT)IDS_T_LOCATE, szFormat, sizeof (szFormat));
   wsprintf (szTitle, szFormat,  GetVirtNodeName (GetCurMdiNodeHandle ()));
   SetWindowText (hwnd, szTitle);
   lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_LOCATE));

   //
   // Load the string "(all)"
   //
   if (LoadString (hResource, (UINT)IDS_I_LOCATE_ALL, String_all, sizeof (String_all)) == 0)
       x_strcpy (String_all, "(all)");

   FillObjectTypes (hwnd);
   ComboBoxFillDatabases (GetDlgItem (hwnd, IDC_LOCATE_DATABASE));

   if (ComboBox_GetCount (GetDlgItem (hwnd, IDC_LOCATE_OBJECTTYPE)) > 0)
       ComboBox_SetCurSel(GetDlgItem (hwnd, IDC_LOCATE_OBJECTTYPE), 0);

   Edit_LimitText (GetDlgItem (hwnd, IDC_LOCATE_FIND), MAXOBJECTNAME -1);
   Edit_SetText   (GetDlgItem (hwnd, IDC_LOCATE_FIND), String_all);
   EnableDisableOKButton (hwnd);

   richCenterDialog(hwnd);
   return TRUE;
}
Example #3
0
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
   LPSECURITYALARMPARAMS lpsecurity   = (LPSECURITYALARMPARAMS)lParam;
   HWND    hwndUsers    = GetDlgItem (hwnd, IDC_REFALARM_BYUSER  );
   HWND    hwndDatabase = GetDlgItem (hwnd, IDC_REFALARM_DATABASE);
   HWND    hwndTables   = GetDlgItem (hwnd, IDC_REFALARM_ONTABLE );
   char    szTitle  [MAX_TITLEBAR_LEN];
   char    szFormat [100];
   char    szDatabaseName [MAXOBJECTNAME];

   if (!AllocDlgProp (hwnd, lpsecurity))
       return FALSE;
   //
   // force catolist.dll to load
   //
   CATOListDummy();

   LoadString (hResource, (UINT)IDS_T_CREATE_SECURITY, szFormat, sizeof (szFormat));

   wsprintf (szTitle, szFormat,
       GetVirtNodeName ( GetCurMdiNodeHandle ()),
       lpsecurity->DBName);
   SetWindowText (hwnd, szTitle);
   lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_REFALARM));

   //
   // Get the available database names and insert them into the combo box
   //
   ComboBoxFillDatabases (hwndDatabase);
   ComboBoxSelectFirstStr(hwndDatabase);
   ComboBox_GetText (hwndDatabase, szDatabaseName, sizeof (szDatabaseName));
   if (x_strlen (szDatabaseName) > 0)
       x_strcpy (lpsecurity->DBName, szDatabaseName);

   //
   // Get the available table names and insert them into the table list 
   //
   if (x_strlen (lpsecurity->DBName) > 0)
   {
       if (!CAListBoxFillTables (hwndTables, lpsecurity->DBName, FALSE))
       {
           CAListBoxDestroyItemData (hwndTables);
           return FALSE;
       }
   }
   //
   // Get the available users names and insert them into the CA list box 
   // 

   CAListBoxFillUsersP (hwndUsers);
   PreCheckItem (hwnd);
   EnableDisableOKButton (hwnd);

   richCenterDialog (hwnd);
   return TRUE;
}
Example #4
0
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
   LPSTORAGEPARAMS lpstructure = (LPSTORAGEPARAMS)lParam;
   char szFormat [100];
   char szTitle  [MAX_TITLEBAR_LEN];
   char buffer   [MAXOBJECTNAME];
   LPUCHAR parentstrings [MAXPLEVEL];

   HWND hwndContainer = GetDlgItem (hwnd, IDC_RELOCATE_CONTAINER);

   if (!AllocDlgProp (hwnd, lpstructure))
       return FALSE;
   parentstrings [0] = lpstructure->DBName;
   if (lpstructure->nObjectType == OT_TABLE)
   {
       LoadString (hResource, (UINT)IDS_T_RELOCATE_TABLE, szFormat, sizeof (szFormat));
       GetExactDisplayString (
           lpstructure->objectname,
           lpstructure->objectowner,
           OT_TABLE,
           parentstrings,
           buffer);
       lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_RELOCATE));
   }
   else
   {
       LoadString (hResource, (UINT)IDS_T_RELOCATE_INDEX, szFormat, sizeof (szFormat));
       GetExactDisplayString (
           lpstructure->objectname,
           lpstructure->objectowner,
           OT_INDEX,
           parentstrings,
           buffer);
       lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_RELOC_IDX));
   }

   wsprintf (
       szTitle,
       szFormat,
       GetVirtNodeName (GetCurMdiNodeHandle ()),
       lpstructure->DBName,
       buffer);
   SetWindowText (hwnd, szTitle);
   
   //DuplicateLocationList   (hwnd);
   InitContainer           (hwndContainer, hwnd, 2);
   ContainerDisableDisplay (hwndContainer);
   FillAllData             (hwnd);
   ContainerEnableDisplay  (hwndContainer, TRUE);
   richCenterDialog        (hwnd);

   return TRUE;
}
Example #5
0
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
   LPGRANTPARAMS lpgrant = (LPGRANTPARAMS)lParam;
   HWND hwndGrantees  = GetDlgItem (hwnd, IDC_GRANT_DBEVENT_GRANTEES);
   HWND hwndDBevents  = GetDlgItem (hwnd, IDC_GRANT_DBEVENT_DBEVENT);
   char szTitle [MAX_TITLEBAR_LEN];
   char szFormat[100];
   //
   // force catolist.dll to load
   //
   CATOListDummy();

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

   LoadString (hResource, (UINT)IDS_T_GRANT_DBEVENT, szFormat, sizeof (szFormat));
   wsprintf (szTitle,
       szFormat,
       GetVirtNodeName (GetCurMdiNodeHandle ()),
       lpgrant->DBName);
   SetWindowText (hwnd, szTitle);
   lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_GRANT_DBEVENT));

   Button_SetCheck (GetDlgItem (hwnd, IDC_GRANT_DBEVENT_USER), TRUE);
   FillGrantees (hwndGrantees, OT_USER);

   if (!CAListBoxFillDBevents (hwndDBevents, lpgrant->DBName))
       CAListBoxDestroyItemData (hwndDBevents);

   if (lpgrant->PreselectPrivileges [GRANT_RAISE])
       Button_SetCheck (GetDlgItem (hwnd, IDC_GRANT_DBEVENT_RAISE),    TRUE);
   if (lpgrant->PreselectPrivileges [GRANT_REGISTER])
       Button_SetCheck (GetDlgItem (hwnd, IDC_GRANT_DBEVENT_REGISTER), TRUE);

   if (x_strlen (lpgrant->PreselectGrantee) > 0)
       CAListBox_SelectString (hwndGrantees, -1, lpgrant->PreselectGrantee);
   if (x_strlen (lpgrant->PreselectObject) > 0)
       CAListBoxSelectStringWithOwner (hwndDBevents, lpgrant->PreselectObject, lpgrant->PreselectObjectOwner);
   EnableDisableOKButton  (hwnd);
   
   richCenterDialog(hwnd);
   return TRUE;
}
Example #6
0
static BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
   int  nProd = 0;
   char Title[200];
   HWND hwndProducts   = GetDlgItem(hwnd, IDC_PRODUCTS);
   HWND hwndTables     = GetDlgItem(hwnd, IDC_TABLES);
   HWND hwndtableall   = GetDlgItem(hwnd, IDC_TABLE_ALL);
   HWND hwndproductall = GetDlgItem(hwnd, IDC_PRODUCT_ALL);
   
   LPRECONCILER lpmod = (LPRECONCILER)lParam;
   
   ZEROINIT (Title);

   if (!AllocDlgProp(hwnd, lpmod))
      return FALSE;
   lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_RECONCILER));
   
   //Fill the windows title bar
   GetWindowText(hwnd,Title,GetWindowTextLength(hwnd)+1);
   x_strcat(Title, " ");
   x_strcat(Title, GetVirtNodeName ( GetCurMdiNodeHandle ()));
   x_strcat(Title, "::");
   x_strcat(Title,lpmod->DBName);

   SetWindowText(hwnd,Title);

   if (!OccupyDbnumberControl(hwnd)
    || !OccupyCddsControl(hwnd))
   {
     ASSERT(NULL);
     EndDialog(hwnd, FALSE);
     return TRUE;
   }
	
   InitialiseEditControls(hwnd);
   EnableDisableOKButton (hwnd);
   richCenterDialog(hwnd);
   return TRUE;
}
Example #7
0
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
   LPREPLMAILPARAMS lpmail = (LPREPLMAILPARAMS)lParam;
   HWND hwndMailText   = GetDlgItem (hwnd, IDC_MAIL_TEXT);
   char szFormat[100];
   char szTitle [MAX_TITLEBAR_LEN];

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

   LoadString (hResource, (UINT)IDS_T_MAIL, szFormat, sizeof (szFormat));
   wsprintf (szTitle,
       szFormat,
       GetVirtNodeName (GetCurMdiNodeHandle ()),
       lpmail->DBName);
   SetWindowText (hwnd, szTitle);
   lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_MAIL));

   Edit_LimitText (hwndMailText, MAX_MAIL_TEXTLEN-1);
   EnableDisableOKButton (hwnd);
       
   richCenterDialog(hwnd);
   return TRUE;
}
Example #8
0
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
   LPGRANTPARAMS lpgrant = (LPGRANTPARAMS)lParam;
   HWND    hwndDatabases = GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_DATABASES);
   HWND    hwndGrantees  = GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_GRANTEES);
   HWND    hwndProcedures= GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_PROCEDURES);
   UCHAR   szDatabaseName[MAXOBJECTNAME];
   char    szTitle [MAX_TITLEBAR_LEN];
   char    szFormat[100];

   if (!AllocDlgProp (hwnd, lpgrant))
       return FALSE;
   //
   // force catolist.dll to load
   //
   CATOListDummy();
   if (lpgrant->ObjectType == OT_PROCEDURE)
      LoadString (hResource, (UINT)IDS_T_GNREF_PROCEDURE, szFormat, sizeof (szFormat));
   else
      LoadString (hResource, (UINT)IDS_T_GNREF_SEQUENCE, szFormat, sizeof (szFormat));

   wsprintf (
       szTitle,
       szFormat,
       GetVirtNodeName (GetCurMdiNodeHandle ()));

   SetWindowText (hwnd, szTitle);
   if (lpgrant->ObjectType == OT_PROCEDURE)
      lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_GNREF_PROCEDURE));
   else
      lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)ID_HELPID_GNREF_SEQUENCE));


   if (lpgrant->GranteeType == OT_GROUP)
   {
       Button_SetCheck (GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_GROUP), TRUE);
       FillGrantees (hwndGrantees, lpgrant->GranteeType);
   }
   else
   if (lpgrant->GranteeType == OT_ROLE)
   {
       Button_SetCheck (GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_ROLE),  TRUE);
       FillGrantees (hwndGrantees, lpgrant->GranteeType);
   }
   else
   {
       if  (x_strcmp (lpgrant->PreselectGrantee, lppublicdispstring()) == 0)
           Button_SetCheck (GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_PUBLIC), TRUE);
       else
       {
           Button_SetCheck (GetDlgItem (hwnd, IDC_GNREF_PROCEDURE_USER),   TRUE);
           lpgrant->GranteeType = OT_USER;
           FillGrantees (hwndGrantees, lpgrant->GranteeType);
       }
   }

   ComboBoxFillDatabases  (hwndDatabases);
   ComboBoxSelectFirstStr (hwndDatabases);
   ComboBox_GetText (hwndDatabases, szDatabaseName, sizeof (szDatabaseName));
   x_strcpy (lpgrant->DBName, szDatabaseName);
   
   if (lpgrant->ObjectType == OT_PROCEDURE) {
      if (!CAListBoxFillProcedures (hwndProcedures, szDatabaseName))
         CAListBoxDestroyItemData (hwndProcedures);
   }
   else {
       ShowWindow( GetDlgItem (hwnd,IDC_GNREF_PROCEDURE_OPTION) ,SW_HIDE);// Hided "With grant Option" control
       LoadString (hResource, (UINT)IDS_STATIC_SEQUENCE, szFormat, sizeof (szFormat));
       SetDlgItemText(  hwnd, IDC_STATIC_GNREF_PROCEDURE, szFormat ); 

       if (!CAListBoxFillSequences (hwndProcedures, lpgrant->DBName))
           CAListBoxDestroyItemData (hwndProcedures);
   }

   if (x_strlen (lpgrant->PreselectGrantee) > 1)
      PreselectGrantee (hwndGrantees, lpgrant->PreselectGrantee);
   if (x_strlen (lpgrant->PreselectObject) > 1)
      CAListBoxSelectStringWithOwner (hwndProcedures, lpgrant->PreselectObject, lpgrant->PreselectObjectOwner);
   EnableDisableOKButton (hwnd);

   richCenterDialog(hwnd);
   return TRUE;
}
Example #9
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;
}
Example #10
0
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
   LPREVOKEPARAMS lprevoke = (LPREVOKEPARAMS)lParam;
   HWND hwndGrantees    = GetDlgItem (hwnd, IDC_REVOKE_TABLE_GRANTEES);
   char szTitle [90];
   char szStr   [MAX_TITLEBAR_LEN];
   int  i, positive_privilege;
   BOOL bGrantAll = FALSE;
   char buffer  [MAXOBJECTNAME];
   LPUCHAR parentstrings [MAXPLEVEL];

   if (!AllocDlgProp (hwnd, lprevoke))
       return FALSE;
   //
   // force catolist.dll to load
   //
   CATOListDummy();


   for (i = 0; i < GRANT_MAX_PRIVILEGES; i++)
   {
       if (lprevoke->PreselectPrivileges [i])
       {
           positive_privilege = i;
           break;
       }
   }

   switch (lprevoke->ObjectType)
   {
       case OT_TABLE:
           lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_REVOKE_TABLE));
           break;
       case OT_VIEW:
           lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_REVOKE_VIEW));
           break;
       case OT_DBEVENT:
           lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_REVOKE_DBEVENT));
           break;
       case OT_PROCEDURE:
           lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_RVKGPROC));
           break;
       case OT_SEQUENCE:
           lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_RVKGSEQUENCE));
           break;
   }

   switch (positive_privilege)
   {
       case GRANT_SELECT    :
           LoadString (hResource, (UINT)IDS_T_REVOKE_SELECT_ON, szTitle, sizeof (szTitle));
           lprevoke->Privileges [GRANT_SELECT] = TRUE;
           if (lprevoke->ObjectType == OT_TABLE)
               HaveBeenGranted = OT_TABLEGRANT_SEL_USER;
           else
               HaveBeenGranted = OT_VIEWGRANT_SEL_USER;
           break;
       case GRANT_INSERT    :
           LoadString (hResource, (UINT)IDS_T_REVOKE_INSERT_ON, szTitle, sizeof (szTitle));
           lprevoke->Privileges [GRANT_INSERT] = TRUE;
           if (lprevoke->ObjectType == OT_TABLE)
               HaveBeenGranted = OT_TABLEGRANT_INS_USER;
           else
               HaveBeenGranted = OT_VIEWGRANT_INS_USER;
           break;
       case GRANT_UPDATE    :
           LoadString (hResource, (UINT)IDS_T_REVOKE_UPDATE_ON, szTitle, sizeof (szTitle));
           lprevoke->Privileges [GRANT_UPDATE] = TRUE;
           if (lprevoke->ObjectType == OT_TABLE)
               HaveBeenGranted = OT_TABLEGRANT_UPD_USER;
           else
               HaveBeenGranted = OT_VIEWGRANT_UPD_USER;
           break;
       case GRANT_DELETE    :
           LoadString (hResource, (UINT)IDS_T_REVOKE_DELETE_ON, szTitle, sizeof (szTitle));
           lprevoke->Privileges [GRANT_DELETE] = TRUE;
           if (lprevoke->ObjectType == OT_TABLE)
               HaveBeenGranted = OT_TABLEGRANT_DEL_USER;
           else
               HaveBeenGranted = OT_VIEWGRANT_DEL_USER;
           break;
       case GRANT_COPY_INTO :
           LoadString (hResource, (UINT)IDS_T_REVOKE_COPYINTO_ON, szTitle, sizeof (szTitle));
           lprevoke->Privileges [GRANT_COPY_INTO] = TRUE;
           HaveBeenGranted = OT_TABLEGRANT_CPI_USER;
           break;
       case GRANT_COPY_FROM :
           LoadString (hResource, (UINT)IDS_T_REVOKE_COPYFROM_ON, szTitle, sizeof (szTitle));
           lprevoke->Privileges [GRANT_COPY_FROM] = TRUE; 
           HaveBeenGranted = OT_TABLEGRANT_CPF_USER;
           break;
       case GRANT_REFERENCE :
           LoadString (hResource, (UINT)IDS_T_REVOKE_REFERENCE_ON, szTitle, sizeof (szTitle));
           lprevoke->Privileges [GRANT_REFERENCE] = TRUE;
           HaveBeenGranted = OT_TABLEGRANT_REF_USER;
           break;
       case GRANT_RAISE     :
           LoadString (hResource, (UINT)IDS_T_REVOKE_RAISE_ON, szTitle, sizeof (szTitle));
           lprevoke->Privileges [GRANT_RAISE] = TRUE;
           HaveBeenGranted = OT_DBEGRANT_RAISE_USER;
           break;
       case GRANT_REGISTER  :
           LoadString (hResource, (UINT)IDS_T_REVOKE_REGISTER_ON, szTitle, sizeof (szTitle));
           lprevoke->Privileges [GRANT_REGISTER] = TRUE;
           HaveBeenGranted = OT_DBEGRANT_REGTR_USER;
           break;
       case GRANT_EXECUTE   :
           LoadString (hResource, (UINT)IDS_T_REVOKE_EXECUTE_ON, szTitle, sizeof (szTitle));
           lprevoke->Privileges [GRANT_EXECUTE] = TRUE;
           HaveBeenGranted = OT_PROCGRANT_EXEC_USER;
           break;
       case GRANT_NEXT_SEQUENCE   :
           LoadString (hResource, (UINT)IDS_T_REVOKE_NEXT_SEQUENCE_ON, szTitle, sizeof (szTitle));
           lprevoke->Privileges [GRANT_NEXT_SEQUENCE] = TRUE;
           HaveBeenGranted = OT_SEQUGRANT_NEXT_USER;
           break;
       case GRANT_ALL       :
           LoadString (hResource, (UINT)IDS_T_REVOKE_ALL_ON, szTitle, sizeof (szTitle));
           lprevoke->Privileges [GRANT_ALL] = TRUE;
           bGrantAll = TRUE;
           switch (lprevoke->ObjectType)
           {
               case OT_TABLE:
                   break;
               case OT_PROCEDURE:
                   break;
               case OT_DBEVENT:
                   break;

           }
           HaveBeenGranted = -1;
           break;
   }

   parentstrings [0] = lprevoke->DBName;
   GetExactDisplayString (
       lprevoke->PreselectObject,
       lprevoke->PreselectObjectOwner,
       lprevoke->ObjectType,
       parentstrings,
       buffer);

   wsprintf (
       szStr,
       szTitle,
       GetVirtNodeName ( GetCurMdiNodeHandle ()),
       lprevoke->DBName,
       buffer);
   SetWindowText (hwnd, szStr);

   if ( lprevoke->ObjectType == OT_SEQUENCE)
   {
      //Hide control the controls not used for sequences
      ShowWindow( GetDlgItem (hwnd,IDC_REVOKE_TABLE_GRANT_OPTION) ,SW_HIDE); // Hided "With grant Option" control
      ShowWindow( GetDlgItem (hwnd,IDC_REVOKE_TABLE_PRIVILEGE)    ,SW_HIDE); 
      ShowWindow( GetDlgItem (hwnd,102)                           ,SW_HIDE);
      ShowWindow( GetDlgItem (hwnd,5020)                          ,SW_HIDE);
      // Unchecked the controls not used
      Button_SetCheck (GetDlgItem (hwnd, IDC_REVOKE_TABLE_PRIVILEGE),    FALSE);
      Button_SetCheck (GetDlgItem (hwnd, IDC_REVOKE_TABLE_CASCADE),      TRUE);
      Button_SetCheck (GetDlgItem (hwnd, IDC_REVOKE_TABLE_RESTRICT),     FALSE);
      Button_SetCheck (GetDlgItem (hwnd, IDC_REVOKE_TABLE_GRANT_OPTION), FALSE);
   }
   else
   {
      Button_SetCheck (GetDlgItem (hwnd, IDC_REVOKE_TABLE_PRIVILEGE),TRUE);
      Button_SetCheck (GetDlgItem (hwnd, IDC_REVOKE_TABLE_CASCADE),  TRUE);
   }

   if (lprevoke->GranteeType == OT_UNKNOWN)
   {
       HandleUnknounObject (hwnd);
   }
   else   
   if (lprevoke->GranteeType == OT_GROUP)
   {
       Button_SetCheck (GetDlgItem (hwnd, IDC_REVOKE_TABLE_GROUP), TRUE);
       FillGrantedUsers(hwndGrantees, lprevoke, HaveBeenGranted);
   }
   else
   if (lprevoke->GranteeType == OT_ROLE)
   {
       Button_SetCheck (GetDlgItem (hwnd, IDC_REVOKE_TABLE_ROLE),  TRUE);
       FillGrantedUsers(hwndGrantees, lprevoke, HaveBeenGranted);
   }
   else
   {
       if  (x_strcmp (lprevoke->PreselectGrantee, lppublicdispstring()) == 0)
           Button_SetCheck (GetDlgItem (hwnd, IDC_REVOKE_TABLE_PUBLIC),  TRUE);
       else
       {
           lprevoke->GranteeType = OT_USER;
           Button_SetCheck (GetDlgItem (hwnd, IDC_REVOKE_TABLE_USER),  TRUE);
           FillGrantedUsers(hwndGrantees, lprevoke, HaveBeenGranted);
       }
   }

   if (x_strlen (lprevoke->PreselectGrantee) > 0)
   {
       CAListBox_SelectString (hwndGrantees, -1, lprevoke->PreselectGrantee);
   }

   if (lprevoke->GranteeType != OT_UNKNOWN)
       EnableDisableOKButton  (hwnd);
   
   richCenterDialog(hwnd);
   return TRUE;
}
Example #11
0
static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
   HWND hwndActionUser = GetDlgItem (hwnd, IDC_AUDITDB_ACTION_USER);
   LPAUDITDBPARAMS lpauditdb  = (LPAUDITDBPARAMS)lParam;
   char szFormat [100];
   char szTitle  [MAX_TITLEBAR_LEN];

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

   ZEROINIT (table);
   table.bRefuseTblWithDupName = TRUE;
   table.lpTable = NULL;
   lpfile        = NULL;

   LoadString (hResource, (UINT)IDS_T_AUDITDB, szFormat, sizeof (szFormat));
   wsprintf (szTitle, szFormat,
       GetVirtNodeName ( GetCurMdiNodeHandle ()),
       lpauditdb->DBName);
   lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_AUDITDB));

   if (lpauditdb->bStartSinceTable)
   {
     LPOBJECTLIST obj;
     char sztemp[MAXOBJECTNAME];
     // Title
     wsprintf( sztemp ," , table %s",lpauditdb->szDisplayTableName);
     lstrcat(szTitle,sztemp);
     // Fill Object List
     obj = AddListObject (table.lpTable, x_strlen (lpauditdb->szCurrentTableName) +1);
     if (obj)
     {
       lstrcpy ((UCHAR *)obj->lpObject,lpauditdb->szCurrentTableName );
       table.lpTable = obj;
     }
     else
     {
       ErrorMessage   ((UINT)IDS_E_CANNOT_ALLOCATE_MEMORY, RES_ERR);
       table.lpTable = NULL;
     }
     lpfile = AddElement (lpfile,lpauditdb->szCurrentTableName );
     AddFile (hwnd, lpfile);

     ShowWindow      (GetDlgItem (hwnd, IDC_EDIT_TABLE_NAME)  ,SW_SHOW);
     ShowWindow      (GetDlgItem (hwnd, IDC_STATIC_TABLE_NAME),SW_SHOW);
     ShowWindow      (GetDlgItem (hwnd, IDC_AUDITDB_IDTABLE)  ,SW_HIDE);
     SetWindowText   (GetDlgItem (hwnd, IDC_EDIT_TABLE_NAME)  ,lpauditdb->szDisplayTableName );
     EnableWindow    (GetDlgItem (hwnd, IDC_EDIT_TABLE_NAME)  ,FALSE );
     Button_SetCheck (GetDlgItem (hwnd, IDC_AUDITDB_TABLES)   ,BST_CHECKED);
     EnableWindow    (GetDlgItem (hwnd, IDC_AUDITDB_TABLES)   ,FALSE );
   }
   SetWindowText (hwnd, szTitle);

   InitializeControls     (hwnd);

   ComboBoxFillUsers (hwndActionUser);
   EnableDisableOKButton (hwnd);
   EnableDisableControls (hwnd);

   richCenterDialog(hwnd);
   return TRUE;
}
Example #12
0
static BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
	LPTABLEPARAMS lptbl = (LPTABLEPARAMS)lParam;

	if (!AllocDlgProp(hwnd, lptbl))
		return FALSE;
    //
    // OpenIngres Version 2.0 only
    // Initialize the Combobox of page_size.
    ComboBox_InitPageSize (hwnd, lptbl->uPage_size);

    if (GetOIVers() == OIVERS_12)
    {
        ShowWindow (GetDlgItem (hwnd, IDC_STATIC_PS), SW_HIDE);
        ShowWindow (GetDlgItem (hwnd, IDC_COMBOPAGESIZE), SW_HIDE);
    }
    else
    {
        ShowWindow (GetDlgItem (hwnd, IDC_STATIC_PS), SW_SHOW);
        ShowWindow (GetDlgItem (hwnd, IDC_COMBOPAGESIZE), SW_SHOW);
    }

	if (GetOIVers() >= OIVERS_30)
	{
		HWND hwndC = GetDlgItem(hwnd, IDC_STATIC1);
		if (hwndC)
			ShowWindow (hwndC, SW_HIDE);
		hwndC = GetDlgItem(hwnd, IDC_LABEL_GRAN);
		if (hwndC)
			ShowWindow (hwndC, SW_HIDE);
	}
	if (!OccupyLabelControl(hwnd)
	 || !OccupyAuditOptionControl(hwnd)
	 || !OccupyAuditKeyControl(hwnd)
	 || !OccupyLocationControl(hwnd))
	{
		ASSERT(NULL);
		return FALSE;
	}

   CheckDlgButton(hwnd, IDC_JOURNALING, lptbl->bJournaling);
   CheckDlgButton(hwnd, IDC_DUPLICATES, lptbl->bDuplicates);

   if (lptbl->nSecAudit != USE_DEFAULT)
   {
      SelectComboBoxItem(GetDlgItem(hwnd, IDC_SEC_AUDIT_OPTION),
                         auditTypes,
                         lptbl->nSecAudit);
   }

   if (lptbl->nLabelGran != USE_DEFAULT)
   {
      SelectComboBoxItem(GetDlgItem(hwnd, IDC_LABEL_GRAN),
                         labelTypes,
                         lptbl->nLabelGran);
   }

   if (*lptbl->szSecAuditKey)
   {
      ComboBox_SelectString(GetDlgItem(hwnd, IDC_SEC_AUDIT_KEY),
                            -1,
                            lptbl->szSecAuditKey);
   }

   if (lptbl->lpLocations)
   {
      LPOBJECTLIST lplist = lptbl->lpLocations;

      while (lplist)
      {
         LPCHECKEDOBJECTS lpObj = (LPCHECKEDOBJECTS)lplist->lpObject;

         CAListBox_SelectString(GetDlgItem(hwnd, IDC_LOCATIONS),
                                -1,
                                lpObj->dbname);

         lplist = lplist->lpNext;
      }
   }
   if (GetOIVers() != OIVERS_12)
     lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_OIV2_TABLESTRUCT));
   else
     lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_TABLESTRUCT));
	richCenterDialog(hwnd);

	return TRUE;
}