function mail_login_access_check($hash)
{
    $email = generrate_access_token($hash, $operation = 'DECODE');
    if ($email != '') {
        login_required($email);
    }
    wp_die('认证失败!', 'Authorization Not Allowed | ' . get_option('blogname'), array('response' => '403'));
}
Exemplo n.º 2
0
 /**
  * Edit profile page.
  */
 function edit()
 {
     global $user, $template;
     login_required();
     if ($_POST) {
         if ($user->update($_POST)) {
             $template->set_msg($user->msg, $user->ok);
         }
         $template->set_msg($user->msg, $user->ok);
     }
     $template->assign('user_email', $user->email);
     $template->assign('user_name', $user->name);
     $template->set_title('Update Information');
     $template->render("user", "edit", true);
 }
Exemplo n.º 3
0
<?php

/**
 * Created by PhpStorm.
 * User: yildiz
 * Date: 16.12.15
 * Time: 21:14
 */
require_once 'config.php';
login_required();
$title = "templates";
$tab = 'temp';
$templates = query("SELECT id,name,columns FROM templates ORDER BY id ASC");
$table = "";
foreach ($templates as $row) {
    $plink = '<a href="" onClick="window.open(\'templates_preview.php?id=' . $row['id'] . '\',width=800,height=600)" title="preview"><img src="media/images/find.png" alt="preview"/></a>';
    $dlink = '<a href="templates_delete.php?id=' . $row['id'] . '" onclick="return confirm(\'Are you sure you want to delete this template?\');" title="delete"><img src="media/images/delete.png" alt="delete"/></a>';
    $elink = '<a href="templates_edit.php?id=' . $row['id'] . '" title="edit"><img src="media/images/page_edit.png" alt="edit"/></a>';
    $table .= "<tr><td>" . $row['id'] . "</td><td>" . $row['name'] . "</td><td>" . $row['columns'] . "</td><td>" . $plink . " " . $dlink . " " . $elink . "</td></tr>\n";
}
$message = error_messages();
$content = <<<EOF
<a href="templates_new.php" class="large">new template »</a>
{$message}
    <table>
        <tr>
            <th></th>
            <th>name</th>
            <th>columns</th>
            <th></th>
        </tr>
Exemplo n.º 4
0
 public function used()
 {
     global $tpl, $scodeModel;
     //設定 Action 相關參數
     set_status($this->controller);
     login_required();
     $get_list = $scodeModel->used_list($this->userid);
     $tpl->assign('row_list', $get_list);
     //設定分頁
     if (empty($get_list['table']['page'])) {
         $page_content = array();
     } else {
         $page_path = $tpl->variables['status']['status']['path'];
         $page_content = $this->set_page($get_list, $page_path);
     }
     $tpl->assign('page_content', $page_content);
     $tpl->set_title('');
     $tpl->render("scode", "used", true);
 }
Exemplo n.º 5
0
 public function edit()
 {
     global $tpl, $member;
     login_required();
     //設定 Action 相關參數
     set_status($this->controller);
     if ($_POST) {
         if ($member->update($_POST)) {
             $tpl->set_msg($member->msg, $member->ok);
         }
         $tpl->set_msg($member->msg, $member->ok);
     }
     $tpl->assign('user_email', $user->email);
     $tpl->assign('user_name', $user->name);
     $tpl->set_title('');
     $tpl->render("member", "edit", true);
 }
