Loading...
 
Features / Usability

Features / Usability


[SOLVED] Enabling "Use email as username" on a populated Tiki23

Hello and sorry to ask this here but I have no clue if this behaviour is a regression, a bug or was always like this.


I have a working (upgraded) Tiki23 with plenty of registered users (username and email).
Now I want to change the log-in preference and to Use email as username.

At tiki-admin.php?page=login
Username
I enable "Use email as username".

Technically, all seems to work;
I can login using the previous username and the email (good)
When registering a new user only the email field is displayed

But admin the users become harder.
At : /tiki-adminusers.php, the email column email doesn't show up anymore, which make sense as now the user should show the email as username.
However for previous account that have a username and an email, the col user display their previous (existing) username.
And if I click on a user the first field is now "email" with the previous username value.

I have no way to find the email that are linked with users from the admin user.
Seems everywhere the field Email displays the previous username value (tiki-user_information.php, etc)

Was it always like this ?
Shouldn't the user displayed "user mail" when "Use email as username" is enable instead of the username ?

Or, is it a kind of dark area where the Tiki admin should handle it by himself ? (Export all user, merge username and email and import… 🤔)

Bernard

Hi Bernard

It's always been like this, and it's really not a good idea to change that once you have a load of users. Your best bet i think is to make the changes in the database directly...

I have a site that we are switching from "email as username" to normal username and "can log in using username or email" enabled because "email as username" isn't fully private, as it warns on the pref. I've written a script to do the conversion which i've been meaning to commit to devtools as an example, it will happen one day (probably) but won't really help you here...

So i think as you say, either export and import or play with the data in the database directly (carefully ;) is your only option.

jonny




> On 22 Dec 2021, at 08:05, Bernard Sfez via TikiWiki-devel <tikiwiki-devel@lists.sourceforge.net> wrote:
>
> Hello and sorry to ask this here but I have no clue if this behaviour is a regression, a bug or was always like this.
>
>
> I have a working (upgraded) Tiki23 with plenty of registered users (username and email).
> Now I want to change the log-in preference and to Use email as username.
>
> At tiki-admin.php?page=login
> Username
> I enable "Use email as username".
>
> Technically, all seems to work;
> I can login using the previous username and the email (good)
> When registering a new user only the email field is displayed
>
> But admin the users become harder.
> At : /tiki-adminusers.php, the email column email doesn't show up anymore, which make sense as now the user should show the email as username.
> However for previous account that have a username and an email, the col user display their previous (existing) username.
> And if I click on a user the first field is now "email" with the previous username value.
>
> I have no way to find the email that are linked with users from the admin user.
> Seems everywhere the field Email displays the previous username value (tiki-user_information.php, etc)
>
> Was it always like this ?
> Shouldn't the user displayed "user mail" when "Use email as username" is enable instead of the username ?
>
> Or, is it a kind of dark area where the Tiki admin should handle it by himself ? (Export all user, merge username and email and import… 🤔)
>
> Bernard
>
> ___
> TikiWiki-devel mailing list
> TikiWiki-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel



___
TikiWiki-devel mailing list
TikiWiki-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel

Thank you for explanation.

> it's really not a good idea to change that once you have a load of users

This is not really a question of sudden idea. 10 years ago internet was different and admin have to follow... ;-)

Feature request posted so we have track of things : https://dev.tiki.org/item8002-Admin-Log-in-when-enabling-disabling-Use-email-as-username-a-conversion-should-be-offered-to-manage-previous-user

See you,
Bernard


> On 22 Dec 2021, at 12:49, Jonny Bradley via TikiWiki-devel <tikiwiki-devel@lists.sourceforge.net> wrote:
>
> Hi Bernard
>
> It's always been like this, and it's really not a good idea to change that once you have a load of users. Your best bet i think is to make the changes in the database directly...
>
> I have a site that we are switching from "email as username" to normal username and "can log in using username or email" enabled because "email as username" isn't fully private, as it warns on the pref. I've written a script to do the conversion which i've been meaning to commit to devtools as an example, it will happen one day (probably) but won't really help you here...
>
> So i think as you say, either export and import or play with the data in the database directly (carefully ;) is your only option.
>
> jonny
>
>
>
>
>> On 22 Dec 2021, at 08:05, Bernard Sfez via TikiWiki-devel <tikiwiki-devel@lists.sourceforge.net> wrote:
>>
>> Hello and sorry to ask this here but I have no clue if this behaviour is a regression, a bug or was always like this.
>>
>>
>> I have a working (upgraded) Tiki23 with plenty of registered users (username and email).
>> Now I want to change the log-in preference and to Use email as username.
>>
>> At tiki-admin.php?page=login
>> Username
>> I enable "Use email as username".
>>
>> Technically, all seems to work;
>> I can login using the previous username and the email (good)
>> When registering a new user only the email field is displayed
>>
>> But admin the users become harder.
>> At : /tiki-adminusers.php, the email column email doesn't show up anymore, which make sense as now the user should show the email as username.
>> However for previous account that have a username and an email, the col user display their previous (existing) username.
>> And if I click on a user the first field is now "email" with the previous username value.
>>
>> I have no way to find the email that are linked with users from the admin user.
>> Seems everywhere the field Email displays the previous username value (tiki-user_information.php, etc)
>>
>> Was it always like this ?
>> Shouldn't the user displayed "user mail" when "Use email as username" is enable instead of the username ?
>>
>> Or, is it a kind of dark area where the Tiki admin should handle it by himself ? (Export all user, merge username and email and import… 🤔)
>>
>> Bernard
>>
>> ___
>> TikiWiki-devel mailing list
>> TikiWiki-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>
>
>
> ___
> TikiWiki-devel mailing list
> TikiWiki-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel



