roundcube plugin ispconfig3_account

Discussion in 'Plugins/Modules/Addons' started by kokez, Oct 2, 2013.

  1. kokez

    kokez New Member HowtoForge Supporter

    I only recently discovered that with the new version of ispconfig3, an user can access the mailserver with the email address and with the username, and this also from roundcube webmail.

    This makes the migration from an ispconfig2 a lot easier. For this reason, I feel that I have to thank Till, Falko and the rest of the development team.

    But once activated this possibility, I noticed that roundcube, logging in with the email, it fails to identify the user. Then I made some changes in: plugins/ispconfig3_account/ispconfig3_account.php

    Line 67, from:
    $mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));

    in this way:
    $username = $this->rcmail_inst->user->data['username'];
    $field = strpos($username,'@') ? 'email' : 'login';
    $mail_user = $this->soap->mail_user_get($session_id, array($field => $username));

    Line 136 (now 138), from:
    $this->rcmail_inst->output->set_env('framed', TRUE);

    in this way:
    $username = $this->rcmail_inst->user->data['username'];
    $field = strpos($username,'@') ? 'email' : 'login';

    $this->rcmail_inst->output->set_env('framed', TRUE);

    Line 140 (now 145), from:
    $table->add('', Q($this->rcmail_inst->user->data['username']));

    in this way:
    $table->add('', Q($username));

    Line 155 (now 160), from:
    $mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));

    in this way:
    $mail_user = $this->soap->mail_user_get($session_id, array($field => $username));


    Trivial but effective for my needs, to check the presence of the "@" character. If you think that it is useful, I propose a change to the plugin developer to implement it in the repository, so it becomes for the benefit of all.

    Ciao!
     

Share This Page