• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mapi_last_hresult函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中mapi_last_hresult函数的典型用法代码示例。如果您正苦于以下问题:PHP mapi_last_hresult函数的具体用法?PHP mapi_last_hresult怎么用?PHP mapi_last_hresult使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了mapi_last_hresult函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: get_mapi_error_name

/**
 * Function to get a human readable string from a MAPI error code
 *
 *@param int $errcode the MAPI error code, if not given, we use mapi_last_hresult
 *@return string The defined name for the MAPI error code
 */
function get_mapi_error_name($errcode = null)
{
    if ($errcode === null) {
        $errcode = mapi_last_hresult();
    }
    if ($errcode !== 0) {
        // get_defined_constants(true) is preferred, but crashes PHP
        // https://bugs.php.net/bug.php?id=61156
        $allConstants = get_defined_constants();
        foreach ($allConstants as $key => $value) {
            /**
             * If PHP encounters a number beyond the bounds of the integer type,
             * it will be interpreted as a float instead, so when comparing these error codes
             * we have to manually typecast value to integer, so float will be converted in integer,
             * but still its out of bound for integer limit so it will be auto adjusted to minus value
             */
            if ($errcode == (int) $value) {
                // Check that we have an actual MAPI error or warning definition
                $prefix = substr($key, 0, 7);
                if ($prefix == "MAPI_E_" || $prefix == "MAPI_W_") {
                    return $key;
                }
            }
        }
    } else {
        return "NOERROR";
    }
    // error code not found, return hex value (this is a fix for 64-bit systems, we can't use the dechex() function for this)
    $result = unpack("H*", pack("N", $errcode));
    return "0x" . $result[1];
}
开发者ID:tuksik,项目名称:zarafa-rest-api,代码行数:37,代码来源:mapi.util.php


示例2: checkMapiError

function checkMapiError($msg)
{
    global $log;
    if (mapi_last_hresult() != 0) {
        $log->warn("MAPI error {$msg}: " . get_mapi_error_name());
        exit;
    }
}
开发者ID:RobertWang,项目名称:sabre-zarafa,代码行数:8,代码来源:server.php


示例3: renamefolder

