Exemple #1
0
 function ImportFolderChange($id, $parent, $displayname, $type)
 {
     // 'type' is ignored because you can only create email (standard) folders
     return mapi_importhierarchychanges_importfolderchange(array(PR_SOURCE_KEY => $id, PR_PARENT_SOURCE_KEY => $parent, PR_DISPLAY_NAME => $displayname));
 }
Exemple #2
0
 function ImportFolderChange($id, $parent, $displayname, $type)
 {
     //create a new folder if $id is not set
     if (!$id) {
         $parentfentryid = mapi_msgstore_entryidfromsourcekey($this->store, hex2bin($parent));
         $parentfolder = mapi_msgstore_openentry($this->store, $parentfentryid);
         $parentpros = mapi_getprops($parentfolder, array(PR_DISPLAY_NAME));
         $newfolder = mapi_folder_createfolder($parentfolder, $displayname, "");
         $props = mapi_getprops($newfolder, array(PR_SOURCE_KEY));
         $id = bin2hex($props[PR_SOURCE_KEY]);
     }
     // 'type' is ignored because you can only create email (standard) folders
     mapi_importhierarchychanges_importfolderchange($this->importer, array(PR_SOURCE_KEY => hex2bin($id), PR_PARENT_SOURCE_KEY => hex2bin($parent), PR_DISPLAY_NAME => $displayname));
     debugLog("Imported changes for folder:{$id}");
     return $id;
 }
Exemple #3
0
 function ImportFolderChange($id, $parent, $displayname, $type)
 {
     //create a new folder if $id is not set
     if (!$id) {
         // the root folder is "0" - get IPM_SUBTREE
         if ($parent == "0") {
             $parentprops = mapi_getprops($this->store, array(PR_IPM_SUBTREE_ENTRYID));
             if (isset($parentprops[PR_IPM_SUBTREE_ENTRYID])) {
                 $parentfentryid = $parentprops[PR_IPM_SUBTREE_ENTRYID];
             }
         } else {
             $parentfentryid = mapi_msgstore_entryidfromsourcekey($this->store, hex2bin($parent));
         }
         $parentfolder = mapi_msgstore_openentry($this->store, $parentfentryid);
         $parentpros = mapi_getprops($parentfolder, array(PR_DISPLAY_NAME));
         $newfolder = mapi_folder_createfolder($parentfolder, $displayname, "");
         mapi_setprops($newfolder, array(PR_CONTAINER_CLASS => $this->GetContainerClassFromFolderType($type)));
         $props = mapi_getprops($newfolder, array(PR_SOURCE_KEY));
         $id = bin2hex($props[PR_SOURCE_KEY]);
         debugLog("Folder created with id:{$id}");
         return $id;
     }
     mapi_importhierarchychanges_importfolderchange($this->importer, array(PR_SOURCE_KEY => hex2bin($id), PR_PARENT_SOURCE_KEY => hex2bin($parent), PR_DISPLAY_NAME => $displayname));
     debugLog("Imported changes for folder:{$id}");
     return $id;
 }