Ejemplo n.º 1
0
 function gen_form()
 {
     $user = $this->rcmail_inst->user->get_prefs();
     $this->rcmail_inst->output->add_label('ispconfig3_forward.invalidaddress', 'ispconfig3_forward.forwardingempty');
     try {
         $session_id = $this->soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass'));
         $mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));
         $this->soap->logout($session_id);
     } catch (SoapFault $e) {
         $this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
     }
     $this->rcmail_inst->output->set_env('framed', TRUE);
     $out .= '<fieldset><legend>' . $this->gettext('acc_forward') . '</legend>' . "\n";
     $table = new html_table(array('cols' => 2, 'class' => 'propform'));
     $input_forwardingaddress = new html_inputfield(array('name' => '_forwardingaddress', 'id' => 'forwardingaddress', 'value' => $forward[1], 'maxlength' => 320, 'size' => 40));
     $table->add('title', rep_specialchars_output($this->gettext('forwardingaddress')));
     $table->add('', $input_forwardingaddress->show($mail_user[0]['cc']));
     $out .= $table->show();
     $out .= "</fieldset>\n";
     return $out;
 }
 function gen_table($attrib)
 {
     $this->rcmail_inst->output->set_env('framed', true);
     $out = '<fieldset><legend>' . $this->gettext('policy_entries') . '</legend>' . "\n";
     $spam_table = new html_table(array('id' => 'spam-table', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 4));
     $spam_table->add_header(array('width' => '220px'), $this->gettext('policy_entries'));
     $spam_table->add_header(array('class' => 'value', 'width' => '150px'), $this->gettext('policy_tag'));
     $spam_table->add_header(array('class' => 'value', 'width' => '150px'), $this->gettext('policy_tag2'));
     $spam_table->add_header(array('class' => 'value', 'width' => '130px'), $this->gettext('policy_kill'));
     try {
         $session_id = $this->soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass'));
         $mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));
         $spam_user = $this->soap->mail_spamfilter_user_get($session_id, array('email' => $mail_user[0]['email']));
         $policies = $this->soap->mail_policy_get($session_id, array(1 => 1));
         for ($i = 0; $i < count($policies); $i++) {
             $class = $class == 'odd' ? 'even' : 'odd';
             if ($policies[$i]['id'] == $spam_user[0]['policy_id']) {
                 $class = 'selected';
             }
             $spam_table->set_row_attribs(array('class' => $class));
             $this->_spam_row($spam_table, $policies[$i]['policy_name'], $policies[$i]['spam_tag_level'], $policies[$i]['spam_tag2_level'], $policies[$i]['spam_kill_level'], $attrib);
         }
         $this->soap->logout($session_id);
     } catch (SoapFault $e) {
         $this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
     }
     if (count($policies) == 0) {
         $spam_table->add(array('colspan' => '4'), rep_specialchars_output($this->gettext('spamnopolicies')));
         $spam_table->set_row_attribs(array('class' => 'odd'));
         $spam_table->add_row();
     }
     $out .= "<div id=\"spam-cont\">" . $spam_table->show() . "</div>\n";
     $out .= "</fieldset>\n";
     return $out;
 }
 function gen_table($attrib)
 {
     $this->rcmail_inst->output->set_env('framed', true);
     $out = '<fieldset><legend>' . $this->gettext('forward_entries') . '</legend>' . "\n";
     $rule_table = new html_table(array('id' => 'rule-table', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 2));
     $rule_table->add_header("", $this->gettext('forward_entries'));
     $rule_table->add_header(array('width' => '16px'), '');
     try {
         $session_id = $this->soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass'));
         $mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));
         $this->soap->logout($session_id);
         $forward = explode(",", $mail_user[0]['cc']);
         if (!empty($forward[0])) {
             for ($i = 0; $i < count($forward); $i++) {
                 $class = $class == 'odd' ? 'even' : 'odd';
                 if ($forward[$i] == get_input_value('_forwardingaddress', RCUBE_INPUT_GET)) {
                     $class = 'selected';
                 }
                 $rule_table->set_row_attribs(array('class' => $class, 'id' => 'rule_' . $forward[$i]));
                 $this->_rule_row($rule_table, $forward[$i], $attrib);
             }
         } else {
             $rule_table->add(array('colspan' => '2'), rep_specialchars_output($this->gettext('forwardnomails')));
             $rule_table->set_row_attribs(array('class' => 'odd'));
             $rule_table->add_row();
         }
     } catch (SoapFault $e) {
         $this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
     }
     $out .= "<div id=\"rule-cont\">" . $rule_table->show() . "</div>\n";
     $out .= "</fieldset>\n";
     return $out;
 }
