function onls() { $applist = $_ENV['app']->get_apps('appid, type, name, url, tagtemplates'); $applist2 = array(); foreach ($applist as $key => $app) { $app['tagtemplates'] = uc_unserialize($app['tagtemplates']); $applist2[$app['appid']] = $app; } return $applist2; }
function updatedata($appid, $data) { $appid = intval($appid); $data = uc_unserialize($data); $this->base->load('app'); $data[0] = addslashes($data[0]); $datanew = array(); if (is_array($data[1])) { foreach ($data[1] as $r) { $datanew[] = $_ENV['misc']->array2string($r); } } $tmp = $_ENV['app']->get_apps('type', "appid='{$appid}'"); $datanew = addslashes($tmp[0]['type'] . "\t" . implode("\t", $datanew)); if (!empty($data[0])) { $return = $this->db->result_first("SELECT count(*) FROM " . UC_DBTABLEPRE . "tags WHERE tagname='{$data['0']}' AND appid='{$appid}'"); if ($return) { $this->db->query("UPDATE " . UC_DBTABLEPRE . "tags SET data='{$datanew}', expiration='" . $this->base->time . "' WHERE tagname='{$data['0']}' AND appid='{$appid}'"); } else { $this->db->query("INSERT INTO " . UC_DBTABLEPRE . "tags (tagname, appid, data, expiration) VALUES ('{$data['0']}', '{$appid}', '{$datanew}', '" . $this->base->time . "')"); } } }
function uc_check_version() { $return = uc_api_post('version', 'check', array()); $data = uc_unserialize($return); return is_array($data) ? $data : $return; }
function unserialize($s) { return uc_unserialize($s); }
function uc_get_list($page, $ppp, $totalnum, $sqladd = '') { $return = call_user_func(UC_API_FUNC, 'user', 'get_list', array('page' => $page, 'ppp' => $ppp, 'totalnum' => $totalnum, 'sqladd' => $sqladd)); return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); }
function uc_tag_get($tagname, $nums = 0) { $return = call_user_func(UC_API_FUNC, 'tag', 'gettag', array('tagname' => $tagname, 'nums' => $nums)); return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); }
} if (!defined('IN_UC')) { error_reporting(0); require_once ROOT_PATH . 'uc_client/config.inc.php'; require_once ROOT_PATH . 'uc_client/client.php'; $code = @$_GET['code']; parse_str(uc_authcode($code, 'DECODE', UC_KEY), $get); $timestamp = time(); if ($timestamp - $get['time'] > 3600) { exit('Authracation has expiried'); } if (empty($get)) { exit('Invalid Request'); } $action = $get['action']; $post = uc_unserialize(file_get_contents('php://input')); if (in_array($get['action'], array('test', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'synlogin', 'synlogout'))) { $uc_note = new uc_note(); exit($uc_note->{$get}['action']($get, $post)); } else { exit(API_RETURN_FAILED); } } else { exit; } class uc_note { var $db = ''; var $tablepre = ''; function _serialize($arr, $htmlon = 0) {
function uc_check_admin($username) { $return = call_user_func(UC_API_FUNC, 'user', 'check_admin', array('username' => $username)); return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); }
/** * 当 UCenter 的应用程序列表变更时,此接口负责通知所有应用程序更新后的应用程序列表。 * @param type $get * @param type $post */ protected function updateapps($get, $post) { $post = uc_unserialize(file_get_contents('php://input')); $cachefile = DISCUZ_ROOT . './uc_client/data/cache/apps.php'; $fp = fopen($cachefile, 'w'); $s = "<?php\r\n"; $s .= '$_CACHE[\'apps\'] = ' . var_export($post, TRUE) . ";\r\n"; fwrite($fp, $s); fclose($fp); return API_RETURN_SUCCEED; }
function uc_user_count($filter) { $return = call_user_func(UC_API_FUNC, 'user', 'user_count', array('filter' => $filter)); return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); }