if (!$currentArticle->checkVariables()) { handle(ERROR_INPUT . '01'); } $response = $currentArticle->create(); if ($response === false) { handle(ERROR_SYSTEM . '00'); } handle('0000{"aid":' . $response . '}'); break; case 'renew': if (!checkAuthority(9)) { handle(ERROR_SYSTEM . '00'); } $currentArticle = new Article(); $currentArticle->aid = getRequest('aid'); $response = json_decode($currentArticle->getData(), true); $currentArticle->init(getRequest('title'), getRequest('content'), (int) getRequest('visibility'), (int) getRequest('notice')); if (!$currentArticle->checkVariables()) { handle(ERROR_INPUT . '01'); } $response = $currentArticle->modify(); if ($response === false) { handle(ERROR_SYSTEM . '00'); } else { handle('0000'); } break; default: ERROR(ERROR_INPUT . '02', 'Request Error.'); break; }