| | |
| | | |
| | | /* |
| | | +-----------------------------------------------------------------------+ |
| | | | program/include/rcube.php | |
| | | | | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2008-2012, The Roundcube Dev Team | |
| | | | Copyright (C) 2011-2012, Kolab Systems AG | |
| | |
| | | /** |
| | | * Singleton instace of rcube |
| | | * |
| | | * @var rcmail |
| | | * @var rcube |
| | | */ |
| | | static protected $instance; |
| | | |
| | |
| | | { |
| | | $storage = $this->get_storage(); |
| | | |
| | | $storage->set_charset($this->config->get('default_charset', RCMAIL_CHARSET)); |
| | | $storage->set_charset($this->config->get('default_charset', RCUBE_CHARSET)); |
| | | |
| | | if ($default_folders = $this->config->get('default_folders')) { |
| | | $storage->set_default_folders($default_folders); |
| | |
| | | |
| | | |
| | | /** |
| | | * Quote a given string. |
| | | * Shortcut function for rcube_utils::rep_specialchars_output() |
| | | * |
| | | * @return string HTML-quoted string |
| | | */ |
| | | public static function Q($str, $mode = 'strict', $newlines = true) |
| | | { |
| | | return rcube_utils::rep_specialchars_output($str, 'html', $mode, $newlines); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Quote a given string for javascript output. |
| | | * Shortcut function for rcube_utils::rep_specialchars_output() |
| | | * |
| | | * @return string JS-quoted string |
| | | */ |
| | | public static function JQ($str) |
| | | { |
| | | return rcube_utils::rep_specialchars_output($str, 'js'); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Construct shell command, execute it and return output as string. |
| | | * Keywords {keyword} are replaced with arguments |
| | | * |
| | |
| | | if (is_object($this->user)) { |
| | | return $this->user->get_username(); |
| | | } |
| | | else if (isset($_SESSION['username'])) { |
| | | return $_SESSION['username']; |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | |
| | | /** |
| | | * Getter for logged user email (derived from user name not identity). |
| | | * |
| | | * @return string User email address |
| | | */ |
| | | public function get_user_email() |
| | | { |
| | | if (is_object($this->user)) { |
| | | return $this->user->get_username('mail'); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Getter for logged user password. |
| | | * |
| | | * @return string User password |
| | | */ |
| | | public function get_user_password() |
| | | { |
| | | if ($this->password) { |
| | | return $this->password; |
| | | } |
| | | else if ($_SESSION['password']) { |
| | | return $this->decrypt($_SESSION['password']); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * Lightweight plugin API class serving as a dummy if plugins are not enabled |
| | | * |
| | | * @package Core |
| | | * @package Framework |
| | | * @subpackage Core |
| | | */ |
| | | class rcube_dummy_plugin_api |
| | | { |