Beispiel #1
0
function get_oss_info($act)
{
    global $settings;
    if ($settings[flow_setting]) {
        $s = pd_encodex($settings[flow_setting], 'DECODE');
        if ($s) {
            $arr = explode('|', $s);
        }
        switch ($act) {
            case 'id':
                return $arr[0];
                break;
            case 'username':
                return $arr[1];
                break;
            case 'access_id':
                return $arr[2];
                break;
            case 'access_key':
                return $arr[3];
                break;
            case 'oss_host':
                return $arr[4];
                break;
            case 'oss_bucket':
                return $arr[5];
                break;
            case 'oss_money':
                return $arr[6];
                break;
        }
    } else {
        return 'no_flow!!!';
    }
}
Beispiel #2
0
function get_template_info($tpl_name)
{
    global $db, $tpf;
    $file = PHPDISK_ROOT . "templates/{$tpl_name}/template_info.php";
    if (file_exists($file)) {
        $_data = read_file($file);
        preg_match("/Template Name:(.*)/i", $_data, $tpl_title);
        preg_match("/Template URL:(.*)/i", $_data, $tpl_url);
        preg_match("/Description:(.*)/i", $_data, $tpl_desc);
        preg_match("/Author:(.*)/i", $_data, $tpl_author);
        preg_match("/Author Site:(.*)/i", $_data, $tpl_site);
        preg_match("/Version:(.*)/i", $_data, $tpl_version);
        preg_match("/Template Type:(.*)/i", $_data, $tpl_type);
        preg_match("/PHPDISK Core:(.*)/i", $_data, $phpdisk_core);
        preg_match("/Template Core:(.*)/i", $_data, $template_core);
    }
    $actived = (int) @$db->result_first("select actived from {$tpf}templates where tpl_name='{$tpl_name}' limit 1");
    $arr = array('tpl_title' => trim($tpl_title[1]), 'tpl_url' => trim($tpl_url[1]), 'tpl_desc' => htmlspecialchars(trim($tpl_desc[1])), 'tpl_author' => trim($tpl_author[1]), 'tpl_site' => trim($tpl_site[1]), 'tpl_version' => trim($tpl_version[1]), 'tpl_type' => trim(strtolower($tpl_type[1])), 'tpl_dir' => trim($tpl_name), 'phpdisk_core' => trim($phpdisk_core[1]), 'template_core' => trim($template_core[1]), 'actived' => $actived);
    if (file_exists(PHPDISK_ROOT . 'templates/' . $tpl_name . '/core.tpl.php')) {
        $hash = @$db->result_first("select hash from {$tpf}templates where tpl_name='{$tpl_name}' limit 1");
        if ($hash) {
            $s = pd_encodex(str_replace(array("\r", "\n"), '', $hash), 'DECODE');
            $arr_t = explode('@@', $s);
            if ($arr_t[1] && time() > $arr_t[1]) {
                $arr[authed_tpl] = 1;
            } else {
                $arrb = explode('|', $arr_t[0]);
                $flag = 0;
                for ($i = 0; $i < count($arrb); $i++) {
                    if ($arrb[$i] && strcasecmp(substr(strrev($_SERVER['HTTP_HOST']), 0, strlen($arrb[$i])), strrev($arrb[$i])) == 0) {
                        $flag++;
                    }
                }
                $arr[authed_tpl] = $flag ? 2 : 1;
            }
        } else {
            $arr[authed_tpl] = 1;
        }
    } else {
        $arr[authed_tpl] = 0;
    }
    return $arr;
}