-
Bug
-
Resolution: Fixed
-
Low
-
HCS 2.1.3
-
None
-
Severity 3 - Minor
Summary
In HipChat Server, you are unable to transfer the owner role to another admin, even if the admin user is confirmed.
Environment
HipChat Server v2.1.3
Steps to Reproduce
- Log into HipChat Server user interface
- Navigate to GROUP ADMIN then to USERS
- Select an admin on the user page.
- Select 'Transfer Ownership'. Select 'Okay' on the popup
Expected Results
The admin is made group owner
Actual Results
The following error is shown in the browser:
"Cannot transfer ownership. User <admin_name> does not have a confirmed email address."
The below exception is thrown in the /var/log/hipchat/web.log file:
2017-02-06T21:11:16.238759+00:00 hipchat web[10424]: admin/user#REQF1D0AD uid-1 18ms [info] Showing flash error: Cannot transfer ownership. User <admin_name> does not have a confirmed email address.
Notes
There are roughly four checks that take place before the group ownership can be transferred to an admin.
- The admin must have confirmed their email address (confirmed = 1 in the HC database)
In additional to the check above, one of the following items must also be true:
- Admins confirmation time (in the admin metadata) must be present (cannot be NULL)
- The created date of the user must be on or after 5-1-2015
- The admin has an AID attached to their account (not applicable for HC Server, so this is always false)
If item number 1 is true and any other item is true, the change will go through. If item number 1 is true and all three items are false, then you'll get the error "Cannot transfer ownership. User <admin_name> does not have a confirmed email address."
Workaround
The easiest workaround involves adding a confirmation date to the admin's metadata. Follow the instructions below:
- Log into the HipChat Server command line.
- Gain access to the database:
DBPASS=$(awk '/"pass"/ {gsub(/[",]/,"");print $2}' /hipchat/config/site.json) && mysql -uroot -p$DBPASS hipchat
- Update the admin's metadata with the confirmation time, subtituting <ID> for the admin's user_id:
UPDATE users SET metadata = '{"confirmation_unix_time":1486417957}' WHERE id=<ID>;
- Exit the database
exit
- Attempt to transfer the owner again.
The time shown is from 2-6-2017