Label and host are not required from now.
This commit is contained in:
11
SQL/postgres/2016052000.sql
Normal file
11
SQL/postgres/2016052000.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
ALTER TABLE
|
||||
ident_switch
|
||||
ALTER COLUMN
|
||||
host
|
||||
DROP NOT NULL;
|
||||
|
||||
ALTER TABLE
|
||||
ident_switch
|
||||
ALTER COLUMN
|
||||
label
|
||||
DROP NOT NULL;
|
||||
@@ -67,17 +67,26 @@ class ident_switch extends rcube_plugin
|
||||
if (strcasecmp($_SESSION['username'], $r['username']) === 0)
|
||||
$opts['selected'] = 'selected';
|
||||
|
||||
// Make label
|
||||
$lbl = $r['label'];
|
||||
if (!$lbl)
|
||||
{
|
||||
if (strpos($r['username'], '@') === false)
|
||||
$lbl = $r['username'] . '@' . ($r['host'] ? $r['host'] : 'localhost');
|
||||
else
|
||||
$lbl = $r['username'];
|
||||
}
|
||||
|
||||
$sOpt .= html::tag(
|
||||
'option',
|
||||
$opts,
|
||||
$r['label']
|
||||
rcube::Q($lbl)
|
||||
);
|
||||
}
|
||||
|
||||
// Render UI if user has extra accounts
|
||||
if (!empty($sOpt))
|
||||
{
|
||||
|
||||
// Add main account
|
||||
$opts = array('value' => -1);
|
||||
if (strcasecmp($_SESSION['username'], $rc->user->data['username']) === 0)
|
||||
@@ -352,7 +361,7 @@ class ident_switch extends rcube_plugin
|
||||
}
|
||||
$_SESSION['password' . $this->my_postfix] = $_SESSION['password'];
|
||||
|
||||
$_SESSION['storage_host'] = $r['host'];
|
||||
$_SESSION['storage_host'] = $r['host'] ? $r['host'] : 'localhost'; // Default host here!
|
||||
$_SESSION['storage_ssl'] = $ssl;
|
||||
$_SESSION['storage_port'] = $port;
|
||||
$_SESSION['username'] = $r['username'];
|
||||
|
||||
Reference in New Issue
Block a user