$fields['type'] = 0; } // 按平台权限拷贝第一个管理员的Token $thirdAccount = new ThirdAccount(); $thirdAccount->copyToken($id, @array_keys($fields['perms'])); $fields['perms'] = serialize($fields['perms']); $user->update($fields, array('id' => $id)); redirect('?'); } else { $fields['username'] = $TEMPLATE['data']['username']; $TEMPLATE['data'] = $fields; } } $wt_open = new WTOpen(); $TEMPLATE['simula']['weibo_list'] = $wt_open->getWeiboList(0, false); $TEMPLATE['simula']['blog_list'] = $wt_open->getBlogList(0, false); $TEMPLATE['platform_list'] = $wt_open->getPlatformList(false); foreach ($TEMPLATE['platform_list'] as &$item) { $item['weibo_list'] = $wt_open->getWeiboList($item['id'], false); $item['blog_list'] = $wt_open->getBlogList($item['id'], false); unset($item); } if (!is_array($TEMPLATE['data']['perms'])) { $TEMPLATE['data']['perms'] = array(); } exit($smarty->r('users_edit')); break; } $TEMPLATE['list'] = $user->getsAll(); foreach ($TEMPLATE['list'] as &$item) { $item['perms'] = unserialize($item['perms']);
$ret = $api->publish($_POST['title'], $content); 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; }
$TEMPLATE['error'] = array('type' => $fields['type'], 'msg' => '用户名和密码不能为空。'); $TEMPLATE['data'] = $fields; } } $TEMPLATE['title'] = '账号绑定'; $TEMPLATE['login_name'] = Passport::GetLoginName(); $TEMPLATE['nav']['bind'] = 'current'; if ($pid > 0) { $TEMPLATE['pid'] = $pid; } $TEMPLATE['weibo_list'] = $wt_open->getWeiboList($pid); foreach ($TEMPLATE['weibo_list'] as $key => &$value) { $value = array('name' => $value, 'third' => get_status($key)); unset($value); } $TEMPLATE['blog_list'] = $wt_open->getBlogList($pid); foreach ($TEMPLATE['blog_list'] as $key => &$value) { $value = array('name' => $value, 'third' => get_status($key)); unset($value); } /* debug cookie start */ if ($_REQUEST['debug_cookie'] == 1) { $TEMPLATE['debug_cookie'] = true; $cookie_path = LOG_PATH . "{$pid}.cookie"; if (Request::IsPost()) { file_put_contents($cookie_path, $_POST['p_cookie']); } $TEMPLATE['p_cookie'] = file_get_contents($cookie_path); } /* debug cookie end*/ $smarty = new Template();