Roundcube Community Forum

 

ident_switch plugin

Started by johnwayne, March 06, 2017, 03:00:19 AM

Previous topic - Next topic

johnwayne

looking for help manually installing the ident_switch plugin. im using rc 1.1.6

johnwayne

i answered my own question, but now have a new one.

first, here's the manual installation steps - so that it can help someone else:
unzip the package from the repo and name the folder "ident_switch" and place it in the plugins directory of your rc installation.
add 'ident_switch' to the $config['plugins'] array in the main config.inc.php file.
you may need to edit the $config['identities_level'] value to allow the ident_switch settings for the additional identities to appear.
open your phpmyadmin and import the mysql.initial.sql file to add the necessary table to the database.

my new question, is:
the ident_switch plugin replaces the static display of the email account at the top of the interface in desktop view with the account chooser, but when using the melanie2 mobile rc skin, the static display of the email account is not replaced with the account chooser. any suggestions on how to achieve this?

johnwayne

the melanie2 author has sent me a suggestion to potentially complete my second question, i will update once i can test it.
now to list a quirk in the ident_switch plugin itself: the server settings if entered when first creating the additional identity, will not be saved. you must first create the new identity, then thereafter edit the server settings for the then existing new identity.

so on to the next question: in all the places that roundcube allows the user to select between identities prior to this plugin - such as the compose window, etc. can the ability to select the other identities in roundcube be disabled? in effect locking the usage into whichever identity is currently selected by the chooser created by the plugin?

without that restriction, sent items and such can get misplaced into other accounts if the identity choice is made from the compose window instead of from the plugin chooser, and so on.

5kyy

Hello,
in current Roundcube 1.3.0 the Plugin didn´t work...
TypeError: $truName.size is not a function
Any solutions?

ineo

#4
I experience the same, Roundcube 1.3.0 and ident_switch 1.1 not working.

For example the pull-down options isn't working so one can't switch between identities.

Below developer console information

jQuery.Deferred exception: $truName.size is not a function @https://hostname/plugins/ident_switch/ident_switch.min.js?s=1476818596:1:55
j@https://hostname/program/js/jquery.min.js?s=1498503424:36:29997
g/</k<@https://hostname/program/js/jquery.min.js?s=1498503424:36:30313

TypeError: $truName.size is not a function
undefined


So seems to be a js problem.

Update July 21 11:30 UTC


Always nice to find the answer  ;)

The .size() method is deprecated as of jQuery 1.8. Use the .length property instead.

So change the size () methode with length in both .js files and everything seems to be working again.

Old:

$(function() {
        var $truName = $('.topright .username');
        if ($truName.size () > 0) {
                $sw = $('#plugin-ident_switch-account');
                if ($sw.size () > 0) {
                        $sw.prependTo('.topright');
                        $truName.hide();
                        $('#plugin-ident_switch-account').show();
                }
        }

New:

$(function() {
        var $truName = $('.topright .username');
        if ($truName.length > 0) {
                $sw = $('#plugin-ident_switch-account');
                if ($sw.length > 0) {
                        $sw.prependTo('.topright');
                        $truName.hide();
                        $('#plugin-ident_switch-account').show();
                }
        }




Regards

5kyy

Hello,

yes i switch both functions and now the dropdown field is available without errors.

But switching accoutns didn´t work yet.
In Console i geht from the ident_switch.js
gwel

which comes from function in line 52...

johnwayne

I solved my issue of disabling the ident_switch availability during compose. will have to follow suit on the mobile skin compose and actually get the identity switcher working in main mobile skin. Does anyone know how to disable editing of the fields that ident_switch creates for the imap settings of additional identities, after they have been created. setting the identities_level = 4 in the config.inc.php doesnt affect those like i had hoped.

5kyy

Hello,

on any Roundcube 1.3.0 installation? Is this plugin running?
Switching the identities is on my installations not possible see above...

ineo


I am running this plugin on a 1.3.1 install based on the changes I made that can be found in this threat.

Looking the plugin repository (https://plugins.roundcube.net/) I don't see any code development, so it seems the bug is stil there when you install is via the composer.

Pretender

ineo, please, can you explain how you the install indent_switch? Because in my roundcube 1.3.1 and Larry skin it doesn`t work...

5kyy

Today, i run the composer again to reinstall the Plugin.

After reinstalltion the size() -> length values had to be replaced as in post above.

But after this, i get same error if i want to switch Accounts.

QWEL

without Account change.

colinh

Thank You For This Thread.

Today I did a manual install of the ident_switch plugin on a new Roundcube 1.3.4 installation running the Larry skin, initially I was not getting the account selection list in the top right of the screen, after finding this thread I modified the plugin Javascript files as suggested, replacing  size() with length , and now it works fine, the account selection list works and switches accounts successfully, I also installed the identity_smtp plugin by doing a git clone of it into the plugins directory and that plugin works nicely as well, so I can switch accounts and send from the appropriate smtp server for the account.

These plugins do work under Roundcube 1.3.4. I am running PHP 7.2 under Apache 2.4.6 on Centos 7.4

Colin

willsmith501

#12
I'm trying to install the ident_switch plugin on Roundcube 1.3.4, and when I try to import the mysql.initial.sql file, I get the following error:

Notice in ./import.php#704
Undefined variable: import_text

The IMAP details show up in the identities tab of settings, but nothing is saved into those fields.

Any help would be greatly appreciated!
Thanks!
Will

pauLee

Quote from: willsmith501 on May 08, 2018, 07:08:31 PM
I'm trying to install the ident_switch plugin on Roundcube 1.3.4, and when I try to import the mysql.initial.sql file, I get the following error:

Notice in ./import.php#704
Undefined variable: import_text

The IMAP details show up in the identities tab of settings, but nothing is saved into those fields.

Any help would be greatly appreciated!
Thanks!
Will

Hi Will,

I have successfully installed the ident_switch with the following command on my RC1.3.x installation:

php composer.phar require boressoft/ident_switch:~3.0

After that I deleted the still existing identities and created them new. And now it works, without any manual editing of the database or js files.


Tom