Author Topic: Hacking Roundcube...  (Read 7062 times)

Offline Borszczuk

  • Jr. Member
  • **
  • Posts: 16
Hacking Roundcube...
« on: February 23, 2010, 01:08:56 PM »
Hi,

I want my users to just give full email address of their account and password in login form. I then want RC to connect the to HOST (so I do not need any predefined list of host nor any lookups hor hashes etc.). Same email, pass and HOST is used for outgoing SMTP which simplifies the thing.

Here what I got now - in config file I set smtp_server, smtp_user and smtp_pass to the documented placeholders and this seem to solve my outgoing mails problem, which is good. For incoming mails however I had to put my fingers into the code and mess a bit. First, I wanted just two inputs in login form (login and pass) and no input nor select for server (this is not practical if your servers changes often or you got hell lot of them). So I hacked login_form() in program/include/rcube_template.php to hide server input ($input_host = html_hiddenfield(...)). Then I rewrote autoselect_host() in program/include/rcmail.php to return host from provided email addres (default_host in config have to be left empty for that).

Can I can achieve the same (both custom login form and imap server name) in cleaner way (plugin perhaps?). Hook 'authenticate' looks promising from what I see, but how can I tweak login form?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,855
Hacking Roundcube...
« Reply #1 on: February 24, 2010, 03:03:04 AM »
you're correct about the authenticate hook, this will let you set what ever you need for the login, to hide the server box just set $rcmail_config['default_host'] to one of your mail servers in your config, its going to be overridden by the work done in the authenticate hook any way.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
Hacking Roundcube...
« Reply #2 on: February 24, 2010, 03:25:00 AM »
You could redirect to a custom login form.