Exemplo n.º 1
0
 function preferences_save($args)
 {
     if ($args['section'] == 'jabber') {
         libgpl::include_php('plugins/libgpl/gibberish/GibberishAES.php');
         $enabled = get_input_value('_jappix_enabled', RCUBE_INPUT_POST);
         $username = trim(get_input_value('_jabber_username', RCUBE_INPUT_POST));
         if (!$username && $enabled) {
             $this->rc->output->show_message('jappix4roundcube.usernameempty', 'error');
             $args['abort'] = true;
         }
         if (preg_match('/[@\\/\\ ]/', $username)) {
             $this->rc->output->show_message('jappix4roundcube.usernameinvalid', 'error');
             $this->rc->output->set_env('jabber_username', $this->rc->config->get('jabber_username', ''));
             $args['abort'] = true;
         } else {
             $args['prefs']['jabber_username'] = $username;
             $this->rc->output->set_env('jabber_username', $args['prefs']['jabber_username']);
         }
         $domain = trim(get_input_value('_jabber_domain', RCUBE_INPUT_POST));
         if (!$this->is_valid_domain_name($domain)) {
             $this->rc->output->show_message('jappix4roundcube.domaininvalid', 'error');
             $this->rc->output->set_env('jabber_domain', $this->rc->config->get('jabber_domain', 'jappix.com'));
             $args['abort'] = true;
         } else {
             $args['prefs']['jabber_domain'] = $domain;
             $this->rc->output->set_env('jabber_domain', $args['prefs']['jabber_domain']);
         }
         $password = trim(get_input_value('_jabber_password', RCUBE_INPUT_POST));
         if (!$password && $this->rc->config->get('jappix_inherit')) {
             $password = $this->rc->decrypt($_SESSION['password']);
         }
         if ($password) {
             $key = md5($this->rc->user->data['username'] . ':' . $this->rc->decrypt($_SESSION['password']));
             $enc = GibberishAES::enc($password, $key);
             $args['prefs']['jabber_enc'] = $enc;
             $this->rc->output->set_env('jabber_enc', $enc);
         }
         $args['prefs']['jappix_enabled'] = $enabled;
         $args['prefs']['jappix_enabled'] = $args['prefs']['jappix_enabled'] ? 1 : 0;
         if ($args['prefs']['jappix_enabled'] == 0) {
             $this->rc->session->remove('jappixminiframe');
         }
         $args['prefs']['jappix_full'] = get_input_value('_jappix_full', RCUBE_INPUT_POST);
         $args['prefs']['jappix_full'] = $args['prefs']['jappix_full'] ? 1 : 0;
         $args['prefs']['jappix_mini'] = get_input_value('_jappix_mini', RCUBE_INPUT_POST);
         $args['prefs']['jappix_mini'] = $args['prefs']['jappix_mini'] ? 1 : 0;
         $args['prefs']['jappix_mini_autologon'] = get_input_value('_jappix_mini_autologon', RCUBE_INPUT_POST);
         $args['prefs']['jappix_mini_autologon'] = $args['prefs']['jappix_mini_autologon'] ? 1 : 0;
         $this->rc->output->set_env('jabber_mini', $args['prefs']['jappix_mini'] ? true : false);
         $this->rc->output->set_env('jabber_autologon', $args['prefs']['jappix_mini_autologon'] ? true : false);
     }
     return $args;
 }
Exemplo n.º 2
0
 /**
  * Plugin initialization
  */
 public function init()
 {
     // check requirements first
     if (!class_exists('ZipArchive', false)) {
         rcmail::raise_error(array('code' => 520, 'file' => __FILE__, 'line' => __LINE__, 'message' => "php_zip extension is required for the zipdownload plugin"), true, false);
         return;
     }
     $rcmail = rcmail::get_instance();
     $this->load_config();
     $this->charset = $rcmail->config->get('zipdownload_charset', RCUBE_CHARSET);
     libgpl::load_localization('zipdownload/localization', 'zipdownload', true);
     if ($rcmail->config->get('zipdownload_attachments', 1) > -1 && ($rcmail->action == 'show' || $rcmail->action == 'preview')) {
         $this->add_hook('template_object_messageattachments', array($this, 'attachment_ziplink'));
     }
     $this->register_action('plugin.zipdownload.attachments', array($this, 'download_attachments'));
     $this->register_action('plugin.zipdownload.messages', array($this, 'download_messages'));
     $this->register_action('plugin.zipdownload.abort', array($this, 'download_abort'));
     if (!$rcmail->action && $rcmail->config->get('zipdownload_selection')) {
         $this->download_menu();
     }
 }
Exemplo n.º 3
0
 function init()
 {
     self::$f = $this;
     $this->add_texts('localization/');
     $this->require_plugin('jqueryui');
     $this->include_stylesheet('qtip/qtip.css');
     $this->include_stylesheet($this->local_skin_path() . '/calendar.css');
     $this->include_script('timepicker2/jquery.timepicker.js');
     $this->include_stylesheet($this->local_skin_path() . '/timepicker2.css');
     $this->include_script('dialogextend/jquery.dialogextend.js');
     $this->include_script('jquery_migrate/jquery.migrate.js');
     $this->include_script('qtip/qtip.js');
     $this->add_hook('render_page', array($this, 'render_page'));
     $this->add_hook('send_page', array($this, 'send_page'));
     if (!class_exists('MyRCHttp')) {
         require_once 'http_request/class.http.php';
     }
     if (!$this->labels_merged) {
         $this->labels_merged = true;
         $this->_merge_labels(array('calendarusername' => 'calendar', 'attendeeplaceholder' => 'calendar', 'events' => 'calendar', 'tasks' => 'calendar', 'errorimportingtask' => 'calendar', 'treat_as_allday' => 'calendar', 'hours' => 'calendar', 'movetotasks' => 'calendar', 'movetocalendar' => 'calendar', 'emailevent' => 'calendar', 'movetonotes' => 'calendar', 'quit' => 'calendar', 'eventaction' => 'calendar', 'gooledisabled' => 'calendar', 'googledisabled_redirect' => 'calendar', 'allowfreebusy' => 'calendar', 'freebusy' => 'calendar', 'sync_interval' => 'calendar', 'minute_s' => 'calendar', 'unabletoadddefaultcalendars' => 'calendar', 'protected' => 'calendar', 'list' => 'tasklist', 'editlist' => 'tasklist', 'tags' => 'tasklist', 'subscribe' => 'tasklist', 'is_subtask' => 'tasklist', 'due' => 'tasklist', 'taskaction' => 'tasklist', 'emailtask' => 'tasklist', 'subscribed' => 'carddav'));
     }
 }