Esempio n. 1
0
function runAll()
{
    global $servers;
    file_put_contents('var/locales', json_encode(array_keys($servers)));
    foreach ($servers as $locale => $server) {
        $account = 'royalAdmin';
        $pass = '******';
        if (!empty($server['account'])) {
            $account = $server['account'];
            $pass = $server['pass'];
        }
        httpPost($server['login_url'], array('account' => $account, 'password' => $pass, 'submit' => true));
        $dashboard = httpGet($server['dashboard_url'], array());
        preg_match('/var statisDatas = ([^;]*);/sim', $dashboard, $data);
        $dataArray = json_decode($data[1], true);
        handleData($locale, $dataArray);
    }
}
Esempio n. 2
0
<?php

//A single-frame unmasked text message
$data = array(0x81, 0x5, 0x48, 0x65, 0x6c, 0x6c, 0x6f);
//A single-frame masked text message
$data2 = array(0x81, 0x85, 0x37, 0xfa, 0x21, 0x3d, 0x7f, 0x9f, 0x4d, 0x51, 0x58);
handleData(toString($data));
handleData(toString($data2));
function toString(array $data)
{
    return array_reduce($data, function ($carry, $item) {
        return $carry .= chr($item);
    });
}
function handleData($data)
{
    $offset = 0;
    $temp = ord($data[$offset++]);
    $FIN = $temp >> 7 & 0x1;
    $RSV1 = $temp >> 6 & 0x1;
    $RSV2 = $temp >> 5 & 0x1;
    $RSV3 = $temp >> 4 & 0x1;
    $opcode = $temp & 0xf;
    echo "First byte: FIN is {$FIN}, RSV1-3 are {$RSV1}, {$RSV2}, {$RSV3}; Opcode is {$opcode} \n";
    $temp = ord($data[$offset++]);
    $mask = $temp >> 7 & 0x1;
    $payload_length = $temp & 0x7f;
    if ($payload_length == 126) {
        $temp = substr($data, $offset, 2);
        $offset += 2;
        $temp = unpack('nl', $temp);
Esempio n. 3
0
             $rt['areaoptions']['city'] && $rt['areaoptions']['city'] >= 0 && ($initValues[] = array('parentid' => $rt['areaoptions']['province'], 'selectid' => 'city', 'defaultid' => $rt['areaoptions']['city'], 'hasfirst' => 1));
             $rt['areaoptions']['area'] && $rt['areaoptions']['area'] >= 0 && ($initValues[] = array('parentid' => $rt['areaoptions']['city'], 'selectid' => 'area', 'defaultid' => $rt['areaoptions']['area'], 'hasfirst' => 1));
         }
         $allAreas = $areasService->buildAllAreasLists(S::isArray($initValues) ? $initValues : $basicValue);
         if (S::inArray($rt['type'], array(6, 7))) {
             $rt['type'] == 6 && ($rt['dateoptions'] = unserialize($rt['options']));
             $rt['options'] = '';
         }
         include PrintEot('customfield');
         exit;
     } else {
         $fieldService = L::loadClass('customerfield', 'user');
         $fieldInfo = $fieldService->getFieldByFieldId($id);
         !$fieldInfo && adminmsg('fieldid_error');
         $fieldInfo['ifsys'] && adminmsg('不允许编辑系统默认字段');
         $updateArray = handleData();
         $fieldService->setField($updateArray, $id);
         if ($fieldInfo['type'] != $updateArray['type']) {
             $dropfield = '';
             $colums = $db->get_one("SHOW COLUMNS FROM pw_memberinfo LIKE " . S::sqlEscape('field_' . $fieldInfo['id']));
             $colums['Field'] == 'field_' . $fieldInfo['id'] && ($dropfield = "DROP field_{$fieldInfo['id']}");
             $dropfield && $db->query("ALTER TABLE pw_memberinfo {$dropfield}");
             $db->query("ALTER TABLE pw_memberinfo ADD field_{$fieldInfo['id']} VARCHAR(255) NOT NULL default ''");
             /*$colums = $db->get_one("SHOW COLUMNS FROM pw_memberinfo LIKE ".S::sqlEscape('field_'.$fieldInfo['id']));
             		$colums['Field'] == 'field_' . $fieldInfo['id'] && $db->query("UPDATE pw_memberinfo SET field_$fieldInfo[id] = ''");*/
         }
         updatecache_field();
         adminmsg('operate_success');
     }
 } elseif ($action == 'del') {
     S::gp(array('selid'));