Exemplo n.º 6
0
    public function hinetpts_exc()
    {
        global $tpl, $config, $deposit;
        set_status($this->controller);
        login_required();
        $serial_no = addslashes($_POST['serial_no']);
        if (empty($serial_no)) {
            echo '<script>alert("序号不可为空白, 请重新输入 !!");
			          window.location = "/site/deposit2/confirm2/?drid=7";
			      </script>';
            exit;
        }
        if ($serial_no != $_POST['serial_no']) {
            echo '<script>alert("序号格式錯誤, 请重新输入 !!");
			          window.location = "/site/deposit2/confirm2/?drid=7";
			      </script>';
            exit;
        }
        $passwd = addslashes($_POST['passw']);
        if (empty($passwd)) {
            echo '<script>alert("密码不可为空白, 请重新输入 !!");
			         window.location = "/site/deposit2/confirm2/?drid=7";    
			        </script>';
            exit;
        }
        if ($passwd != $_POST['passw']) {
            echo '<script>alert("密码格式錯誤, 请重新输入 !!");
			          window.location = "/site/deposit2/confirm2/?drid=7";
			      </script>';
            exit;
        }
        $userid = $_SESSION['auth_id'];
        $ch_serial = $deposit->get_ch_serial($serial_no);
        if (!$ch_serial) {
            echo '<script>alert("序号错误, 请重新输入 !!");
			           window.location = "/site/deposit2/confirm2/?drid=7";
			         </script>';
            exit;
        }
        if ($passwd != $ch_serial['passw']) {
            $arr_update = array();
            $arr_update['userid'] = $userid;
            $arr_update['err_num'] = $ch_serial['err_num'] + 1;
            if ($arr_update['err_num'] < 3) {
                echo '<script>alert("密码错误 : ' . $arr_update['err_num'] . ' 次, 请重新输入 !!");
				         window.location = "/site/deposit2/confirm2/?drid=7";
				       </script>';
            } else {
                $arr_update['switch'] = 'L';
                echo '<script>alert("密码输入错误 3 次,序号已锁定暂停兑换,请洽客服人员 !!");
				         window.location = "/site/deposit2/confirm2/?drid=7";
				       </script>';
            }
            $deposit->update_ch_serial($serial_no, $arr_update);
            exit;
        }
        if ($ch_serial['switch'] == 'L') {
            echo '<script>alert("本序号已暂时停用,请洽客服人员 !!");
			         window.location = "/site/deposit2/confirm2/?drid=7";
			        </script>';
            exit;
        }
        if ($ch_serial['switch'] == 'Y') {
            echo '<script>alert("本序号已使用过, 无法再兑换杀币 !!");
			         window.location = "/site/deposit2/confirm2/?drid=7";
			        </script>';
            exit;
        }
        if ($passwd == $ch_serial['passw']) {
            $arr_update = array();
            $drid = $_POST['drid'];
            $spoint = $ch_serial['point'];
            error_log("[hinetpst_exc] drid={$drid}, spoint={$spoint} ...");
            $deposit_rule = $deposit->deposit_rule_test($drid);
            if ($deposit_rule) {
                $deposit_rule_item = $deposit->get_deposit_rule_item_by_drid_spoint($drid, $spoint);
                if ($deposit_rule_item) {
                    $driid = $deposit_rule_item['driid'];
                    error_log("[hinetpst_exc] driid={$driid} ...");
                    // 產生訂單及儲值資料
                    $depositid = $deposit->add_deposit($userid, $deposit_rule_item['amount']);
                    $spointid = $deposit->add_spoint($userid, $deposit_rule_item['spoint']);
                    $dhid = $deposit->add_deposit_history($userid, $driid, $depositid, $spointid);
                    error_log("[hinetpst_exc] dhid={$dhid}, spointid={$spointid}, depositid={$depositid} ...");
                    // 修改訂單及儲值狀態
                    $get_deposit_history = $deposit->get_deposit_history($dhid);
                    $get_deposit_id = $deposit->get_deposit_id($depositid);
                    error_log("[hinetpts_exc] saja_deposit switch : " . $get_deposit_id[0]['switch']);
                    if ($get_deposit_history[0]['dhid'] && $get_deposit_id[0]['switch'] == 'N') {
                        $hinet_array['out_trade_no'] = $get_deposit_history[0]['dhid'];
                        $hinet_array['spoints'] = $spoint;
                        $hinet_array['userid'] = $userid;
                        $hinet_array['serialno'] = $serial_no;
                        $deposit->set_deposit_history($hinet_array, $get_deposit_history[0], "hinet");
                        $deposit->set_deposit($get_deposit_history[0]['depositid']);
                        $deposit->set_spoint($get_deposit_history[0]['spointid']);
                        $get_deposit_rule_item = $deposit->get_deposit_rule_item($get_deposit_history[0]['driid']);
                        $get_scode_promote = $deposit->get_scode_promote_rt_test($get_deposit_rule_item[0]['driid']);
                        if (!empty($get_scode_promote)) {
                            foreach ($get_scode_promote as $sk => $sv) {
                                if ($sv['productid'] == 0) {
                                    $socde = $deposit->add_scode($userid, $sv);
                                    $deposit->add_scode_history($userid, $socde, $sv);
                                }
                                if ($sv['productid'] > 0 && !empty($sv['productid'])) {
                                    for ($i = 0; $i < $sv['num']; $i++) {
                                        $deposit->add_oscode($userid, $sv);
                                    }
                                }
                            }
                        }
                        $arr_update = array();
                        $arr_update['userid'] = $userid;
                        $arr_update['switch'] = 'Y';
                        $arr_update['dhid'] = $dhid;
                        $arr_update['modifyerid'] = $userid;
                        $deposit->update_ch_serial($serial_no, $arr_update);
                        echo '<script>alert("兑换成功, 新增杀币 ' . $spoint . ' 点 !!");window.location = "/site/member?channelid=1"</script>';
                    }
                }
            }
        }
        exit;
    }
Exemplo n.º 7
0
 public function twcreditcard_pay()
 {
     global $tpl, $config, $deposit;
     set_status($this->controller);
     login_required();
     $pay_info = array();
     $pay_info['web'] = $config['creditcard']['merchantnumber'];
     $pay_info['MN'] = floatval($_POST['amount']);
     $pay_info['Td'] = $_POST['ordernumber'];
     $pay_info['sna'] = urlencode($_SESSION['user']['profile']['nickname']);
     $pay_info['sdt'] = $_SESSION['user']['name'];
     $pay_info['email'] = $_SESSION['user']['email'];
     $pay_info['note1'] = "{userid:" . $_SESSION['auth_id'] . "}";
     $pay_info['note2'] = "";
     $pay_info['OrderInfo'] = urlencode("OrderId:" . $pay_info['Td'] . ",Name:" . $_SESSION['user']['profile']['nickname'] . ",Userid:" . $_SESSION['auth_id'] . ",Amount:" . $pay_info['MN'] . ",Spts:" . $_POST['spoint']);
     $pay_info['Card_Type'] = $config['creditcard']['Card_Type'];
     $chkvalue_ori = $pay_info['web'] . $config['creditcard']['code'] . $pay_info['MN'];
     $pay_info['ChkValue'] = strtoupper(sha1($chkvalue_ori));
     error_log("Ori ChkValue :" . $chkvalue_ori);
     error_log("ChkValue :" . $pay_info['ChkValue']);
     // Add By Thomas 150917 for Data Consistency Check
     if (floatval($_POST['amount']) < 0) {
         die('<script>alert("Pay Amount Error !");history.back();</script>');
         exit;
     }
     if (empty($_POST['chkStr'])) {
         die('<script>alert("Empty Security Data !!");history.back();</script>');
         exit;
     }
     $cs = new convertString();
     $chkStr = $cs->strDecode($_POST['chkStr'], $config["encode_key"], $config["encode_type"]);
     error_log("[c/deposit/twcreditcard_pay] chkStr : " . $chkStr);
     $chkArr = explode("|", $chkStr);
     if (is_array($chkArr)) {
         $chk_orderid = $chkArr[0];
         $chk_amount = $chkArr[1];
         error_log("[c/deposit/twcreditcard_pay] pay data : " . $_POST['ordernumber'] . "|" . $_POST['amount']);
         if (floatval($chk_amount) != floatval($_POST['amount'])) {
             die('<script>alert("Total Fee Check Error !!");history.back();</script>');
             exit;
         }
         if ($chk_orderid != $_POST['ordernumber']) {
             die('<script>alert("Trade No. Check Failed !!");history.back();</script>');
             exit;
         }
     } else {
         die('<script>alert("Security Data Parse Error !!");history.back();</script>');
         exit;
     }
     $get_deposit_history = $deposit->get_deposit_history($pay_info['Td']);
     if (!empty($get_deposit_history[0]['dhid'])) {
         $arr_cond = array();
         $arr_cond['dhid'] = $pay_info['Td'];
         $arr_data = array();
         $arr_data['out_trade_no'] = $pay_info['Td'];
         $arr_data['userid'] = $_SESSION['auth_id'];
         $arr_data['amount'] = intval($pay_info['MN']);
         $arr_data['timepaid'] = date('YmdHis');
         $arr_data['phone'] = $pay_info['sdt'];
         $arr_data['paymenttype'] = $config['creditcard']['paymenttype'];
         $arr_date['ChkValue'] = $pay_info['ChkValue'];
         $arr_update['data'] = json_encode($arr_data);
         $arr_update['modifierid'] = $_SESSION['auth_id'];
         $arr_update['modifiername'] = $_SESSION['user']['profile']['nickname'];
         $arr_update['modifiertype'] = 'User';
         $deposit->update_deposit_history($arr_cond, $arr_update);
         $submit = '<body onload="document.form1.submit();" >';
         $submit .= '<form name="form1" action="' . $config['creditcard']['url_payment'] . '" method="POST">';
         $submit .= '<input type="hidden" name="web" value="' . $config['creditcard']['merchantnumber'] . '" />';
         $submit .= '<input type="hidden" name="MN" value="' . intval($pay_info['MN']) . '" />';
         // $submit.='<input type="hidden" name="MN" value="1" />';
         $submit .= '<input type="hidden" name="OrderInfo" value="' . $pay_info['OrderInfo'] . '" />';
         $submit .= '<input type="hidden" name="Td" value="' . $pay_info['Td'] . '" />';
         $submit .= '<input type="hidden" name="sna" value="' . $pay_info['sna'] . '" />';
         $submit .= '<input type="hidden" name="sdt" value="' . $pay_info['sdt'] . '" />';
         $submit .= '<input type="hidden" name="email" value="' . $pay_info['email'] . '" />';
         $submit .= '<input type="hidden" name="note1" value="' . $pay_info['note1'] . '" />';
         $submit .= '<input type="hidden" name="note2" value="' . $pay_info['note2'] . '" />';
         $submit .= '<input type="hidden" name="Card_Type" value="' . $pay_info['Card_Type'] . '" />';
         $submit .= '<input type="hidden" name="ChkValue" value="' . $pay_info['ChkValue'] . '" />';
         $submit .= '</form>';
         $submit .= '</body>';
         error_log($submit);
         echo $submit;
     } else {
         echo '<script>alert("充值程序異常!");window.location = "/site/deposit/"</script>';
     }
     exit;
 }
