Hi Georgi, The other workable option where U dont have direct access to database is use the DHIS2 WebAPI
Georgi, Since the account is a superuser, you could use the WebAPI to create a new Superuser and allocate to the Main parent orgunit using the payloads below:-
For this to work properly (currently) you need to generate an ID (/api/system/id) and then modify the payload like this:
{ "id": "generated-id", "firstName": "John", "surname": "Doe", "email": "johndoe@mail.com ", "userCredentials": { "userInfo": { "id": "generated-id" }, "username": "johndoe", "password": "your-password-123", "userRoles": [ { "id": "Euq3XfEIEbx" } ] }, "organisationUnits": [ { "id": "ImspTQPwCqd" } ], "userGroups": [ { "id": "vAvEltyXGbD" } ] }
generated-id should be generated using /api/system/id (WebAPI)
Then, Use Curl to Create the user. Once done, Login and Update your account as usual using users App
curl -X POST -u user:pass -d @u.json -H "Content-Type: application/json" [http://server/api/24/users](http://server/api/24/users)
···
On Mon, Mar 12, 2018 at 8:47 PM, Knut Staring knutst@gmail.com wrote:
Ok…and you cannot just revert to the dump? Or the dump has the same problem?
In any case, since you have a dump which you can experiment with (pls note that I have not tested this procedure thoroughly, and you might get more than one answer if you have more than one root or more than one superuser):
In any case, you should be able to do this in three steps - first finding the root OU and then your user:
- SELECT organisationunitid, name FROM organisationunit where parentid is null; LET’S SAY THE ANSWER IS 18
- SELECT userid from userrole where name=‘Superuser’; LET’S SAY THE ANSWER IS 32
Given those values, you should be able to do this:
- UPDATE usermembership SET organisationunitid = 18 WHERE userinfoid = 32;
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp
–
On Mon, Mar 12, 2018 at 6:21 PM, Georgi Chakarov georgi@logicaloutcomes.net wrote:
We got a database dump.
From: Knut Staring [mailto:knutst@gmail.com]
Sent: Monday, March 12, 2018 7:07 PM
To: Georgi Chakarov georgi@logicaloutcomes.net
Cc: DHIS 2 developers dhis2-devs@lists.launchpad.net; DHIS 2 Users list dhis2-users@lists.launchpad.net
Subject: Re: [Dhis2-devs] URGENT: Data capture and Maintenance org units Access
Do you have direct access to the database?
On Mon, Mar 12, 2018, 17:47 Georgi Chakarov georgi@logicaloutcomes.net wrote:
Hello all,
For some testing purpose, I gave my superuser access to ONE org unit at the lowest level. Now, I and (all other users ) see only this org unit for all data entry and maintenance apps, which is a bit strange.
Does anyone know how do I regain access to the entire org unit tree again?
Georgi Chakarov, CIA | georgi@logicaloutcomes.net | +1-647-478-5634 x 104 | LogicalOutcomes c/o Centre for Social Innovation, 720 Bathurst Street, Toronto Canada M5S 2R4 | * You may unsubscribe from receiving commercial electronic messages from LogicalOutcomes by emailing *info@logicaloutcomes.net
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp
Knut Staring
Department of Information, Evidence and Research
World Health Organization, Geneva, Switzerland
Office: +41 22 791 3683 Mob1: +33 6 4434 2931 Mob2: +47 9188 0522
Skype: knutstar
–
–
Stephen Ocaya
Tel: +256 393 217 892 | Mob: +256774558980
www.stephocay.com
SkypeID: stephocay