___
TikiWiki-devel mailing list
TikiWiki-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel


>> enabled because "email as username" isn't fully private

In my case the user have user trackers so they have a Real Name that is available.

At tiki-admin.php?page=login => Username, I enabled;
Obscure email when using email as username
This will attempt as much as possible to hide the email address, showing the real name or the truncated email address instead.

Is it really working well… Too well !!!
I need a way for the admin to see the users email. 😂

Bernard

> On 22 Dec 2021, at 13:09, Bernard Sfez via TikiWiki-devel <tikiwiki-devel@lists.sourceforge.net> wrote:
>
> Thank you for explanation.
>
>> it's really not a good idea to change that once you have a load of users
>
> This is not really a question of sudden idea. 10 years ago internet was different and admin have to follow... ;-)
>
> Feature request posted so we have track of things : https://dev.tiki.org/item8002-Admin-Log-in-when-enabling-disabling-Use-email-as-username-a-conversion-should-be-offered-to-manage-previous-user
>
> See you,
> Bernard
>
>
>> On 22 Dec 2021, at 12:49, Jonny Bradley via TikiWiki-devel <tikiwiki-devel@lists.sourceforge.net> wrote:
>>
>> Hi Bernard
>>
>> It's always been like this, and it's really not a good idea to change that once you have a load of users. Your best bet i think is to make the changes in the database directly...
>>
>> I have a site that we are switching from "email as username" to normal username and "can log in using username or email" enabled because "email as username" isn't fully private, as it warns on the pref. I've written a script to do the conversion which i've been meaning to commit to devtools as an example, it will happen one day (probably) but won't really help you here...
>>
>> So i think as you say, either export and import or play with the data in the database directly (carefully ;) is your only option.
>>
>> jonny
>>
>>
>>
>>
>>> On 22 Dec 2021, at 08:05, Bernard Sfez via TikiWiki-devel <tikiwiki-devel@lists.sourceforge.net> wrote:
>>>
>>> Hello and sorry to ask this here but I have no clue if this behaviour is a regression, a bug or was always like this.
>>>
>>>
>>> I have a working (upgraded) Tiki23 with plenty of registered users (username and email).
>>> Now I want to change the log-in preference and to Use email as username.
>>>
>>> At tiki-admin.php?page=login
>>> Username
>>> I enable "Use email as username".
>>>
>>> Technically, all seems to work;
>>> I can login using the previous username and the email (good)
>>> When registering a new user only the email field is displayed
>>>
>>> But admin the users become harder.
>>> At : /tiki-adminusers.php, the email column email doesn't show up anymore, which make sense as now the user should show the email as username.
>>> However for previous account that have a username and an email, the col user display their previous (existing) username.
>>> And if I click on a user the first field is now "email" with the previous username value.
>>>
>>> I have no way to find the email that are linked with users from the admin user.
>>> Seems everywhere the field Email displays the previous username value (tiki-user_information.php, etc)
>>>
>>> Was it always like this ?
>>> Shouldn't the user displayed "user mail" when "Use email as username" is enable instead of the username ?
>>>
>>> Or, is it a kind of dark area where the Tiki admin should handle it by himself ? (Export all user, merge username and email and import… 🤔)
>>>
>>> Bernard
>>>
>>> ___
>>> TikiWiki-devel mailing list
>>> TikiWiki-devel at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>
>>
>>
>> ___
>> TikiWiki-devel mailing list
>> TikiWiki-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>
>
>
> ___
> TikiWiki-devel mailing list
> TikiWiki-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel


posts: 8633 Israel

Enabling the option is not enough, you have to convert all your user login from username to email. This is how I did it and it worked;

  1. Backup the database
  2. Look for all trackers with a username selector field
  3. Once field identified convert then username for the user email directly in mysql
    Here for a fieldId 1 in a tracker
    Copy to clipboard
    update tiki_tracker_item_fields i inner join users_users u on i.value=u.login set i.value=u.email where i.fieldId=1;
  4. Repeated this for all trackers username selector fields
  5. Copy the email over the login in the users_users table
    Copy to clipboard
    UPDATE users_users SET login=email;

    You may need to clean duplicates... search replace or manually
  6. Clean the Notifications list if used.
    On the notifications the username is hard-recorded, you need to tracker the users for whom it is needed to replace the username with the email.
  7. Reinstate the admin account (last but not least), go back to users_users and normally your very first user is the admin, replace the login (email) with "admin.


That's how I did and it worked just fine.

posts: 126886 United Kingdom

HI Bernard

Well done - there may be other places where user logins are used, tiki_history, tiki_actionlog etc which on some sites also need changing, which is why it's best to get this decision right at the start! rolleyes

Bernard Sfez / Tiki Specialist wrote:
  1. Reinstate the admin account (last but not least), go back to users_users and normally your very first user is the admin, replace the login (email) with "admin.

You could always exclude the admin user from the updates with

Copy to clipboard
UPDATE users_users SET login=email; WHERE login != 'admin'

But well done, maybe this should be a recipe somewhere?

posts: 8633 Israel
Jonny Bradley wrote:
But well done, maybe this should be a recipe somewhere?


The famous and awaited Tiki Recipes Book by bsfez... 😂

I agree it is on other places but letting the old login in history or action logs didn't broke the Tiki. ;-)


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting