mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1522 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
b11f360ce9
commit
95b1e8be45
3 changed files with 283 additions and 244 deletions
|
|
@ -10,6 +10,15 @@
|
|||
* 모듈 실행 이전(before_module_proc)에 호출이 되어야 하며 정상동작후에는 강제 종료를 한다.
|
||||
**/
|
||||
|
||||
// called_position가 after_module_proc일때 rsd태그 삽입
|
||||
if($called_position == 'after_module_proc') {
|
||||
// 현재 모듈의 rsd주소를 만듬
|
||||
$rsd_url = sprintf('%s%s/api', Context::getRequestUri(), $this->module);
|
||||
|
||||
// 헤더에 rsd태그 삽입
|
||||
Context::addHtmlHeader(" ".'<link rel="EditURI" type="application/rsd+xml" title="RSD" href="'.$rsd_url.'" />');
|
||||
}
|
||||
|
||||
// called_position가 before_module_proc일때 실행
|
||||
if($called_position != 'before_module_proc' || $_REQUEST['act'] != 'api') return;
|
||||
|
||||
|
|
@ -32,15 +41,16 @@
|
|||
$password = trim($params[2]->value->string->body);
|
||||
|
||||
// member controller을 이용해서 로그인 시도
|
||||
if($user_id && $password) {
|
||||
$oMemberController = &getController('member');
|
||||
$output = $oMemberController->doLogin($user_id, $password);
|
||||
|
||||
// 로그인 실패시 에러 메시지 출력
|
||||
if(!$output->toBool()) {
|
||||
$content = getXmlRpcFailure(1, $output->getMessage());
|
||||
printContent($content);
|
||||
}
|
||||
}
|
||||
|
||||
// 로그인 성공시 method name에 따른 실행
|
||||
} else {
|
||||
|
||||
// 카테고리의 정보를 구해옴
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
|
@ -59,6 +69,7 @@
|
|||
$blog_list = array($obj);
|
||||
|
||||
$content = getXmlRpcResponse($blog_list);
|
||||
printContent($content);
|
||||
break;
|
||||
|
||||
// 카테고리 목록 return
|
||||
|
|
@ -77,6 +88,7 @@
|
|||
}
|
||||
|
||||
$content = getXmlRpcResponse($category_obj_list);
|
||||
printContent($content);
|
||||
break;
|
||||
|
||||
// 파일 업로드
|
||||
|
|
@ -98,6 +110,7 @@
|
|||
$obj->url = 'http://blog.nzeo.com/'.$target_filename;
|
||||
|
||||
$content = getXmlRpcResponse($obj);
|
||||
printContent($content);
|
||||
break;
|
||||
|
||||
// 글작성
|
||||
|
|
@ -169,6 +182,8 @@
|
|||
$content = getXmlRpcResponse(''.$document_srl);
|
||||
}
|
||||
FileHandler::removeDir($tmp_uploaded_path);
|
||||
|
||||
printContent($content);
|
||||
break;
|
||||
|
||||
// 글 수정
|
||||
|
|
@ -253,6 +268,8 @@
|
|||
$content = getXmlRpcResponse(Context::getRequestUri().$this->mid.'/'.$document_srl);
|
||||
FileHandler::removeDir($tmp_uploaded_path);
|
||||
}
|
||||
|
||||
printContent($content);
|
||||
break;
|
||||
|
||||
// 글삭제
|
||||
|
|
@ -266,17 +283,28 @@
|
|||
if(!$output->toBool()) $content = getXmlRpcFailure(1, $output->getMessage());
|
||||
else $content = getXmlRpcResponse(true);
|
||||
|
||||
printContent($content);
|
||||
break;
|
||||
|
||||
// 아무런 요청이 없을 경우 RSD 출력
|
||||
default :
|
||||
|
||||
$homepagelink = getUrl('','mid',$this->mid);
|
||||
$api_url = sprintf('%s%s/api', Context::getRequestUri(), $this->module);
|
||||
$content = <<<RSDContent
|
||||
<?xml version="1.0" ?>
|
||||
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd" >
|
||||
<service>
|
||||
<engineName>zeroboardXE</engineName>
|
||||
<engineLink>http://www.zeroboard.com/ </engineLink>
|
||||
<homePageLink>{$homepagelink}</homePageLink>
|
||||
<apis>
|
||||
<api name="MetaWeblog" preferred="true" apiLink="{$api_url}" blogID="" />
|
||||
</apis>
|
||||
</service>
|
||||
</rsd>
|
||||
RSDContent;
|
||||
printContent($content);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
header("Content-Type: text/xml; charset=UTF-8");
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
print $content;
|
||||
|
||||
exit();
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -49,4 +49,15 @@
|
|||
if(!$is_sub_set) return sprintf("<param>\n%s</param>", $buff);
|
||||
return $buff;
|
||||
}
|
||||
|
||||
function printContent($content) {
|
||||
header("Content-Type: text/xml; charset=UTF-8");
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
print $content;
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* 0 : files/_debug_message.php 에 연결하여 출력
|
||||
* 1 : Response Method 가 XML 형식이 아닐 경우 브라우저에 최상단에 주석으로 표시
|
||||
**/
|
||||
define('__DEBUG_OUTPUT__', 1);
|
||||
define('__DEBUG_OUTPUT__', 0);
|
||||
|
||||
/**
|
||||
* @brief 디버깅 메세지 출력
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue