- Timestamp:
- 12/22/09 22:02:05 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
taggingreloaded/files/lib/action/TaggingReloadedSaveAction.class.php
r1087 r1091 12 12 */ 13 13 class TaggingReloadedSaveAction extends AbstractAction { 14 protected $taggable ID = 0;14 protected $taggable = ''; 15 15 protected $className = ''; 16 protected $classPath = ''; 16 17 protected $entryKey = 'entryID'; 17 protected $ entryID = 0;18 protected $objectID = 0; 18 19 protected $languageID = 0; 19 20 … … 24 25 parent::readParameters(); 25 26 26 $this->taggableID = intval($_REQUEST['taggableID']);27 27 $this->className = $_REQUEST['className']; 28 $this->entryID = intval($_REQUEST['entryID']); 28 $this->classPath = $_REQUEST['classPath']; 29 $this->objectID = intval($_REQUEST['objectID']); 29 30 30 if(isset($_REQUEST['entryKey']) $this->entryKey = $_REQUEST['entryKey']; 31 if(isset($_REQUEST['languageID']) $this->languageID = intval($_REQUEST['languageID']); 31 if(isset($_REQUEST['entryKey'])) $this->entryKey = $_REQUEST['entryKey']; 32 if(isset($_REQUEST['languageID'])) $this->languageID = intval($_REQUEST['languageID']); 33 if(isset($_REQUEST['taggable'])) $this->taggable = $_REQUEST['taggable']; 34 35 $this->tags3 = TaggingReloadedUtil::readFormParameters(); 32 36 } 33 37 … … 38 42 parent::execute(); 39 43 40 $tagged = new $this->className(array( 41 $this->entryKey => $this->entryID, 44 if(!preg_match('/^Tagged/', $this->className) || preg_match('/\./', $this->className)) { 45 throw new PermissionDeniedException(); 46 } 47 48 $classPath = WCF_DIR.'lib/data/'.$this->classPath.'/'.$this->className.'.class.php'; 49 50 if(preg_match('/\./', $this->classPath) || !file_exists($classPath)) { 51 throw new PermissionDeniedException(); 52 } 53 54 require_once $classPath; 55 56 $tagged = new $this->className(null, array( 57 $this->entryKey => $this->objectID, 42 58 'taggable' => TagEngine::getInstance()->getTaggable($this->taggable) 43 59 )); … … 47 63 } 48 64 49 TaggingUtil::save($userid. $tags, $tagged, $this->languageID); 65 $userID = WCF::getUser()->userID; 66 67 $existingTagsUser = TaggingReloadedUtil::getTagsByObject($userID, $tagged, $this->languageID, true); 68 $existingTagsObject = TaggingReloadedUtil::getTagsByObject($userID, $tagged, $this->languageID, false); 69 TaggingReloadedUtil::tagging3save($userID, $tagged, $this->languageID, $this->tags3, $existingTagsUser, $existingTagsObject); 50 70 51 71 $this->executed();
