Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

users.alias column is redundant #3851

Closed
rcubetrac opened this issue Jul 31, 2012 · 13 comments
Closed

users.alias column is redundant #3851

rcubetrac opened this issue Jul 31, 2012 · 13 comments

Comments

@rcubetrac
Copy link

@rcubetrac rcubetrac commented Jul 31, 2012

Reported by @alecpl on 31 Jul 2012 10:35 UTC as Trac ticket #1488581

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:[[BR]]

  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.

Migrated-From: http://trac.roundcube.net/ticket/1488581

@rcubetrac

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented Aug 6, 2012

Comment by @alecpl on 6 Aug 2012 09:10 UTC

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

@rcubetrac

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented Aug 6, 2012

Status changed by @alecpl on 6 Aug 2012 09:10 UTC

new => closed

@rcubetrac

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented Aug 7, 2012

Comment by Dodge on 7 Aug 2012 08:53 UTC

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

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

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented Aug 7, 2012

Status changed by Dodge on 7 Aug 2012 08:53 UTC

closed => reopened

@rcubetrac

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented Aug 7, 2012

Comment by @alecpl on 7 Aug 2012 09:55 UTC

Fixed in ee2187e.

@rcubetrac

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented Aug 7, 2012

Status changed by @alecpl on 7 Aug 2012 09:55 UTC

reopened => closed

@rcubetrac

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented Aug 7, 2012

Comment by Dodge on 7 Aug 2012 11:37 UTC

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..

@rcubetrac

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented Aug 7, 2012

Status changed by Dodge on 7 Aug 2012 11:37 UTC

closed => reopened

@rcubetrac

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented Aug 7, 2012

Comment by @alecpl on 7 Aug 2012 11:55 UTC

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.

@rcubetrac

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented Aug 7, 2012

Status changed by @alecpl on 7 Aug 2012 11:55 UTC

reopened => closed

@rcubetrac rcubetrac closed this Aug 7, 2012
@rcubetrac

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented Aug 7, 2012

Comment by Dodge on 7 Aug 2012 12:40 UTC

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.

@rcubetrac

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented May 12, 2013

Comment by tyo on 12 May 2013 08:25 UTC

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.

@rcubetrac

This comment has been minimized.

Copy link
Author

@rcubetrac rcubetrac commented May 12, 2013

Comment by @alecpl on 12 May 2013 08:42 UTC

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.