function settings()
{
    $user = login_required();
    $message = array();
    if ($_POST) {
        foreach ($_POST as $key => $value) {
            $user->{$key} = $value;
        }
        $user->save();
        $message = array("text" => "Seus dados foram salvos com sucesso!", "type" => "success");
    }
    global $twig;
    echo $twig->render('user_detail.html', array('user' => $user, 'message' => $message));
}
Exemplo n.º 9
0
 function userCancelTx()
 {
     global $db, $config, $tpl, $mall;
     //設定 Action 相關參數
     login_required();
     set_status($this->controller);
     date_default_timezone_set('Asia/Shanghai');
     $userid = $_SESSION['auth_id'];
     $evrid = $_POST['evrid'];
     $arrCond = array();
     $arrCond['userid'] = $userid;
     $arrCond['evrid'] = $evrid;
     // $arrCond['tx_status']='2';
     $arrUpd = array();
     $arrUpd['tx_status'] = '-1';
     $retCode = $mall->updQrcodeTxRecord($arrUpd, $arrCond);
     $retArr = array();
     $retArr['evrid'] = $evrid;
     if ($retCode) {
         // $ws=new Client($config['wss_url']);
         // $ws->send('NTFY|'.$arrCond['evrid'].'|'.$arrUpd['tx_status']);
         $retArr['retCode'] = '1';
         $retArr['retMsg'] = urlencode('买方取消交易!!');
     } else {
         $retArr['retCode'] = $retCode;
         $retArr['retMsg'] = urlencode('买方取消失败!!');
     }
     $this->replyAndExit($retArr);
 }