Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-06-07 Thread Dave Page
Thanks - applied with a minor tweak for the button styling so it
looked consistent in webkit browsers.

On Tue, Jun 7, 2016 at 8:13 AM, Harshal Dhumal
 wrote:
> Hi,
>
>
> PFA patch for user management issues.
>
> --
> Harshal Dhumal
> Software Engineer
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Mon, Jun 6, 2016 at 6:06 PM, Dave Page  wrote:
>>
>> Hi
>>
>> Thanks - I've commit as-is (with some minor tweaks), however the
>> following issues are present:
>>
>> 1) I get an error: "Invalid Email id: dpage...@pgadmin.org". That is a
>> perfectly valid email address, but I guess we're not recognising the
>> +.
>
> Fixed.
>
>
>>
>>
>> 2) When I mouse-over the Users menu option, the cursor isn't changing
>> to a pointer.
>
> Fixed.
>
>>
>>
>> 3) The font in the Close button is still not quite the same as for the
>> other dialogues.
>
> Fixed font size issue.
>
>
>>
>>
>> Please fix and submit patch(es).
>>
>> Thanks.
>>
>> On Mon, Jun 6, 2016 at 11:58 AM, Harshal Dhumal
>>  wrote:
>> > Hi,
>> >
>> > PFA updated patch (V6) for user management functionality.
>> >
>> > Changes: As per Ashesh's suggestion I have disabled email update of
>> > existing
>> > user.
>> >
>> >
>> > --
>> > Harshal Dhumal
>> > Software Engineer
>> >
>> > EnterpriseDB India: http://www.enterprisedb.com
>> > The Enterprise PostgreSQL Company
>> >
>> > On Mon, Jun 6, 2016 at 2:16 PM, Dave Page  wrote:
>> >>
>> >> Hi
>> >>
>> >> On Fri, Jun 3, 2016 at 10:52 PM, Harshal Dhumal
>> >>  wrote:
>> >> > Hi,
>> >> >
>> >> >
>> >> > PFA attached patch (V5) for user management functionality.
>> >> >
>> >> > Note: If you've applied any of the previous patch of this
>> >> > functionality
>> >> > then
>> >> > set ConfigDB value to 10 in version table of and also delete role
>> >> > 'Standard'
>> >> > from role table before applying this patch.
>> >>
>> >> Done - also restarted my app server, and done a hard refresh of the
>> >> browser...
>> >>
>> >> And I get "(index):310 Uncaught TypeError: Cannot read property
>> >> 'show_users' of undefined" when I try to open the Users menu option.
>> >
>> >
>> > This was an issue. Ideally Users menu shouldn't be visible to non admin
>> > users. I have fixed in this patch.
>> >
>> >>
>> >>
>> >> >> - The Close button should be disabled if errors are present.
>> >> >
>> >> >
>> >> > I'm not convinced that to deny superuser from closing dialog for his
>> >> > mistakes (accidental mistakes).
>> >> >
>> >> > Consider a case when superuser clears email for any old user
>> >> > inadvertently
>> >> > (obviously this won't reflect on server). At this point there is no
>> >> > proper
>> >> > way that he can roll back or close the dialog without saving it if we
>> >> > disable close button. He has to either enter correct email for that
>> >> > user
>> >> > or
>> >> > refresh the browser.
>> >> >
>> >> > Another case while adding new user if he plans not to add user then
>> >> > he
>> >> > has
>> >> > to clear that partially filled user from grid before he can close the
>> >> > dialog.
>> >>
>> >> Well we either need that, or a message box asking the user if he wants
>> >> to discard his changes and offering OK/Cancel options.
>> >
>> >
>> > I have added confirmation before closing dialog if any unsaved changes
>> > are
>> > present.
>> >
>> >
>> >>
>> >>
>> >> >> - If I enter all the details for a new user and then hit Close, the
>> >> >> dialog
>> >> >> is closed and the new user is NOT added. I have to click something
>> >> >> else
>> >> >> first so the row loses focus, and then click close.
>> >> >
>> >> >
>> >> > I was not able to reproduce this issue. I tried with both close
>> >> > buttons
>> >> > (top-right and bottom-right). Users were created in both the cases by
>> >> > adding
>> >> > all details and directly closing dialog without clicking anywhere on
>> >> > the
>> >> > dialog.
>> >>
>> >> Hmm, I'll re-test when I get an updated patch.
>> >
>> > Ok
>> >
>> >>
>> >>
>> >> --
>> >> Dave Page
>> >> Blog: http://pgsnake.blogspot.com
>> >> Twitter: @pgsnake
>> >>
>> >> EnterpriseDB UK: http://www.enterprisedb.com
>> >> The Enterprise PostgreSQL Company
>> >
>> >
>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-06-07 Thread Harshal Dhumal
Hi,


PFA patch for user management issues.

-- 
*Harshal Dhumal*
*Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Mon, Jun 6, 2016 at 6:06 PM, Dave Page  wrote:

> Hi
>
> Thanks - I've commit as-is (with some minor tweaks), however the
> following issues are present:
>
> 1) I get an error: "Invalid Email id: dpage...@pgadmin.org". That is a
> perfectly valid email address, but I guess we're not recognising the
> +.
>
Fixed.



>
> 2) When I mouse-over the Users menu option, the cursor isn't changing
> to a pointer.
>
Fixed.


>
> 3) The font in the Close button is still not quite the same as for the
> other dialogues.
>
Fixed font size issue.



