403Webshell
Server IP : 103.161.17.216  /  Your IP : 216.73.216.1
Web Server : nginx/1.18.0
System : Linux tipsysaigoncharming 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/mail.thegioididong.edu.vn/program/steps/settings/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/mail.thegioididong.edu.vn/program/steps/settings/responses.inc
<?php

/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 |                                                                       |
 | Copyright (C) The Roundcube Dev Team                                  |
 |                                                                       |
 | Licensed under the GNU General Public License version 3 or            |
 | any later version with exceptions for skins & plugins.                |
 | See the README file for a full license statement.                     |
 |                                                                       |
 | PURPOSE:                                                              |
 |   Manage and save canned response texts                               |
 +-----------------------------------------------------------------------+
 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
 +-----------------------------------------------------------------------+
*/


if (!empty($_POST['_insert'])) {
    $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST));
    $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST, true));

    if (!empty($name) && !empty($text)) {
        $dupes = 0;
        $responses = $RCMAIL->get_compose_responses(false, true);
        foreach ($responses as $resp) {
            if (strcasecmp($name, preg_replace('/\s\(\d+\)$/', '', $resp['name'])) == 0)
                $dupes++;
        }
        if ($dupes) {  // require a unique name
            $name .= ' (' . ++$dupes . ')';
        }

        $response = array('name' => $name, 'text' => $text, 'format' => 'text', 'key' => substr(md5($name), 0, 16));
        $responses[] = $response;

        if ($RCMAIL->user->save_prefs(array('compose_responses' => $responses))) {
            $RCMAIL->output->command('add_response_item', $response);
            $RCMAIL->output->command('display_message', $RCMAIL->gettext('successfullysaved'), 'confirmation');
        }
        else {
            $RCMAIL->output->command('display_message', $RCMAIL->gettext('errorsaving'), 'error');
        }
    }

    // send response
    $RCMAIL->output->send();
}

if ($RCMAIL->action == 'delete-response' && $RCMAIL->output->ajax_call) {
    if ($key = rcube_utils::get_input_value('_key', rcube_utils::INPUT_POST)) {
        $responses = $RCMAIL->get_compose_responses(false, true);
        foreach ($responses as $i => $response) {
            if (empty($response['key']))
                $response['key'] = substr(md5($response['name']), 0, 16);
            if ($response['key'] == $key) {
                unset($responses[$i]);
                $deleted = $RCMAIL->user->save_prefs(array('compose_responses' => $responses));
                break;
            }
        }
    }

    if ($deleted) {
        $RCMAIL->output->command('display_message', $RCMAIL->gettext('deletedsuccessfully'), 'confirmation');
        $RCMAIL->output->command('remove_response', $key);
    }

    $RCMAIL->output->send();
}


$OUTPUT->set_pagetitle($RCMAIL->gettext('responses'));
$OUTPUT->include_script('list.js');

$OUTPUT->add_handlers(array(
    'responseslist' => 'rcmail_responses_list',
));
$OUTPUT->add_label('deleteresponseconfirm');

$OUTPUT->send('responses');


/**
 *
 */
function rcmail_responses_list($attrib)
{
    global $RCMAIL, $OUTPUT;

    $attrib += array('id' => 'rcmresponseslist', 'tagname' => 'table');

    $plugin = $RCMAIL->plugins->exec_hook('responses_list', array(
        'list' => $RCMAIL->get_compose_responses(true),
        'cols' => array('name')
    ));

    $out = $RCMAIL->table_output($attrib, $plugin['list'], $plugin['cols'], 'key');

    $readonly_responses = array();
    foreach ($plugin['list'] as $item) {
        if (!empty($item['static'])) {
            $readonly_responses[] = $item['key'];
        }
    }

    // set client env
    $OUTPUT->add_gui_object('responseslist', $attrib['id']);
    $OUTPUT->set_env('readonly_responses', $readonly_responses);

    return $out;
}

Youez - 2016 - github.com/yon3zu
LinuXploit