Author Topic: Password Plugin  (Read 9939 times)

Offline Schmatze

  • Jr. Member
  • **
  • Posts: 31
Password Plugin
« Reply #15 on: August 18, 2010, 11:51:13 AM »
This was the first one I tried. Doesn't work either.

Code: [Select]
You can't specify target table 'virtual_users' for update in FROM clause

Thats why I tried it with a temporary table.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
Password Plugin
« Reply #16 on: August 18, 2010, 12:13:01 PM »
Ok I think its just a mysql format problem, try this:
Code: [Select]

$rcmail_config['password_query'] = 'UPDATE `mail`.`virtual_users` SET `password` = MD5( %p ) WHERE `virtual_users`.`id` = (SELECT `id` FROM `mail`.`virtual_users` WHERE `domain_id` = (SELECT `id` FROM `mail`.`virtual_users` WHERE `name` = %d) AND `user` = %l AND `password` = MD5( %o )) LIMIT 1';

Offline Schmatze

  • Jr. Member
  • **
  • Posts: 31
Password Plugin
« Reply #17 on: August 18, 2010, 12:37:59 PM »
Ok, I made a view now with the password and the mail-address inside.

Works fine now.

Here is my query:

Code: [Select]
UPDATE `mail`.`view_users` SET `password` = MD5( %p ) WHERE `email` = %u AND `password` = MD5( %o ) LIMIT 1

Thanks for your help. ;)