当前位置: 首页>>代码示例>>PHP>>正文


PHP send_request函数代码示例

本文整理汇总了PHP中send_request函数的典型用法代码示例。如果您正苦于以下问题:PHP send_request函数的具体用法?PHP send_request怎么用?PHP send_request使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了send_request函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: client_updateAutoresponder

/**
 * Update autoresponder of the given mail account
 *
 * @param int $mailAccountId Mail account id
 * @param string $autoresponderMessage Auto-responder message
 * @return void
 */
function client_updateAutoresponder($mailAccountId, $autoresponderMessage)
{
    $autoresponderMessage = clean_input($autoresponderMessage);
    if ($autoresponderMessage == '') {
        set_page_message(tr('Auto-responder message cannot be empty.'), 'error');
        redirectTo("mail_autoresponder_enable.php?mail_account_id={$mailAccountId}");
    } else {
        $db = iMSCP_Database::getInstance();
        try {
            $db->beginTransaction();
            $query = "SELECT `mail_addr` FROM `mail_users` WHERE `mail_id` = ?";
            $stmt = exec_query($query, $mailAccountId);
            $query = "UPDATE `mail_users` SET `status` = ?, `mail_auto_respond_text` = ? WHERE `mail_id` = ?";
            exec_query($query, array('tochange', $autoresponderMessage, $mailAccountId));
            // Purge autoreplies log entries
            delete_autoreplies_log_entries();
            $db->commit();
            // Ask iMSCP daemon to trigger engine dispatcher
            send_request();
            write_log(sprintf("%s: Updated auto-responder for the '%s' mail account", $_SESSION['user_logged'], $stmt->fields['mail_addr']), E_USER_NOTICE);
            set_page_message(tr('Auto-responder successfully scheduled for update.'), 'success');
        } catch (iMSCP_Exception_Database $e) {
            $db->rollBack();
            throw $e;
        }
    }
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:34,代码来源:mail_autoresponder_edit.php

示例2: client_updateHtaccessUser

/**
 * Updates htaccess user.
 *
 * @param int $dmn_id Domain unique identifier
 * @param int $uuser_id Htaccess user unique identifier
 * @return
 */
function client_updateHtaccessUser(&$dmn_id, &$uuser_id)
{
    if (isset($_POST['uaction']) && $_POST['uaction'] == 'modify_user') {
        // we have to add the user
        if (isset($_POST['pass']) && isset($_POST['pass_rep'])) {
            if (!checkPasswordSyntax($_POST['pass'])) {
                return;
            }
            if ($_POST['pass'] !== $_POST['pass_rep']) {
                set_page_message(tr("Passwords do not match."), 'error');
                return;
            }
            $nadmin_password = cryptPasswordWithSalt($_POST['pass'], generateRandomSalt(true));
            $change_status = 'tochange';
            $query = "\n\t\t\t\tUPDATE\n\t\t\t\t\t`htaccess_users`\n\t\t\t\tSET\n\t\t\t\t\t`upass` = ?, `status` = ?\n\t\t\t\tWHERE\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t\tAND\n\t\t\t\t\t`id` = ?\n\t\t\t";
            exec_query($query, array($nadmin_password, $change_status, $dmn_id, $uuser_id));
            send_request();
            $query = "\n\t\t\t\tSELECT\n\t\t\t\t\t`uname`\n\t\t\t\tFROM\n\t\t\t\t\t`htaccess_users`\n\t\t\t\tWHERE\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t\tAND\n\t\t\t\t\t`id` = ?\n\t\t\t";
            $rs = exec_query($query, array($dmn_id, $uuser_id));
            $uname = $rs->fields['uname'];
            $admin_login = $_SESSION['user_logged'];
            write_log("{$admin_login}: updated htaccess user ID: {$uname}", E_USER_NOTICE);
            redirectTo('protected_user_manage.php');
        }
    } else {
        return;
    }
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:35,代码来源:protected_user_edit.php

示例3: gen_page_dynamic_data

function gen_page_dynamic_data(&$tpl, &$sql, $mail_id)
{
    global $cfg;
    if (isset($_POST['uaction']) && $_POST['uaction'] === 'enable_arsp') {
        if ($_POST['arsp_message'] === '') {
            $tpl->assign('ARSP_MESSAGE', '');
            set_page_message(tr('Please type your mail autorespond message!'));
            return;
        }
        $arsp_message = $_POST['arsp_message'];
        $item_change_status = $cfg['ITEM_CHANGE_STATUS'];
        check_for_lock_file();
        $query = <<<SQL_QUERY
            update
                mail_users
            set
                status = ?,
                mail_auto_respond = ?
            where
                mail_id = ?
SQL_QUERY;
        $rs = exec_query($sql, $query, array($item_change_status, $arsp_message, $mail_id));
        send_request();
        write_log($_SESSION['user_logged'] . " : add mail autorsponder");
        set_page_message(tr('Mail account scheduler for modification!'));
        header("Location: email_accounts.php");
        exit(0);
    } else {
        $tpl->assign('ARSP_MESSAGE', '');
    }
}
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:31,代码来源:enable_mail_arsp.php

示例4: scheduleBackupRestoration

/**
 * Schedule backup restoration.
 *
 * @param int $userId Customer unique identifier
 * @return void
 */
function scheduleBackupRestoration($userId)
{
    exec_query("UPDATE `domain` SET `domain_status` = ? WHERE `domain_admin_id` = ?", array('torestore', $userId));
    send_request();
    write_log($_SESSION['user_logged'] . ": scheduled backup restoration.", E_USER_NOTICE);
    set_page_message(tr('Backup has been successfully scheduled for restoration.'), 'success');
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:13,代码来源:backup.php

示例5: padd_group

function padd_group($tpl, $sql, $dmn_id)
{
    $cfg = EasySCP_Registry::get('Config');
    if (isset($_POST['uaction']) && $_POST['uaction'] == 'add_group') {
        // we have to add the group
        if (isset($_POST['groupname'])) {
            if (!validates_username($_POST['groupname'])) {
                set_page_message(tr('Invalid group name!'), 'warning');
                return;
            }
            $groupname = $_POST['groupname'];
            $query = "\n\t\t\t\tSELECT\n\t\t\t\t\t`id`\n\t\t\t\tFROM\n\t\t\t\t\t`htaccess_groups`\n\t\t\t\tWHERE\n\t\t\t\t\t`ugroup` = ?\n\t\t\t\tAND\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t";
            $rs = exec_query($sql, $query, array($groupname, $dmn_id));
            if ($rs->recordCount() == 0) {
                $change_status = $cfg->ITEM_ADD_STATUS;
                $query = "\n\t\t\t\t\tINSERT INTO `htaccess_groups`\n\t\t\t\t\t\t(`dmn_id`, `ugroup`, `status`)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t(?, ?, ?)\n\t\t\t\t";
                exec_query($sql, $query, array($dmn_id, $groupname, $change_status));
                send_request();
                $admin_login = $_SESSION['user_logged'];
                write_log("{$admin_login}: add group (protected areas): {$groupname}");
                user_goto('protected_user_manage.php');
            } else {
                set_page_message(tr('Group already exists!'), 'error');
                return;
            }
        } else {
            set_page_message(tr('Invalid group name!'), 'error');
            return;
        }
    } else {
        return;
    }
}
开发者ID:gOOvER,项目名称:EasySCP,代码行数:33,代码来源:protected_group_add.php

示例6: client_addHtaccessGroup

/**
 * Adds Htaccess group.
 *
 * @param int $domainId Domain unique identifier
 * @return
 */
function client_addHtaccessGroup($domainId)
{
    if (isset($_POST['uaction']) && $_POST['uaction'] == 'add_group') {
        // we have to add the group
        if (isset($_POST['groupname'])) {
            if (!validates_username($_POST['groupname'])) {
                set_page_message(tr('Invalid group name!'), 'error');
                return;
            }
            $groupname = $_POST['groupname'];
            $query = "\n\t\t\t\tSELECT\n\t\t\t\t\t`id`\n\t\t\t\tFROM\n\t\t\t\t\t`htaccess_groups`\n\t\t\t\tWHERE\n\t\t\t\t\t`ugroup` = ?\n\t\t\t\tAND\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t";
            $rs = exec_query($query, array($groupname, $domainId));
            if ($rs->rowCount() == 0) {
                $change_status = 'toadd';
                $query = "\n\t\t\t\t\tINSERT INTO `htaccess_groups` (\n\t\t\t\t\t    `dmn_id`, `ugroup`, `status`\n\t\t\t\t\t) VALUES (\n\t\t\t\t\t    ?, ?, ?\n\t\t\t\t\t)\n\t\t\t\t";
                exec_query($query, array($domainId, $groupname, $change_status));
                send_request();
                set_page_message(tr('Htaccess group successfully scheduled for addition.'), 'success');
                $admin_login = $_SESSION['user_logged'];
                write_log("{$admin_login}: added htaccess group: {$groupname}", E_USER_NOTICE);
                redirectTo('protected_user_manage.php');
            } else {
                set_page_message(tr('This htaccess group already exists.'), 'error');
                return;
            }
        } else {
            set_page_message(tr('Invalid htaccess group name.'), 'error');
            return;
        }
    } else {
        return;
    }
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:39,代码来源:protected_group_add.php

示例7: get_uptime

function get_uptime()
{
    global $passwords, $uptime, $cache_file;
    $all_time = send_request("summary.average/" . $passwords->pingdom->checkid . "?includeuptime=true");
    $last_month = send_request("summary.average/" . $passwords->pingdom->checkid . "?includeuptime=true&from=" . (time() - 2592000));
    $uptime = array("all_time" => $all_time->summary->status->totalup / ($all_time->summary->status->totalup + $all_time->summary->status->totaldown), "last_month" => $last_month->summary->status->totalup / ($last_month->summary->status->totalup + $last_month->summary->status->totaldown));
    file_put_contents($cache_file, "<?php\n  \$last_check = " . var_export(time(), true) . ";\n\n  \$uptime = " . var_export($uptime, true) . ";\n?" . ">");
}
开发者ID:mcenderdragon,项目名称:Icon-Craft,代码行数:8,代码来源:uptime.php

示例8: died

 function died($error)
 {
     $data = "We are very sorry, but there were error(s) found with the form you submitted. ";
     $data .= "These errors appear below.<br />";
     $data .= $error;
     $data .= "Please go back and fix these errors.<br />";
     send_request($data, true);
 }
开发者ID:kgrant360,项目名称:geekchicprogramming.com,代码行数:8,代码来源:send-form-email.php

示例9: make_request

function make_request()
{
    $user = $_GET['login'];
    $password = md5($_GET['password']);
    $packet_id = wddx_packet_start("Authentication Request");
    wddx_add_vars($packet_id, 'user', 'password');
    $packet = wddx_packet_end($packet_id);
    // make a custom POST request to the server with the wddx packet
    return send_request($packet);
}
开发者ID:SandyS1,项目名称:presentations,代码行数:10,代码来源:client.inc.php

示例10: get_api_data

function get_api_data($url, $param = array())
{
    $url = API_URL . $url;
    $sign = encrypt($param);
    $param['sign'] = $sign;
    $api_str = send_request($url, $param);
    if (is_json($api_str)) {
        return json_decode($api_str, TRUE);
    } else {
        return return_format(array($api_str), "json_str 解析错误,这是api内部报错!请联系1162097842@qq.com", API_NORMAL_ERR);
    }
}
开发者ID:codekissyoung,项目名称:filmfest,代码行数:12,代码来源:functions.php

示例11: opendkim_deactivate

/**
 * Deactivate OpenDKIM for the given customer
 *
 * @param int $customerId Customer unique identifier
 * @return void
 */
function opendkim_deactivate($customerId)
{
    $stmt = exec_query('SELECT COUNT(admin_id) AS cnt FROM admin WHERE admin_id = ? AND created_by = ? AND admin_status = ?', array($customerId, $_SESSION['user_id'], 'ok'));
    $row = $stmt->fetchRow(PDO::FETCH_ASSOC);
    if ($row['cnt']) {
        exec_query('UPDATE opendkim SET opendkim_status = ? WHERE admin_id = ?', array('todelete', $customerId));
        send_request();
        set_page_message(tr('OpenDKIM support scheduled for deactivation. This can take few seconds.'), 'success');
    } else {
        showBadRequestErrorPage();
    }
}
开发者ID:reneschuster,项目名称:plugins,代码行数:18,代码来源:opendkim.php

示例12: submit

 public function submit()
 {
     //先接受get数组,然后再填充到conf里面
     $conf = ['rzm' => 2013214368, 'xm' => 'ling', 'ip' => '202.202.41.125', 'bt' => '这是测试数据,请穆老师处理', 'fwxmh' => 01, 'bxdh' => 18580024667, 'fwquy' => '', 'wxdd' => '27栋', 'bxnr' => '这是测试数据,请穆老师处理', 'wxdjh' => 'a66222d0-f5ba-4fe5-86d4-a3cd01815db4', 'hfmyd' => '满意', 'hfjy' => '这是测试数据,请穆老师处理'];
     $wxdh = send_request('RepairApp', $conf);
     //提交
     if ($wxdh) {
         $this->ajaxReturn(true);
     } else {
         $this->ajaxReturn(false);
     }
 }
开发者ID:RedrockTeam,项目名称:report,代码行数:12,代码来源:SubmitController.class.php

示例13: performTest

 public function performTest($testName)
 {
     $testUri = testCase::BASE_SERVICE . $testName . '.' . testCase::RESPONSE_FORMAT;
     echo_line('<pre>');
     echo_line("Request:");
     echo_line("\t" . $testUri);
     echo_line("\nResponse:\n");
     $response = send_request($testUri, 'GET');
     $coder = new CJSON();
     $object = $coder->decode($response);
     print_as_json('', $object);
     echo_line('</pre>');
 }
开发者ID:rosko,项目名称:AlmazService,代码行数:13,代码来源:testClassSheme.php

示例14: returnVisit

 public function returnVisit()
 {
     if (session('stuId') && session('wx_djh') && I('post.hfmyd') && I('post.hfjy')) {
         $conf = ['rzm' => session('stuId'), 'wxdjh' => session('get.wx_djh'), 'hfmyd' => I('post.hfmyd'), 'hfjy' => I('post.hfjy')];
         if (send_request('PayReturnVisit', $conf)) {
             $this->ajaxReturn(true);
         } else {
             $this->ajaxReturn(false);
         }
     } else {
         $this->error('数据填写不完整');
     }
 }
开发者ID:RedrockTeam,项目名称:report-repair-fe,代码行数:13,代码来源:DetailController.class.php

示例15: firstLoad

 public function firstLoad()
 {
     $conf = ['id' => session('stuId')];
     $res = send_request('InfoById', $conf);
     //获取从接口拿到的保修单数据
     if ($res) {
         D('Globle')->cacheRefresh($res);
         //每次查询的时候跟新本地缓存
         $this->LoadUnfinishedData();
     } else {
         //查看是否为接口问题
         $this->LoadUnfinishedData();
     }
 }
开发者ID:RedrockTeam,项目名称:report-repair-fe,代码行数:14,代码来源:IndexController.class.php


注:本文中的send_request函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。