Opened 11 months ago

Closed 11 months ago

Last modified 5 weeks ago

#1488581 closed Bugs (fixed)

users.alias column is redundant

Reported by: alec Owned by:
Priority: 5 Milestone: 0.9-beta
Component: Core functionality Version: 0.8-rc
Severity: normal Keywords:
Cc:

Description (last modified by alec)

That column is used only for log in. The current behaviour allows only one alias. Also not every installation is using it at all. What I propose is to:

  1. remove this column.
  2. add an option which will search for the username in identities table.
    SELECT u.*
    FROM users u
    JOIN identities i ON (i.user_id = u.user_id)
    WHERE email = ? AND del <> 1
    LIMIT 1
    

So, this way searching for alias would be optional (which will improve performance) and will gives more possibilities.

Change History (9)

comment:1 Changed 11 months ago by alec

  • Description modified (diff)

comment:2 Changed 11 months ago by alec

  • Resolution set to fixed
  • Status changed from new to closed

Done in 565c472918e7f9707cd8d7909ad5dbcc5a921fdf. The option name is 'user_aliases'.

comment:3 Changed 11 months ago by Dodge

  • Resolution fixed deleted
  • Status changed from closed to reopened

cant autocreate user after using latest Git with clean DB ($rcmail_config['user_aliases'] = false;)

[07-Aug-2012 08:48:21 UTC] MDB2 Error: no such field (-19): _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_deadbeefdeadbeef FROM 'INSERT INTO users (created, last_login, username, mail_host, alias, language) VALUES (now(), now(), ?, ?, ?, ?)']
[Native code: 1054]
[Native message: Unknown column 'alias' in 'field list']
[07-Aug-2012 10:48:21 +0200]: DB Error: _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_mysql_deadbeefdeadbeef FROM 'INSERT INTO users (created, last_login, username, mail_host, alias, language) VALUES (now(), now(), ?, ?, ?, ?)']
[Native code: 1054]
[Native message: Unknown column 'alias' in 'field list']
in /srv/roundcubemail/program/include/rcube_mdb2.php on line 326 (POST /mail/?_task=login&_action=login)
[07-Aug-2012 10:48:21 +0200]: PHP Error: Failed to create new user in /srv/roundcubemail/program/include/rcube_user.php on line 517 (POST /mail/?_task=login&_action=login)
[07-Aug-2012 10:48:21 +0200]: PHP Error: Failed to create a user record. Maybe aborted by a plugin? in /srv/roundcubemail/program/include/rcmail.php on line 512 (POST /mail/?_task=login&_action=login) 

comment:4 Changed 11 months ago by alec

  • Resolution set to fixed
  • Status changed from reopened to closed

comment:5 Changed 11 months ago by Dodge

  • Resolution fixed deleted
  • Status changed from closed to reopened

Sorry for bugging again, but i would like to know it is intended that i cant login with only the part before @ anymore.

before these changes, i was able to do the following:
(starting with a clean database)

  • login with dodge@ mymail.com
  • # rc created my user
  • # seeing my mails..
  • logout
  • login with dodge
  • # seeing my mails..

now it is:
(also starting with a clean database)

  • login with dodge@ mymail.com
  • # rc created my user
  • # seeing my mails..
  • logout
  • login with dodge
  • # login failed
  • login with dodge@ mymail.com
  • # seeing my mails..

comment:6 Changed 11 months ago by alec

  • Resolution set to fixed
  • Status changed from reopened to closed

What plugins are you using? I think by default it was never supposed to work this way. To make this work, you need a plugin or you need to set username_domain option. It means it's expected behavior.

comment:7 Changed 11 months ago by Dodge

I'm not using any plugins, i just git clone'd the repo.

I found my problem.
I had user_domain set to @mymail.com instead of mymail.com

Now i just wonder why it worked before these changes.

comment:8 Changed 5 weeks ago by tyo

The column was not redundant :(
It allowed me to set up log in aliases for the users. Now they have to use the cryptic IMAP logins that my provider assigns -- they can't possibly remember them.

I have to downgrade; this way, roundcube is not usable for me.

comment:9 Changed 5 weeks ago by alec

A proper use for this is to write/use a plugin (see virtuser_query plugin) or if these aliases are email addresses use user_aliases option.

Note: See TracTickets for help on using tickets.