Ejemplo n.º 4
0
 function accounts_form_content($email = "", $username = "", $password = "", $server = "", $port = "", $useSSL = 'none', $leave_a_copy = true, $provider = "", $default_folder = "", $show_import_old_messages_option = true)
 {
     $rcmail = rcmail::get_instance();
     $this->include_script('pop3fetcher_providers.js');
     // allow the following attributes to be added to the <table> tag
     $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));
     // return the complete edit form as table
     $user = $rcmail->user->data['username'];
     if ($_SESSION['global_alias']) {
         $user = $_SESSION['global_alias'];
     }
     if ($email != "") {
         $out .= '<fieldset><legend>' . $email . ' ::: ' . $user . '</legend>' . "\n";
     } else {
         $out .= '<fieldset>' . "\n";
     }
     $out .= '<br />' . "\n";
     $out .= '<table' . $attrib_str . ">\n";
     //<script type=\"text/javascript\">console.log(providers['gmail.com']);</script>
     $field_id = 'pop3fetcher_email';
     $input_pop3fetcher_email = new html_inputfield(array('autocomplete' => 'off', 'name' => '_pop3fetcher_email', 'id' => $field_id, 'size' => 30));
     $out .= sprintf("<tr><td valign=\"middle\" class=\"title\"><label for=\"%s\">%s</label>:</td><td colspan=\"3\">%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('account_email')), $input_pop3fetcher_email->show($email));
     $field_id = 'pop3fetcher_username';
     $input_pop3fetcher_username = new html_inputfield(array('autocomplete' => 'off', 'name' => '_pop3fetcher_username', 'id' => $field_id, 'size' => 30));
     $out .= sprintf("<tr><td valign=\"middle\" class=\"title\"><label for=\"%s\">%s</label>:</td><td colspan=\"3\">%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('account_username')), $input_pop3fetcher_username->show($username));
     $field_id = 'pop3fetcher_password';
     $input_pop3fetcher_password = new html_passwordfield(array('autocomplete' => 'off', 'name' => '_pop3fetcher_password', 'id' => $field_id, 'size' => 30));
     $out .= sprintf("<tr><td valign=\"middle\" class=\"title\"><label for=\"%s\">%s</label>:</td><td colspan=\"3\">%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('account_password')), $input_pop3fetcher_password->show($password));
     $field_id = 'pop3fetcher_provider';
     $input_pop3fetcher_provider = new html_select(array('name' => '_pop3fetcher_provider', 'id' => $field_id));
     $out .= sprintf("<tr><td valign=\"middle\" class=\"title\"><label for=\"%s\">%s</label>:</td><td colspan=\"3\">%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('account_provider')), $input_pop3fetcher_provider->show());
     $field_id = 'pop3fetcher_serveraddress';
     $input_pop3fetcher_serveraddress = new html_inputfield(array('autocomplete' => 'off', 'name' => '_pop3fetcher_serveraddress', 'id' => $field_id, 'size' => 30));
     $out .= sprintf("<tr><td valign=\"middle\" class=\"title\"><label for=\"%s\">%s</label>:</td><td colspan=\"3\">%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('account_serveraddress')), $input_pop3fetcher_serveraddress->show($server));
     $field_id = 'pop3fetcher_serverport';
     $input_pop3fetcher_serverport = new html_inputfield(array('autocomplete' => 'off', 'name' => '_pop3fetcher_serverport', 'id' => $field_id, 'size' => 10));
     $field_id2 = 'pop3fetcher_ssl';
     $input_pop3fetcher_ssl = new html_select(array('name' => '_pop3fetcher_ssl', 'id' => $field_id2));
     $input_pop3fetcher_ssl->add('none', '');
     $input_pop3fetcher_ssl->add('tls', 'tls');
     $input_pop3fetcher_ssl->add('ssl', 'ssl');
     $input_pop3fetcher_ssl->add('sslv2', 'sslv2');
     $input_pop3fetcher_ssl->add('sslv3', 'sslv3');
     $out .= sprintf("<tr><td valign=\"middle\" class=\"title\"><label for=\"%s\">%s</label>:</td><td>%s</td><td valign=\"middle\" class=\"title\"><label for=\"%s\">%s</label>:</td><td>%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('account_serverport')), $input_pop3fetcher_serverport->show($port), $field_id2, rep_specialchars_output($this->gettext('account_usessl')), $input_pop3fetcher_ssl->show($useSSL));
     $field_id = 'pop3fetcher_leaveacopy';
     $input_pop3fetcher_leaveacopy = new html_checkbox(array('name' => '_pop3fetcher_leaveacopy', 'id' => $field_id));
     $out .= sprintf("<tr><td valign=\"middle\" colspan=\"3\" class=\"title\"><label for=\"%s\">%s</label>:</td><td>%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('account_leaveacopy')), $input_pop3fetcher_leaveacopy->show($leave_a_copy ? false : true));
     // QUESTA COSA E' STRANA MA FUNZIONA...
     // SET TARGET DEFAULT FOLDER
     $field_id = 'pop3fetcher_defaultfolder';
     $this->rcmail->imap_connect();
     // get mailbox list
     $a_folders = $rcmail->imap->list_folders();
     $delimiter = $rcmail->imap->get_hierarchy_delimiter();
     $a_mailboxes = array();
     $custom_folder_name = $this->config["root_folder_path"] . $delimiter . str_replace($delimiter, "_", $email);
     $found = false;
     foreach ($a_folders as $ifolder) {
         if ($ifolder == $custom_folder_name) {
             $found = true;
         }
         rcmail_build_folder_tree($a_mailboxes, $ifolder, $delimiter);
     }
     $input_folderlist = new html_select(array('name' => '_pop3fetcher_defaultfolder', 'id' => $field_id));
     rcmail_render_folder_tree_select($a_mailboxes, $field_id, 100, $input_folderlist, false);
     if (!$found && $default_folder != "" && $default_folder != $custom_folder_name) {
         $input_folderlist->add(str_replace($delimiter, "_", $email), "#AUTO_FOLDER#");
     }
     //$input_folderlist->add('create new folder', 'create_new_folder');
     $out .= sprintf("<tr><td valign=\"middle\" class=\"title\"><label for=\"%s\">%s</label>:</td><td colspan=\"3\">%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('account_default_folder')), $input_folderlist->show($default_folder));
     $field_id = 'pop3fetcher_testconnection';
     $input_pop3fetcher_testconnection = new html_checkbox(array('name' => '_pop3fetcher_testconnection', 'id' => $field_id));
     $out .= sprintf("<tr><td valign=\"middle\" colspan=\"3\" class=\"title\"><label for=\"%s\">%s</label>:</td><td>%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('test_connection_on_save')), $input_pop3fetcher_testconnection->show(false));
     // QUESTA COSA E' STRANA MA FUNZIONA...
     if ($show_import_old_messages_option) {
         $field_id = 'pop3fetcher_import_old_messages';
         $input_pop3fetcher_import_old_messages = new html_checkbox(array('name' => '_pop3fetcher_import_old_messages', 'id' => $field_id));
         $out .= sprintf("<tr><td valign=\"middle\" colspan=\"3\" class=\"title\"><label for=\"%s\">%s</label>:</td><td>%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('account_import_old_messages')), $input_pop3fetcher_import_old_messages->show(true));
         // QUESTA COSA E' STRANA MA FUNZIONA...
     }
     $out .= "\n</table>";
     $out .= '<br />' . "\n";
     $out .= "</fieldset>\n";
     $out .= "<script type='text/javascript'>\n\t\t\t\tvar delimiter = '" . $delimiter . "';\n\t\t\t\tvar root_folder_path = '" . $this->config["root_folder_path"] . "';\n\t\t\t\tload_pop3_providers('" . $provider . "');\n\t\t\t\t\$('#pop3fetcher_email').keyup(\n\t\t\t\t\tfunction(){update_default_folder_name(\$(this).val());}\n\t\t\t\t);\n\t\t\t</script>";
     return $out;
 }
Ejemplo n.º 5
0
 function gen_table($attrib)
 {
     $this->rcmail_inst->output->set_env('framed', TRUE);
     $out = '<fieldset><legend>' . $this->gettext('wblistentries') . '</legend>' . "\n";
     $rule_table = new html_table(array('id' => 'rule-table', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 4));
     $rule_table->add_header("", $this->gettext('wblistentries'));
     $rule_table->add_header(array('width' => '16px'), '');
     $rule_table->add_header(array('width' => '20px'), '');
     $rule_table->add_header(array('width' => '16px'), '');
     try {
         $session_id = $this->soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass'));
         $mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));
         $spam_user = $this->soap->mail_spamfilter_user_get($session_id, array('email' => $mail_user[0]['email']));
         $wblist = $this->soap->mail_spamfilter_whitelist_get($session_id, array('rid' => $spam_user[0]['id']));
         //$blist = $this->soap->mail_spamfilter_blacklist_get($session_id, array('rid' => $spam_user[0]['id']));
         //$wblist = array_merge($wlist, $blist);
         $this->soap->logout($session_id);
         for ($i = 0; $i < count($wblist); $i++) {
             $class = $class == 'odd' ? 'even' : 'odd';
             if ($wblist[$i]['wblist_id'] == get_input_value('_id', RCUBE_INPUT_GET)) {
                 $class = 'selected';
             }
             $rule_table->set_row_attribs(array('class' => $class, 'id' => 'rule_' . $wblist[$i]['wblist_id']));
             $this->_rule_row($rule_table, $wblist[$i]['email'], $wblist[$i]['wb'], $wblist[$i]['active'], $wblist[$i]['wblist_id'], $attrib);
         }
     } catch (SoapFault $e) {
         $this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
     }
     if (count($wblist) == 0) {
         $rule_table->add(array('colspan' => '4'), rep_specialchars_output($this->gettext('wblistnorules')));
         $rule_table->set_row_attribs(array('class' => 'odd'));
         $rule_table->add_row();
     }
     $out .= "<div id=\"rule-cont\">" . $rule_table->show() . "</div>\n";
     $out .= "</fieldset>\n";
     return $out;
 }
Ejemplo n.º 6
0
 private function _address_row($address_table, $field, $value, $attrib)
 {
     if (!isset($field)) {
         $address_table->set_row_attribs(array('style' => 'display: none;'));
     }
     $hidden_action = new html_hiddenfield(array('name' => '_headerblock_rule_act[]', 'value' => ''));
     $hidden_field = new html_hiddenfield(array('name' => '_headerblock_rule_field[]', 'value' => $field));
     $hidden_text = new html_hiddenfield(array('name' => '_headerblock_rule_value[]', 'value' => $value));
     switch ($field) {
         case "From":
             $fieldtxt = rep_specialchars_output($this->gettext('headerfrom'));
             break;
         case "To":
             $fieldtxt = rep_specialchars_output($this->gettext('headerto'));
             break;
         case "Subject":
             $fieldtxt = rep_specialchars_output($this->gettext('headersubject'));
             break;
         case "X-Mailer":
             $fieldtxt = rep_specialchars_output($this->gettext('headerxmailer'));
             break;
     }
     $address_table->add(array('class' => 'field'), $fieldtxt);
     $address_table->add(array('class' => 'email'), $value);
     $del_button = $this->api->output->button(array('command' => 'plugin.veximaccountadmin.addressrule_del', 'type' => 'image', 'image' => 'plugins/veximaccountadmin/delete.png', 'alt' => 'delete', 'title' => 'delete'));
     $address_table->add('control', '&nbsp;' . $del_button . $hidden_action->show() . $hidden_field->show() . $hidden_text->show());
     return $address_table;
 }
Ejemplo n.º 7
0
 function gen_form()
 {
     $confirm = $this->rcmail_inst->config->get('password_confirm_current');
     $pwl = $this->rcmail_inst->config->get('password_min_length');
     if (!empty($pwl)) {
         $pwl = max(6, $pwl);
     } else {
         $pwl = 6;
     }
     $this->rcmail_inst->output->add_label('ispconfig3_pass.nopassword', 'ispconfig3_pass.nocurpassword', 'ispconfig3_pass.passwordinconsistency', 'ispconfig3_pass.changepasswd', 'ispconfig3_pass.passwordminlength');
     $this->rcmail_inst->output->add_script('var pw_min_length =' . $pwl . ';');
     $this->rcmail_inst->output->set_env('framed', TRUE);
     $out .= '<fieldset><legend>' . $this->gettext('password') . '</legend>' . "\n";
     $table = new html_table(array('cols' => 2, 'class' => 'propform'));
     if ($confirm) {
         $input_newpasswd = new html_passwordfield(array('name' => '_curpasswd', 'id' => 'curpasswd', 'size' => 20));
         $table->add('title', rep_specialchars_output($this->gettext('curpasswd')));
         $table->add('', $input_newpasswd->show());
     }
     $input_newpasswd = new html_passwordfield(array('name' => '_newpasswd', 'id' => 'newpasswd', 'size' => 20));
     $table->add('title', rep_specialchars_output($this->gettext('newpasswd')));
     $table->add('', $input_newpasswd->show() . '<div id="pass-check">');
     $input_confpasswd = new html_passwordfield(array('name' => '_confpasswd', 'id' => 'confpasswd', 'size' => 20));
     $table->add('title', rep_specialchars_output($this->gettext('confpasswd')));
     $table->add('', $input_confpasswd->show());
     $out .= $table->show();
     $out .= "</fieldset>\n";
     return $out;
 }
 function gen_js_list()
 {
     $this->_startup();
     if (sizeof($this->script) == 0) {
         $this->api->output->command('sieverules_update_list', 'add-first', -1, rep_specialchars_output($this->gettext('nosieverules')));
     } else {
         foreach ($this->script as $idx => $filter) {
             if ($filter['disabled'] == 1) {
                 $filter_name = $filter['name'] . ' (' . $this->gettext('disabled') . ')';
             } else {
                 $filter_name = $filter['name'];
             }
             $tmp_output = new rcube_template('settings');
             $dst = $idx - 1;
             $up_link = $tmp_output->button(array('command' => 'plugin.sieverules.move', 'prop' => $dst, 'type' => 'link', 'class' => 'up_arrow', 'title' => 'sieverules.moveup', 'content' => ' '));
             $up_link = str_replace("'", "\\'", $up_link);
             $dst = $idx + 2;
             $down_link = $tmp_output->button(array('command' => 'plugin.sieverules.move', 'prop' => $dst, 'type' => 'link', 'class' => 'down_arrow', 'title' => 'sieverules.movedown', 'content' => ' '));
             $down_link = str_replace("'", "\\'", $down_link);
             $this->api->output->command('sieverules_update_list', $idx == 0 ? 'add-first' : 'add', 'rcmrow' . $idx, Q($filter_name), $down_link, $up_link);
         }
     }
     $this->api->output->send();
 }
 function gen_table($attrib)
 {
     $this->rcmail_inst->output->set_env('framed', true);
     $out = '<fieldset><legend>' . $this->gettext('fetchmail_entries') . '</legend>' . "\n";
     $fetch_table = new html_table(array('id' => 'fetch-table', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 3));
     $fetch_table->add_header("", $this->gettext('fetchmailserver'));
     $fetch_table->add_header(array('width' => '20px'), '');
     $fetch_table->add_header(array('width' => '16px'), '');
     try {
         $session_id = $this->soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass'));
         $mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));
         $fetchmail = $this->soap->mail_fetchmail_get($session_id, array('destination' => $mail_user[0]['email']));
         $this->soap->logout($session_id);
         for ($i = 0; $i < count($fetchmail); $i++) {
             $class = $class == 'odd' ? 'even' : 'odd';
             if ($fetchmail[$i]['mailget_id'] == get_input_value('_id', RCUBE_INPUT_GET)) {
                 $class = 'selected';
             }
             $fetch_table->set_row_attribs(array('class' => $class, 'id' => 'fetch_' . $fetchmail[$i]['mailget_id']));
             $this->_fetch_row($fetch_table, $fetchmail[$i]['source_username'] . '@' . $fetchmail[$i]['source_server'], $fetchmail[$i]['active'], $fetchmail[$i]['mailget_id'], $attrib);
         }
     } catch (SoapFault $e) {
         $this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
     }
     if (count($fetchmail) == 0) {
         $fetch_table->add(array('colspan' => '3'), rep_specialchars_output($this->gettext('nofetch')));
         $fetch_table->set_row_attribs(array('class' => 'odd'));
         $fetch_table->add_row();
     }
     $out .= "<div id=\"fetch-cont\">" . $fetch_table->show() . "</div>\n";
     $out .= "</fieldset>\n";
     return $out;
 }
Ejemplo n.º 10
0
 private function _address_row($address_table, $field, $value, $attrib)
 {
     if (!isset($field)) {
         $address_table->set_row_attribs(array('style' => 'display: none;'));
     }
     $hidden_action = new html_hiddenfield(array('name' => '_address_rule_act[]', 'value' => ''));
     $hidden_field = new html_hiddenfield(array('name' => '_address_rule_field[]', 'value' => $field));
     $hidden_text = new html_hiddenfield(array('name' => '_address_rule_value[]', 'value' => $value));
     switch ($field) {
         case "whitelist_from":
             $fieldtxt = rep_specialchars_output($this->gettext('whitelist_from'));
             break;
         case "blacklist_from":
             $fieldtxt = rep_specialchars_output($this->gettext('blacklist_from'));
             break;
         case "whitelist_to":
             $fieldtxt = rep_specialchars_output($this->gettext('whitelist_to'));
             break;
     }
     $address_table->add(array('class' => $field), $fieldtxt);
     $address_table->add(array('class' => 'email'), $value);
     $del_button = $this->api->output->button(array('command' => 'plugin.sauserprefs.addressrule_del', 'type' => 'link', 'class' => 'delete', 'label' => 'delete', 'content' => ' '));
     $address_table->add('control', $del_button . $hidden_action->show() . $hidden_field->show() . $hidden_text->show());
     return $address_table;
 }
 /**
  * Generate the html of the account lists
  * @param type $attrib
  * @return type
  */
 function show_accounts_list($attrib)
 {
     $table = new html_table(array('id' => 'fetchmail-rc-table', 'class' => 'records-table', 'cellspacing' => '0', 'cols' => 1));
     $table->add_header(array('colspan' => 2), $this->gettext('accounts'));
     $accounts_list = $this->accounts_get_sorted_list();
     if (count($accounts_list) == 0) {
         $table->add(array('colspan' => '2'), rep_specialchars_output($this->gettext('noaccounts')));
     } else {
         foreach ($accounts_list as $account) {
             $idx = $account['fetchmail_rc_id'];
             $table->set_row_attribs(array('id' => 'rcmrow' . $idx));
             if ($account['mail_enabled'] == 0) {
                 $table->add(null, Q($account['mail_host']) . ' (' . $this->gettext('disabled') . ')');
             } else {
                 $table->add(null, Q($account['mail_host']) . ($account['count_error'] > 0 ? ' (' . $this->gettext('short_mail_error') . ')' : ''));
             }
         }
     }
     return html::tag('div', array('id' => 'fetchmail_rc-list-filters'), $table->show($attrib));
 }
Ejemplo n.º 12
0
 function vboxadm_form()
 {
     $rcmail = rcmail::get_instance();
     $this->_load_config();
     // add labels to client - to be used in JS alerts
     $rcmail->output->add_label('vboxadm.enterallpassfields', 'vboxadm.passwordinconsistency', 'vboxadm.autoresponderlong', 'vboxadm.autoresponderlongnum', 'vboxadm.autoresponderlongmax');
     $rcmail->output->set_env('product_name', $rcmail->config->get('product_name'));
     $settings = $this->_get_configuration();
     $sa_active = $settings['sa_active'];
     $sa_kill_score = $settings['sa_kill_score'];
     $is_on_vacation = $settings['is_on_vacation'];
     $vacation_subj = $settings['vacation_subj'];
     $vacation_msg = $settings['vacation_msg'];
     $vacation_start = $settings['vacation_start'];
     $vacation_end = $settings['vacation_end'];
     $max_msg_size_mb = $settings['max_msg_size'] / (1024 * 1024);
     $user_id = $settings['id'];
     $domain_id = $settings['domain_id'];
     $alias_active = $settings['alias_active'];
     $alias_goto = $settings['alias_goto'];
     $domain_settings = $this->_get_domain_configuration($domain_id);
     $active_domain = $domain_settings['name'];
     $rcmail->output->set_env('vacation_maxlength', $this->config['vboxadm_vacation_maxlength']);
     $out .= '<p class="introtext">' . $this->gettext('introtext') . '</p>' . "\n";
     if ($this->config['show_admin_link'] == true && ($settings['is_domainadmin'] == true || $settings['is_siteadmin'])) {
         $out .= '<p class="adminlink">';
         $out .= sprintf($this->gettext('adminlinktext'), '<a href="' . $this->config['vboxadm_url'] . '" target="_blank">', '</a>');
         $out .= "</p>\n";
     }
     // =====================================================================================================
     // SpamAssassin
     $out .= '<fieldset><legend>' . $this->gettext('spam') . '</legend>' . "\n";
     $out .= '<div class="fieldset-content">';
     $out .= '<table class="vboxadm-settings" cellpadding="0" cellspacing="0">';
     $field_id = 'sa_active';
     $input_spamenabled = new html_checkbox(array('name' => 'sa_active', 'id' => $field_id, 'value' => 1));
     //		$out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n",
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td>\n", $field_id, rep_specialchars_output($this->gettext('spamenabled')), $input_spamenabled->show($sa_active ? 1 : 0), '<br /><span class="vboxadm-explanation">' . $this->gettext('spamenabledexplanation') . '</span>');
     $field_id = 'sa_kill_score';
     $input_spamscorerefuse = new html_inputfield(array('name' => 'sa_kill_score', 'id' => $field_id, 'maxlength' => 8, 'size' => 8));
     //		$out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n",
     $out .= sprintf("<th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('spamscorerefuse')), $input_spamscorerefuse->show($sa_kill_score), '<br /><span class="vboxadm-explanation">' . $this->gettext('spamscorerefuseexplanation') . '. <span class="sameline">' . $this->gettext('domaindefault') . ': ' . $default_sa_refuse . '.</span></span>');
     $out .= '</table>';
     $out .= '</div></fieldset>' . "\n\n";
     // =====================================================================================================
     // Autoresponder
     $out .= '<fieldset><legend>' . $this->gettext('autoresponder') . '</legend>' . "\n";
     $out .= '<div class="fieldset-content">';
     $out .= '<table><tr><td>';
     $out .= '<table class="vboxadm-settings" cellpadding="0" cellspacing="0">';
     $field_id = 'is_on_vacation';
     $input_autoresponderenabled = new html_checkbox(array('name' => 'is_on_vacation', 'id' => $field_id, 'value' => 1));
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('autoresponderenabled')), $input_autoresponderenabled->show($is_on_vacation ? 1 : 0), '');
     $field_id = 'vacation_start';
     $input_vacation_start = new html_inputfield(array('name' => 'vacation_start', 'id' => $field_id, 'maxlength' => 10, 'class' => 'text-long'));
     if ($vacation_start == '0000-00-00') {
         $vacation_start = '';
     } else {
         $vacation_start = preg_replace('/^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/', '$3.$2.$1', $vacation_start);
     }
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('autoresponderstartdate')), $input_vacation_start->show($vacation_start), '');
     $field_id = 'vacation_end';
     $input_vacation_end = new html_inputfield(array('name' => 'vacation_end', 'id' => $field_id, 'maxlength' => 10, 'class' => 'text-long'));
     if ($vacation_end == '0000-00-00') {
         $vacation_end = '';
     } else {
         $vacation_end = preg_replace('/^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/', '$3.$2.$1', $vacation_end);
     }
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('autoresponderenddate')), $input_vacation_end->show($vacation_end), '');
     $field_id = 'vacation_subj';
     $input_vacation_subj = new html_inputfield(array('name' => 'vacation_subj', 'id' => $field_id, 'maxlength' => 255, 'class' => 'text-long'));
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('autorespondersubject')), $input_vacation_subj->show($vacation_subj), '<br /><span class="vboxadm-explanation">' . $this->gettext('autorespondersubjectexplanation') . '.</span>');
     $out .= '</table></td>';
     $out .= '<td><table class="vboxadm-settings" cellpadding="0" cellspacing="0">';
     $field_id = 'vacation_msg';
     $input_vacation_msg = new html_textarea(array('name' => 'vacation_msg', 'id' => $field_id, 'class' => 'textarea'));
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('autorespondermessage')), $input_vacation_msg->show($vacation_msg), '<br /><span class="vboxadm-explanation">' . $this->gettext('autorespondermessageexplanation') . '</span>');
     $out .= '</table></td></tr></table>';
     $out .= '</div></fieldset>' . "\n\n";
     // ============================================================
     // Parameters
     $out .= '<table><tr><td>';
     $out .= '<fieldset><legend>' . $this->gettext('parameters') . '</legend>' . "\n";
     $out .= '<div class="fieldset-content">';
     $out .= '<table class="vboxadm-settings" cellpadding="0" cellspacing="0">';
     $field_id = 'max_msg_size';
     $input_messagesize = new html_inputfield(array('name' => 'max_msg_size', 'id' => $field_id, 'maxlength' => 16, 'class' => 'text-long'));
     if ($default_maxmsgsize == 0) {
         $default_maxmsgsize = $this->gettext('unlimited');
     } else {
         $default_maxmsgsize = $default_maxmsgsize . ' MB';
     }
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('messagesize')), $input_messagesize->show($max_msg_size_mb), '<br /><span class="vboxadm-explanation">' . str_replace('%d', $active_domain, str_replace('%m', $default_maxmsgsize, $this->gettext('messagesizeexplanation'))) . '</span>');
     $out .= '</table>';
     $out .= '</div></fieldset>' . "\n\n";
     // ============================================================
     // Aliases
     if ($this->config['user_managed_aliases']) {
         // user can edit aliases for his mail address
         $out .= '<fieldset><legend>' . $this->gettext('aliases') . '</legend>' . "\n";
         $out .= '<div class="fieldset-content">';
         $out .= '<span class="vboxadm-explanation">' . $this->gettext('aliasesexplanation') . '</span>';
         $out .= '<table class="vboxadm-settings" cellpadding="0" cellspacing="0">';
         $field_id = 'alias_active';
         $input_alias_active = new html_checkbox(array('name' => 'alias_active', 'id' => $field_id, 'value' => 1));
         $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('aliasesenabled')), $input_alias_active->show($alias_active ? 1 : 0), '');
         $field_id = 'alias_goto';
         $input_alias_goto = new html_inputfield(array('name' => 'alias_goto', 'id' => $field_id, 'maxlength' => 255, 'class' => 'text-long'));
         $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('aliasaddresses')), $input_alias_goto->show($alias_goto), '');
         $out .= '</table>';
         $out .= '</div></fieldset>' . "\n\n";
     }
     // ============================================================
     $out .= '</td><td>';
     // =====================================================================================================
     // Password change
     $out .= '<fieldset><legend>' . $this->gettext('passwordchange') . '</legend>' . "\n";
     $out .= '<div class="fieldset-content">';
     $out .= '<p>' . $this->gettext('passwordcurrentexplanation') . '</p>';
     $out .= '<table class="vboxadm-settings" cellpadding="0" cellspacing="0">';
     $field_id = 'newpasswd';
     $input_passwordnew = new html_passwordfield(array('name' => '_newpasswd', 'id' => $field_id, 'class' => 'text-long', 'autocomplete' => 'off'));
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('passwordnew')), $input_passwordnew->show(), '');
     $field_id = 'confpasswd';
     $input_passwordconf = new html_passwordfield(array('name' => '_confpasswd', 'id' => $field_id, 'class' => 'text-long', 'autocomplete' => 'off'));
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('passwordconfirm')), $input_passwordconf->show(), '');
     $out .= '</table>';
     $out .= '</div></fieldset>' . "\n\n";
     // ============================================================
     $out .= '</td></tr></table>';
     // =====================================================================================================
     // Password
     $out .= '<fieldset><legend>' . $this->gettext('password') . '</legend>' . "\n";
     $out .= '<div class="fieldset-content">';
     $out .= '<p>' . $this->gettext('passwordexplanation') . '</p>';
     $out .= '<table class="vboxadm-settings" cellpadding="0" cellspacing="0">';
     $field_id = 'curpasswd';
     $input_passwordcurrent = new html_passwordfield(array('name' => '_curpasswd', 'id' => $field_id, 'class' => 'text-long', 'autocomplete' => 'off'));
     $out .= sprintf("<tr><th><label for=\"%s\">%s</label>:</th><td>%s%s</td></tr>\n", $field_id, rep_specialchars_output($this->gettext('passwordcurrent')), $input_passwordcurrent->show(), '');
     $out .= '</table>';
     $out .= '</div></fieldset>' . "\n\n";
     // ============================================================
     $out .= html::p(null, $rcmail->output->button(array('command' => 'plugin.vboxadm-save', 'type' => 'input', 'class' => 'button mainaction', 'label' => 'save')));
     $rcmail->output->add_gui_object('vboxadmform', 'vboxadmform');
     $out = $rcmail->output->form_tag(array('id' => 'vboxadmform', 'class' => 'scroller', 'name' => 'vboxadmform', 'method' => 'post', 'action' => './?_task=settings&_action=plugin.vboxadm-save'), $out);
     $out = html::div(array('class' => 'settingsbox', 'style' => 'margin:0 0 15px 0;'), html::div(array('class' => 'boxtitle'), $this->gettext('accountadministration')) . html::div(array('style' => 'padding:15px'), $outtop . "\n" . $out . "\n" . $outbottom));
     return $out;
 }
 function pfadmin_autoresponder_form()
 {
     $rcmail = rcmail::get_instance();
     // add some labels to client
     $rcmail->output->add_label('pfadmin_autoresponder.autoresponder', 'pfadmin_autoresponder.dateformatinconsistency', 'pfadmin_autoresponder.dateformat', 'pfadmin_autoresponder.entervalidmonth', 'pfadmin_autoresponder.entervalidday', 'pfadmin_autoresponder.enterfordigityear', 'pfadmin_autoresponder.entervaliddate', 'pfadmin_autoresponder.dateinpast', 'pfadmin_autoresponder.subjectempty', 'pfadmin_autoresponder.and');
     $rcmail->output->add_script("var settings_account=true;");
     $settings = $this->_get();
     $enabled = $settings['active'];
     $subject = $settings['subject'];
     $body = $settings['body'];
     $date = $settings['activeuntil'];
     $datefrom = $settings['activefrom'];
     $date = str_replace("-", "/", substr($date, 0, 10));
     $datefrom = str_replace("-", "/", substr($datefrom, 0, 10));
     if ($date == "0000/00/00") {
         $date = "";
     }
     if ($datefrom == "0000/00/00") {
         $datefrom = "";
     }
     $rcmail->output->set_env('product_name', $rcmail->config->get('product_name'));
     // allow the following attributes to be added to the <table> tag
     $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));
     // return the complete edit form as table
     $table = new html_table(array('cols' => 2));
     // show autoresponder properties
     $field_id = 'autoresponder_subject';
     $input_autorespondersubject = new html_textarea(array('name' => '_autorespondersubject', 'id' => $field_id, 'cols' => 48, 'rows' => 2));
     $table->add('title', html::label($field_id, rep_specialchars_output($this->gettext('subject'))));
     $table->add(null, $input_autorespondersubject->show($subject));
     $field_id = 'autoresponderbody';
     $input_autoresponderbody = new html_textarea(array('name' => '_autoresponderbody', 'id' => $field_id, 'cols' => 48, 'rows' => 15));
     $table->add('title', html::label($field_id, rep_specialchars_output($this->gettext('autorespondermessage'))));
     $table->add(null, $input_autoresponderbody->show($body));
     $field_id = 'autoresponderdatefrom';
     $input_autoresponderdatefrom = new html_inputfield(array('name' => '_autoresponderdatefrom', 'id' => $field_id, 'value' => $date, 'maxlength' => 10, 'size' => 10));
     $table->add('title', html::label($field_id, rep_specialchars_output($this->gettext('autoresponderdatefrom'))));
     $table->add(null, $input_autoresponderdatefrom->show($datefrom) . " " . $this->gettext('dateformat'));
     $field_id = 'autoresponderdate';
     $input_autoresponderdate = new html_inputfield(array('name' => '_autoresponderdate', 'id' => $field_id, 'value' => $date, 'maxlength' => 10, 'size' => 10));
     $table->add('title', html::label($field_id, rep_specialchars_output($this->gettext('autoresponderdate'))));
     $table->add(null, $input_autoresponderdate->show($date) . " " . $this->gettext('dateformat'));
     $field_id = 'autoresponderenabled';
     $input_autoresponderenabled = new html_checkbox(array('name' => '_autoresponderenabled', 'id' => $field_id, 'value' => 1));
     $table->add('title', html::label($field_id, rep_specialchars_output($this->gettext('autoresponderenabled'))));
     $table->add(null, $input_autoresponderenabled->show($enabled));
     $out = html::div(array('class' => 'box'), html::div(array('id' => 'prefs-title', 'class' => 'boxtitle'), $this->gettext('autoresponder')) . html::div(array('class' => 'boxcontent'), $table->show() . html::p(null, $rcmail->output->button(array('command' => 'plugin.pfadmin_autoresponder-save', 'type' => 'input', 'class' => 'button mainaction', 'label' => 'save')))));
     $rcmail->output->add_gui_object('autoresponderform', 'autoresponder-form');
     return $rcmail->output->form_tag(array('id' => 'autoresponderform', 'name' => 'autoresponderform', 'method' => 'post', 'action' => './?_task=settings&_action=plugin.pfadmin_autoresponder-save'), $out);
 }
