Ejemplo n.º 1
0
 /**
  * 获取指定用户权限
  * @param int $id	用户ID
  */
 public function getPerms($id)
 {
     $info = $this->get($id);
     if ($info['type'] == 1) {
         $wt_open = new WTOpen();
         $platform_list = $wt_open->getPlatformList(false);
         $perms = array();
         foreach ($platform_list as $key => $item) {
             $perms[$key] = $item['name'];
         }
     } else {
         $perms = unserialize($info['perms']);
     }
     if (!is_array($perms)) {
         $perms = array();
     }
     return $perms;
 }
Ejemplo n.º 2
0
                if ($ret !== true && str_contains($ret, '已过期')) {
                    $thirdAccount->fail($third, $ret);
                }
                $TEMPLATE['report'][$type] = array('status' => $ret === true, 'msg' => $ret === true ? '发送成功!' . ($third['url'] ? '<a href="' . $third['url'] . '" target="_blank">查看</a>' : '') : '发送失败:' . $ret . ' <a href="list_err.php">重新发送</a>');
                $task->AddTask($type, $content, time(), NULL, $ret === true ? Task::OK : Task::ERROR, $ret, 'blog', $_POST['title']);
            }
            $watch->Stop();
            $TEMPLATE['report']['watch'] = array('status' => true, 'msg' => "总耗时:{$watch->getElapsedSeconds()} 秒");
        }
    }
}
$TEMPLATE['title'] = '发博客';
$TEMPLATE['login_name'] = Passport::GetLoginName();
$TEMPLATE['nav']['blog'] = 'current';
$TEMPLATE['target_list'] = $wt_open->getBlogList();
$TEMPLATE['platform_list'] = $wt_open->getPlatformList();
foreach ($TEMPLATE['platform_list'] as &$item) {
    $item['list'] = $wt_open->getBlogList($item['id']);
    unset($item);
}
$smarty = new Template();
echo $smarty->r('blog');
function validate()
{
    global $TEMPLATE;
    $check = true;
    if (strlen($_POST['title']) == 0 || strlen($_POST['content']) == 0) {
        $TEMPLATE['report']['check_cont'] = array('status' => false, 'msg' => '标题和内容均不能为空!');
        $check = false;
    }
    if ($_POST['time'] == 'on' && strtotime($_POST['send_time']) < time()) {