} if (!checkperm('managepublic')) { cpmessage('no_authority_management_operation'); } $type = $_GET['type'] ? trim($_GET['type']) : 'appslist'; $page = $_GET['page'] ? trim($_GET['page']) : '1'; $op = $_GET['op'] ? trim($_GET['op']) : ''; if ($type == 'api') { $tab = 2; if ($op == 'mod') { $url = ''; $id = $_GET['id']; $api_arr['status'] = $_GET['status']; $isupdate = updatetable('api', $api_arr, array('id' => $id)); if (@(include_once S_ROOT . './plugin/iauth/IAuthManage.php')) { IAUTH_edit_API($id, $url, $api_arr['status']); } echo 1; exit; } if ($op == 'delete') { $id = $_GET['id']; $_SGLOBAL['db']->query("DELETE FROM " . tname('api') . " WHERE id={$id}"); if (@(include_once S_ROOT . './plugin/iauth/IAuthManage.php')) { IAUTH_remove_API($id); } echo 1; exit; } $url = "admincp.php?ac={$ac}&type=api"; $wheresql = "WHERE 1=1";
} if (submitcheck('apiapply')) { //接收信息 $url = trim($_POST['url']); $appid = trim($_POST['appid']); $name = $_POST['name']; $fullname = trim($_POST['fullname']); $intro = $_POST['intro']; $explain = $_POST['explain']; $status = 'disable'; $api_arr = array('name' => $name, 'appid' => $appid, 'url' => $url, 'fullname' => $fullname, 'intro' => $intro, 'explain' => $explain, 'status' => $status); if (!isset($_POST['mod'])) { $id = inserttable('api', $api_arr, 1); if ($id) { //同步至iauth if (@(include_once S_ROOT . './plugin/iauth/IAuthManage.php')) { IAUTH_new_API($id, $url, $status); } } } else { $id = $_POST['id']; $isupdate = updatetable('api', $api_arr, array('id' => $id)); if ($isupdate) { //同步至iauth if (@(include_once S_ROOT . './plugin/iauth/IAuthManage.php')) { IAUTH_edit_API($id, $url, $status); } } } } include_once template("/plugin/apps/api");