} else { $TEMPLATE['error'] = array('type' => $fields['type'], 'msg' => $ret); $TEMPLATE['data'] = $fields; } } else { $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']);
if (!isset($fields['type'])) { $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) {
$TEMPLATE['report']['watch'] = array('status' => true, 'msg' => "总耗时:{$watch->getElapsedSeconds()} 秒"); } } } if ($_GET['testmail']) { $mail = Config::get_mail('token_expire'); if (sendmail($mail['to'], '【微博工具】测试邮件', '测试邮件内容', $error)) { echo '发送成功'; } else { echo "<font color=red>发送失败:{$error}</font>"; } } $TEMPLATE['title'] = '发微博'; $TEMPLATE['login_name'] = Passport::GetLoginName(); $TEMPLATE['nav']['index'] = 'current'; $TEMPLATE['target_list'] = $wt_open->getWeiboList(); $TEMPLATE['platform_list'] = $wt_open->getPlatformList(); foreach ($TEMPLATE['platform_list'] as &$item) { $item['list'] = $wt_open->getWeiboList($item['id']); unset($item); } $smarty = new Template(); echo $smarty->r('index'); /** * 验证发送表单 */ function validate() { global $TEMPLATE; $check = true; if (strlen($_POST['content']) == 0) {