コード例 #1
0
ファイル: Ueditor.php プロジェクト: jaya-project/zycms
 public function upload()
 {
     $CONFIG = json_decode(preg_replace("/\\/\\*[\\s\\S]+?\\*\\//", "", file_get_contents(realpath("./data/config.json"))), true);
     switch ($this->action) {
         case 'config':
             $result = json_encode($CONFIG);
             break;
             /* 上传图片 */
         /* 上传图片 */
         case 'uploadimage':
             /* 上传涂鸦 */
         /* 上传涂鸦 */
         case 'uploadscrawl':
             /* 上传视频 */
         /* 上传视频 */
         case 'uploadvideo':
             /* 上传文件 */
         /* 上传文件 */
         case 'uploadfile':
             $result = action_upload($CONFIG);
             break;
             /* 列出图片 */
         /* 列出图片 */
         case 'listimage':
             $result = action_list($CONFIG);
             break;
             /* 列出文件 */
         /* 列出文件 */
         case 'listfile':
             $result = action_list($CONFIG);
             break;
             /* 抓取远程文件 */
         /* 抓取远程文件 */
         case 'catchimage':
             $result = action_crawler($CONFIG);
             break;
         default:
             $result = json_encode(array('state' => '请求地址出错'));
             break;
     }
     /* 输出结果 */
     if (isset($_GET["callback"])) {
         if (preg_match("/^[\\w_]+\$/", $this->input->get("callback"))) {
             echo htmlspecialchars($this->input->get("callback")) . '(' . $result . ')';
         } else {
             echo json_encode(array('state' => 'callback参数不合法'));
         }
     } else {
         echo $result;
     }
 }
コード例 #2
0
ファイル: index.php プロジェクト: sd-design/php-simple-blog
require_once "../models/db.php";
require_once "../models/articles.php";
$link = db_connect();
$action = isset($_GET['action']) ? $_GET['action'] : "";
switch ($action) {
    case "add":
        action_add();
        break;
    case "edit":
        action_edit();
        break;
    case "delete":
        action_delete();
        break;
    default:
        action_list();
}
function action_add()
{
    global $link;
    if (!empty($_POST)) {
        articles_new($link, $_POST['title'], $_POST['date'], $_POST['content']);
        header("Location: index.php");
    }
    $article['title'] = "";
    $article['content'] = "";
    $article['date'] = "";
    require "../views/article_admin.php";
}
function action_edit()
{
コード例 #3
0
        /* 上传文件 */
    /* 上传文件 */
    case 'uploadfile':
        $type = 0;
        $result = (include "action_upload.php");
        break;
        /* 列出图片 */
    /* 列出图片 */
    case 'listimage':
        $result = action_list($classid, $username);
        //$result = include("action_list.php");
        break;
        /* 列出文件 */
    /* 列出文件 */
    case 'listfile':
        $result = action_list($classid, $username);
        //$result = include("action_list.php");
        break;
        /* 抓取远程文件 */
    /* 抓取远程文件 */
    case 'catchimage':
        $type = 1;
        $result = (include "action_crawler.php");
        break;
    default:
        $result = json_encode(array('state' => '请求地址出错'));
        break;
}
/*
 * 写入数据库
 * eInsertFileTable(文件名、文件大小,存放日期目录,上传者,栏目id,文件编号,文件类型,信息ID,文件临时识别编号(原文件名称),文件存放目录方式,信息公共ID,归属类型,附件副表ID)
コード例 #4
0
ファイル: cronjob.php プロジェクト: ahanjir07/vivvo-dev
$argv = $_SERVER['argv'];
$argc = $_SERVER['argc'];
if ($argc < 2) {
    cronjob_error('ERROR: Insufficient arguments. Type --help for usage info.');
}
define('VIVVO_CRONJOB_MODE', true);
require_once dirname(dirname(dirname(__FILE__))) . '/conf.php';
$options = parseOptions($argc, $argv, $defaultOptions);
if ($options['help']) {
    help();
    exit;
}
if ($options['task']) {
    action_task($options);
} elseif ($options['list']) {
    action_list($options);
} elseif ($options['touch']) {
    action_touch($options);
} else {
    cronjob_error('ERROR: Required arguments missing. Type --help for usage info.');
}
/**
 * Handles cronjob.php --task=<task_name> [--plugin=<plugin_name>]
 */
function action_task($options)
{
    if ($options['plugin']) {
        if (!is_dir($filename = VIVVO_FS_PLUGIN_ROOT . 'plugins/' . $options['plugin'])) {
            cronjob_error("ERROR: Plugin '{$options['plugin']}' could not be found.");
        }
        if (!file_exists($filename .= '/tasks/' . $options['task'] . '.php')) {
コード例 #5
0
// be the same as $_REQUEST['login'] but we cannot assume that.
$adminOps = get_option('cartpaujPM_options');
$admin_user_login = $adminOps['admin_user_login'];
// While the password is sent to us as plain text, this transport interface
// should always be encrypted via SSL (HTTPS). See also:
// http://codex.wordpress.org/Function_Reference/wp_authenticate
// http://codex.wordpress.org/Class_Reference/WP_User
$user = wp_authenticate($_REQUEST['login'], $_REQUEST['password']);
if (is_wp_error($user)) {
    $out['errmsg'] = "Portal authentication failed.";
} else {
    if (!$user->has_cap('create_users') && !$user->has_cap('manage_portal')) {
        $out['errmsg'] = "This login does not have permission to administer the portal.";
    } else {
        if ('list' == $action) {
            action_list($_REQUEST['date_from'], $_REQUEST['date_to']);
        } else {
            if ('getpost' == $action) {
                action_getpost($_REQUEST['postid']);
            } else {
                if ('getupload' == $action) {
                    action_getupload($_REQUEST['uploadid']);
                } else {
                    if ('delpost' == $action) {
                        action_delpost($_REQUEST['postid']);
                    } else {
                        if ('checkptform' == $action) {
                            action_checkptform($_REQUEST['patient'], $_REQUEST['form']);
                        } else {
                            if ('getmessage' == $action) {
                                action_getmessage($_REQUEST['messageid']);
コード例 #6
0
        echo '<strong>Petitions Started:</strong>: ' . $per['count'];
        echo '<strong>Petitions Signatures Generated:</strong>: ' . $per_ct['count'];
        $sql = "select distinct supporter_KEY  from supporter_action where personal_petition=1 and action_KEY =" . $key;
        $Pet = $db->CacheExecute($sql) or die($db->errorMsg() . $sql);
        $pet = $Pet->FetchRow();
        foreach ($pet as $i) {
            #echo '<td><a href="'.ACTION_URL.$a['campaign_slug'].'/">'.$i['supporter_KEY'].'</a></td>';
        }
    }
}
$options['action_type'] = $_REQUEST['action_type'];
$options['campaign'] = $_REQUEST['campaign'];
if ($_REQUEST['count']) {
    $count = $_REQUEST['count'];
} else {
    $count = 50;
}
if ($_REQUEST['action_KEY']) {
    action_detail($_REQUEST['action_KEY']);
} else {
    echo action_list($count, $options);
}
#echo '<pre>';
#print_r($ref);
#echo '</pre>';
require_once '../_footer.php';
?>