Example #1
0
<?php

require 'hfwinc/session.php';
require 'hfwinc/rsa.php';
require 'hfwinc/hwfunction.php';
/*用户登录检测*/
if (!isset($_SESSION['#LOGIN']) || !isset($_SESSION['#UID']) || !isset($_SESSION['#DTE']) || !isset($_SESSION['#TID'])) {
    $hstr = explode("", trim(Priv_decrypt(HGT('info'), TRUE)));
    if (count($hstr) < 2) {
        echo 'error-num';
        exit(0);
    }
    //格式不对
    if (strlen($hstr[0]) > 1) {
        $uid = '0x' . strToHex($hstr[0]);
    } else {
        echo 'error-uid';
        exit(0);
    }
    //用户名为空或小于2个字节
    if (strlen($hstr[1]) > 5) {
        $pwd = md5($hstr[1], false);
    } else {
        echo 'error-pwd';
        exit(0);
    }
    //密码为空或小于6
    $hsql = "select id,nme,ste,grup from user_tab where uid={$uid} and pwd='{$pwd}'";
    $result = @mysql_query($hsql, $link);
    if ($result != false) {
        if ($row = @mysql_fetch_array($result)) {
Example #2
0
function CheckTaskState()
{
    global $link;
    $tkey = HGT('info');
    if (strlen($tkey) > 30) {
        $tkey = '0x' . strToHex($tkey);
    } else {
        echo "keyerr";
        exit;
    }
    $hsql = 'select ste,msg from task_tab where tkey=' . $tkey;
    if ($result = mysql_query($hsql, $link)) {
        $row = mysql_fetch_array($result);
        switch ((int) $row['ste']) {
            case 0:
                echo "wait";
                break;
            case 1:
                HwExec('delete from task_tab where tkey=' . $tkey);
                echo "success";
                break;
            case -1:
                echo "error" . $row['msg'];
                break;
            default:
                echo "unknowerror";
                break;
        }
        mysql_free_result($result);
    } else {
        echo "chkerror";
    }
}