issue 53 if document extra vars is serialized, do not serialize with duplicate.

and when insert trash, TrashVO make from External module.


git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8575 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-07-07 05:08:35 +00:00
parent 2fdc18196c
commit c44583f122
4 changed files with 10 additions and 14 deletions

View file

@ -79,9 +79,6 @@
$oTrashVO->setTitle(trim(strip_tags($oComment->variables['content'])));
$oTrashVO->setOriginModule('comment');
$oTrashVO->setSerializedObject(serialize($oComment->variables));
$oTrashVO->setIpaddress($_SERVER['REMOTE_ADDR']);
$oTrashVO->setRemoverSrl($logged_info->member_srl);
$oTrashVO->setRegdate(date('YmdHis'));
$output = $oTrashAdminController->insertTrash($oTrashVO);
if (!$output->toBool()) {

View file

@ -547,6 +547,7 @@
//DB restore
$output = $oDocumentController->insertDocument($originObject, false, true);
if(!$output->toBool()) return new Object(-1, $output->getMessage());
//FILE restore
$oDocument = $oDocumentModel->getDocument($originObject->document_srl);

View file

@ -141,6 +141,7 @@ class documentController extends document {
$oDB = &DB::getInstance();
$oDB->begin();
// List variables
if($obj->comment_status) $obj->commentStatus = $obj->comment_status;
if(!$obj->commentStatus) $obj->commentStatus = 'DENY';
if($obj->commentStatus == 'DENY') $this->_checkCommentStatusForOldVersion(&$obj);
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
@ -148,8 +149,8 @@ class documentController extends document {
if($obj->notify_message != 'Y') $obj->notify_message = 'N';
if(!$isRestore) $obj->ipaddress = $_SERVER['REMOTE_ADDR']; //board에서 form key값으로 ipaddress를 사용하면 엄한 ip가 등록됨. 필터와는 상관없슴
// Serialize the $extra_vars
if(!$isRestore) $obj->extra_vars = serialize($obj->extra_vars);
// Serialize the $extra_vars, check the extra_vars type, because duplicate serialized avoid
if(!is_string($obj->extra_vars)) $obj->extra_vars = serialize($obj->extra_vars);
// Remove the columns for automatic saving
unset($obj->_saved_doc_srl);
unset($obj->_saved_doc_title);
@ -174,8 +175,8 @@ class documentController extends document {
// Check the status of password hash for manually inserting. Apply md5 hashing for otherwise.
if($obj->password && !$obj->password_is_hashed) $obj->password = md5($obj->password);
// Insert member's information only if the member is logged-in and not manually registered.
$logged_info = Context::get('logged_info');
if(Context::get('is_logged') && !$manual_inserted && !$isRestore) {
$logged_info = Context::get('logged_info');
$obj->member_srl = $logged_info->member_srl;
$obj->user_id = $logged_info->user_id;
$obj->user_name = $logged_info->user_name;
@ -541,9 +542,6 @@ class documentController extends document {
$oTrashVO->setOriginModule('document');
$oTrashVO->setSerializedObject(serialize($oDocument->variables));
$oTrashVO->setDescription($obj->description);
$oTrashVO->setIpaddress($_SERVER['REMOTE_ADDR']);
$oTrashVO->setRemoverSrl($logged_info->member_srl);
$oTrashVO->setRegdate(date('YmdHis'));
$oTrashAdminController = &getAdminController('trash');
$output = $oTrashAdminController->insertTrash($oTrashVO);

View file

@ -8,6 +8,7 @@ class trashAdminController extends trash
{
/**
* @brief object insert to trash
* @param $obj : TrashVO type object
**/
function insertTrash($obj)
{
@ -16,11 +17,10 @@ class trashAdminController extends trash
$logged_info = Context::get('logged_info');
$oTrashVO = new TrashVO();
$oTrashVO->setTrashSrl(getNextSequence());
$oTrashVO->setTitle($obj->title);
$oTrashVO->setOriginModule($obj->trashType);
$oTrashVO->setSerializedObject(serialize($obj->originObject));
$oTrashVO->setDescription($obj->description);
$oTrashVO = &$obj;
if(!$oTrashVO->getTrashSrl()) $oTrashVO->setTrashSrl(getNextSequence());
if(!is_string($oTrashVO->getSerializedObject())) $oTrashVO->setSerializedObject(serialize($oTrashVO->getSerializedObject()));
$oTrashVO->setIpaddress($_SERVER['REMOTE_ADDR']);
$oTrashVO->setRemoverSrl($logged_info->member_srl);
$oTrashVO->setRegdate(date('YmdHis'));