Page MenuHomePhorge

No OneTemporary

Size
91 KB
Referenced Files
None
Subscribers
None
diff --git a/installer/index.php b/installer/index.php
index d084c8aa5..d90c4f981 100644
--- a/installer/index.php
+++ b/installer/index.php
@@ -1,175 +1,175 @@
<?php
/*
+-------------------------------------------------------------------------+
| Roundcube Webmail setup tool |
| Version 0.9-git |
| |
| Copyright (C) 2009-2013, The Roundcube Dev Team |
| |
| This program is free software: you can redistribute it and/or modify |
| it under the terms of the GNU General Public License (with exceptions |
| for skins & plugins) as published by the Free Software Foundation, |
| either version 3 of the License, or (at your option) any later version. |
| |
| This file forms part of the Roundcube Webmail Software for which the |
| following exception is added: Plugins and Skins which merely make |
| function calls to the Roundcube Webmail Software, and for that purpose |
| include it by reference shall not be considered modifications of |
| the software. |
| |
| If you wish to use this file in another project or create a modified |
| version that will not be part of the Roundcube Webmail Software, you |
| may remove the exception above and use this source code under the |
| original version of the license. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of the GNU General Public License |
| along with this program. If not, see http://www.gnu.org/licenses/. |
| |
+-------------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-------------------------------------------------------------------------+
*/
ini_set('error_reporting', E_ALL &~ (E_NOTICE | E_STRICT));
ini_set('display_errors', 1);
define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../').'/');
define('RCUBE_INSTALL_PATH', INSTALL_PATH);
define('RCUBE_CONFIG_DIR', INSTALL_PATH . 'config/');
$include_path = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
$include_path .= INSTALL_PATH . 'program/include' . PATH_SEPARATOR;
$include_path .= ini_get('include_path');
set_include_path($include_path);
require_once 'Roundcube/bootstrap.php';
require_once 'rcube_install.php';
// deprecated aliases (to be removed)
require_once 'bc.php';
if (function_exists('session_start'))
session_start();
$RCI = rcube_install::get_instance();
$RCI->load_config();
if (isset($_GET['_getconfig'])) {
$filename = 'config.inc.php';
if (!empty($_SESSION['config'])) {
header('Content-type: text/plain');
header('Content-Disposition: attachment; filename="'.$filename.'"');
echo $_SESSION['config'];
exit;
}
else {
header('HTTP/1.0 404 Not found');
die("The requested configuration was not found. Please run the installer from the beginning.");
}
}
if ($RCI->configured && ($RCI->getprop('enable_installer') || $_SESSION['allowinstaller']) &&
!empty($_GET['_mergeconfig'])) {
$filename = 'config.inc.php';
header('Content-type: text/plain');
header('Content-Disposition: attachment; filename="'.$filename.'"');
$RCI->merge_config();
echo $RCI->create_config();
exit;
}
// go to 'check env' step if we have a local configuration
if ($RCI->configured && empty($_REQUEST['_step'])) {
header("Location: ./?_step=1");
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Roundcube Webmail Installer</title>
<meta name="Robots" content="noindex,nofollow" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="styles.css" />
<script type="text/javascript" src="client.js"></script>
</head>
<body>
<div id="banner">
<div class="banner-bg"></div>
<div class="banner-logo"><a href="http://roundcube.net"><img src="images/roundcube_logo.png" width="210" height="55" border="0" alt="Roundcube - open source webmail software" /></a></div>
</div>
<div id="topnav">
<a href="http://trac.roundcube.net/wiki/Howto_Install">How-to Wiki</a>
</div>
<div id="content">
<?php
// exit if installation is complete
if ($RCI->configured && !$RCI->getprop('enable_installer') && !$_SESSION['allowinstaller']) {
// header("HTTP/1.0 404 Not Found");
if ($RCI->configured && $RCI->legacy_config) {
echo '<h2 class="error">Your configuration needs to be migrated!</h2>';
echo '<p>We changed the configuration files structure and your installation needs to be updated accordingly.</p>';
- echo '<p>Please run the <tt>bin/update.sh</tt> script from the command line or set <p>&nbsp; <tt>$rcmail_config[\'enable_installer\'] = true;</tt></p>';
+ echo '<p>Please run the <tt>bin/update.sh</tt> script from the command line or set <p>&nbsp; <tt>$rcube_config[\'enable_installer\'] = true;</tt></p>';
echo ' in your RCUBE_CONFIG_DIR/main.inc.php to let the installer help you migrating it.</p>';
}
else {
echo '<h2 class="error">The installer is disabled!</h2>';
- echo '<p>To enable it again, set <tt>$rcmail_config[\'enable_installer\'] = true;</tt> in RCUBE_CONFIG_DIR/config.inc.php</p>';
+ echo '<p>To enable it again, set <tt>$config[\'enable_installer\'] = true;</tt> in RCUBE_CONFIG_DIR/config.inc.php</p>';
}
echo '</div></body></html>';
exit;
}
?>
<h1>Roundcube Webmail Installer</h1>
<ol id="progress">
<?php
$include_steps = array(
1 => './check.php',
2 => './config.php',
3 => './test.php',
);
if (!in_array($RCI->step, array_keys($include_steps))) {
$RCI->step = 1;
}
foreach (array('Check environment', 'Create config', 'Test config') as $i => $item) {
$j = $i + 1;
$link = ($RCI->step >= $j || $RCI->configured) ? '<a href="./index.php?_step='.$j.'">' . Q($item) . '</a>' : Q($item);
printf('<li class="step%d%s">%s</li>', $j+1, $RCI->step > $j ? ' passed' : ($RCI->step == $j ? ' current' : ''), $link);
}
?>
</ol>
<?php
include $include_steps[$RCI->step];
?>
</div>
<div id="footer">
Installer by the Roundcube Dev Team. Copyright &copy; 2008-2012 – Published under the GNU Public License;&nbsp;
Icons by <a href="http://famfamfam.com">famfamfam</a>
</div>
</body>
</html>
diff --git a/plugins/acl/config.inc.php.dist b/plugins/acl/config.inc.php.dist
index d0e1a0932..3f0b1efb6 100644
--- a/plugins/acl/config.inc.php.dist
+++ b/plugins/acl/config.inc.php.dist
@@ -1,25 +1,25 @@
<?php
// Default look of access rights table
// In advanced mode all access rights are displayed separately
// In simple mode access rights are grouped into four groups: read, write, delete, full
-$rcmail_config['acl_advanced_mode'] = false;
+$config['acl_advanced_mode'] = false;
// LDAP addressbook that would be searched for user names autocomplete.
-// That should be an array refering to the $rcmail_config['ldap_public'] array key
+// That should be an array refering to the $config['ldap_public'] array key
// or complete addressbook configuration array.
-$rcmail_config['acl_users_source'] = '';
+$config['acl_users_source'] = '';
// The LDAP attribute which will be used as ACL user identifier
-$rcmail_config['acl_users_field'] = 'mail';
+$config['acl_users_field'] = 'mail';
// The LDAP search filter will be &'d with search queries
-$rcmail_config['acl_users_filter'] = '';
+$config['acl_users_filter'] = '';
// Include the following 'special' access control subjects in the ACL dialog;
// Defaults to array('anyone', 'anonymous') (not when set to an empty array)
// Example: array('anyone') to exclude 'anonymous'.
// Set to an empty array to exclude all special aci subjects.
-$rcmail_config['acl_specials'] = array('anyone', 'anonymous');
+$config['acl_specials'] = array('anyone', 'anonymous');
?>
diff --git a/plugins/additional_message_headers/config.inc.php.dist b/plugins/additional_message_headers/config.inc.php.dist
index 83ccd869c..72a4f1cee 100644
--- a/plugins/additional_message_headers/config.inc.php.dist
+++ b/plugins/additional_message_headers/config.inc.php.dist
@@ -1,14 +1,14 @@
<?php
-// $rcmail_config['additional_message_headers']['X-Remote-Browser'] = $_SERVER['HTTP_USER_AGENT'];
-// $rcmail_config['additional_message_headers']['X-Originating-IP'] = $_SERVER['REMOTE_ADDR'];
-// $rcmail_config['additional_message_headers']['X-RoundCube-Server'] = $_SERVER['SERVER_ADDR'];
+// $config['additional_message_headers']['X-Remote-Browser'] = $_SERVER['HTTP_USER_AGENT'];
+// $config['additional_message_headers']['X-Originating-IP'] = $_SERVER['REMOTE_ADDR'];
+// $config['additional_message_headers']['X-RoundCube-Server'] = $_SERVER['SERVER_ADDR'];
// if( isset( $_SERVER['MACHINE_NAME'] )) {
-// $rcmail_config['additional_message_headers']['X-RoundCube-Server'] .= ' (' . $_SERVER['MACHINE_NAME'] . ')';
+// $config['additional_message_headers']['X-RoundCube-Server'] .= ' (' . $_SERVER['MACHINE_NAME'] . ')';
// }
// To remove (e.g. X-Sender) message header use null value
-// $rcmail_config['additional_message_headers']['X-Sender'] = null;
+// $config['additional_message_headers']['X-Sender'] = null;
?>
diff --git a/plugins/database_attachments/config.inc.php.dist b/plugins/database_attachments/config.inc.php.dist
index b23a9a1be..c371cbbb7 100644
--- a/plugins/database_attachments/config.inc.php.dist
+++ b/plugins/database_attachments/config.inc.php.dist
@@ -1,12 +1,12 @@
<?php
// By default this plugin stores attachments in filesystem
// and copies them into sql database.
// You can change it to use 'memcache' or 'apc'.
-$rcmail_config['database_attachments_cache'] = 'db';
+$config['database_attachments_cache'] = 'db';
// Attachment data expires after specied TTL time in seconds (max.2592000).
// Default is 12 hours.
-$rcmail_config['database_attachments_cache_ttl'] = 12 * 60 * 60;
+$config['database_attachments_cache_ttl'] = 12 * 60 * 60;
?>
diff --git a/plugins/debug_logger/debug_logger.php b/plugins/debug_logger/debug_logger.php
index deb6deb91..88237d767 100644
--- a/plugins/debug_logger/debug_logger.php
+++ b/plugins/debug_logger/debug_logger.php
@@ -1,150 +1,150 @@
<?php
/**
* Debug Logger
*
* Enhanced logging for debugging purposes. It is not recommened
* to be enabled on production systems without testing because of
* the somewhat increased memory, cpu and disk i/o overhead.
*
* Debug Logger listens for existing console("message") calls and
* introduces start and end tags as well as free form tagging
* which can redirect messages to files. The resulting log files
* provide timing and tag quantity results.
*
* Enable the plugin in config.inc.php and add your desired
* log types and files.
*
* @version @package_version@
* @author Ziba Scott
* @website http://roundcube.net
*
* Example:
*
* config.inc.php:
*
- * // $rcmail_config['debug_logger'][type of logging] = name of file in log_dir
+ * // $config['debug_logger'][type of logging] = name of file in log_dir
* // The 'master' log includes timing information
- * $rcmail_config['debug_logger']['master'] = 'master';
+ * $config['debug_logger']['master'] = 'master';
* // If you want sql messages to also go into a separate file
- * $rcmail_config['debug_logger']['sql'] = 'sql';
+ * $config['debug_logger']['sql'] = 'sql';
*
* index.php (just after $RCMAIL->plugins->init()):
*
* console("my test","start");
* console("my message");
* console("my sql calls","start");
* console("cp -r * /dev/null","shell exec");
* console("select * from example","sql");
* console("select * from example","sql");
* console("select * from example","sql");
* console("end");
* console("end");
*
*
* logs/master (after reloading the main page):
*
* [17-Feb-2009 16:51:37 -0500] start: Task: mail.
* [17-Feb-2009 16:51:37 -0500] start: my test
* [17-Feb-2009 16:51:37 -0500] my message
* [17-Feb-2009 16:51:37 -0500] shell exec: cp -r * /dev/null
* [17-Feb-2009 16:51:37 -0500] start: my sql calls
* [17-Feb-2009 16:51:37 -0500] sql: select * from example
* [17-Feb-2009 16:51:37 -0500] sql: select * from example
* [17-Feb-2009 16:51:37 -0500] sql: select * from example
* [17-Feb-2009 16:51:37 -0500] end: my sql calls - 0.0018 seconds shell exec: 1, sql: 3,
* [17-Feb-2009 16:51:37 -0500] end: my test - 0.0055 seconds shell exec: 1, sql: 3,
* [17-Feb-2009 16:51:38 -0500] end: Task: mail. - 0.8854 seconds shell exec: 1, sql: 3,
*
* logs/sql (after reloading the main page):
*
* [17-Feb-2009 16:51:37 -0500] sql: select * from example
* [17-Feb-2009 16:51:37 -0500] sql: select * from example
* [17-Feb-2009 16:51:37 -0500] sql: select * from example
*/
class debug_logger extends rcube_plugin
{
function init()
{
require_once(dirname(__FILE__).'/runlog/runlog.php');
$this->runlog = new runlog();
if(!rcmail::get_instance()->config->get('log_dir')){
rcmail::get_instance()->config->set('log_dir',INSTALL_PATH.'logs');
}
$log_config = rcmail::get_instance()->config->get('debug_logger',array());
foreach($log_config as $type=>$file){
$this->runlog->set_file(rcmail::get_instance()->config->get('log_dir').'/'.$file, $type);
}
$start_string = "";
$action = rcmail::get_instance()->action;
$task = rcmail::get_instance()->task;
if($action){
$start_string .= "Action: ".$action.". ";
}
if($task){
$start_string .= "Task: ".$task.". ";
}
$this->runlog->start($start_string);
$this->add_hook('console', array($this, 'console'));
$this->add_hook('authenticate', array($this, 'authenticate'));
}
function authenticate($args){
$this->runlog->note('Authenticating '.$args['user'].'@'.$args['host']);
return $args;
}
function console($args){
$note = $args[0];
$type = $args[1];
if(!isset($args[1])){
// This could be extended to detect types based on the
// file which called console. For now only rcube_imap/rcube_storage is supported
$bt = debug_backtrace();
$file = $bt[3]['file'];
switch(basename($file)){
case 'rcube_imap.php':
$type = 'imap';
break;
case 'rcube_storage.php':
$type = 'storage';
break;
default:
$type = FALSE;
break;
}
}
switch($note){
case 'end':
$type = 'end';
break;
}
switch($type){
case 'start':
$this->runlog->start($note);
break;
case 'end':
$this->runlog->end();
break;
default:
$this->runlog->note($note, $type);
break;
}
return $args;
}
function __destruct()
{
if ($this->runlog)
$this->runlog->end();
}
}
diff --git a/plugins/enigma/config.inc.php.dist b/plugins/enigma/config.inc.php.dist
index ca841d0ac..2adb4d9f6 100644
--- a/plugins/enigma/config.inc.php.dist
+++ b/plugins/enigma/config.inc.php.dist
@@ -1,14 +1,14 @@
<?php
// Enigma Plugin options
// --------------------
// A driver to use for PGP. Default: "gnupg".
-$rcmail_config['enigma_pgp_driver'] = 'gnupg';
+$config['enigma_pgp_driver'] = 'gnupg';
// A driver to use for S/MIME. Default: "phpssl".
-$rcmail_config['enigma_smime_driver'] = 'phpssl';
+$config['enigma_smime_driver'] = 'phpssl';
// Keys directory for all users. Default 'enigma/home'.
// Must be writeable by PHP process
-$rcmail_config['enigma_pgp_homedir'] = null;
+$config['enigma_pgp_homedir'] = null;
diff --git a/plugins/help/config.inc.php.dist b/plugins/help/config.inc.php.dist
index 1dbc21753..7cc8d5f00 100644
--- a/plugins/help/config.inc.php.dist
+++ b/plugins/help/config.inc.php.dist
@@ -1,35 +1,35 @@
<?php
// Help content iframe source
// %l will be replaced by the language code resolved using the 'help_language_map' option
-$rcmail_config['help_source'] = 'http://roundcube.net/doc/help/0.9/%l/';
+$config['help_source'] = 'http://roundcube.net/doc/help/0.9/%l/';
// Map task/action combinations to deep-links
// Use '<task>/<action>' or only '<task>' strings as keys
// The values will be appended to the 'help_source' URL
-$rcmail_config['help_index_map'] = array(
+$config['help_index_map'] = array(
'login' => 'login.html',
'mail' => 'mail/index.html',
'mail/compose' => 'mail/compose.html',
'addressbook' => 'addressbook/index.html',
'settings' => 'settings/index.html',
'settings/preferences' => 'settings/preferences.html',
'settings/folders' => 'settings/folders.html',
'settings/identities' => 'settings/identities.html',
);
// Map to translate Roundcube language codes into help document languages
// The '*' entry will be used as default
-$rcmail_config['help_language_map'] = array('*' => 'en_US');
+$config['help_language_map'] = array('*' => 'en_US');
// Enter an absolute URL to a page displaying information about this webmail
// Alternatively, create a HTML file under <this-plugin-dir>/content/about.html
-$rcmail_config['help_about_url'] = null;
+$config['help_about_url'] = null;
// Enter an absolute URL to a page displaying information about this webmail
// Alternatively, put your license text to <this-plugin-dir>/content/license.html
-$rcmail_config['help_license_url'] = null;
+$config['help_license_url'] = null;
// Determine whether to open the help in a new window
-$rcmail_config['help_open_extwin'] = false;
+$config['help_open_extwin'] = false;
diff --git a/plugins/hide_blockquote/hide_blockquote.php b/plugins/hide_blockquote/hide_blockquote.php
index 1168656fd..2ad5dd8ac 100644
--- a/plugins/hide_blockquote/hide_blockquote.php
+++ b/plugins/hide_blockquote/hide_blockquote.php
@@ -1,78 +1,78 @@
<?php
/**
* Quotation block hidding
*
* Plugin that adds a possibility to hide long blocks of cited text in messages.
*
* Configuration:
* // Minimum number of citation lines. Longer citation blocks will be hidden.
* // 0 - no limit (no hidding).
- * $rcmail_config['hide_blockquote_limit'] = 0;
+ * $config['hide_blockquote_limit'] = 0;
*
* @version @package_version@
* @license GNU GPLv3+
* @author Aleksander Machniak <alec@alec.pl>
*/
class hide_blockquote extends rcube_plugin
{
public $task = 'mail|settings';
function init()
{
$rcmail = rcmail::get_instance();
if ($rcmail->task == 'mail'
&& ($rcmail->action == 'preview' || $rcmail->action == 'show')
&& ($limit = $rcmail->config->get('hide_blockquote_limit'))
) {
// include styles
$this->include_stylesheet($this->local_skin_path() . "/style.css");
// Script and localization
$this->include_script('hide_blockquote.js');
$this->add_texts('localization', true);
// set env variable for client
$rcmail->output->set_env('blockquote_limit', $limit);
}
else if ($rcmail->task == 'settings') {
$dont_override = $rcmail->config->get('dont_override', array());
if (!in_array('hide_blockquote_limit', $dont_override)) {
$this->add_hook('preferences_list', array($this, 'prefs_table'));
$this->add_hook('preferences_save', array($this, 'save_prefs'));
}
}
}
function prefs_table($args)
{
if ($args['section'] != 'mailview') {
return $args;
}
$this->add_texts('localization');
$rcmail = rcmail::get_instance();
$limit = (int) $rcmail->config->get('hide_blockquote_limit');
$field_id = 'hide_blockquote_limit';
$input = new html_inputfield(array('name' => '_'.$field_id, 'id' => $field_id, 'size' => 5));
$args['blocks']['main']['options']['hide_blockquote_limit'] = array(
'title' => $this->gettext('quotelimit'),
'content' => $input->show($limit ? $limit : '')
);
return $args;
}
function save_prefs($args)
{
if ($args['section'] == 'mailview') {
$args['prefs']['hide_blockquote_limit'] = (int) rcube_utils::get_input_value('_hide_blockquote_limit', rcube_utils::INPUT_POST);
}
return $args;
}
}
diff --git a/plugins/http_authentication/config.inc.php.dist b/plugins/http_authentication/config.inc.php.dist
index 0d798a586..0940dee1f 100644
--- a/plugins/http_authentication/config.inc.php.dist
+++ b/plugins/http_authentication/config.inc.php.dist
@@ -1,9 +1,9 @@
<?php
// HTTP Basic Authentication Plugin options
// ----------------------------------------
// Default mail host to log-in using user/password from HTTP Authentication.
// This is useful if the users are free to choose arbitrary mail hosts (or
// from a list), but have one host they usually want to log into.
-// Unlike $rcmail_config['default_host'] this must be a string!
-$rcmail_config['http_authentication_host'] = '';
+// Unlike $config['default_host'] this must be a string!
+$config['http_authentication_host'] = '';
diff --git a/plugins/http_authentication/http_authentication.php b/plugins/http_authentication/http_authentication.php
index 2631537a0..d86e1791c 100644
--- a/plugins/http_authentication/http_authentication.php
+++ b/plugins/http_authentication/http_authentication.php
@@ -1,92 +1,92 @@
<?php
/**
* HTTP Basic Authentication
*
* Make use of an existing HTTP authentication and perform login with the existing user credentials
*
* Configuration:
* // redirect the client to this URL after logout. This page is then responsible to clear HTTP auth
- * $rcmail_config['logout_url'] = 'http://server.tld/logout.html';
+ * $config['logout_url'] = 'http://server.tld/logout.html';
*
* See logout.html (in this directory) for an example how HTTP auth can be cleared.
*
* For other configuration options, see config.inc.php.dist!
*
* @version @package_version@
* @license GNU GPLv3+
* @author Thomas Bruederli
*/
class http_authentication extends rcube_plugin
{
function init()
{
$this->add_hook('startup', array($this, 'startup'));
$this->add_hook('authenticate', array($this, 'authenticate'));
$this->add_hook('logout_after', array($this, 'logout'));
}
function startup($args)
{
if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) {
$rcmail = rcmail::get_instance();
$rcmail->add_shutdown_function(array('http_authentication', 'shutdown'));
// handle login action
if (empty($args['action']) && empty($_SESSION['user_id'])) {
$args['action'] = 'login';
}
// Set user password in session (see shutdown() method for more info)
else if (!empty($_SESSION['user_id']) && empty($_SESSION['password'])) {
$_SESSION['password'] = $rcmail->encrypt($_SERVER['PHP_AUTH_PW']);
}
}
return $args;
}
function authenticate($args)
{
// Load plugin's config file
$this->load_config();
$host = rcmail::get_instance()->config->get('http_authentication_host');
if (is_string($host) && trim($host) !== '' && empty($args['host']))
$args['host'] = rcube_utils::idn_to_ascii(rcube_utils::parse_host($host));
// Allow entering other user data in login form,
// e.g. after log out (#1487953)
if (!empty($args['user'])) {
return $args;
}
if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) {
$args['user'] = $_SERVER['PHP_AUTH_USER'];
$args['pass'] = $_SERVER['PHP_AUTH_PW'];
}
$args['cookiecheck'] = false;
$args['valid'] = true;
return $args;
}
function logout($args)
{
// redirect to configured URL in order to clear HTTP auth credentials
if (!empty($_SERVER['PHP_AUTH_USER']) && $args['user'] == $_SERVER['PHP_AUTH_USER']) {
if ($url = rcmail::get_instance()->config->get('logout_url')) {
header("Location: $url", true, 307);
}
}
}
function shutdown()
{
// There's no need to store password (even if encrypted) in session
// We'll set it back on startup (#1486553)
rcmail::get_instance()->session->remove('password');
}
}
diff --git a/plugins/identity_select/identity_select.php b/plugins/identity_select/identity_select.php
index 203776725..0048c4d43 100644
--- a/plugins/identity_select/identity_select.php
+++ b/plugins/identity_select/identity_select.php
@@ -1,68 +1,68 @@
<?php
/**
* Identity selection based on additional message headers.
*
* On reply to a message user identity selection is based on
* content of standard headers i.e. From, To, Cc and Return-Path.
* Here you can add header(s) set by your SMTP server (e.g.
* Delivered-To, Envelope-To, X-Envelope-To, X-RCPT-TO) to make
* identity selection more accurate.
*
* Enable the plugin in config.inc.php and add your desired headers:
- * $rcmail_config['identity_select_headers'] = array('Delivered-To');
+ * $config['identity_select_headers'] = array('Delivered-To');
*
* @version @package_version@
* @author Aleksander Machniak <alec@alec.pl>
* @license GNU GPLv3+
*/
class identity_select extends rcube_plugin
{
public $task = 'mail';
function init()
{
$this->add_hook('identity_select', array($this, 'select'));
$this->add_hook('storage_init', array($this, 'storage_init'));
}
/**
* Adds additional headers to supported headers list
*/
function storage_init($p)
{
$rcmail = rcmail::get_instance();
if ($add_headers = (array)$rcmail->config->get('identity_select_headers', array())) {
$p['fetch_headers'] = trim($p['fetch_headers'] . ' ' . strtoupper(join(' ', $add_headers)));
}
return $p;
}
/**
* Identity selection
*/
function select($p)
{
if ($p['selected'] !== null) {
return $p;
}
$rcmail = rcmail::get_instance();
foreach ((array)$rcmail->config->get('identity_select_headers', array()) as $header) {
if ($header = $p['message']->headers->get($header, false)) {
foreach ($p['identities'] as $idx => $ident) {
if (in_array($ident['email_ascii'], (array)$header)) {
$p['selected'] = $idx;
break 2;
}
}
}
}
return $p;
}
}
diff --git a/plugins/jqueryui/config.inc.php.dist b/plugins/jqueryui/config.inc.php.dist
index a3c3f75a0..8e111e0e1 100644
--- a/plugins/jqueryui/config.inc.php.dist
+++ b/plugins/jqueryui/config.inc.php.dist
@@ -1,13 +1,13 @@
<?php
// if you want to load localization strings for specific sub-libraries of jquery-ui, configure them here
-$rcmail_config['jquery_ui_i18n'] = array('datepicker');
+$config['jquery_ui_i18n'] = array('datepicker');
// map Roundcube skins with jquery-ui themes here
-$rcmail_config['jquery_ui_skin_map'] = array(
+$config['jquery_ui_skin_map'] = array(
'larry' => 'larry',
'default' => 'larry',
'groupvice4' => 'redmond',
);
?>
diff --git a/plugins/managesieve/config.inc.php.dist b/plugins/managesieve/config.inc.php.dist
index 65dbcfc4e..cb56a0efd 100644
--- a/plugins/managesieve/config.inc.php.dist
+++ b/plugins/managesieve/config.inc.php.dist
@@ -1,67 +1,67 @@
<?php
// managesieve server port. When empty the port will be determined automatically
// using getservbyname() function, with 4190 as a fallback.
-$rcmail_config['managesieve_port'] = null;
+$config['managesieve_port'] = null;
// managesieve server address, default is localhost.
// Replacement variables supported in host name:
// %h - user's IMAP hostname
// %n - http hostname ($_SERVER['SERVER_NAME'])
// %d - domain (http hostname without the first part)
// For example %n = mail.domain.tld, %d = domain.tld
-$rcmail_config['managesieve_host'] = 'localhost';
+$config['managesieve_host'] = 'localhost';
// authentication method. Can be CRAM-MD5, DIGEST-MD5, PLAIN, LOGIN, EXTERNAL
// or none. Optional, defaults to best method supported by server.
-$rcmail_config['managesieve_auth_type'] = null;
+$config['managesieve_auth_type'] = null;
// Optional managesieve authentication identifier to be used as authorization proxy.
// Authenticate as a different user but act on behalf of the logged in user.
// Works with PLAIN and DIGEST-MD5 auth.
-$rcmail_config['managesieve_auth_cid'] = null;
+$config['managesieve_auth_cid'] = null;
// Optional managesieve authentication password to be used for imap_auth_cid
-$rcmail_config['managesieve_auth_pw'] = null;
+$config['managesieve_auth_pw'] = null;
// use or not TLS for managesieve server connection
// Note: tls:// prefix in managesieve_host is also supported
-$rcmail_config['managesieve_usetls'] = false;
+$config['managesieve_usetls'] = false;
// default contents of filters script (eg. default spam filter)
-$rcmail_config['managesieve_default'] = '/etc/dovecot/sieve/global';
+$config['managesieve_default'] = '/etc/dovecot/sieve/global';
// The name of the script which will be used when there's no user script
-$rcmail_config['managesieve_script_name'] = 'managesieve';
+$config['managesieve_script_name'] = 'managesieve';
// Sieve RFC says that we should use UTF-8 endcoding for mailbox names,
// but some implementations does not covert UTF-8 to modified UTF-7.
// Defaults to UTF7-IMAP
-$rcmail_config['managesieve_mbox_encoding'] = 'UTF-8';
+$config['managesieve_mbox_encoding'] = 'UTF-8';
// I need this because my dovecot (with listescape plugin) uses
// ':' delimiter, but creates folders with dot delimiter
-$rcmail_config['managesieve_replace_delimiter'] = '';
+$config['managesieve_replace_delimiter'] = '';
// disabled sieve extensions (body, copy, date, editheader, encoded-character,
// envelope, environment, ereject, fileinto, ihave, imap4flags, index,
// mailbox, mboxmetadata, regex, reject, relational, servermetadata,
// spamtest, spamtestplus, subaddress, vacation, variables, virustest, etc.
// Note: not all extensions are implemented
-$rcmail_config['managesieve_disabled_extensions'] = array();
+$config['managesieve_disabled_extensions'] = array();
// Enables debugging of conversation with sieve server. Logs it into <log_dir>/sieve
-$rcmail_config['managesieve_debug'] = false;
+$config['managesieve_debug'] = false;
// Enables features described in http://wiki.kolab.org/KEP:14
-$rcmail_config['managesieve_kolab_master'] = false;
+$config['managesieve_kolab_master'] = false;
// Script name extension used for scripts including. Dovecot uses '.sieve',
// Cyrus uses '.siv'. Doesn't matter if you have managesieve_kolab_master disabled.
-$rcmail_config['managesieve_filename_extension'] = '.sieve';
+$config['managesieve_filename_extension'] = '.sieve';
// List of reserved script names (without extension).
// Scripts listed here will be not presented to the user.
-$rcmail_config['managesieve_filename_exceptions'] = array();
+$config['managesieve_filename_exceptions'] = array();
?>
diff --git a/plugins/new_user_identity/new_user_identity.php b/plugins/new_user_identity/new_user_identity.php
index bb0821a53..3943134b2 100644
--- a/plugins/new_user_identity/new_user_identity.php
+++ b/plugins/new_user_identity/new_user_identity.php
@@ -1,85 +1,85 @@
<?php
/**
* New user identity
*
* Populates a new user's default identity from LDAP on their first visit.
*
* This plugin requires that a working public_ldap directory be configured.
*
* @version @package_version@
* @author Kris Steinhoff
* @license GNU GPLv3+
*
* Example configuration:
*
* // The id of the address book to use to automatically set a new
* // user's full name in their new identity. (This should be an
- * // string, which refers to the $rcmail_config['ldap_public'] array.)
- * $rcmail_config['new_user_identity_addressbook'] = 'People';
+ * // string, which refers to the $config['ldap_public'] array.)
+ * $config['new_user_identity_addressbook'] = 'People';
*
* // When automatically setting a new users's full name in their
* // new identity, match the user's login name against this field.
- * $rcmail_config['new_user_identity_match'] = 'uid';
+ * $config['new_user_identity_match'] = 'uid';
*/
class new_user_identity extends rcube_plugin
{
public $task = 'login';
private $ldap;
function init()
{
$this->add_hook('user_create', array($this, 'lookup_user_name'));
}
function lookup_user_name($args)
{
if ($this->init_ldap($args['host'])) {
$results = $this->ldap->search('*', $args['user'], true);
if (count($results->records) == 1) {
$user_name = is_array($results->records[0]['name']) ? $results->records[0]['name'][0] : $results->records[0]['name'];
$user_email = is_array($results->records[0]['email']) ? $results->records[0]['email'][0] : $results->records[0]['email'];
$args['user_name'] = $user_name;
if (!$args['user_email'] && strpos($user_email, '@')) {
$args['user_email'] = rcube_utils::idn_to_ascii($user_email);
}
}
}
return $args;
}
private function init_ldap($host)
{
if ($this->ldap) {
return $this->ldap->ready;
}
$rcmail = rcmail::get_instance();
$addressbook = $rcmail->config->get('new_user_identity_addressbook');
$ldap_config = (array)$rcmail->config->get('ldap_public');
$match = $rcmail->config->get('new_user_identity_match');
if (empty($addressbook) || empty($match) || empty($ldap_config[$addressbook])) {
return false;
}
$this->ldap = new new_user_identity_ldap_backend(
$ldap_config[$addressbook],
$rcmail->config->get('ldap_debug'),
$rcmail->config->mail_domain($host),
$match);
return $this->ldap->ready;
}
}
class new_user_identity_ldap_backend extends rcube_ldap
{
function __construct($p, $debug, $mail_domain, $search)
{
parent::__construct($p, $debug, $mail_domain);
$this->prop['search_fields'] = (array)$search;
}
}
diff --git a/plugins/newmail_notifier/config.inc.php.dist b/plugins/newmail_notifier/config.inc.php.dist
index 067fe19f1..cdb563c40 100644
--- a/plugins/newmail_notifier/config.inc.php.dist
+++ b/plugins/newmail_notifier/config.inc.php.dist
@@ -1,12 +1,12 @@
<?php
// Enables basic notification
-$rcmail_config['newmail_notifier_basic'] = false;
+$config['newmail_notifier_basic'] = false;
// Enables sound notification
-$rcmail_config['newmail_notifier_sound'] = false;
+$config['newmail_notifier_sound'] = false;
// Enables desktop notification
-$rcmail_config['newmail_notifier_desktop'] = false;
+$config['newmail_notifier_desktop'] = false;
?>
diff --git a/plugins/password/README b/plugins/password/README
index bd462592e..262ebfd86 100644
--- a/plugins/password/README
+++ b/plugins/password/README
@@ -1,322 +1,322 @@
-----------------------------------------------------------------------
Password Plugin for Roundcube
-----------------------------------------------------------------------
Plugin that adds a possibility to change user password using many
methods (drivers) via Settings/Password tab.
-----------------------------------------------------------------------
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
@version @package_version@
@author Aleksander Machniak <alec@alec.pl>
@author <see driver files for driver authors>
-----------------------------------------------------------------------
1. Configuration
2. Drivers
2.1. Database (sql)
2.2. Cyrus/SASL (sasl)
2.3. Poppassd/Courierpassd (poppassd)
2.4. LDAP (ldap)
2.5. DirectAdmin Control Panel (directadmin)
2.6. cPanel (cpanel)
2.7. XIMSS/Communigate (ximms)
2.8. Virtualmin (virtualmin)
2.9. hMailServer (hmail)
2.10. PAM (pam)
2.11. Chpasswd (chpasswd)
2.12. LDAP - no PEAR (ldap_simple)
2.13. XMail (xmail)
2.14. Pw (pw_usermod)
2.15. domainFACTORY (domainfactory)
2.16. DBMail (dbmail)
2.17. Expect (expect)
2.18. Samba (smb)
2.19. Vpopmail daemon (vpopmaild)
3. Driver API
1. Configuration
----------------
Copy config.inc.php.dist to config.inc.php and set the options as described
within the file.
2. Drivers
----------
Password plugin supports many password change mechanisms which are
handled by included drivers. Just pass driver name in 'password_driver' option.
2.1. Database (sql)
-------------------
You can specify which database to connect by 'password_db_dsn' option and
what SQL query to execute by 'password_query'. See config.inc.php.dist file for
more info.
Example implementations of an update_passwd function:
- This is for use with LMS (http://lms.org.pl) database and postgres:
CREATE OR REPLACE FUNCTION update_passwd(hash text, account text) RETURNS integer AS $$
DECLARE
res integer;
BEGIN
UPDATE passwd SET password = hash
WHERE login = split_part(account, '@', 1)
AND domainid = (SELECT id FROM domains WHERE name = split_part(account, '@', 2))
RETURNING id INTO res;
RETURN res;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;
- This is for use with a SELECT update_passwd(%o,%c,%u) query
Updates the password only when the old password matches the MD5 password
in the database
CREATE FUNCTION update_password (oldpass text, cryptpass text, user text) RETURNS text
MODIFIES SQL DATA
BEGIN
DECLARE currentsalt varchar(20);
DECLARE error text;
SET error = 'incorrect current password';
SELECT substring_index(substr(user.password,4),_latin1'$',1) INTO currentsalt FROM users WHERE username=user;
SELECT '' INTO error FROM users WHERE username=user AND password=ENCRYPT(oldpass,currentsalt);
UPDATE users SET password=cryptpass WHERE username=user AND password=ENCRYPT(oldpass,currentsalt);
RETURN error;
END
Example SQL UPDATEs:
- Plain text passwords:
UPDATE users SET password=%p WHERE username=%u AND password=%o AND domain=%h LIMIT 1
- Crypt text passwords:
UPDATE users SET password=%c WHERE username=%u LIMIT 1
- Use a MYSQL crypt function (*nix only) with random 8 character salt
UPDATE users SET password=ENCRYPT(%p,concat(_utf8'$1$',right(md5(rand()),8),_utf8'$')) WHERE username=%u LIMIT 1
- MD5 stored passwords:
UPDATE users SET password=MD5(%p) WHERE username=%u AND password=MD5(%o) LIMIT 1
2.2. Cyrus/SASL (sasl)
----------------------
Cyrus SASL database authentication allows your Cyrus+Roundcube
installation to host mail users without requiring a Unix Shell account!
This driver only covers the "sasldb" case when using Cyrus SASL. Kerberos
and PAM authentication mechanisms will require other techniques to enable
user password manipulations.
Cyrus SASL includes a shell utility called "saslpasswd" for manipulating
user passwords in the "sasldb" database. This plugin attempts to use
this utility to perform password manipulations required by your webmail
users without any administrative interaction. Unfortunately, this
scheme requires that the "saslpasswd" utility be run as the "cyrus"
user - kind of a security problem since we have chosen to SUID a small
script which will allow this to happen.
This driver is based on the Squirrelmail Change SASL Password Plugin.
See http://www.squirrelmail.org/plugin_view.php?id=107 for details.
Installation:
Change into the helpers directory. Edit the chgsaslpasswd.c file as is
documented within it.
Compile the wrapper program:
gcc -o chgsaslpasswd chgsaslpasswd.c
Chown the compiled chgsaslpasswd binary to the cyrus user and group
that your browser runs as, then chmod them to 4550.
For example, if your cyrus user is 'cyrus' and the apache server group is
'nobody' (I've been told Redhat runs Apache as user 'apache'):
chown cyrus:nobody chgsaslpasswd
chmod 4550 chgsaslpasswd
Stephen Carr has suggested users should try to run the scripts on a test
account as the cyrus user eg;
su cyrus -c "./chgsaslpasswd -p test_account"
This will allow you to make sure that the script will work for your setup.
Should the script not work, make sure that:
1) the user the script runs as has access to the saslpasswd|saslpasswd2
file and proper permissions
2) make sure the user in the chgsaslpasswd.c file is set correctly.
This could save you some headaches if you are the paranoid type.
2.3. Poppassd/Courierpassd (poppassd)
-------------------------------------
You can specify which host to connect to via 'password_pop_host' and
what port via 'password_pop_port'. See config.inc.php.dist file for more info.
2.4. LDAP (ldap)
----------------
See config.inc.php.dist file. Requires PEAR::Net_LDAP2 package.
2.5. DirectAdmin Control Panel (directadmin)
--------------------------------------------
You can specify which host to connect to via 'password_directadmin_host' (don't
forget to use tcp:// or ssl://) and what port via 'password_direactadmin_port'.
The password enforcement with plenty customization can be done directly by
DirectAdmin, please see http://www.directadmin.com/features.php?id=910
See config.inc.php.dist file for more info.
2.6. cPanel (cpanel)
--------------------
Install cPanel XMLAPI Client Class into Roundcube program/lib directory
or any other place in PHP include path. You can get the class from
https://raw.github.com/CpanelInc/xmlapi-php/master/xmlapi.php
You can configure parameters for connection to cPanel's API interface.
See config.inc.php.dist file for more info.
2.7. XIMSS/Communigate (ximms)
------------------------------
You can specify which host and port to connect to via 'password_ximss_host'
and 'password_ximss_port'. See config.inc.php.dist file for more info.
2.8. Virtualmin (virtualmin)
----------------------------
As in sasl driver this one allows to change password using shell
utility called "virtualmin". See helpers/chgvirtualminpasswd.c for
installation instructions. See also config.inc.php.dist file.
2.9. hMailServer (hmail)
------------------------
Requires PHP COM (Windows only). For access to hMail server on remote host
you'll need to define 'hmailserver_remote_dcom' and 'hmailserver_server'.
See config.inc.php.dist file for more info.
2.10. PAM (pam)
---------------
This driver is for changing passwords of shell users authenticated with PAM.
Requires PECL's PAM exitension to be installed (http://pecl.php.net/package/PAM).
2.11. Chpasswd (chpasswd)
-------------------------
Driver that adds functionality to change the systems user password via
the 'chpasswd' command. See config.inc.php.dist file.
Attached wrapper script (helpers/chpass-wrapper.py) restricts password changes
to uids >= 1000 and can deny requests based on a blacklist.
2.12. LDAP - no PEAR (ldap_simple)
-----------------------------------
It's rewritten ldap driver that doesn't require the Net_LDAP2 PEAR extension.
It uses directly PHP's ldap module functions instead (as Roundcube does).
This driver is fully compatible with the ldap driver, but
does not require (or uses) the
- $rcmail_config['password_ldap_force_replace'] variable.
+ $config['password_ldap_force_replace'] variable.
Other advantages:
* Connects only once with the LDAP server when using the search user.
* Does not read the DN, but only replaces the password within (that is
why the 'force replace' is always used).
2.13. XMail (xmail)
-----------------------------------
Driver for XMail (www.xmailserver.org). See config.inc.php.dist file
for configuration description.
2.14. Pw (pw_usermod)
-----------------------------------
Driver to change the systems user password via the 'pw usermod' command.
See config.inc.php.dist file for configuration description.
2.15. domainFACTORY (domainfactory)
-----------------------------------
Driver for the hosting provider domainFACTORY (www.df.eu).
No configuration options.
2.16. DBMail (dbmail)
-----------------------------------
Driver that adds functionality to change the users DBMail password.
It only works with dbmail-users on the same host where Roundcube runs
and requires shell access and gcc in order to compile the binary
(see instructions in chgdbmailusers.c file).
See config.inc.php.dist file for configuration description.
Note: DBMail users can also use sql driver.
2.17. Expect (expect)
-----------------------------------
Driver to change user password via the 'expect' command.
See config.inc.php.dist file for configuration description.
2.18. Samba (smb)
-----------------------------------
Driver to change Samba user password via the 'smbpasswd' command.
See config.inc.php.dist file for configuration description.
2.19. Vpopmail daemon (vpopmaild)
-----------------------------------
Driver for the daemon of vpopmail. Vpopmail is used with qmail to
enable virtual users that are saved in a database and not in /etc/passwd.
- Set $rcmail_config['password_vpopmaild_host'] to the host where vpopmaild runs.
+ Set $config['password_vpopmaild_host'] to the host where vpopmaild runs.
- Set $rcmail_config['password_vpopmaild_port'] to the port of vpopmaild.
+ Set $config['password_vpopmaild_port'] to the port of vpopmaild.
3. Driver API
-------------
Driver file (<driver_name>.php) must define 'password_save' function with
two arguments. First - current password, second - new password. Function
should return PASSWORD_SUCCESS on success or any of PASSWORD_CONNECT_ERROR,
PASSWORD_CRYPT_ERROR, PASSWORD_ERROR when driver was unable to change password.
Extended result (as a hash-array with 'message' and 'code' items) can be returned
too. See existing drivers in drivers/ directory for examples.
diff --git a/plugins/password/config.inc.php.dist b/plugins/password/config.inc.php.dist
index 9256829aa..82f6617e5 100644
--- a/plugins/password/config.inc.php.dist
+++ b/plugins/password/config.inc.php.dist
@@ -1,364 +1,364 @@
<?php
// Password Plugin options
// -----------------------
// A driver to use for password change. Default: "sql".
// See README file for list of supported driver names.
-$rcmail_config['password_driver'] = 'sql';
+$config['password_driver'] = 'sql';
// Determine whether current password is required to change password.
// Default: false.
-$rcmail_config['password_confirm_current'] = true;
+$config['password_confirm_current'] = true;
// Require the new password to be a certain length.
// set to blank to allow passwords of any length
-$rcmail_config['password_minimum_length'] = 0;
+$config['password_minimum_length'] = 0;
// Require the new password to contain a letter and punctuation character
// Change to false to remove this check.
-$rcmail_config['password_require_nonalpha'] = false;
+$config['password_require_nonalpha'] = false;
// Enables logging of password changes into logs/password
-$rcmail_config['password_log'] = false;
+$config['password_log'] = false;
// Comma-separated list of login exceptions for which password change
// will be not available (no Password tab in Settings)
-$rcmail_config['password_login_exceptions'] = null;
+$config['password_login_exceptions'] = null;
// Array of hosts that support password changing. Default is NULL.
// Listed hosts will feature a Password option in Settings; others will not.
// Example:
-//$rcmail_config['password_hosts'] = array('mail.example.com', 'mail2.example.org');
-$rcmail_config['password_hosts'] = null;
+//$config['password_hosts'] = array('mail.example.com', 'mail2.example.org');
+$config['password_hosts'] = null;
// Enables saving the new password even if it matches the old password. Useful
// for upgrading the stored passwords after the encryption scheme has changed.
-$rcmail_config['password_force_save'] = false;
+$config['password_force_save'] = false;
// SQL Driver options
// ------------------
// PEAR database DSN for performing the query. By default
// Roundcube DB settings are used.
-$rcmail_config['password_db_dsn'] = '';
+$config['password_db_dsn'] = '';
// The SQL query used to change the password.
// The query can contain the following macros that will be expanded as follows:
// %p is replaced with the plaintext new password
// %c is replaced with the crypt version of the new password, MD5 if available
// otherwise DES. More hash function can be enabled using the password_crypt_hash
// configuration parameter.
// %D is replaced with the dovecotpw-crypted version of the new password
// %o is replaced with the password before the change
// %n is replaced with the hashed version of the new password
// %q is replaced with the hashed password before the change
// %h is replaced with the imap host (from the session info)
// %u is replaced with the username (from the session info)
// %l is replaced with the local part of the username
// (in case the username is an email address)
// %d is replaced with the domain part of the username
// (in case the username is an email address)
// Escaping of macros is handled by this module.
// Default: "SELECT update_passwd(%c, %u)"
-$rcmail_config['password_query'] = 'SELECT update_passwd(%c, %u)';
+$config['password_query'] = 'SELECT update_passwd(%c, %u)';
// By default the crypt() function which is used to create the '%c'
// parameter uses the md5 algorithm. To use different algorithms
// you can choose between: des, md5, blowfish, sha256, sha512.
// Before using other hash functions than des or md5 please make sure
// your operating system supports the other hash functions.
-$rcmail_config['password_crypt_hash'] = 'md5';
+$config['password_crypt_hash'] = 'md5';
// By default domains in variables are using unicode.
// Enable this option to use punycoded names
-$rcmail_config['password_idn_ascii'] = false;
+$config['password_idn_ascii'] = false;
// Path for dovecotpw (if not in $PATH)
-// $rcmail_config['password_dovecotpw'] = '/usr/local/sbin/dovecotpw';
+// $config['password_dovecotpw'] = '/usr/local/sbin/dovecotpw';
// Dovecot method (dovecotpw -s 'method')
-$rcmail_config['password_dovecotpw_method'] = 'CRAM-MD5';
+$config['password_dovecotpw_method'] = 'CRAM-MD5';
// Enables use of password with crypt method prefix in %D, e.g. {MD5}$1$LUiMYWqx$fEkg/ggr/L6Mb2X7be4i1/
-$rcmail_config['password_dovecotpw_with_method'] = false;
+$config['password_dovecotpw_with_method'] = false;
// Using a password hash for %n and %q variables.
// Determine which hashing algorithm should be used to generate
// the hashed new and current password for using them within the
// SQL query. Requires PHP's 'hash' extension.
-$rcmail_config['password_hash_algorithm'] = 'sha1';
+$config['password_hash_algorithm'] = 'sha1';
// You can also decide whether the hash should be provided
// as hex string or in base64 encoded format.
-$rcmail_config['password_hash_base64'] = false;
+$config['password_hash_base64'] = false;
// Poppassd Driver options
// -----------------------
// The host which changes the password
-$rcmail_config['password_pop_host'] = 'localhost';
+$config['password_pop_host'] = 'localhost';
// TCP port used for poppassd connections
-$rcmail_config['password_pop_port'] = 106;
+$config['password_pop_port'] = 106;
// SASL Driver options
// -------------------
// Additional arguments for the saslpasswd2 call
-$rcmail_config['password_saslpasswd_args'] = '';
+$config['password_saslpasswd_args'] = '';
// LDAP and LDAP_SIMPLE Driver options
// -----------------------------------
// LDAP server name to connect to.
// You can provide one or several hosts in an array in which case the hosts are tried from left to right.
// Exemple: array('ldap1.exemple.com', 'ldap2.exemple.com');
// Default: 'localhost'
-$rcmail_config['password_ldap_host'] = 'localhost';
+$config['password_ldap_host'] = 'localhost';
// LDAP server port to connect to
// Default: '389'
-$rcmail_config['password_ldap_port'] = '389';
+$config['password_ldap_port'] = '389';
// TLS is started after connecting
// Using TLS for password modification is recommanded.
// Default: false
-$rcmail_config['password_ldap_starttls'] = false;
+$config['password_ldap_starttls'] = false;
// LDAP version
// Default: '3'
-$rcmail_config['password_ldap_version'] = '3';
+$config['password_ldap_version'] = '3';
// LDAP base name (root directory)
// Exemple: 'dc=exemple,dc=com'
-$rcmail_config['password_ldap_basedn'] = 'dc=exemple,dc=com';
+$config['password_ldap_basedn'] = 'dc=exemple,dc=com';
// LDAP connection method
// There is two connection method for changing a user's LDAP password.
// 'user': use user credential (recommanded, require password_confirm_current=true)
// 'admin': use admin credential (this mode require password_ldap_adminDN and password_ldap_adminPW)
// Default: 'user'
-$rcmail_config['password_ldap_method'] = 'user';
+$config['password_ldap_method'] = 'user';
// LDAP Admin DN
// Used only in admin connection mode
// Default: null
-$rcmail_config['password_ldap_adminDN'] = null;
+$config['password_ldap_adminDN'] = null;
// LDAP Admin Password
// Used only in admin connection mode
// Default: null
-$rcmail_config['password_ldap_adminPW'] = null;
+$config['password_ldap_adminPW'] = null;
// LDAP user DN mask
// The user's DN is mandatory and as we only have his login,
// we need to re-create his DN using a mask
// '%login' will be replaced by the current roundcube user's login
// '%name' will be replaced by the current roundcube user's name part
// '%domain' will be replaced by the current roundcube user's domain part
// '%dc' will be replaced by domain name hierarchal string e.g. "dc=test,dc=domain,dc=com"
// Exemple: 'uid=%login,ou=people,dc=exemple,dc=com'
-$rcmail_config['password_ldap_userDN_mask'] = 'uid=%login,ou=people,dc=exemple,dc=com';
+$config['password_ldap_userDN_mask'] = 'uid=%login,ou=people,dc=exemple,dc=com';
// LDAP search DN
// The DN roundcube should bind with to find out user's DN
// based on his login. Note that you should comment out the default
// password_ldap_userDN_mask setting for this to take effect.
// Use this if you cannot specify a general template for user DN with
// password_ldap_userDN_mask. You need to perform a search based on
// users login to find his DN instead. A common reason might be that
// your users are placed under different ou's like engineering or
// sales which cannot be derived from their login only.
-$rcmail_config['password_ldap_searchDN'] = 'cn=roundcube,ou=services,dc=example,dc=com';
+$config['password_ldap_searchDN'] = 'cn=roundcube,ou=services,dc=example,dc=com';
// LDAP search password
// If password_ldap_searchDN is set, the password to use for
// binding to search for user's DN. Note that you should comment out the default
// password_ldap_userDN_mask setting for this to take effect.
// Warning: Be sure to set approperiate permissions on this file so this password
// is only accesible to roundcube and don't forget to restrict roundcube's access to
// your directory as much as possible using ACLs. Should this password be compromised
// you want to minimize the damage.
-$rcmail_config['password_ldap_searchPW'] = 'secret';
+$config['password_ldap_searchPW'] = 'secret';
// LDAP search base
// If password_ldap_searchDN is set, the base to search in using the filter below.
// Note that you should comment out the default password_ldap_userDN_mask setting
// for this to take effect.
-$rcmail_config['password_ldap_search_base'] = 'ou=people,dc=example,dc=com';
+$config['password_ldap_search_base'] = 'ou=people,dc=example,dc=com';
// LDAP search filter
// If password_ldap_searchDN is set, the filter to use when
// searching for user's DN. Note that you should comment out the default
// password_ldap_userDN_mask setting for this to take effect.
// '%login' will be replaced by the current roundcube user's login
// '%name' will be replaced by the current roundcube user's name part
// '%domain' will be replaced by the current roundcube user's domain part
// '%dc' will be replaced by domain name hierarchal string e.g. "dc=test,dc=domain,dc=com"
// Example: '(uid=%login)'
// Example: '(&(objectClass=posixAccount)(uid=%login))'
-$rcmail_config['password_ldap_search_filter'] = '(uid=%login)';
+$config['password_ldap_search_filter'] = '(uid=%login)';
// LDAP password hash type
// Standard LDAP encryption type which must be one of: crypt,
// ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, or clear.
// Please note that most encodage types require external libraries
// to be included in your PHP installation, see function hashPassword in drivers/ldap.php for more info.
// Default: 'crypt'
-$rcmail_config['password_ldap_encodage'] = 'crypt';
+$config['password_ldap_encodage'] = 'crypt';
// LDAP password attribute
// Name of the ldap's attribute used for storing user password
// Default: 'userPassword'
-$rcmail_config['password_ldap_pwattr'] = 'userPassword';
+$config['password_ldap_pwattr'] = 'userPassword';
// LDAP password force replace
// Force LDAP replace in cases where ACL allows only replace not read
// See http://pear.php.net/package/Net_LDAP2/docs/latest/Net_LDAP2/Net_LDAP2_Entry.html#methodreplace
// Default: true
-$rcmail_config['password_ldap_force_replace'] = true;
+$config['password_ldap_force_replace'] = true;
// LDAP Password Last Change Date
// Some places use an attribute to store the date of the last password change
// The date is meassured in "days since epoch" (an integer value)
// Whenever the password is changed, the attribute will be updated if set (e.g. shadowLastChange)
-$rcmail_config['password_ldap_lchattr'] = '';
+$config['password_ldap_lchattr'] = '';
// LDAP Samba password attribute, e.g. sambaNTPassword
// Name of the LDAP's Samba attribute used for storing user password
-$rcmail_config['password_ldap_samba_pwattr'] = '';
+$config['password_ldap_samba_pwattr'] = '';
// LDAP Samba Password Last Change Date attribute, e.g. sambaPwdLastSet
// Some places use an attribute to store the date of the last password change
// The date is meassured in "seconds since epoch" (an integer value)
// Whenever the password is changed, the attribute will be updated if set
-$rcmail_config['password_ldap_samba_lchattr'] = '';
+$config['password_ldap_samba_lchattr'] = '';
// DirectAdmin Driver options
// --------------------------
// The host which changes the password
// Use 'ssl://host' instead of 'tcp://host' when running DirectAdmin over SSL.
// The host can contain the following macros that will be expanded as follows:
// %h is replaced with the imap host (from the session info)
// %d is replaced with the domain part of the username (if the username is an email)
-$rcmail_config['password_directadmin_host'] = 'tcp://localhost';
+$config['password_directadmin_host'] = 'tcp://localhost';
// TCP port used for DirectAdmin connections
-$rcmail_config['password_directadmin_port'] = 2222;
+$config['password_directadmin_port'] = 2222;
// vpopmaild Driver options
// -----------------------
// The host which changes the password
-$rcmail_config['password_vpopmaild_host'] = 'localhost';
+$config['password_vpopmaild_host'] = 'localhost';
// TCP port used for vpopmaild connections
-$rcmail_config['password_vpopmaild_port'] = 89;
+$config['password_vpopmaild_port'] = 89;
// cPanel Driver options
// --------------------------
// The cPanel Host name
-$rcmail_config['password_cpanel_host'] = 'host.domain.com';
+$config['password_cpanel_host'] = 'host.domain.com';
// The cPanel admin username
-$rcmail_config['password_cpanel_username'] = 'username';
+$config['password_cpanel_username'] = 'username';
// The cPanel admin password
-$rcmail_config['password_cpanel_password'] = 'password';
+$config['password_cpanel_password'] = 'password';
// The cPanel port to use
-$rcmail_config['password_cpanel_port'] = 2087;
+$config['password_cpanel_port'] = 2087;
// XIMSS (Communigate server) Driver options
// -----------------------------------------
// Host name of the Communigate server
-$rcmail_config['password_ximss_host'] = 'mail.example.com';
+$config['password_ximss_host'] = 'mail.example.com';
// XIMSS port on Communigate server
-$rcmail_config['password_ximss_port'] = 11024;
+$config['password_ximss_port'] = 11024;
// chpasswd Driver options
// ---------------------
// Command to use
-$rcmail_config['password_chpasswd_cmd'] = 'sudo /usr/sbin/chpasswd 2> /dev/null';
+$config['password_chpasswd_cmd'] = 'sudo /usr/sbin/chpasswd 2> /dev/null';
// XMail Driver options
// ---------------------
-$rcmail_config['xmail_host'] = 'localhost';
-$rcmail_config['xmail_user'] = 'YourXmailControlUser';
-$rcmail_config['xmail_pass'] = 'YourXmailControlPass';
-$rcmail_config['xmail_port'] = 6017;
+$config['xmail_host'] = 'localhost';
+$config['xmail_user'] = 'YourXmailControlUser';
+$config['xmail_pass'] = 'YourXmailControlPass';
+$config['xmail_port'] = 6017;
// hMail Driver options
// -----------------------
// Remote hMailServer configuration
// true: HMailserver is on a remote box (php.ini: com.allow_dcom = true)
// false: Hmailserver is on same box as PHP
-$rcmail_config['hmailserver_remote_dcom'] = false;
+$config['hmailserver_remote_dcom'] = false;
// Windows credentials
-$rcmail_config['hmailserver_server'] = array(
+$config['hmailserver_server'] = array(
'Server' => 'localhost', // hostname or ip address
'Username' => 'administrator', // windows username
'Password' => 'password' // windows user password
);
// Virtualmin Driver options
// -------------------------
// Username format:
// 0: username@domain
// 1: username%domain
// 2: username.domain
// 3: domain.username
// 4: username-domain
// 5: domain-username
// 6: username_domain
// 7: domain_username
// 8: username@domain; mbox.username
-$rcmail_config['password_virtualmin_format'] = 8;
+$config['password_virtualmin_format'] = 8;
// pw_usermod Driver options
// --------------------------
// Use comma delimited exlist to disable password change for users
// Add the following line to visudo to tighten security:
// www ALL=NOPASSWORD: /usr/sbin/pw
-$rcmail_config['password_pw_usermod_cmd'] = 'sudo /usr/sbin/pw usermod -h 0 -n';
+$config['password_pw_usermod_cmd'] = 'sudo /usr/sbin/pw usermod -h 0 -n';
// DBMail Driver options
// -------------------
// Additional arguments for the dbmail-users call
-$rcmail_config['password_dbmail_args'] = '-p sha512';
+$config['password_dbmail_args'] = '-p sha512';
// Expect Driver options
// ---------------------
// Location of expect binary
-$rcmail_config['password_expect_bin'] = '/usr/bin/expect';
+$config['password_expect_bin'] = '/usr/bin/expect';
// Location of expect script (see helpers/passwd-expect)
-$rcmail_config['password_expect_script'] = '';
+$config['password_expect_script'] = '';
// Arguments for the expect script. See the helpers/passwd-expect file for details.
// This is probably a good starting default:
// -telent -host localhost -output /tmp/passwd.log -log /tmp/passwd.log
-$rcmail_config['password_expect_params'] = '';
+$config['password_expect_params'] = '';
// smb Driver options
// ---------------------
// Samba host (default: localhost)
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
-$rcmail_config['password_smb_host'] = 'localhost';
+$config['password_smb_host'] = 'localhost';
// Location of smbpasswd binary
-$rcmail_config['password_smb_cmd'] = '/usr/bin/smbpasswd';
+$config['password_smb_cmd'] = '/usr/bin/smbpasswd';
diff --git a/plugins/password/drivers/hmail.php b/plugins/password/drivers/hmail.php
index a8f07a23b..650434617 100644
--- a/plugins/password/drivers/hmail.php
+++ b/plugins/password/drivers/hmail.php
@@ -1,63 +1,61 @@
<?php
/**
* hMailserver password driver
*
* @version 2.0
* @author Roland 'rosali' Liebl <myroundcube@mail4us.net>
- *
*/
class rcube_hmail_password
{
public function save($curpass, $passwd)
{
$rcmail = rcmail::get_instance();
if ($curpass == '' || $passwd == '') {
return PASSWORD_ERROR;
}
try {
$remote = $rcmail->config->get('hmailserver_remote_dcom', false);
if ($remote)
$obApp = new COM("hMailServer.Application", $rcmail->config->get('hmailserver_server'));
else
$obApp = new COM("hMailServer.Application");
}
catch (Exception $e) {
rcube::write_log('errors', "Plugin password (hmail driver): " . trim(strip_tags($e->getMessage())));
rcube::write_log('errors', "Plugin password (hmail driver): This problem is often caused by DCOM permissions not being set.");
return PASSWORD_ERROR;
}
$username = $rcmail->user->data['username'];
if (strstr($username,'@')){
$temparr = explode('@', $username);
$domain = $temparr[1];
}
else {
$domain = $rcmail->config->get('username_domain',false);
if (!$domain) {
- rcube::write_log('errors','Plugin password (hmail driver): $rcmail_config[\'username_domain\'] is not defined.');
- rcube::write_log('errors','Plugin password (hmail driver): Hint: Use hmail_login plugin (http://myroundcube.googlecode.com');
+ rcube::write_log('errors','Plugin password (hmail driver): $config[\'username_domain\'] is not defined.');
return PASSWORD_ERROR;
}
$username = $username . "@" . $domain;
}
$obApp->Authenticate($username, $curpass);
try {
$obDomain = $obApp->Domains->ItemByName($domain);
$obAccount = $obDomain->Accounts->ItemByAddress($username);
$obAccount->Password = $passwd;
$obAccount->Save();
return PASSWORD_SUCCESS;
}
catch (Exception $e) {
rcube::write_log('errors', "Plugin password (hmail driver): " . trim(strip_tags($e->getMessage())));
rcube::write_log('errors', "Plugin password (hmail driver): This problem is often caused by DCOM permissions not being set.");
return PASSWORD_ERROR;
}
}
}
diff --git a/plugins/password/drivers/xmail.php b/plugins/password/drivers/xmail.php
index 59e467c5b..47beb2178 100644
--- a/plugins/password/drivers/xmail.php
+++ b/plugins/password/drivers/xmail.php
@@ -1,106 +1,106 @@
<?php
/**
* XMail Password Driver
*
* Driver for XMail password
*
* @version 2.0
* @author Helio Cavichiolo Jr <helio@hcsistemas.com.br>
*
* Setup xmail_host, xmail_user, xmail_pass and xmail_port into
* config.inc.php of password plugin as follows:
*
- * $rcmail_config['xmail_host'] = 'localhost';
- * $rcmail_config['xmail_user'] = 'YourXmailControlUser';
- * $rcmail_config['xmail_pass'] = 'YourXmailControlPass';
- * $rcmail_config['xmail_port'] = 6017;
+ * $config['xmail_host'] = 'localhost';
+ * $config['xmail_user'] = 'YourXmailControlUser';
+ * $config['xmail_pass'] = 'YourXmailControlPass';
+ * $config['xmail_port'] = 6017;
*
*/
class rcube_xmail_password
{
function save($currpass, $newpass)
{
$rcmail = rcmail::get_instance();
list($user,$domain) = explode('@', $_SESSION['username']);
$xmail = new XMail;
$xmail->hostname = $rcmail->config->get('xmail_host');
$xmail->username = $rcmail->config->get('xmail_user');
$xmail->password = $rcmail->config->get('xmail_pass');
$xmail->port = $rcmail->config->get('xmail_port');
if (!$xmail->connect()) {
rcube::raise_error(array(
'code' => 600,
'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Password plugin: Unable to connect to mail server"
), true, false);
return PASSWORD_CONNECT_ERROR;
}
else if (!$xmail->send("userpasswd\t".$domain."\t".$user."\t".$newpass."\n")) {
$xmail->close();
rcube::raise_error(array(
'code' => 600,
'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Password plugin: Unable to change password"
), true, false);
return PASSWORD_ERROR;
}
else {
$xmail->close();
return PASSWORD_SUCCESS;
}
}
}
class XMail {
var $socket;
var $hostname = 'localhost';
var $username = 'xmail';
var $password = '';
var $port = 6017;
function send($msg)
{
socket_write($this->socket,$msg);
if (substr(socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") {
return false;
}
return true;
}
function connect()
{
$this->socket = socket_create(AF_INET, SOCK_STREAM, 0);
if ($this->socket < 0)
return false;
$result = socket_connect($this->socket, $this->hostname, $this->port);
if ($result < 0) {
socket_close($this->socket);
return false;
}
if (substr(socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") {
socket_close($this->socket);
return false;
}
if (!$this->send("$this->username\t$this->password\n")) {
socket_close($this->socket);
return false;
}
return true;
}
function close()
{
$this->send("quit\n");
socket_close($this->socket);
}
}
diff --git a/plugins/redundant_attachments/config.inc.php.dist b/plugins/redundant_attachments/config.inc.php.dist
index a0be3755e..a6d1ad4dc 100644
--- a/plugins/redundant_attachments/config.inc.php.dist
+++ b/plugins/redundant_attachments/config.inc.php.dist
@@ -1,13 +1,13 @@
<?php
// By default this plugin stores attachments in filesystem
// and copies them into sql database.
// In environments with replicated database it is possible
// to use memcache as a fallback when write-master is unavailable.
-$rcmail_config['redundant_attachments_memcache'] = false;
+$config['redundant_attachments_memcache'] = false;
// Attachment data expires after specied TTL time in seconds (max.2592000).
// Default is 12 hours.
-$rcmail_config['redundant_attachments_cache_ttl'] = 12 * 60 * 60;
+$config['redundant_attachments_cache_ttl'] = 12 * 60 * 60;
?>
diff --git a/plugins/show_additional_headers/show_additional_headers.php b/plugins/show_additional_headers/show_additional_headers.php
index c2b0ca1d3..b7f01104c 100644
--- a/plugins/show_additional_headers/show_additional_headers.php
+++ b/plugins/show_additional_headers/show_additional_headers.php
@@ -1,51 +1,51 @@
<?php
/**
* Show additional message headers
*
* Proof-of-concept plugin which will fetch additional headers
* and display them in the message view.
*
* Enable the plugin in config.inc.php and add your desired headers:
- * $rcmail_config['show_additional_headers'] = array('User-Agent');
+ * $config['show_additional_headers'] = array('User-Agent');
*
* @version @package_version@
* @author Thomas Bruederli
* @license GNU GPLv3+
*/
class show_additional_headers extends rcube_plugin
{
public $task = 'mail';
function init()
{
$rcmail = rcmail::get_instance();
if ($rcmail->action == 'show' || $rcmail->action == 'preview') {
$this->add_hook('storage_init', array($this, 'storage_init'));
$this->add_hook('message_headers_output', array($this, 'message_headers'));
} else if ($rcmail->action == '') {
// with enabled_caching we're fetching additional headers before show/preview
$this->add_hook('storage_init', array($this, 'storage_init'));
}
}
function storage_init($p)
{
$rcmail = rcmail::get_instance();
if ($add_headers = (array)$rcmail->config->get('show_additional_headers', array()))
$p['fetch_headers'] = trim($p['fetch_headers'].' ' . strtoupper(join(' ', $add_headers)));
return $p;
}
function message_headers($p)
{
$rcmail = rcmail::get_instance();
foreach ((array)$rcmail->config->get('show_additional_headers', array()) as $header) {
if ($value = $p['headers']->get($header))
$p['output'][$header] = array('title' => $header, 'value' => $value);
}
return $p;
}
}
diff --git a/plugins/squirrelmail_usercopy/config.inc.php.dist b/plugins/squirrelmail_usercopy/config.inc.php.dist
index cb62b1b86..03ec1cb86 100644
--- a/plugins/squirrelmail_usercopy/config.inc.php.dist
+++ b/plugins/squirrelmail_usercopy/config.inc.php.dist
@@ -1,25 +1,25 @@
<?php
// Driver - 'file' or 'sql'
-$rcmail_config['squirrelmail_driver'] = 'sql';
+$config['squirrelmail_driver'] = 'sql';
// full path to the squirrelmail data directory
-$rcmail_config['squirrelmail_data_dir'] = '';
-$rcmail_config['squirrelmail_data_dir_hash_level'] = 0;
+$config['squirrelmail_data_dir'] = '';
+$config['squirrelmail_data_dir_hash_level'] = 0;
// 'mysql://dbuser:dbpass@localhost/database'
-$rcmail_config['squirrelmail_dsn'] = 'mysql://user:password@localhost/webmail';
-$rcmail_config['squirrelmail_db_charset'] = 'iso-8859-1';
+$config['squirrelmail_dsn'] = 'mysql://user:password@localhost/webmail';
+$config['squirrelmail_db_charset'] = 'iso-8859-1';
-$rcmail_config['squirrelmail_address_table'] = 'address';
-$rcmail_config['squirrelmail_userprefs_table'] = 'userprefs';
+$config['squirrelmail_address_table'] = 'address';
+$config['squirrelmail_userprefs_table'] = 'userprefs';
// identities_level option value for squirrelmail plugin
// With this you can bypass/change identities_level checks
// for operations inside this plugin. See #1486773
-$rcmail_config['squirrelmail_identities_level'] = null;
+$config['squirrelmail_identities_level'] = null;
// Set to false if you don't want the email address of the default identity
// (squirrelmail preference "email_address") to be saved as alias.
// Recommended: set to false if your squirrelmail config setting $edit_identity has been true.
-$rcmail_config['squirrelmail_set_alias'] = true;
\ No newline at end of file
+$config['squirrelmail_set_alias'] = true;
\ No newline at end of file
diff --git a/plugins/subscriptions_option/subscriptions_option.php b/plugins/subscriptions_option/subscriptions_option.php
index 284c048df..130f16a8b 100644
--- a/plugins/subscriptions_option/subscriptions_option.php
+++ b/plugins/subscriptions_option/subscriptions_option.php
@@ -1,93 +1,93 @@
<?php
/**
* Subscription Options
*
* A plugin which can enable or disable the use of imap subscriptions.
* It includes a toggle on the settings page under "Server Settings".
* The preference can also be locked
*
* Add it to the plugins list in config.inc.php to enable the user option
* The user option can be hidden and set globally by adding 'use_subscriptions'
* to the 'dont_override' configure line:
- * $rcmail_config['dont_override'] = array('use_subscriptions');
+ * $config['dont_override'] = array('use_subscriptions');
* and then set the global preference
- * $rcmail_config['use_subscriptions'] = true; // or false
+ * $config['use_subscriptions'] = true; // or false
*
* Roundcube caches folder lists. When a user changes this option or visits
* their folder list, this cache is refreshed. If the option is on the
* 'dont_override' list and the global option has changed, don't expect
* to see the change until the folder list cache is refreshed.
*
* @version @package_version@
* @author Ziba Scott
* @license GNU GPLv3+
*/
class subscriptions_option extends rcube_plugin
{
public $task = 'mail|settings';
function init()
{
$this->add_texts('localization/', false);
$dont_override = rcmail::get_instance()->config->get('dont_override', array());
if (!in_array('use_subscriptions', $dont_override)) {
$this->add_hook('preferences_list', array($this, 'settings_blocks'));
$this->add_hook('preferences_save', array($this, 'save_prefs'));
}
$this->add_hook('storage_folders', array($this, 'mailboxes_list'));
$this->add_hook('folders_list', array($this, 'folders_list'));
}
function settings_blocks($args)
{
if ($args['section'] == 'server') {
$use_subscriptions = rcmail::get_instance()->config->get('use_subscriptions');
$field_id = 'rcmfd_use_subscriptions';
$checkbox = new html_checkbox(array('name' => '_use_subscriptions', 'id' => $field_id, 'value' => 1));
$args['blocks']['main']['options']['use_subscriptions'] = array(
'title' => html::label($field_id, rcube::Q($this->gettext('useimapsubscriptions'))),
'content' => $checkbox->show($use_subscriptions?1:0),
);
}
return $args;
}
function save_prefs($args)
{
if ($args['section'] == 'server') {
$rcmail = rcmail::get_instance();
$use_subscriptions = $rcmail->config->get('use_subscriptions');
$args['prefs']['use_subscriptions'] = isset($_POST['_use_subscriptions']) ? true : false;
// if the use_subscriptions preference changes, flush the folder cache
if (($use_subscriptions && !isset($_POST['_use_subscriptions'])) ||
(!$use_subscriptions && isset($_POST['_use_subscriptions']))) {
$storage = $rcmail->get_storage();
$storage->clear_cache('mailboxes');
}
}
return $args;
}
function mailboxes_list($args)
{
$rcmail = rcmail::get_instance();
if (!$rcmail->config->get('use_subscriptions', true)) {
$args['folders'] = $rcmail->get_storage()->list_folders_direct();
}
return $args;
}
function folders_list($args)
{
$rcmail = rcmail::get_instance();
if (!$rcmail->config->get('use_subscriptions', true)) {
$args['table']->remove_column('subscribed');
}
return $args;
}
}
diff --git a/plugins/virtuser_file/virtuser_file.php b/plugins/virtuser_file/virtuser_file.php
index ed0eba189..f2b357aaf 100644
--- a/plugins/virtuser_file/virtuser_file.php
+++ b/plugins/virtuser_file/virtuser_file.php
@@ -1,105 +1,105 @@
<?php
/**
* File based User-to-Email and Email-to-User lookup
*
* Add it to the plugins list in config.inc.php and set
* path to a virtuser table file to resolve user names and e-mail
* addresses
- * $rcmail_config['virtuser_file'] = '';
+ * $rcmail['virtuser_file'] = '';
*
* @version @package_version@
* @license GNU GPLv3+
* @author Aleksander Machniak
*/
class virtuser_file extends rcube_plugin
{
private $file;
private $app;
function init()
{
$this->app = rcmail::get_instance();
$this->file = $this->app->config->get('virtuser_file');
if ($this->file) {
$this->add_hook('user2email', array($this, 'user2email'));
$this->add_hook('email2user', array($this, 'email2user'));
}
}
/**
* User > Email
*/
function user2email($p)
{
$r = $this->findinvirtual('/\s' . preg_quote($p['user'], '/') . '\s*$/');
$result = array();
for ($i=0; $i<count($r); $i++) {
$arr = preg_split('/\s+/', $r[$i]);
if (count($arr) > 0 && strpos($arr[0], '@')) {
$result[] = rcube_utils::idn_to_ascii(trim(str_replace('\\@', '@', $arr[0])));
if ($p['first']) {
$p['email'] = $result[0];
break;
}
}
}
$p['email'] = empty($result) ? NULL : $result;
return $p;
}
/**
* Email > User
*/
function email2user($p)
{
$r = $this->findinvirtual('/^' . preg_quote($p['email'], '/') . '\s/');
for ($i=0; $i<count($r); $i++) {
$arr = preg_split('/\s+/', trim($r[$i]));
if (count($arr) > 0) {
$p['user'] = trim($arr[count($arr)-1]);
break;
}
}
return $p;
}
/**
* Find matches of the given pattern in virtuser file
*
* @param string Regular expression to search for
* @return array Matching entries
*/
private function findinvirtual($pattern)
{
$result = array();
$virtual = null;
if ($this->file)
$virtual = file($this->file);
if (empty($virtual))
return $result;
// check each line for matches
foreach ($virtual as $line) {
$line = trim($line);
if (empty($line) || $line[0]=='#')
continue;
if (preg_match($pattern, $line))
$result[] = $line;
}
return $result;
}
}
diff --git a/plugins/virtuser_query/virtuser_query.php b/plugins/virtuser_query/virtuser_query.php
index 3181cda94..a0b748288 100644
--- a/plugins/virtuser_query/virtuser_query.php
+++ b/plugins/virtuser_query/virtuser_query.php
@@ -1,165 +1,165 @@
<?php
/**
* DB based User-to-Email and Email-to-User lookup
*
* Add it to the plugins list in config.inc.php and set
* SQL queries to resolve usernames, e-mail addresses and hostnames from the database
* %u will be replaced with the current username for login.
* %m will be replaced with the current e-mail address for login.
*
* Queries should select the user's e-mail address, username or the imap hostname as first column
* The email query could optionally select identity data columns in specified order:
* name, organization, reply-to, bcc, signature, html_signature
*
- * $rcmail_config['virtuser_query'] = array('email' => '', 'user' => '', 'host' => '', 'alias' => '');
+ * $config['virtuser_query'] = array('email' => '', 'user' => '', 'host' => '', 'alias' => '');
*
* The email query can return more than one record to create more identities.
* This requires identities_level option to be set to value less than 2.
*
* By default Roundcube database is used. To use different database (or host)
- * you can specify DSN string in $rcmail_config['virtuser_query_dsn'] option.
+ * you can specify DSN string in $config['virtuser_query_dsn'] option.
*
* @version @package_version@
* @author Aleksander Machniak <alec@alec.pl>
* @author Steffen Vogel
* @author Tim Gerundt
* @license GNU GPLv3+
*/
class virtuser_query extends rcube_plugin
{
private $config;
private $app;
private $db;
function init()
{
$this->app = rcmail::get_instance();
$this->config = $this->app->config->get('virtuser_query');
if (!empty($this->config)) {
if (is_string($this->config)) {
$this->config = array('email' => $this->config);
}
if ($this->config['email']) {
$this->add_hook('user2email', array($this, 'user2email'));
}
if ($this->config['user']) {
$this->add_hook('email2user', array($this, 'email2user'));
}
if ($this->config['host']) {
$this->add_hook('authenticate', array($this, 'user2host'));
}
if ($this->config['alias']) {
$this->add_hook('authenticate', array($this, 'alias2user'));
}
}
}
/**
* User > Email
*/
function user2email($p)
{
$dbh = $this->get_dbh();
$sql_result = $dbh->query(preg_replace('/%u/', $dbh->escape($p['user']), $this->config['email']));
while ($sql_arr = $dbh->fetch_array($sql_result)) {
if (strpos($sql_arr[0], '@')) {
if ($p['extended'] && count($sql_arr) > 1) {
$result[] = array(
'email' => rcube_utils::idn_to_ascii($sql_arr[0]),
'name' => $sql_arr[1],
'organization' => $sql_arr[2],
'reply-to' => rcube_utils::idn_to_ascii($sql_arr[3]),
'bcc' => rcube_utils::idn_to_ascii($sql_arr[4]),
'signature' => $sql_arr[5],
'html_signature' => (int)$sql_arr[6],
);
}
else {
$result[] = $sql_arr[0];
}
if ($p['first']) {
break;
}
}
}
$p['email'] = $result;
return $p;
}
/**
* EMail > User
*/
function email2user($p)
{
$dbh = $this->get_dbh();
$sql_result = $dbh->query(preg_replace('/%m/', $dbh->escape($p['email']), $this->config['user']));
if ($sql_arr = $dbh->fetch_array($sql_result)) {
$p['user'] = $sql_arr[0];
}
return $p;
}
/**
* User > Host
*/
function user2host($p)
{
$dbh = $this->get_dbh();
$sql_result = $dbh->query(preg_replace('/%u/', $dbh->escape($p['user']), $this->config['host']));
if ($sql_arr = $dbh->fetch_array($sql_result)) {
$p['host'] = $sql_arr[0];
}
return $p;
}
/**
* Alias > User
*/
function alias2user($p)
{
$dbh = $this->get_dbh();
$sql_result = $dbh->query(preg_replace('/%u/', $dbh->escape($p['user']), $this->config['alias']));
if ($sql_arr = $dbh->fetch_array($sql_result)) {
$p['user'] = $sql_arr[0];
}
return $p;
}
/**
* Initialize database handler
*/
function get_dbh()
{
if (!$this->db) {
if ($dsn = $this->app->config->get('virtuser_query_dsn')) {
// connect to the virtuser database
$this->db = rcube_db::factory($dsn);
$this->db->set_debug((bool)$this->app->config->get('sql_debug'));
$this->db->db_connect('r'); // connect in read mode
}
else {
$this->db = $this->app->get_dbh();
}
}
return $this->db;
}
}
diff --git a/plugins/zipdownload/README b/plugins/zipdownload/README
index 4fa3c17b6..f253d63ee 100644
--- a/plugins/zipdownload/README
+++ b/plugins/zipdownload/README
@@ -1,35 +1,35 @@
Roundcube Webmail ZipDownload
=============================
This plugin adds an option to download all attachments to a message in one zip
file, when a message has multiple attachments. The plugin also allows the
download of a selection of messages in 1 zip file and the download of entire
folders.
Requirements
============
* php_zip extension (including ZipArchive class)
Either install it via PECL or for PHP >= 5.2 compile with --enable-zip option
License
=======
This plugin is released under the GNU General Public License Version 3
or later (http://www.gnu.org/licenses/gpl.html).
Even if skins might contain some programming work, they are not considered
as a linked part of the plugin and therefore skins DO NOT fall under the
provisions of the GPL license. See the README file located in the core skins
folder for details on the skin license.
Install
=======
* Place this plugin folder into plugins directory of Roundcube
-* Add zipdownload to $rcmail_config['plugins'] in your Roundcube config
+* Add zipdownload to $config['plugins'] in your Roundcube config
NB: When downloading the plugin from GitHub you will need to create a
directory called zipdownload and place the files in there, ignoring the
root directory in the downloaded archive
Config
======
The default config file is plugins/zipdownload/config.inc.php.dist
Rename this to plugins/zipdownload/config.inc.php
\ No newline at end of file
diff --git a/plugins/zipdownload/config.inc.php.dist b/plugins/zipdownload/config.inc.php.dist
index 5c7489a15..0b2d14b60 100644
--- a/plugins/zipdownload/config.inc.php.dist
+++ b/plugins/zipdownload/config.inc.php.dist
@@ -1,21 +1,21 @@
<?php
/**
* ZipDownload configuration file
*/
// Zip attachments
// Only show the link when there are more than this many attachments
// -1 to prevent downloading of attachments as zip
-$rcmail_config['zipdownload_attachments'] = 1;
+$config['zipdownload_attachments'] = 1;
// Zip entire folders
-$rcmail_config['zipdownload_folder'] = false;
+$config['zipdownload_folder'] = false;
// Zip selection of messages
-$rcmail_config['zipdownload_selection'] = false;
+$config['zipdownload_selection'] = false;
// Charset to use for filenames inside the zip
-$rcmail_config['zipdownload_charset'] = 'ISO-8859-1';
+$config['zipdownload_charset'] = 'ISO-8859-1';
?>
\ No newline at end of file

File Metadata

Mime Type
text/x-diff
Expires
Thu, Dec 18, 1:30 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
418864
Default Alt Text
(91 KB)

Event Timeline