예제 #1
0
파일: login.php 프로젝트: h3len/Project
 public function logout()
 {
     session_start();
     include_once ROOT_PATH . 'lib/class/log.class.php';
     $log = new hglog();
     $log->add_log('退出平台');
     if ($this->settings['App_auth']) {
         $this->curl = new curl($this->settings['App_auth']['host'], $this->settings['App_auth']['dir']);
         $this->curl->initPostData();
         if ($_SESSION['livmcp_userinfo']) {
             foreach ($_SESSION['livmcp_userinfo'] as $k => $v) {
                 $this->curl->addRequestData($k, $v);
             }
         }
         $this->curl->addRequestData('a', 'logout');
         $this->curl->request('get_access_token.php');
     }
     $_SESSION['livmcp_userinfo'] = array();
     $this->Redirect('成功退出系统.');
 }
예제 #2
0
파일: 58.php 프로젝트: h3len/Project
<?php

$this->curl = new curl('localhost', 'livsns/api/news/admin/');
$this->curl->setSubmitType('post');
$this->curl->setReturnFormat('json');
$id = $this->input['id'];
$this->curl->initPostData();
$this->curl->addRequestData('a', 'update');
$this->curl->addRequestData('id', $id);
$hg_data_return = $this->curl->request('news_update.php');
include_once ROOT_PATH . 'lib/class/log.class.php';
$log = new hglog();
$logcontent = '保存内容';
$log->add_log($logcontent, 'update');
if ($log_pub) {
    $log->add_log("文稿发布内容[{$id}]至CMS栏目");
}
if ($hg_data_return) {
    $this->redirect('保存成功', '', 0, 0, "top.&#036;.closeFormWin('{$id}')");
} else {
    $this->ReportError('保存失败', '', 0, 0, "top.&#036;.closeFormWin('{$id}')");
}
예제 #3
0
파일: crontab.php 프로젝트: h3len/Project
<?php

define('WITH_DB', true);
define('ROOT_DIR', '../');
define('SCRIPT_NAME', 'crontab');
require '../global.php';
$sql = 'SELECT * FROM ' . DB_PREFIX . 'crontab where 1 and run_time<=' . TIMENOW;
$q = $gDB->query($sql);
include_once ROOT_PATH . 'lib/class/log.class.php';
$log = new hglog();
while ($r = $gDB->fetch_array($q)) {
    $cron[] = array('host' => $r['host'], 'port' => $r['port'], 'dir' => $r['dir'], 'file' => $r['file_name'], 'token' => $r['token']);
    //$runtime = strtotime(date('Y-m-d') . ' ' . date('H:i:s', $r['run_time']));
    $sql = "UPDATE " . DB_PREFIX . "crontab SET run_time=" . (TIMENOW + $r['space']) . " WHERE id=" . $r['id'];
    $gDB->query($sql);
    if ($r['is_log']) {
        $logcontent = $r['host'] . '/' . $r['dir'] . $r['file_name'] . '已执行';
        $log->add_log($logcontent, 'log');
    }
}
echo json_encode($cron);