function renamefolder($store, $entryid, $name)
{
    if (!$entryid) {
        print "Unable to find {$name} folder\n";
        return;
    }
    $folder = mapi_msgstore_openentry($store, $entryid);
    if (!$folder) {
        print "Unable to open folder " . bin2hex($entryid) . "\n";
        return;
    }
    mapi_setprops($folder, array(PR_DISPLAY_NAME => $name));
    if (mapi_last_hresult() != 0) {
        print "Unable to rename " . bin2hex($entryid) . " to '{$name}'\n";
    } else {
        print "Renamed " . bin2hex($entryid) . " to '{$name}'\n";
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:18,代码来源:exec.zarafa7.foldersnames.php


示例4: openMsgStore

function openMsgStore($username, $password)
{
    $session = mapi_logon_zarafa($username, $password, SERVER);
    if (mapi_last_hresult() != 0) {
        trigger_error(sprintf("MAPI Error: 0x%x", mapi_last_hresult()), E_USER_ERROR);
    }
    $storesTable = mapi_getmsgstorestable($session);
    $stores = mapi_table_queryallrows($storesTable, array(PR_ENTRYID, PR_MDB_PROVIDER));
    for ($i = 0; $i < count($stores); $i++) {
        if ($stores[$i][PR_MDB_PROVIDER] == ZARAFA_SERVICE_GUID) {
            $storeEntryid = $stores[$i][PR_ENTRYID];
            break;
        }
    }
    if (!isset($storeEntryid)) {
        trigger_error("Default store not found", E_USER_ERROR);
    }
    $store = mapi_openmsgstore($session, $storeEntryid);
    isUnicodeStore($store);
    return $store;
}
开发者ID:marco-uniware,项目名称:zarafa-tools,代码行数:21,代码来源:process-contacts.php


示例5: getuserlist

 function getuserlist()
 {
     $this->companylist = mapi_zarafa_getcompanylist($this->defaultstore);
     if (mapi_last_hresult() == NOERROR && is_array($this->companylist)) {
         // multi company setup, get all users from all companies
         if ($this->options->company != "") {
             foreach ($this->companylist as $companyName => $companyData) {
                 if ($companyName == $this->options->company) {
                     $this->userlist = mapi_zarafa_getuserlist($this->defaultstore, $companyData["companyid"]);
                     break;
                 }
             }
         } else {
             // Sanity check: multi-company setup, but no company in options
             print "Running in a multi-company environment, but no company specified in command line.\n";
             exit(RESULT_ERROR_NOCOMPANYSPECIFIED);
         }
     } else {
         // single company setup, get list of all zarafa users
         print "Getting user list\n";
         $this->userlist = mapi_zarafa_getuserlist($this->defaultstore);
     }
     if (count($this->userlist) <= 0) {
         print "Unable to get user list\n";
         exit(RESULT_ERROR_USERLIST);
     }
 }
开发者ID:marco-uniware,项目名称:zarafa-tools,代码行数:27,代码来源:delete-freebusy.php


示例6: GetState

 /**
  * Reads the current state from the Exporter
  *
  * @access public
  * @return string
  * @throws StatusException
  */
 public function GetState()
 {
     $error = false;
     if (!isset($this->statestream) || $this->exporter === false) {
         $error = true;
     }
     if ($error === true || mapi_exportchanges_updatestate($this->exporter, $this->statestream) != true) {
         throw new StatusException(sprintf("ExportChangesICS->GetState(): Error, state not available or unable to update: 0x%X", mapi_last_hresult()), $this->folderid ? SYNC_STATUS_FOLDERHIERARCHYCHANGED : SYNC_FSSTATUS_CODEUNKNOWN, null, LOGLEVEL_WARN);
     }
     mapi_stream_seek($this->statestream, 0, STREAM_SEEK_SET);
     $state = "";
     while (true) {
         $data = mapi_stream_read($this->statestream, 4096);
         if (strlen($data)) {
             $state .= $data;
         } else {
             break;
         }
     }
     return $state;
 }
开发者ID:BackupTheBerlios,项目名称:z-push-svn,代码行数:28,代码来源:exporter.php


示例7: deleteCard

 /**
  * Deletes a card
  * 
  * @param mixed $addressBookId 
  * @param string $cardUri 
  * @return bool 
  */
 public function deleteCard($addressBookId, $cardUri)
 {
     $this->logger->info("deleteCard({$cardUri})");
     if (READ_ONLY) {
         $this->logger->warn("Cannot delete card: read-only");
         return false;
     }
     $folder = mapi_msgstore_openentry($this->bridge->getStore($addressBookId), $addressBookId);
     $entryId = $this->getContactEntryId($addressBookId, $cardUri);
     if ($entryId === 0) {
         $this->logger->warn("Contact not found!");
         return false;
     }
     // $folder = mapi_msgstore_openentry($this->bridge->getStore($addressBookId), $addressBookId);
     mapi_folder_deletemessages($folder, array($entryId));
     if (mapi_last_hresult() > 0) {
         return false;
     }
     return true;
 }
开发者ID:RobertWang,项目名称:sabre-zarafa,代码行数:27,代码来源:ZarafaCardDavBackend.php


示例8: readPropStream

 /**
  * Reads data of large properties from a stream
  *
  * @param MAPIMessage $message
  * @param long $prop
  *
  * @access public
  * @return string
  */
 public static function readPropStream($message, $prop)
 {
     $stream = mapi_openproperty($message, $prop, IID_IStream, 0, 0);
     $ret = mapi_last_hresult();
     if ($ret == MAPI_E_NOT_FOUND) {
         ZLog::Write(LOGLEVEL_DEBUG, sprintf("MAPIUtils->readPropStream: property 0x%s not found. It is either empty or not set. It will be ignored.", str_pad(dechex($prop), 8, 0, STR_PAD_LEFT)));
         return "";
     } elseif ($ret) {
         ZLog::Write(LOGLEVEL_ERROR, "MAPIUtils->readPropStream error opening stream: 0X%X", $ret);
         return "";
     }
     $data = "";
     $string = "";
     while (1) {
         $data = mapi_stream_read($stream, 1024);
         if (strlen($data) == 0) {
             break;
         }
         $string .= $data;
     }
     return $string;
 }
开发者ID:SvKn,项目名称:Z-Push-contrib,代码行数:31,代码来源:mapiutils.php


示例9: zpa_remove_device

function zpa_remove_device($adminStore, $session, $user, $deviceid)
{
    $userEntryId = @mapi_msgstore_createentryid($adminStore, $user);
    $userStore = @mapi_openmsgstore($session, $userEntryId);
    $hresult = mapi_last_hresult();
    if ($hresult != NOERROR) {
        echo "Could not open store for {$user}. The script will exit.\n";
        exit(1);
    }
    $devicesprops = mapi_getprops($userStore, array(0x6880101e, 0x6881101e, 0x6882101e, 0x6883101e, 0x68841003, 0x6885101e, 0x6886101e, 0x6887101e, 0x68881040, 0x68891040));
    if (isset($devicesprops[0x6881101e]) && is_array($devicesprops[0x6881101e])) {
        $ak = array_search($deviceid, $devicesprops[0x6881101e]);
        if ($ak !== false) {
            if (count($devicesprops[0x6880101e]) == 1) {
                mapi_deleteprops($userStore, array(0x6880101e, 0x6881101e, 0x6882101e, 0x6883101e, 0x68841003, 0x6885101e, 0x6886101e, 0x6887101e, 0x68881040, 0x68891040));
            } else {
                unset($devicesprops[0x6880101e][$ak], $devicesprops[0x6881101e][$ak], $devicesprops[0x6882101e][$ak], $devicesprops[0x6883101e][$ak], $devicesprops[0x68841003][$ak], $devicesprops[0x6885101e][$ak], $devicesprops[0x6886101e][$ak], $devicesprops[0x6887101e][$ak], $devicesprops[0x68881040][$ak], $devicesprops[0x68891040][$ak]);
                mapi_setprops($userStore, array(0x6880101e => isset($devicesprops[0x6880101e]) ? $devicesprops[0x6880101e] : array(), 0x6881101e => isset($devicesprops[0x6881101e]) ? $devicesprops[0x6881101e] : array(), 0x6882101e => isset($devicesprops[0x6882101e]) ? $devicesprops[0x6882101e] : array(), 0x6883101e => isset($devicesprops[0x6883101e]) ? $devicesprops[0x6883101e] : array(), 0x68841003 => isset($devicesprops[0x68841003]) ? $devicesprops[0x68841003] : array(), 0x6885101e => isset($devicesprops[0x6885101e]) ? $devicesprops[0x6885101e] : array(), 0x6886101e => isset($devicesprops[0x6886101e]) ? $devicesprops[0x6886101e] : array(), 0x6887101e => isset($devicesprops[0x6887101e]) ? $devicesprops[0x6887101e] : array(), 0x68881040 => isset($devicesprops[0x68881040]) ? $devicesprops[0x68881040] : array(), 0x68891040 => isset($devicesprops[0x68891040]) ? $devicesprops[0x68891040] : array()));
            }
            $hresult = mapi_last_hresult();
            if ($hresult != NOERROR) {
                echo "Could not remove device from list for {$user}. Errorcode 0x" . sprintf("%x", $hresult) . ". The script will exit.\n";
                exit(1);
            } else {
                echo "Removed device from list.\n";
            }
        } else {
            echo "No device found with the given id.\n";
            exit(1);
        }
    } else {
        echo "No devices found for the user {$user}.\n";
        exit(1);
    }
}
开发者ID:BackupTheBerlios,项目名称:z-push-svn,代码行数:35,代码来源:z-push-admin.php


示例10: mapi_openmsgstore

    $store = mapi_openmsgstore($l_rSession, $storeEntryId);
    $root = mapi_msgstore_openentry($store, null);
    $spamStoreProps = mapi_getprops($root, array(PR_ADDITIONAL_REN_ENTRYIDS));
    $spamFolder = mapi_msgstore_openentry($store, $spamStoreProps[PR_ADDITIONAL_REN_ENTRYIDS][4]);
    $table = mapi_folder_getcontentstable($spamFolder);
    $spamRows = mapi_table_queryallrows($table, array(PR_ENTRYID, PR_CREATION_TIME));
    echo (mapi_last_hresult() == 0 ? "Fetching messages from Junk Folder..." : "Some error in fetching...") . "\n";
    if (count($spamRows) > 0) {
        $spamEntryIds = array();
        echo "\nTotal messages in Junk folder found are : " . count($spamRows) . "\n";
        for ($i = 0; $i < count($spamRows); $i++) {
            if (greaterDate(date("Y-m-d G:i:s", $spamRows[$i][PR_CREATION_TIME]), $daysBeforeDeleted)) {
                array_push($spamEntryIds, $spamRows[$i][PR_ENTRYID]);
            }
        }
        if (count($spamEntryIds) > 0) {
            echo "\nDeleting all " . count($spamEntryIds) . " message(s)...\n";
            mapi_folder_deletemessages($spamFolder, $spamEntryIds);
            echo "" . (mapi_last_hresult() == 0 ? "\nHooray! there is no spam." : "Some error in deleting... There are still some spam messages.") . "\n";
        } else {
            echo "\nNo message found before " . $daysBeforeDeleted . " days in Junk Folder.";
        }
    } else {
        echo "\nNo message found in Junk Folder.";
    }
} else {
    echo "No default store found... Terminating process.\n";
}
?>

开发者ID:marco-uniware,项目名称:zarafa-tools,代码行数:29,代码来源:spam.php


示例11: define

define("FIELD_NAMES", true);
//the format of date values: true if they are as unix timestamps, false otherwise
define("DATES_AS_TIMESTAMPS", false);
// mapping for the csv column number to contact field (first field is 0)
$csv_mapping = array("given_name" => 0, "middle_name" => 1, "surname" => 2, "display_name_prefix" => 3, "webpage" => 6, "birthday" => 8, "wedding_anniversary" => 9, "notes" => 13, "email_address_1" => 14, "email_address_2" => 15, "email_address_3" => 16, "home_telephone_number" => 18, "home2_telephone_number" => 19, "cellular_telephone_number" => 20, "pager_telephone_number" => 21, "home_fax_number" => 22, "home_address" => 23, "home_address_street" => 24, "home_address_street2" => 25, "home_address_street3" => 26, "home_address_pobox" => 27, "home_address_city" => 28, "home_address_state" => 29, "home_address_postal_code" => 30, "home_address_country" => 31, "spouse_name" => 32, "manager_name" => 34, "assistant" => 35, "company_telephone_number" => 37, "office_telephone_number" => 38, "business2_telephone_number" => 39, "business_fax_number" => 40, "assistant_telephone_number" => 41, "company_name" => 42, "job_title" => 43, "department_name" => 44, "office_location" => 45, "profession" => 47, "business_address" => 49, "business_address_street" => 50, "business_address_street2" => 51, "business_address_street3" => 52, "business_address_pobox" => 53, "business_address_city" => 54, "business_address_state" => 55, "business_address_postal_code" => 56, "business_address_country" => 57, "other_telephone_number" => 58, "other_address" => 60, "other_address_street" => 61, "other_address_street2" => 62, "other_address_street3" => 63, "other_address_pobox" => 64, "other_address_city" => 65, "other_address_state" => 66, "other_address_postal_code" => 67, "other_address_country" => 68, "callback_telephone_number" => 69, "car_telephone_number" => 70, "isdn_number" => 71, "radio_telephone_number" => 72, "ttytdd_telephone_number" => 73, "telex_telephone_number" => 74, "sensitivity" => 84, "categories" => 87);
##########################
## end of configuration ##
##########################
error_reporting(E_ALL);
ini_set("display_errors", true);
ini_set("html_errors", false);
mapidefs();
mapitags();
$session = mapi_logon_zarafa($username, $password, SERVER);
if (mapi_last_hresult() != 0) {
    trigger_error(sprintf("MAPI Error: 0x%x", mapi_last_hresult()), E_USER_ERROR);
}
$storesTable = mapi_getmsgstorestable($session);
$stores = mapi_table_queryallrows($storesTable, array(PR_ENTRYID, PR_MDB_PROVIDER));
for ($i = 0; $i < count($stores); $i++) {
    if ($stores[$i][PR_MDB_PROVIDER] == ZARAFA_SERVICE_GUID) {
        $storeEntryid = $stores[$i][PR_ENTRYID];
        break;
    }
}
if (!isset($storeEntryid)) {
    trigger_error("Default store not found", E_USER_ERROR);
}
$store = mapi_openmsgstore($session, $storeEntryid);
$root = mapi_msgstore_openentry($store, null);
$rootProps = mapi_getprops($root, array(PR_IPM_CONTACT_ENTRYID));
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:31,代码来源:exec.zarafa.csv2contacts.php


示例12: setContactPicture

 /**
  * Assign a contact picture to a contact
  * @param entryId contact entry id
  * @param contactPicture must be a valid jpeg file. If contactPicture is NULL will remove contact picture from contact if exists
  */
 public function setContactPicture(&$contact, $contactPicture)
 {
     $this->logger->trace("setContactPicture");
     // Find if contact picture is already set
     $contactAttachment = -1;
     $hasattachProp = mapi_getprops($contact, array(PR_HASATTACH));
     if ($hasattachProp) {
         $attachmentTable = mapi_message_getattachmenttable($contact);
         $attachments = mapi_table_queryallrows($attachmentTable, array(PR_ATTACH_NUM, PR_ATTACH_SIZE, PR_ATTACH_LONG_FILENAME, PR_ATTACH_FILENAME, PR_ATTACHMENT_HIDDEN, PR_DISPLAY_NAME, PR_ATTACH_METHOD, PR_ATTACH_CONTENT_ID, PR_ATTACH_MIME_TAG, PR_ATTACHMENT_CONTACTPHOTO, PR_EC_WA_ATTACHMENT_HIDDEN_OVERRIDE));
         foreach ($attachments as $attachmentRow) {
             if (isset($attachmentRow[PR_ATTACHMENT_CONTACTPHOTO]) && $attachmentRow[PR_ATTACHMENT_CONTACTPHOTO]) {
                 $contactAttachment = $attachmentRow[PR_ATTACH_NUM];
                 break;
             }
         }
     }
     // Remove existing attachment if necessary
     if ($contactAttachment != -1) {
         $this->logger->trace("removing existing contact picture");
         $attach = mapi_message_deleteattach($contact, $contactAttachment);
     }
     if ($contactPicture !== NULL) {
         $this->logger->debug("Saving contact picture as attachment");
         // Create attachment
         $attach = mapi_message_createattach($contact);
         // Update contact attachment properties
         $properties = array(PR_ATTACH_SIZE => strlen($contactPicture), PR_ATTACH_LONG_FILENAME => 'ContactPicture.jpg', PR_ATTACHMENT_HIDDEN => false, PR_DISPLAY_NAME => 'ContactPicture.jpg', PR_ATTACH_METHOD => ATTACH_BY_VALUE, PR_ATTACH_MIME_TAG => 'image/jpeg', PR_ATTACHMENT_CONTACTPHOTO => true, PR_ATTACH_DATA_BIN => $contactPicture, PR_ATTACHMENT_FLAGS => 1, PR_ATTACH_EXTENSION_A => '.jpg', PR_ATTACH_NUM => 1);
         mapi_setprops($attach, $properties);
         mapi_savechanges($attach);
     }
     // Test
     if (mapi_last_hresult() > 0) {
         $this->logger->warn("Error saving contact picture: " . get_mapi_error_name());
     } else {
         $this->logger->trace("contact picture done");
     }
 }
开发者ID:RobertWang,项目名称:sabre-zarafa,代码行数:42,代码来源:ZarafaBridge.php


示例13: clearSuggestionList

function clearSuggestionList($session, $store, $userName)
{
    // create entryid of user's store
    $userStoreEntryId = mapi_msgstore_createentryid($store, $userName);
    if (!$userStoreEntryId) {
        print "Error in creating entryid for user's store - " . $userName . "\n";
        return false;
    }
    // open user's store
    $userStore = mapi_openmsgstore($session, $userStoreEntryId);
    if (!$userStore) {
        print "Error in opening user's store - " . $userName . "\n";
        return false;
    }
    // we are not checking here that property exists or not because it could happen that getprops will return
    // MAPI_E_NOT_ENOUGH_MEMORY for very large property, if property does not exists then it will be created
    // remove property data, overwirte existing data with a blank string (PT_STRING8)
    mapi_setprops($userStore, array(PR_EC_RECIPIENT_HISTORY => ""));
    $result = mapi_last_hresult();
    if ($result == NOERROR) {
        // Save changes
        mapi_savechanges($userStore);
        return mapi_last_hresult() == NOERROR ? true : false;
    }
    return false;
}
开发者ID:marco-uniware,项目名称:zarafa-tools,代码行数:26,代码来源:clear_suggestionlist.php


示例14: listfolders_getlist

function listfolders_getlist($adminStore, $session, $user)
{
    global $supported_classes;
    if (strtoupper($user) == 'SYSTEM') {
        // Find the public store store
        $storestables = @mapi_getmsgstorestable($session);
        $result = @mapi_last_hresult();
        if ($result == NOERROR) {
            $rows = @mapi_table_queryallrows($storestables, array(PR_ENTRYID, PR_MDB_PROVIDER));
            foreach ($rows as $row) {
                if (isset($row[PR_MDB_PROVIDER]) && $row[PR_MDB_PROVIDER] == ZARAFA_STORE_PUBLIC_GUID) {
                    if (!isset($row[PR_ENTRYID])) {
                        echo "Public folder are not available.\nIf this is a multi-tenancy system, use -u and -p and login with an admin user of the company.\nThe script will exit.\n";
                        exit(1);
                    }
                    $entryid = $row[PR_ENTRYID];
                    break;
                }
            }
        }
    } else {
        $entryid = @mapi_msgstore_createentryid($adminStore, $user);
    }
    $userStore = @mapi_openmsgstore($session, $entryid);
    $hresult = mapi_last_hresult();
    // Cache the store for later use
    if ($hresult != NOERROR) {
        echo "Could not open store for '{$user}'. The script will exit.\n";
        exit(1);
    }
    if (strtoupper($user) != 'SYSTEM') {
        $inbox = mapi_msgstore_getreceivefolder($userStore);
        if (mapi_last_hresult() != NOERROR) {
            printf("Could not open inbox for %s (0x%08X). The script will exit.\n", $user, mapi_last_hresult());
            exit(1);
        }
        $inboxProps = mapi_getprops($inbox, array(PR_SOURCE_KEY));
    }
    $storeProps = mapi_getprops($userStore, array(PR_IPM_OUTBOX_ENTRYID, PR_IPM_SENTMAIL_ENTRYID, PR_IPM_WASTEBASKET_ENTRYID));
    $root = @mapi_msgstore_openentry($userStore, null);
    $h_table = @mapi_folder_gethierarchytable($root, CONVENIENT_DEPTH);
    $subfolders = @mapi_table_queryallrows($h_table, array(PR_ENTRYID, PR_DISPLAY_NAME, PR_CONTAINER_CLASS, PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY, PR_FOLDER_TYPE, PR_ATTR_HIDDEN));
    echo "Available folders in store '{$user}':\n" . str_repeat("-", 50) . "\n";
    foreach ($subfolders as $folder) {
        // do not display hidden and search folders
        if (isset($folder[PR_ATTR_HIDDEN]) && $folder[PR_ATTR_HIDDEN] || isset($folder[PR_FOLDER_TYPE]) && $folder[PR_FOLDER_TYPE] == FOLDER_SEARCH) {
            continue;
        }
        // handle some special folders
        if (strtoupper($user) != 'SYSTEM' && (isset($inboxProps[PR_SOURCE_KEY]) && $folder[PR_SOURCE_KEY] == $inboxProps[PR_SOURCE_KEY] || $folder[PR_ENTRYID] == $storeProps[PR_IPM_SENTMAIL_ENTRYID] || $folder[PR_ENTRYID] == $storeProps[PR_IPM_WASTEBASKET_ENTRYID])) {
            $folder[PR_CONTAINER_CLASS] = "IPF.Note";
        }
        if (isset($folder[PR_CONTAINER_CLASS]) && array_key_exists($folder[PR_CONTAINER_CLASS], $supported_classes)) {
            echo "Folder name:\t" . $folder[PR_DISPLAY_NAME] . "\n";
            echo "Folder ID:\t" . bin2hex($folder[PR_SOURCE_KEY]) . "\n";
            echo "Type:\t\t" . $supported_classes[$folder[PR_CONTAINER_CLASS]] . "\n";
            echo "\n";
        }
    }
}
开发者ID:EGroupware,项目名称:z-push,代码行数:60,代码来源:listfolders.php


示例15: _openDefaultMessageStore

 function _openDefaultMessageStore($session)
 {
     // Find the default store
     $storestables = mapi_getmsgstorestable($session);
     $result = mapi_last_hresult();
     $entryid = false;
     if ($result == NOERROR) {
         $rows = mapi_table_queryallrows($storestables, array(PR_ENTRYID, PR_DEFAULT_STORE, PR_MDB_PROVIDER));
         foreach ($rows as $row) {
             if (isset($row[PR_DEFAULT_STORE]) && $row[PR_DEFAULT_STORE] == true) {
                 $entryid = $row[PR_ENTRYID];
                 break;
             }
         }
     }
     if ($entryid) {
         return mapi_openmsgstore($session, $entryid);
     } else {
         return false;
     }
 }
开发者ID:nnaannoo,项目名称:paskot,代码行数:21,代码来源:ics.php


示例16: mapi_openmsgstore

 // Open msg store by using the entryID
 $l_rDefaultStore = mapi_openmsgstore($l_rSession, $l_bbnEntryID);
 echo 'Opening default store result (0=success): ' . mapi_last_hresult() . "\n";
 // Get inbox
 $l_rInbox = mapi_msgstore_getreceivefolder($l_rDefaultStore);
 echo 'Getting entryID of inbox folder result (0=success): ' . mapi_last_hresult() . "\n";
 // Check if folder has been opened
 if ($l_rInbox) {
     // Open contents table
     $l_rInboxTable = mapi_folder_getcontentstable($l_rInbox);
     echo 'Opening contents table result (0=success): ' . mapi_last_hresult() . "\n";
     // Find the item by restricting all items to the correct ID
     $restrict = array(RES_AND, array(array(RES_PROPERTY, array(RELOP => RELOP_NE, ULPROPTAG => PR_PROCESSED, VALUE => array(PR_PROCESSED => true))), array(RES_CONTENT, array(FUZZYLEVEL => FL_PREFIX, ULPROPTAG => PR_MESSAGE_CLASS, VALUE => array(PR_SUBJECT => 'IPM.Schedule.Meeting'))), array(RES_BITMASK, array(ULTYPE => BMR_EQZ, ULMASK => MSGFLAG_READ, ULPROPTAG => PR_MESSAGE_FLAGS))));
     // Just get all items from table
     $l_aRows = mapi_table_queryallrows($l_rInboxTable, array(PR_ENTRYID, PR_MESSAGE_CLASS, PR_SUBJECT, PR_PROCESSED), $restrict);
     echo 'Querying contents table result (0=success): ' . mapi_last_hresult() . "\n";
     //print_r(count($l_aRows));
     //exit;
     echo 'Processing messages' . "\n";
     $l_iCounter = 0;
     for ($i = 0; $i < count($l_aRows); $i++) {
         $l_sMsgClassSearch = 'IPM.Schedule.Meeting';
         $l_rMessage = mapi_msgstore_openentry($l_rDefaultStore, $l_aRows[$i][PR_ENTRYID]);
         $req = new Meetingrequest($l_rDefaultStore, $l_rMessage, $l_rSession);
         if ($req->isMeetingRequest() && !$req->isLocalOrganiser()) {
             // Put the item in the calendar 'tentatively'
             $req->doAccept(true, false, false);
             $l_iCounter++;
         } elseif ($req->isMeetingCancellation()) {
             // Let's do some processing of this Meeting Cancellation Object we received
             $req->processMeetingCancellation();
开发者ID:marco-uniware,项目名称:zarafa-tools,代码行数:31,代码来源:process_meetingrequests.php


示例17: getSearchFoldersRoot

 /**
  * Function will open FINDER_ROOT folder in root container
  * public folder's don't have FINDER_ROOT folder
  *
  * @see getSearchFoldersRoot($store) function in the webaccess
  *
  * @return mapiFolderObject root folder for search folders
  */
 private function getSearchFoldersRoot()
 {
     // check if we can create search folders
     $storeProps = mapi_getprops($this->store, array(PR_STORE_SUPPORT_MASK, PR_FINDER_ENTRYID));
     if (($storeProps[PR_STORE_SUPPORT_MASK] & STORE_SEARCH_OK) != STORE_SEARCH_OK) {
         ZLog::Write(LOGLEVEL_WARN, "Store doesn't support search folders. Public store doesn't have FINDER_ROOT folder");
         return false;
     }
     // open search folders root
     $searchRootFolder = mapi_msgstore_openentry($this->store, $storeProps[PR_FINDER_ENTRYID]);
     if (mapi_last_hresult() != NOERROR) {
         ZLog::Write(LOGLEVEL_WARN, sprintf("Unable to open search folder (0x%X)", mapi_last_hresult()));
         return false;
     }
     return $searchRootFolder;
 }
开发者ID:BackupTheBerlios,项目名称:z-push-svn,代码行数:24,代码来源:zarafa.php


示例18: mapi_openmsgstore

if ($storeEntryId) {
    $store = mapi_openmsgstore($l_rSession, $storeEntryId);
    $delStoreProps = mapi_getprops($store, array(PR_IPM_WASTEBASKET_ENTRYID));
    $deletedFolder = mapi_msgstore_openentry($store, $delStoreProps[PR_IPM_WASTEBASKET_ENTRYID]);
    $table = mapi_folder_getcontentstable($deletedFolder);
    $delRows = mapi_table_queryallrows($table, array(PR_ENTRYID, PR_CREATION_TIME));
    echo (mapi_last_hresult() == 0 ? "Fetching messages from Deleted Folder..." : "Some error in fetching...") . "\n";
    if (count($delRows) > 0) {
        $delEntryIds = array();
        echo 'Total messages in deleted folder found are : ' . count($delRows) . "\n";
        for ($i = 0; $i < count($delRows); $i++) {
            if (greaterDate(date("Y-m-d G:i:s", $delRows[$i][PR_CREATION_TIME]), $daysBeforeDeleted)) {
                array_push($delEntryIds, $delRows[$i][PR_ENTRYID]);
            }
        }
        if (count($delEntryIds) > 0) {
            echo "\nDeleting all " . count($delEntryIds) . " messages...\n";
            mapi_folder_deletemessages($deletedFolder, $delEntryIds);
            echo "" . (mapi_last_hresult() == 0 ? "Successfully deleted all messages" : "Some error in deleting... please try again later") . "\n";
        } else {
            echo "\nNo message found before " . $daysBeforeDeleted . " days in Deleted Folder.";
        }
    } else {
        echo "\nNo message found in Deleted Folder.";
    }
} else {
    echo "No default store found... Terminating process.\n";
}
?>

开发者ID:marco-uniware,项目名称:zarafa-tools,代码行数:29,代码来源:delete.php


示例19: ImportFolderDeletion

 /**
  * 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;
 }
开发者ID:netconstructor,项目名称:sogosync,代码行数:28,代码来源:importer.php


示例20: setPropsIndividually

 /**
  * Sets the properties one by one in a MAPI object
  *
  * @param mixed             &$mapimessage
  * @param array             &$propsToSet
  * @param array             &$mapiprops
  *
  * @access private
  * @return
  */
 private function setPropsIndividually(&$mapimessage, &$propsToSet, &$mapiprops)
 {
     foreach ($propsToSet as $prop => $value) {
         mapi_setprops($mapimessage, array($prop => $value));
         if (mapi_last_hresult()) {
             Zlog::Write(LOGLEVEL_ERROR, sprintf("Failed setting property [%s] with value [%s], error code was:%x", array_search($prop, $mapiprops), $value, mapi_last_hresult()));
         }
     }
 }
开发者ID:netconstructor,项目名称:sogosync,代码行数:19,代码来源:mapiprovider.php



注:本文中的mapi_last_hresult函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mapi_logon_zarafa函数代码示例发布时间:2022-05-15
下一篇:
PHP mapi_getprops函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap