From: hiroshi Date: Tue, 10 Mar 2009 16:15:05 +0000 (+0000) Subject: Even a restriction user is possible for an own password change. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=13116204839bfec59236f4c868345237ea1c1b50;p=users%2Fquan74%2Fpgadmin-import.git Even a restriction user is possible for an own password change. git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7659 a7884b65-44f6-0310-8a51-81a127f17b15 --- diff --git a/pgadmin/dlg/dlgRole.cpp b/pgadmin/dlg/dlgRole.cpp index c77f3d880..dfdb12ffd 100644 --- a/pgadmin/dlg/dlgRole.cpp +++ b/pgadmin/dlg/dlgRole.cpp @@ -200,15 +200,25 @@ int dlgRole::Go(bool modal) chkUpdateCat->Disable(); datValidUntil->Disable(); timValidUntil->Disable(); - txtPasswd->Disable(); - txtRePasswd->Disable(); btnAddRole->Disable(); btnDelRole->Disable(); cbVarname->Disable(); txtValue->Disable(); txtConnectionLimit->Disable(); - btnAdd->Disable(); btnRemove->Disable(); + /* Its own password can be changed. */ + if (connection->GetUser() != role->GetName()) + { + txtPasswd->Disable(); + txtRePasswd->Disable(); + btnAdd->Disable(); + } + else + { + txtPasswd->Enable(); + txtRePasswd->Enable(); + btnAdd->Enable(); + } } } else diff --git a/pgadmin/dlg/dlgUser.cpp b/pgadmin/dlg/dlgUser.cpp index 7d18493b2..4e5a0685a 100644 --- a/pgadmin/dlg/dlgUser.cpp +++ b/pgadmin/dlg/dlgUser.cpp @@ -156,14 +156,23 @@ int dlgUser::Go(bool modal) chkCreateUser->Disable(); datValidUntil->Disable(); timValidUntil->Disable(); - txtPasswd->Disable(); - txtRePasswd->Disable(); btnAddGroup->Disable(); btnDelGroup->Disable(); cbVarname->Disable(); txtValue->Disable(); - btnAdd->Disable(); btnRemove->Disable(); + if (connection->GetUser() != user->GetName()) + { + txtPasswd->Disable(); + txtRePasswd->Disable(); + btnAdd->Disable(); + } + else + { + txtPasswd->Enable(); + txtRePasswd->Enable(); + btnAdd->Enable(); + } } } else