summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
Diffstat (limited to 'program/include')
-rw-r--r--program/include/bc.php2
-rw-r--r--program/include/iniset.php20
-rw-r--r--program/include/rcmail.php16
3 files changed, 15 insertions, 23 deletions
diff --git a/program/include/bc.php b/program/include/bc.php
index d8356338d..df018320c 100644
--- a/program/include/bc.php
+++ b/program/include/bc.php
@@ -287,7 +287,7 @@ function rcmail_remote_ip()
function rcube_check_referer()
{
- return rcmail::check_referer();
+ return rcube_utils::check_referer();
}
function rcube_timer()
diff --git a/program/include/iniset.php b/program/include/iniset.php
index b32ae4e8e..919cc7682 100644
--- a/program/include/iniset.php
+++ b/program/include/iniset.php
@@ -24,21 +24,6 @@
define('RCMAIL_VERSION', '1.0-git');
define('RCMAIL_START', microtime(true));
-$config = array(
- // Some users are not using Installer, so we'll check some
- // critical PHP settings here. Only these, which doesn't provide
- // an error/warning in the logs later. See (#1486307).
- 'suhosin.session.encrypt' => 0,
- 'session.auto_start' => 0,
- 'file_uploads' => 1,
-);
-foreach ($config as $optname => $optval) {
- if ($optval != ini_get($optname) && @ini_set($optname, $optval) === false) {
- die("ERROR: Wrong '$optname' option value and it wasn't possible to set it to required value ($optval).\n"
- ."Check your PHP configuration (including php_admin_flag).");
- }
-}
-
if (!defined('INSTALL_PATH')) {
define('INSTALL_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');
}
@@ -75,6 +60,11 @@ require_once 'Roundcube/bootstrap.php';
// register autoloader for rcmail app classes
spl_autoload_register('rcmail_autoload');
+// include composer autoloader (if available)
+if (file_exists('vendor/autoload.php')) {
+ require 'vendor/autoload.php';
+}
+
// backward compatybility (to be removed)
require_once INSTALL_PATH . 'program/include/bc.php';
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 1bde4034f..7acb3490d 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -98,7 +98,10 @@ class rcmail extends rcube
// reset some session parameters when changing task
if ($this->task != 'utils') {
- if ($this->session && $_SESSION['task'] != $this->task)
+ // we reset list page when switching to another task
+ // but only to the main task interface - empty action (#1489076)
+ // this will prevent from unintentional page reset on cross-task requests
+ if ($this->session && $_SESSION['task'] != $this->task && empty($this->action))
$this->session->remove('page');
// set current task to session
$_SESSION['task'] = $this->task;
@@ -258,13 +261,13 @@ class rcmail extends rcube
*/
public function get_address_sources($writeable = false, $skip_hidden = false)
{
- $abook_type = strtolower($this->config->get('address_book_type'));
- $ldap_config = $this->config->get('ldap_public');
+ $abook_type = (string) $this->config->get('address_book_type');
+ $ldap_config = (array) $this->config->get('ldap_public');
$autocomplete = (array) $this->config->get('autocomplete_addressbooks');
- $list = array();
+ $list = array();
// We are using the DB address book or a plugin address book
- if ($abook_type != 'ldap' && $abook_type != '') {
+ if (!empty($abook_type) && strtolower($abook_type) != 'ldap') {
if (!isset($this->address_books['0']))
$this->address_books['0'] = new rcube_contacts($this->db, $this->get_user_id());
$list['0'] = array(
@@ -277,8 +280,7 @@ class rcmail extends rcube
);
}
- if ($ldap_config) {
- $ldap_config = (array) $ldap_config;
+ if (!empty($ldap_config)) {
foreach ($ldap_config as $id => $prop) {
// handle misconfiguration
if (empty($prop) || !is_array($prop)) {