~ubuntu-branches/debian/sid/pgadmin3/sid

« back to all changes in this revision

Viewing changes to pgadmin/dlg/dlgUser.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2009-07-30 12:27:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730122716-fddbh42on721bbs2
Tags: 1.10.0-1
* New upstream release.
* Adjusted watch file to match release candidates.
* Updated to Standards-Version 3.8.2:
  - Moved to Section: database.
  - Add DEB_BUILD_OPTIONS support for parallel building.
  - Move from findstring to filter suggestion for DEB_BUILD_OPTIONS parsing.
* pgagent got split into its own separate source package by upstream.
* Exclude Docs.vcproj from installation.
* Move doc-base.enus from pgadmin3 to pgadmin3-data package, the files are
  in there too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//////////////////////////////////////////////////////////////////////////
2
2
//
3
3
// pgAdmin III - PostgreSQL Tools
4
 
// RCS-ID:      $Id: dlgUser.cpp 6953 2008-01-03 15:20:23Z dpage $
5
 
// Copyright (C) 2002 - 2008, The pgAdmin Development Team
6
 
// This software is released under the Artistic Licence
 
4
// RCS-ID:      $Id: dlgUser.cpp 7758 2009-03-26 20:49:59Z dpage $
 
5
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
 
6
// This software is released under the BSD Licence
7
7
//
8
8
// dlgUser.cpp - PostgreSQL User Property
9
9
//
156
156
            chkCreateUser->Disable();
157
157
            datValidUntil->Disable();
158
158
            timValidUntil->Disable();
159
 
            txtPasswd->Disable();
160
 
            txtRePasswd->Disable();
161
159
            btnAddGroup->Disable();
162
160
            btnDelGroup->Disable();
163
161
            cbVarname->Disable();
164
162
            txtValue->Disable();
165
 
            btnAdd->Disable();
166
163
            btnRemove->Disable();
 
164
            if (connection->GetUser() != user->GetName())
 
165
            {
 
166
                txtPasswd->Disable();
 
167
                txtRePasswd->Disable();
 
168
                btnAdd->Disable();
 
169
            }
 
170
            else
 
171
            {
 
172
                txtPasswd->Enable();
 
173
                txtRePasswd->Enable();
 
174
                btnAdd->Enable();
 
175
            }
167
176
        }
168
177
    }
169
178
    else
388
397
 
389
398
wxString dlgUser::GetSql()
390
399
{
 
400
    int pos;
391
401
    wxString sql;
392
402
    wxString name=GetName();
393
403
    
439
449
        wxArrayString tmpGroups=user->GetGroupsIn();
440
450
 
441
451
        // check for added groups
442
 
        for (int pos=0 ; pos < cnt ; pos++)
 
452
        for (pos=0 ; pos < cnt ; pos++)
443
453
        {
444
454
            wxString groupName=lbGroupsIn->GetString(pos);
445
455
 
452
462
        }
453
463
        
454
464
        // check for removed groups
455
 
        for (int pos=0 ; pos < (int)tmpGroups.GetCount() ; pos++)
 
465
        for (pos=0 ; pos < (int)tmpGroups.GetCount() ; pos++)
456
466
        {
457
467
            sql += wxT("ALTER GROUP ") + qtIdent(tmpGroups.Item(pos))
458
468
                +  wxT(" DROP USER ") + qtIdent(name) + wxT(";\n");
484
494
        sql += wxT(";\n");
485
495
 
486
496
        int cnt = lbGroupsIn->GetCount();
487
 
        for (int pos=0 ; pos < cnt ; pos++)
 
497
        for (pos=0 ; pos < cnt ; pos++)
488
498
            sql += wxT("ALTER GROUP ") + qtIdent(lbGroupsIn->GetString(pos))
489
499
                +  wxT(" ADD USER ") + qtIdent(name) + wxT(";\n");
490
500
    }
499
509
    }
500
510
 
501
511
    int cnt=lstVariables->GetItemCount();
502
 
    int pos;
503
 
 
 
512
  
504
513
    // check for changed or added vars
505
514
    for (pos=0 ; pos < cnt ; pos++)
506
515
    {
539
548
    return sql;
540
549
}
541
550
 
 
551