Beispiel #1
0
 /**
  * Imports a folder deletion
  *
  * @param string        $id
  * @param string        $parent id is ignored in ICS
  *
  * @access public
  * @return int          SYNC_FOLDERHIERARCHY_STATUS
  * @throws StatusException
  */
 public function ImportFolderDeletion($id, $parent = false)
 {
     ZLog::Write(LOGLEVEL_DEBUG, sprintf("ImportChangesICS->ImportFolderDeletion('%s','%s'): importing folder deletetion", $id, $parent));
     $folderentryid = mapi_msgstore_entryidfromsourcekey($this->store, hex2bin($id));
     if (!$folderentryid) {
         throw new StatusException(sprintf("ImportChangesICS->ImportFolderDeletion('%s','%s'): Error, unable to resolve folder", $id, $parent, mapi_last_hresult()), SYNC_FSSTATUS_FOLDERDOESNOTEXIST);
     }
     // get the folder type from the MAPIProvider
     $type = $this->mapiprovider->GetFolderType($folderentryid);
     if (Utils::IsSystemFolder($type)) {
         throw new StatusException(sprintf("ImportChangesICS->ImportFolderDeletion('%s','%s'): Error deleting system/default folder", $id, $parent), SYNC_FSSTATUS_SYSTEMFOLDER);
     }
     $ret = mapi_importhierarchychanges_importfolderdeletion($this->importer, 0, array(PR_SOURCE_KEY => hex2bin($id)));
     if (!$ret) {
         throw new StatusException(sprintf("ImportChangesICS->ImportFolderDeletion('%s','%s'): Error deleting folder: 0x%X", $id, $parent, mapi_last_hresult()), SYNC_FSSTATUS_SERVERERROR);
     }
     return $ret;
 }
Beispiel #2
0
 function ImportFolderDeletion($id, $parent)
 {
     return mapi_importhierarchychanges_importfolderdeletion(array($id));
 }
Beispiel #3
0
 function ImportFolderDeletion($id, $parent)
 {
     return mapi_importhierarchychanges_importfolderdeletion($this->importer, 0, array(PR_SOURCE_KEY => hex2bin($id)));
 }
Beispiel #4
0
 function ImportFolderDeletion($id, $parent)
 {
     $folderentryid = mapi_msgstore_entryidfromsourcekey($this->store, hex2bin($id));
     if (!$folderentryid) {
         debugLog(sprintf("Could not get the entryid for the sourcekey %s", $id));
         return 4;
         //SYNC_FSSTATUS_FOLDERDOESNOTEXIST - constant not available in z-push 1
     }
     $type = $this->GetFolderType($folderentryid);
     if (isSystemFolder($type)) {
         debugLog(sprintf("A system folder (%s) cannot be deleted", $id));
         return 3;
         //SYNC_FSSTATUS_SYSTEMFOLDER - constant not available in z-push 1
     }
     return mapi_importhierarchychanges_importfolderdeletion($this->importer, 0, array(PR_SOURCE_KEY => hex2bin($id)));
 }