Ejemplo n.º 14
0
 function gen_form()
 {
     try {
         $session_id = $this->soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass'));
         $mail_user = $this->soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username']));
         $this->soap->logout($session_id);
     } catch (SoapFault $e) {
         $this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error');
     }
     $enabled = $mail_user[0]['autoresponder'];
     if ($enabled == 'y') {
         $enabled = 1;
     } else {
         $enabled = 0;
     }
     if ($mail_user[0]['autoresponder_start_date'] == '0000-00-00 00:00:00') {
         $mail_user[0]['autoresponder_start_date'] = date('Y') . '-' . date('m') . '-' . date('d') . ' ' . date('H') . ':' . date('i');
     }
     if ($mail_user[0]['autoresponder_end_date'] == '0000-00-00 00:00:00') {
         $mail_user[0]['autoresponder_end_date'] = date('Y') . '-' . date('m') . '-' . date('d') . ' ' . date('H') . ':' . date('i');
     }
     $this->rcmail_inst->output->set_env('framed', TRUE);
     $hidden_priority = new html_hiddenfield(array('name' => '_priority', 'value' => $priority, 'id' => 'priority'));
     $out .= $hidden_priority->show();
     $out .= '<fieldset><legend>' . $this->gettext('acc_autoreply') . '</legend>' . "\n";
     $table = new html_table(array('cols' => 2, 'class' => 'propform'));
     $input_autoreplysubject = new html_inputfield(array('name' => '_autoreplysubject', 'id' => 'autoreplysubject', 'size' => 40));
     $table->add('title', rep_specialchars_output($this->gettext('subject')));
     $table->add('', $input_autoreplysubject->show($mail_user[0]['autoresponder_subject']));
     $input_autoreplybody = new html_textarea(array('name' => '_autoreplybody', 'id' => 'autoreplybody', 'cols' => 48, 'rows' => 15));
     $table->add('title', rep_specialchars_output($this->gettext('autoreplymessage')));
     $table->add('', $input_autoreplybody->show($mail_user[0]['autoresponder_text']));
     $input_autoreplystarton = new html_inputfield(array('name' => '_autoreplystarton', 'id' => 'autoreplystarton', 'size' => 20));
     $table->add('title', rep_specialchars_output($this->gettext('autoreplystarton')));
     $table->add('', $input_autoreplystarton->show($mail_user[0]['autoresponder_start_date']));
     $input_autoreplyendby = new html_inputfield(array('name' => '_autoreplyendby', 'id' => 'autoreplyendby', 'size' => 20));
     $table->add('title', rep_specialchars_output($this->gettext('autoreplyendby')));
     $table->add('', $input_autoreplyendby->show($mail_user[0]['autoresponder_end_date']));
     $input_autoreplyenabled = new html_checkbox(array('name' => '_autoreplyenabled', 'id' => 'autoreplyenabled', 'value' => 1));
     $table->add('title', rep_specialchars_output($this->gettext('autoreplyenabled')));
     $table->add('', $input_autoreplyenabled->show($enabled));
     $out .= $table->show();
     $out .= "</fieldset>\n";
     return $out;
 }