>
> Please fix and submit patch(es).
>
> Thanks.
>
> On Mon, Jun 6, 2016 at 11:58 AM, Harshal Dhumal
>  wrote:
> > Hi,
> >
> > PFA updated patch (V6) for user management functionality.
> >
> > Changes: As per Ashesh's suggestion I have disabled email update of
> existing
> > user.
> >
> >
> > --
> > Harshal Dhumal
> > Software Engineer
> >
> > EnterpriseDB India: http://www.enterprisedb.com
> > The Enterprise PostgreSQL Company
> >
> > On Mon, Jun 6, 2016 at 2:16 PM, Dave Page  wrote:
> >>
> >> Hi
> >>
> >> On Fri, Jun 3, 2016 at 10:52 PM, Harshal Dhumal
> >>  wrote:
> >> > Hi,
> >> >
> >> >
> >> > PFA attached patch (V5) for user management functionality.
> >> >
> >> > Note: If you've applied any of the previous patch of this
> functionality
> >> > then
> >> > set ConfigDB value to 10 in version table of and also delete role
> >> > 'Standard'
> >> > from role table before applying this patch.
> >>
> >> Done - also restarted my app server, and done a hard refresh of the
> >> browser...
> >>
> >> And I get "(index):310 Uncaught TypeError: Cannot read property
> >> 'show_users' of undefined" when I try to open the Users menu option.
> >
> >
> > This was an issue. Ideally Users menu shouldn't be visible to non admin
> > users. I have fixed in this patch.
> >
> >>
> >>
> >> >> - The Close button should be disabled if errors are present.
> >> >
> >> >
> >> > I'm not convinced that to deny superuser from closing dialog for his
> >> > mistakes (accidental mistakes).
> >> >
> >> > Consider a case when superuser clears email for any old user
> >> > inadvertently
> >> > (obviously this won't reflect on server). At this point there is no
> >> > proper
> >> > way that he can roll back or close the dialog without saving it if we
> >> > disable close button. He has to either enter correct email for that
> user
> >> > or
> >> > refresh the browser.
> >> >
> >> > Another case while adding new user if he plans not to add user then he
> >> > has
> >> > to clear that partially filled user from grid before he can close the
> >> > dialog.
> >>
> >> Well we either need that, or a message box asking the user if he wants
> >> to discard his changes and offering OK/Cancel options.
> >
> >
> > I have added confirmation before closing dialog if any unsaved changes
> are
> > present.
> >
> >
> >>
> >>
> >> >> - If I enter all the details for a new user and then hit Close, the
> >> >> dialog
> >> >> is closed and the new user is NOT added. I have to click something
> else
> >> >> first so the row loses focus, and then click close.
> >> >
> >> >
> >> > I was not able to reproduce this issue. I tried with both close
> buttons
> >> > (top-right and bottom-right). Users were created in both the cases by
> >> > adding
> >> > all details and directly closing dialog without clicking anywhere on
> the
> >> > dialog.
> >>
> >> Hmm, I'll re-test when I get an updated patch.
> >
> > Ok
> >
> >>
> >>
> >> --
> >> Dave Page
> >> Blog: http://pgsnake.blogspot.com
> >> Twitter: @pgsnake
> >>
> >> EnterpriseDB UK: http://www.enterprisedb.com
> >> The Enterprise PostgreSQL Company
> >
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/browser/templates/browser/index.html b/web/pgadmin/browser/templates/browser/index.html
index a70cb5b..69d3ecc 100644
--- a/web/pgadmin/browser/templates/browser/index.html
+++ b/web/pgadmin/browser/templates/browser/index.html
@@ -69,7 +69,7 @@ try {
 {{ _('Change Password') }}
 
 {% if is_admin %}
-{{ _('Users') }}
+{{ _('Users') }}
 
 {% endif %}
 {{ _('Logout') }}
diff --git a/web/pgadmin/static/css/overrides.css b/web/pgadmin/static/css/overrides.css
index 3cb7dc8..02f0e02 100755
--- a/web/pgadmin/static/css/overrides.css
+++ b/web/pgadmin/static/css/overrides.css
@@ -1103,7 +1103,7 @@ span.button-label {
 }
 button.pg-alertify-button {
   font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
-  font-size: 15px;
+  font-size: 14px;
 }
 .fa.pg-alertify-button:before {
   

Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-06-06 Thread Dave Page
Hi

Thanks - I've commit as-is (with some minor tweaks), however the
following issues are present:

1) I get an error: "Invalid Email id: dpage...@pgadmin.org". That is a
perfectly valid email address, but I guess we're not recognising the
+.

2) When I mouse-over the Users menu option, the cursor isn't changing
to a pointer.

3) The font in the Close button is still not quite the same as for the
other dialogues.

Please fix and submit patch(es).

Thanks.

On Mon, Jun 6, 2016 at 11:58 AM, Harshal Dhumal
 wrote:
> Hi,
>
> PFA updated patch (V6) for user management functionality.
>
> Changes: As per Ashesh's suggestion I have disabled email update of existing
> user.
>
>
> --
> Harshal Dhumal
> Software Engineer
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Mon, Jun 6, 2016 at 2:16 PM, Dave Page  wrote:
>>
>> Hi
>>
>> On Fri, Jun 3, 2016 at 10:52 PM, Harshal Dhumal
>>  wrote:
>> > Hi,
>> >
>> >
>> > PFA attached patch (V5) for user management functionality.
>> >
>> > Note: If you've applied any of the previous patch of this functionality
>> > then
>> > set ConfigDB value to 10 in version table of and also delete role
>> > 'Standard'
>> > from role table before applying this patch.
>>
>> Done - also restarted my app server, and done a hard refresh of the
>> browser...
>>
>> And I get "(index):310 Uncaught TypeError: Cannot read property
>> 'show_users' of undefined" when I try to open the Users menu option.
>
>
> This was an issue. Ideally Users menu shouldn't be visible to non admin
> users. I have fixed in this patch.
>
>>
>>
>> >> - The Close button should be disabled if errors are present.
>> >
>> >
>> > I'm not convinced that to deny superuser from closing dialog for his
>> > mistakes (accidental mistakes).
>> >
>> > Consider a case when superuser clears email for any old user
>> > inadvertently
>> > (obviously this won't reflect on server). At this point there is no
>> > proper
>> > way that he can roll back or close the dialog without saving it if we
>> > disable close button. He has to either enter correct email for that user
>> > or
>> > refresh the browser.
>> >
>> > Another case while adding new user if he plans not to add user then he
>> > has
>> > to clear that partially filled user from grid before he can close the
>> > dialog.
>>
>> Well we either need that, or a message box asking the user if he wants
>> to discard his changes and offering OK/Cancel options.
>
>
> I have added confirmation before closing dialog if any unsaved changes are
> present.
>
>
>>
>>
>> >> - If I enter all the details for a new user and then hit Close, the
>> >> dialog
>> >> is closed and the new user is NOT added. I have to click something else
>> >> first so the row loses focus, and then click close.
>> >
>> >
>> > I was not able to reproduce this issue. I tried with both close buttons
>> > (top-right and bottom-right). Users were created in both the cases by
>> > adding
>> > all details and directly closing dialog without clicking anywhere on the
>> > dialog.
>>
>> Hmm, I'll re-test when I get an updated patch.
>
> Ok
>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-06-06 Thread Dave Page
Hi

On Fri, Jun 3, 2016 at 10:52 PM, Harshal Dhumal
 wrote:
> Hi,
>
>
> PFA attached patch (V5) for user management functionality.
>
> Note: If you've applied any of the previous patch of this functionality then
> set ConfigDB value to 10 in version table of and also delete role 'Standard'
> from role table before applying this patch.

Done - also restarted my app server, and done a hard refresh of the browser...

And I get "(index):310 Uncaught TypeError: Cannot read property
'show_users' of undefined" when I try to open the Users menu option.

>> - The Close button should be disabled if errors are present.
>
>
> I'm not convinced that to deny superuser from closing dialog for his
> mistakes (accidental mistakes).
>
> Consider a case when superuser clears email for any old user inadvertently
> (obviously this won't reflect on server). At this point there is no proper
> way that he can roll back or close the dialog without saving it if we
> disable close button. He has to either enter correct email for that user or
> refresh the browser.
>
> Another case while adding new user if he plans not to add user then he has
> to clear that partially filled user from grid before he can close the
> dialog.

Well we either need that, or a message box asking the user if he wants
to discard his changes and offering OK/Cancel options.

>> - If I enter all the details for a new user and then hit Close, the dialog
>> is closed and the new user is NOT added. I have to click something else
>> first so the row loses focus, and then click close.
>
>
> I was not able to reproduce this issue. I tried with both close buttons
> (top-right and bottom-right). Users were created in both the cases by adding
> all details and directly closing dialog without clicking anywhere on the
> dialog.

Hmm, I'll re-test when I get an updated patch.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-06-03 Thread Harshal Dhumal
Hi,


PFA attached patch (V5) for user management functionality.

Note: If you've applied any of the previous patch of this functionality
then set ConfigDB value to 10 in version table of and also delete role
'Standard' from role table before applying this patch.


On Fri, Jun 3, 2016 at 4:39 PM, Dave Page  wrote:

>
>
> On Fri, Jun 3, 2016 at 11:37 AM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> Hi Harshal,
>>
>> Dave asked to put the User Management menu under the 'Change Password'
>> (right top side).
>>
> Done


>
> Correct - that way it won't be displayed in desktop mode. Other comments:
>
> - If I type an email address, then hit tab to select a Role, I immediately
> get an error saying that the role cannot be empty and the control loses
> focus. I should be able to add a user using just the keyboard.
>

Fixed the issue to not to show error immediately. Also role cell does not
lose focus after tab hit, it is select2 cell which does not respond to
focus-in event of tab. This is general issue for all select2 cells.


>
> - In general I'm seeing validation errors before I've had a chance to
> enter values. I should only see them if the appropriate field has lost
> focus.
>

Fixed.


>
> - Role names should be "Administrator" and "User".
>
Fixed (set ConfidDB to 10 before applying this patch if any of previous
patch was applied.)


>
> - The Close button should be disabled if errors are present.
>

I'm not convinced that to deny superuser from closing dialog for his
mistakes (accidental mistakes).

Consider a case when superuser clears email for any old user inadvertently
(obviously this won't reflect on server). At this point there is no proper
way that he can roll back or close the dialog without saving it if we
disable close button. He has to either enter correct email for that user or
refresh the browser.

Another case while adding new user if he plans not to add user then he has
to clear that partially filled user from grid before he can close the
dialog.

Let me know if we still want to implement this.


>
> - If I enter all the details for a new user and then hit Close, the dialog
> is closed and the new user is NOT added. I have to click something else
> first so the row loses focus, and then click close.
>

I was not able to reproduce this issue. I tried with both close buttons
(top-right and bottom-right). Users were created in both the cases by
adding all details and directly closing dialog without clicking anywhere on
the dialog.


>
> - The styling of the Add button and header does not match other grids
> (blue background for the header, title in white on the left, grey "ADD"
> button with no icon. The search box should be pushed right, to the left of
> the button as well I think.
>

Fixed.


>
> - s/Search by email/Filter by email
>
> - s/New Password/New password
>
> - s/Confirm Password/Confirm password
>

Fixed.

>
> - The font on the Close button doesn't match what's on the properties
> dialogues (looks like a global issue)
>
>
Fixed.


>
>
- The minimum size of the dialogue should be set such that the dialogue is
> usable at mimimum size, e.g. all columns shown, with 2 rows.
>
> Fixed.



> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/TODO.txt b/TODO.txt
index 93abba0..1df1305 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -45,3 +45,11 @@ Graphical Explain
 * Explanation on the statistic for the graphical explain plan.
 * Arrow colouring based on the percentage of the cost, and time taken on each
   explain node.
+
+User management
+---
+1. Pagination should be there if there are large number of users.
+2. There should be a way of notifying the user once its password is changed by any administrator.
+3. We can add 'created by' column.
+4. User creation and last modified time.
+5. If current user changes its own name/email, main page should reflect new changes.
\ No newline at end of file
diff --git a/web/config.py b/web/config.py
index ebb85aa..8545add 100644
--- a/web/config.py
+++ b/web/config.py
@@ -150,7 +150,7 @@ MAX_SESSION_IDLE_TIME = 60
 
 # The schema version number for the configuration database
 # DO NOT CHANGE UNLESS YOU ARE A PGADMIN DEVELOPER!!
-SETTINGS_SCHEMA_VERSION = 10
+SETTINGS_SCHEMA_VERSION = 11
 
 # The default path to the SQLite database used to store user accounts and
 # settings. This default places the file in the same directory as this
diff --git a/web/pgadmin/browser/templates/browser/index.html b/web/pgadmin/browser/templates/browser/index.html
index 89fe2a8..ed85c78 100644
--- a/web/pgadmin/browser/templates/browser/index.html
+++ b/web/pgadmin/browser/templates/browser/index.html
@@ -68,6 +68,8 @@ try {
   
 {{ _('Change Password') }}
 
+{{ _('Users') }}
+
 {{ _('Logout') }}
   
 
diff 

Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-06-03 Thread Dave Page
On Fri, Jun 3, 2016 at 11:37 AM, Ashesh Vashi  wrote:

> Hi Harshal,
>
> Dave asked to put the User Management menu under the 'Change Password'
> (right top side).
>

Correct - that way it won't be displayed in desktop mode. Other comments:

- If I type an email address, then hit tab to select a Role, I immediately
get an error saying that the role cannot be empty and the control loses
focus. I should be able to add a user using just the keyboard.

- In general I'm seeing validation errors before I've had a chance to enter
values. I should only see them if the appropriate field has lost focus.

- Role names should be "Administrator" and "User".

- The Close button should be disabled if errors are present.

- If I enter all the details for a new user and then hit Close, the dialog
is closed and the new user is NOT added. I have to click something else
first so the row loses focus, and then click close.

- The styling of the Add button and header does not match other grids (blue
background for the header, title in white on the left, grey "ADD" button
with no icon. The search box should be pushed right, to the left of the
button as well I think.

- s/Search by email/Filter by email

- s/New Password/New password

- s/Confirm Password/Confirm password

- The font on the Close button doesn't match what's on the properties
dialogues (looks like a global issue)

- The minimum size of the dialogue should be set such that the dialogue is
usable at mimimum size, e.g. all columns shown, with 2 rows.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-06-03 Thread Ashesh Vashi
Hi Harshal,

Dave asked to put the User Management menu under the 'Change Password'
(right top side).

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


On Thu, Jun 2, 2016 at 7:12 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch for user management functionality.
>
> Major changes in this patch are:
>
> 1. In-place editing of user and saving on server.
> 2. Removed dependency on marshmallow python package.
> 3. UI improvements.
> 4. Search by email.
>
>
>
>
>
> --
> *Harshal Dhumal*
> *Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Tue, May 31, 2016 at 4:24 PM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> On Tue, May 31, 2016 at 2:45 PM, Dave Page  wrote:
>>
>>>
>>>
>>> On Tue, May 31, 2016 at 9:52 AM, Ashesh Vashi <
>>> ashesh.va...@enterprisedb.com> wrote:
>>>



 On Tue, May 31, 2016 at 1:26 PM, Dave Page  wrote:

> Yeah, I was about to reply on this too;
>
> - Why do we need Marshmallow?
>
> - Why do we need a role system? Perhaps in the future we might have
> shared servers, and roles that cannot modify them, but not now.
>
 Hmm..
 He just added one more role - 'Standard'.
 'Administrator' role was already presents in it.

>>>
>>> Oh yes, sorry, misread that. 'pgAdmin User Role' would be a better
>>> description though I think.
>>>
>> Yeah - that can be done. :-)
>>
>> --
>>
>> Thanks & Regards,
>>
>> Ashesh Vashi
>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>> 
>>
>>
>> *http://www.linkedin.com/in/asheshvashi*
>> 
>>
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-06-02 Thread Harshal Dhumal
Hi,

This patch requires backgrid password cell for I have sent patch yesterday.

-- 
*Harshal Dhumal*
*Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Thu, Jun 2, 2016 at 7:12 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch for user management functionality.
>
> Major changes in this patch are:
>
> 1. In-place editing of user and saving on server.
> 2. Removed dependency on marshmallow python package.
> 3. UI improvements.
> 4. Search by email.
>
>
>
>
>
> --
> *Harshal Dhumal*
> *Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Tue, May 31, 2016 at 4:24 PM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> On Tue, May 31, 2016 at 2:45 PM, Dave Page  wrote:
>>
>>>
>>>
>>> On Tue, May 31, 2016 at 9:52 AM, Ashesh Vashi <
>>> ashesh.va...@enterprisedb.com> wrote:
>>>



 On Tue, May 31, 2016 at 1:26 PM, Dave Page  wrote:

> Yeah, I was about to reply on this too;
>
> - Why do we need Marshmallow?
>
> - Why do we need a role system? Perhaps in the future we might have
> shared servers, and roles that cannot modify them, but not now.
>
 Hmm..
 He just added one more role - 'Standard'.
 'Administrator' role was already presents in it.

>>>
>>> Oh yes, sorry, misread that. 'pgAdmin User Role' would be a better
>>> description though I think.
>>>
>> Yeah - that can be done. :-)
>>
>> --
>>
>> Thanks & Regards,
>>
>> Ashesh Vashi
>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>> 
>>
>>
>> *http://www.linkedin.com/in/asheshvashi*
>> 
>>
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-06-02 Thread Harshal Dhumal
Hi,

PFA patch for user management functionality.

Major changes in this patch are:

1. In-place editing of user and saving on server.
2. Removed dependency on marshmallow python package.
3. UI improvements.
4. Search by email.





-- 
*Harshal Dhumal*
*Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Tue, May 31, 2016 at 4:24 PM, Ashesh Vashi  wrote:

> On Tue, May 31, 2016 at 2:45 PM, Dave Page  wrote:
>
>>
>>
>> On Tue, May 31, 2016 at 9:52 AM, Ashesh Vashi <
>> ashesh.va...@enterprisedb.com> wrote:
>>
>>>
>>>
>>>
>>> On Tue, May 31, 2016 at 1:26 PM, Dave Page  wrote:
>>>
 Yeah, I was about to reply on this too;

 - Why do we need Marshmallow?

 - Why do we need a role system? Perhaps in the future we might have
 shared servers, and roles that cannot modify them, but not now.

>>> Hmm..
>>> He just added one more role - 'Standard'.
>>> 'Administrator' role was already presents in it.
>>>
>>
>> Oh yes, sorry, misread that. 'pgAdmin User Role' would be a better
>> description though I think.
>>
> Yeah - that can be done. :-)
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> 
>
>
> *http://www.linkedin.com/in/asheshvashi*
> 
>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
diff --git a/TODO.txt b/TODO.txt
index 93abba0..1df1305 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -45,3 +45,11 @@ Graphical Explain
 * Explanation on the statistic for the graphical explain plan.
 * Arrow colouring based on the percentage of the cost, and time taken on each
   explain node.
+
+User management
+---
+1. Pagination should be there if there are large number of users.
+2. There should be a way of notifying the user once its password is changed by any administrator.
+3. We can add 'created by' column.
+4. User creation and last modified time.
+5. If current user changes its own name/email, main page should reflect new changes.
\ No newline at end of file
diff --git a/web/config.py b/web/config.py
index 4dd6c76..8f043b2 100644
--- a/web/config.py
+++ b/web/config.py
@@ -150,7 +150,7 @@ MAX_SESSION_IDLE_TIME = 60
 
 # The schema version number for the configuration database
 # DO NOT CHANGE UNLESS YOU ARE A PGADMIN DEVELOPER!!
-SETTINGS_SCHEMA_VERSION = 10
+SETTINGS_SCHEMA_VERSION = 11
 
 # The default path to the SQLite database used to store user accounts and
 # settings. This default places the file in the same directory as this
diff --git a/web/pgadmin/static/css/overrides.css b/web/pgadmin/static/css/overrides.css
index 55d83e0..d746a10 100755
--- a/web/pgadmin/static/css/overrides.css
+++ b/web/pgadmin/static/css/overrides.css
@@ -1232,3 +1232,37 @@ form[name="change_password_form"] .help-block {
 visibility: hidden;
   }
 }
+
+.subnode-footer {
+  text-align: right;
+  border-color: #a9a9a9;
+  border-style: inset inset inset solid;
+  border-width: 2px 1px 0;
+  margin-top: -10px;
+}
+
+.subnode-footer .ajs-button {
+  margin: 2px 2px 0;
+}
+
+.user_management {
+  margin: 0 10px !important;
+  border: 1px solid #ccc;
+  width: calc(100% - 20px);
+  height: 100%;
+  overflow: hidden;
+}
+
+.user_management .search_users form {
+  margin: 0;
+}
+
+.user_management table {
+  display: block;
+  height: 100%;
+  overflow: auto;
+}
+
+.user_management .backform-tab {
+  height: calc(100% - 75px);
+}
\ No newline at end of file
diff --git a/web/pgadmin/tools/user_management/__init__.py b/web/pgadmin/tools/user_management/__init__.py
new file mode 100644
index 000..324ea4d
--- /dev/null
+++ b/web/pgadmin/tools/user_management/__init__.py
@@ -0,0 +1,327 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Implements pgAdmin4 User Management Utility"""
+
+import json
+import re
+
+from flask import render_template, request, \
+url_for, Response, abort
+from flask.ext.babel import gettext as _
+from flask.ext.security import login_required, roles_required, current_user
+
+from pgadmin.utils.ajax import make_response as ajax_response,\
+make_json_response, bad_request, internal_server_error
+from pgadmin.utils import PgAdminModule
+from pgadmin.model import db, Role, User, UserPreference, Server,\
+ServerGroup, Process, Setting
+from flask.ext.security.utils import encrypt_password
+
+# set template path for sql scripts
+MODULE_NAME = 'user_management'
+server_info = {}
+
+
+class UserManagementModule(PgAdminModule):

Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-05-31 Thread Ashesh Vashi
On Tue, May 31, 2016 at 2:45 PM, Dave Page  wrote:

>
>
> On Tue, May 31, 2016 at 9:52 AM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>>
>>
>>
>> On Tue, May 31, 2016 at 1:26 PM, Dave Page  wrote:
>>
>>> Yeah, I was about to reply on this too;
>>>
>>> - Why do we need Marshmallow?
>>>
>>> - Why do we need a role system? Perhaps in the future we might have
>>> shared servers, and roles that cannot modify them, but not now.
>>>
>> Hmm..
>> He just added one more role - 'Standard'.
>> 'Administrator' role was already presents in it.
>>
>
> Oh yes, sorry, misread that. 'pgAdmin User Role' would be a better
> description though I think.
>
Yeah - that can be done. :-)

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-05-31 Thread Dave Page
On Tue, May 31, 2016 at 9:52 AM, Ashesh Vashi  wrote:

>
>
>
> On Tue, May 31, 2016 at 1:26 PM, Dave Page  wrote:
>
>> Yeah, I was about to reply on this too;
>>
>> - Why do we need Marshmallow?
>>
>> - Why do we need a role system? Perhaps in the future we might have
>> shared servers, and roles that cannot modify them, but not now.
>>
> Hmm..
> He just added one more role - 'Standard'.
> 'Administrator' role was already presents in it.
>

Oh yes, sorry, misread that. 'pgAdmin User Role' would be a better
description though I think.


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-05-31 Thread Ashesh Vashi
On Tue, May 31, 2016 at 1:26 PM, Dave Page  wrote:

> Yeah, I was about to reply on this too;
>
> - Why do we need Marshmallow?
>
> - Why do we need a role system? Perhaps in the future we might have shared
> servers, and roles that cannot modify them, but not now.
>
Hmm..
He just added one more role - 'Standard'.
'Administrator' role was already presents in it.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


>
> - Why is the editing not done in-grid? It's only a single line per record.
> Seems like an awful lot of code for what should be a simple backgrid
> implementation.
>
> On Tue, May 31, 2016 at 8:42 AM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> Hi Harshal,
>>
>> Please find the updated patch with some improvement, we should not show
>> any of the functions to the non-administrator user.
>>
>> * Please handle unauthorised routes call using our own wrapper function.
>>Because - role_required wrapper redirect the call to unauthorised
>> page, which we don't required. We needed proper ajax response.
>> * Add search filter on top of grid.
>> * Open the form of user, when we add new user.
>> * Do not allow to add new user, if the form is not complete for the new
>> user.
>> * Do not allow to close the form of new user with incomplete data.
>> (Though - allow it to remove it.)
>> * Close the form on save button call.
>> * Allow to change attributes of existing users from the grid itself.
>>
>>
>> --
>>
>> Thanks & Regards,
>>
>> Ashesh Vashi
>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>> 
>>
>>
>> *http://www.linkedin.com/in/asheshvashi*
>> 
>>
>> On Tue, May 31, 2016 at 12:12 PM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>>
>>> --
>>> *Harshal Dhumal*
>>> *Software Engineer *
>>>
>>>
>>>
>>> EenterpriseDB 
>>>
>>> On Mon, May 30, 2016 at 4:09 PM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi Harshal,

 PFA comments as below,

 1) While running setup.py for the first time, We did not handle the
 case to create Standard user.

>>> Fixed
>>>
>>>
 2) Save button gets enable only clicking on input text box

>>> Fixed
>>>
>>>
 3) Remove delete button from sub-node

>>> Removed button.
>>>
>>> 4) If current user changes its own name/email, main page should reflect
 new changes.

>>> Moved to TODO
>>>
>>>


 Can be listed as TODO
 
 1) Erros description is missing, for example when have user
 t...@test.com presnt and user try to add user same as t...@test.com we
 get error as "Error during saving user" it should be descriptive like
 "ERRPR: User {XYZ} is already exists.."

>>> Fixed. (Added client side validation)
>>>
>>>
 2) There should be an option to delete multiple users at one shot.

>>> Moved to TODO
>>>
>>>
 3) There should be an option to active/deactivate multiple users in one
 shot.

>>> Moved to TODO
>>>
>>>
 4) In-place editing in backgrid.

>>> Moved to TODO
>>>
>>>


 Regards,
 Murtuza

 --
 Regards,
 Murtuza Zabuawala
 EnterpriseDB: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company

 On Fri, May 27, 2016 at 7:02 PM, Harshal Dhumal <
 harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> PFA initial patch for User management functionality.
>
>
> --
> *Harshal Dhumal*
> *Software Engineer *
>
>
>
> EenterpriseDB 
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>

>>>
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-05-31 Thread Dave Page
Yeah, I was about to reply on this too;

- Why do we need Marshmallow?

- Why do we need a role system? Perhaps in the future we might have shared
servers, and roles that cannot modify them, but not now.

- Why is the editing not done in-grid? It's only a single line per record.
Seems like an awful lot of code for what should be a simple backgrid
implementation.

On Tue, May 31, 2016 at 8:42 AM, Ashesh Vashi  wrote:

> Hi Harshal,
>
> Please find the updated patch with some improvement, we should not show
> any of the functions to the non-administrator user.
>
> * Please handle unauthorised routes call using our own wrapper function.
>Because - role_required wrapper redirect the call to unauthorised page,
> which we don't required. We needed proper ajax response.
> * Add search filter on top of grid.
> * Open the form of user, when we add new user.
> * Do not allow to add new user, if the form is not complete for the new
> user.
> * Do not allow to close the form of new user with incomplete data. (Though
> - allow it to remove it.)
> * Close the form on save button call.
> * Allow to change attributes of existing users from the grid itself.
>
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> 
>
>
> *http://www.linkedin.com/in/asheshvashi*
> 
>
> On Tue, May 31, 2016 at 12:12 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>>
>> --
>> *Harshal Dhumal*
>> *Software Engineer *
>>
>>
>>
>> EenterpriseDB 
>>
>> On Mon, May 30, 2016 at 4:09 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Harshal,
>>>
>>> PFA comments as below,
>>>
>>> 1) While running setup.py for the first time, We did not handle the case
>>> to create Standard user.
>>>
>> Fixed
>>
>>
>>> 2) Save button gets enable only clicking on input text box
>>>
>> Fixed
>>
>>
>>> 3) Remove delete button from sub-node
>>>
>> Removed button.
>>
>> 4) If current user changes its own name/email, main page should reflect
>>> new changes.
>>>
>> Moved to TODO
>>
>>
>>>
>>>
>>> Can be listed as TODO
>>> 
>>> 1) Erros description is missing, for example when have user
>>> t...@test.com presnt and user try to add user same as t...@test.com we
>>> get error as "Error during saving user" it should be descriptive like
>>> "ERRPR: User {XYZ} is already exists.."
>>>
>> Fixed. (Added client side validation)
>>
>>
>>> 2) There should be an option to delete multiple users at one shot.
>>>
>> Moved to TODO
>>
>>
>>> 3) There should be an option to active/deactivate multiple users in one
>>> shot.
>>>
>> Moved to TODO
>>
>>
>>> 4) In-place editing in backgrid.
>>>
>> Moved to TODO
>>
>>
>>>
>>>
>>> Regards,
>>> Murtuza
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>> On Fri, May 27, 2016 at 7:02 PM, Harshal Dhumal <
>>> harshal.dhu...@enterprisedb.com> wrote:
>>>
 Hi,

 PFA initial patch for User management functionality.


 --
 *Harshal Dhumal*
 *Software Engineer *



 EenterpriseDB 


 --
 Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgadmin-hackers


>>>
>>
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-05-31 Thread Harshal Dhumal
Hi,


-- 
*Harshal Dhumal*
*Software Engineer *



EenterpriseDB 

On Mon, May 30, 2016 at 4:09 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Harshal,
>
> PFA comments as below,
>
> 1) While running setup.py for the first time, We did not handle the case
> to create Standard user.
>
Fixed


> 2) Save button gets enable only clicking on input text box
>
Fixed


> 3) Remove delete button from sub-node
>
Removed button.

4) If current user changes its own name/email, main page should reflect new
> changes.
>
Moved to TODO


>
>
> Can be listed as TODO
> 
> 1) Erros description is missing, for example when have user t...@test.com
> presnt and user try to add user same as t...@test.com we get error as
> "Error during saving user" it should be descriptive like "ERRPR: User {XYZ}
> is already exists.."
>
Fixed. (Added client side validation)


> 2) There should be an option to delete multiple users at one shot.
>
Moved to TODO


> 3) There should be an option to active/deactivate multiple users in one
> shot.
>
Moved to TODO


> 4) In-place editing in backgrid.
>
Moved to TODO


>
>
> Regards,
> Murtuza
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Fri, May 27, 2016 at 7:02 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA initial patch for User management functionality.
>>
>>
>> --
>> *Harshal Dhumal*
>> *Software Engineer *
>>
>>
>>
>> EenterpriseDB 
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>>
>


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-05-31 Thread Harshal Dhumal
Hi,

PFA updated patch for user management.

-- 
*Harshal Dhumal*
*Software Engineer *



EenterpriseDB 

On Mon, May 30, 2016 at 5:51 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi Harshal,
>
>
> Please find the review comments so far:
>
> *Issues:*
> 1. The UI design doesn't look interactive, especially add new user button.
>
Moved to TODO


> 2. In requirements.txt, while adding new dependent library the name of
> library and version should be separate by '==' instead of '--'
>
Fixed


> 3. Under File menu, "Users" menu item should not be visible for non-admin
> users. For now it is only disabled.
>
Moved to TODO


> 4. Change role of admin user to non-admin user, then navigate to File >
> Users. It doesn't show users in Dialog and Add user doesn't work. Instead
> it is better to reload the page. Please find attached screenshot.
>

Moved to TODO (We can write code to reload the page but we have
"onbeforeunload" listener on window which is preventing page reload unless
user clicks on "Leave page" button).


> 5. The data grid content should fill the unnecessary gap above the footer.
>
Moved to TODO (This is generic issue as I'm using common dialog)

6. The title of delete user confirmation dialog should be "Delete user ?",
> instead of "Delete User".
>
Fixed

7. The Edit and Delete column shouldn't be sortable.
>
Moved to TODO (This issue exist throughout the application)


> 8. Columns 'creation time' & 'last modified' are missing.
>

Moved to TODO. (We are not recording these user properties at this stage.
The purpose of User management functionality is to only update existing
user properties, add user and delete user.)


> 9. Password should have validation of minimum number of characters.
>
Fixed


>
> *Can be added into TODO list:*
> 1. There is no way to search a user by name or email id.
> 2. Pagination should be there if there are large number of users.
> 3. There should be a way of notifying the user once its password is
> changed by any administrator.
> 4. We can add 'created by' column.
>
All of above 4 Moved to TODO.

5. One administrator shouldn't have privilege to modify the details of
> other administrator.
> This is the role of super admin.
>
As per my offline discussion with Ashesh we don't need this.



>
>
> Thanks
> Surinder Kumar
>
> On Fri, May 27, 2016 at 7:02 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA initial patch for User management functionality.
>>
>>
>> --
>> *Harshal Dhumal*
>> *Software Engineer *
>>
>>
>>
>> EenterpriseDB 
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>>
>
diff --git a/TODO.txt b/TODO.txt
index 93abba0..05f84b3 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -45,3 +45,16 @@ Graphical Explain
 * Explanation on the statistic for the graphical explain plan.
 * Arrow colouring based on the percentage of the cost, and time taken on each
   explain node.
+
+
+User management
+---
+1. Dialog UI design improvement.
+2. Under File menu, "Users" menu item should not be visible for non-admin users. For now it is only disabled.
+3. Search a user by name or email id.
+4. Pagination should be there if there are large number of users.
+5. There should be a way of notifying the user once its password is changed by any administrator.
+6. We can add 'created by' column.
+7. User creation and last modified time.
+8. If current user changes its own name/email, main page should reflect new changes.
+9. In-place editing in backgrid.
\ No newline at end of file
diff --git a/requirements_py2.txt b/requirements_py2.txt
index a442e36..cff40b5 100644
--- a/requirements_py2.txt
+++ b/requirements_py2.txt
@@ -44,3 +44,5 @@ unittest2==1.1.0
 Werkzeug==0.9.6
 WTForms==2.0.2
 sqlparse==0.1.19
+flask-marshmallow==0.6.2
+marshmallow-sqlalchemy==0.8.1
diff --git a/requirements_py3.txt b/requirements_py3.txt
index 233b14f..70ab746 100644
--- a/requirements_py3.txt
+++ b/requirements_py3.txt
@@ -38,3 +38,5 @@ Werkzeug==0.9.6
 wheel==0.24.0
 WTForms==2.0.2
 sqlparse==0.1.19
+flask-marshmallow==0.6.2
+marshmallow-sqlalchemy==0.8.1
\ No newline at end of file
diff --git a/web/config.py b/web/config.py
index 36f1632..712ee2b 100644
--- a/web/config.py
+++ b/web/config.py
@@ -150,7 +150,7 @@ MAX_SESSION_IDLE_TIME = 60
 
 # The schema version number for the configuration database
 # DO NOT CHANGE UNLESS YOU ARE A PGADMIN DEVELOPER!!
-SETTINGS_SCHEMA_VERSION = 10
+SETTINGS_SCHEMA_VERSION = 11
 
 # The default path to the SQLite database used to store user accounts and
 # settings. This default places the file in the same directory as this
diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py
index f04897e..6d1a9b2 100644
--- a/web/pgadmin/__init__.py
+++ b/web/pgadmin/__init__.py
@@ -16,7 +16,7 @@ from 

Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-05-30 Thread Ashesh Vashi
On Mon, May 30, 2016 at 4:09 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Harshal,
>
> PFA comments as below,
>
> 1) While running setup.py for the first time, We did not handle the case
> to create Standard user.
> 2) Save button gets enable only clicking on input text box
> 3) Remove delete button from sub-node
> 4) If current user changes its own name/email, main page should reflect
> new changes.
>
>
> Can be listed as TODO
> 
> 1) Erros description is missing, for example when have user t...@test.com
> presnt and user try to add user same as t...@test.com we get error as
> "Error during saving user" it should be descriptive like "ERRPR: User {XYZ}
> is already exists.."
> 2) There should be an option to delete multiple users at one shot.
>
Let's not do it right now.
You can add as TODO.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


> 3) There should be an option to active/deactivate multiple users in one
> shot.
> 4) In-place editing in backgrid.
>
>
> Regards,
> Murtuza
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Fri, May 27, 2016 at 7:02 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA initial patch for User management functionality.
>>
>>
>> --
>> *Harshal Dhumal*
>> *Software Engineer *
>>
>>
>>
>> EenterpriseDB 
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>>
>


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-05-30 Thread Murtuza Zabuawala
Hi Harshal,

PFA comments as below,

1) While running setup.py for the first time, We did not handle the case to
create Standard user.
2) Save button gets enable only clicking on input text box
3) Remove delete button from sub-node
4) If current user changes its own name/email, main page should reflect new
changes.


Can be listed as TODO

1) Erros description is missing, for example when have user t...@test.com
presnt and user try to add user same as t...@test.com we get error as
"Error during saving user" it should be descriptive like "ERRPR: User {XYZ}
is already exists.."
2) There should be an option to delete multiple users at one shot.
3) There should be an option to active/deactivate multiple users in one
shot.
4) In-place editing in backgrid.


Regards,
Murtuza

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Fri, May 27, 2016 at 7:02 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> PFA initial patch for User management functionality.
>
>
> --
> *Harshal Dhumal*
> *Software Engineer *
>
>
>
> EenterpriseDB 
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>


[pgadmin-hackers] User management functionality patch [pgadmin4]

2016-05-27 Thread Harshal Dhumal
Hi,

PFA initial patch for User management functionality.


-- 
*Harshal Dhumal*
*Software Engineer *



EenterpriseDB 
diff --git a/requirements_py2.txt b/requirements_py2.txt
index a442e36..f3d8622 100644
--- a/requirements_py2.txt
+++ b/requirements_py2.txt
@@ -44,3 +44,5 @@ unittest2==1.1.0
 Werkzeug==0.9.6
 WTForms==2.0.2
 sqlparse==0.1.19
+flask-marshmallow-0.6.2
+marshmallow-sqlalchemy==0.8.1
diff --git a/requirements_py3.txt b/requirements_py3.txt
index 233b14f..6a6fea4 100644
--- a/requirements_py3.txt
+++ b/requirements_py3.txt
@@ -38,3 +38,5 @@ Werkzeug==0.9.6
 wheel==0.24.0
 WTForms==2.0.2
 sqlparse==0.1.19
+flask-marshmallow-0.6.2
+marshmallow-sqlalchemy==0.8.1
\ No newline at end of file
diff --git a/web/config.py b/web/config.py
index 36f1632..712ee2b 100644
--- a/web/config.py
+++ b/web/config.py
@@ -150,7 +150,7 @@ MAX_SESSION_IDLE_TIME = 60
 
 # The schema version number for the configuration database
 # DO NOT CHANGE UNLESS YOU ARE A PGADMIN DEVELOPER!!
-SETTINGS_SCHEMA_VERSION = 10
+SETTINGS_SCHEMA_VERSION = 11
 
 # The default path to the SQLite database used to store user accounts and
 # settings. This default places the file in the same directory as this
diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py
index f04897e..6d1a9b2 100644
--- a/web/pgadmin/__init__.py
+++ b/web/pgadmin/__init__.py
@@ -16,7 +16,7 @@ from flask.ext.security import Security, SQLAlchemyUserDatastore
 from flask_security.utils import login_user
 from flask_mail import Mail
 from htmlmin.minify import html_minify
-from pgadmin.model import db, Role, User, Version
+from pgadmin.model import db, Role, User, Version, ma
 from importlib import import_module
 from werkzeug.local import LocalProxy
 from pgadmin.utils import PgAdminModule, driver
@@ -189,6 +189,7 @@ def create_app(app_name=config.APP_NAME):
 
 # Create database connection object and mailer
 db.init_app(app)
+ma.init_app(app)
 Mail(app)
 
 import pgadmin.utils.paths as paths
diff --git a/web/pgadmin/model/__init__.py b/web/pgadmin/model/__init__.py
index b8bb256..0aefbf9 100644
--- a/web/pgadmin/model/__init__.py
+++ b/web/pgadmin/model/__init__.py
@@ -20,9 +20,11 @@ things:
 
 from flask.ext.sqlalchemy import SQLAlchemy
 from flask.ext.security import UserMixin, RoleMixin
+from flask_marshmallow import Marshmallow
+from marshmallow import fields
 
 db = SQLAlchemy()
-
+ma = Marshmallow()
 # Define models
 roles_users = db.Table(
 'roles_users',
@@ -46,6 +48,12 @@ class Role(db.Model, RoleMixin):
 description = db.Column(db.String(256), nullable=False)
 
 
+class RoleSchema(ma.ModelSchema):
+"""Define a role schema for serialization"""
+class Meta:
+model = Role
+
+
 class User(db.Model, UserMixin):
 """Define a user object"""
 __tablename__ = 'user'
@@ -58,6 +66,23 @@ class User(db.Model, UserMixin):
 backref=db.backref('users', lazy='dynamic'))
 
 
+class UserSchema(ma.ModelSchema):
+"""Define a user schema for serialization"""
+class Meta:
+model = User
+exclude = ('password', 'roles')
+
+# Convert list of user roles to role.
+# There will be only one role associated with user.
+role = fields.Function(
+  lambda user: str(user.roles[0].id) if len(user.roles) else None
+)
+
+is_admin = fields.Function(
+  lambda user: True if (len(user.roles) and user.roles[0].name == 'Administrators') else False
+)
+
+
 class Setting(db.Model):
 """Define a setting object"""
 __tablename__ = 'setting'
diff --git a/web/pgadmin/static/css/overrides.css b/web/pgadmin/static/css/overrides.css
index 55d83e0..719a989 100755
--- a/web/pgadmin/static/css/overrides.css
+++ b/web/pgadmin/static/css/overrides.css
@@ -1121,7 +1121,7 @@ button.pg-alertify-button {
   margin: 0 0 10px;
   overflow: auto;
   padding: 5px 10px;
-  word-break: break-all;
+  word-break: keep-all;
   word-wrap: break-word;
 }
 
@@ -1129,6 +1129,11 @@ div.backform_control_notes label.control-label {
   min-width: 0px;
 }
 
+.backform_control_notes span{
+  white-space: pre-wrap;
+  word-break: keep-all !important;
+}
+
 form[name="change_password_form"] .help-block {
 color: #A94442 !important;
 }
@@ -1232,3 +1237,15 @@ form[name="change_password_form"] .help-block {
 visibility: hidden;
   }
 }
+
+.subnode-footer {
+  text-align: right;
+  border-color: #a9a9a9;
+  border-style: inset inset inset solid;
+  border-width: 2px 1px 0;
+  margin-top: -10px;
+}
+
+.subnode-footer .ajs-button {
+  margin: 2px 2px 0;
+}
diff --git a/web/pgadmin/tools/user/__init__.py b/web/pgadmin/tools/user/__init__.py
new file mode 100644
index 000..e7cac5a
--- /dev/null
+++ b/web/pgadmin/tools/user/__init__.py
@@ -0,0 +1,307 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is