/** * Adds an additional folder to the given device and the Request::GetGETUser(). * * @param string $deviceId device id the folder should be added to. * @param string $add_store the store where this folder is located, e.g. "SYSTEM" (for public folder) or an username/email address. * @param string $add_folderid the folder id of the additional folder. * @param string $add_name the name of the additional folder (has to be unique for all folders on the device). * @param string $add_type AS foldertype of SYNC_FOLDER_TYPE_USER_* * @param int $add_flags Additional flags, like DeviceManager::FLD_FLAGS_REPLYASUSER * * @access public * @return boolean */ public function AdditionalFolderAdd($deviceId, $add_store, $add_folderid, $add_name, $add_type, $add_flags) { $user = Request::GetGETUser(); $deviceId = preg_replace("/[^A-Za-z0-9]/", "", $deviceId); $add_folderid = preg_replace("/[^A-Za-z0-9]/", "", $add_folderid); $add_type = preg_replace("/[^0-9]/", "", $add_type); $add_flags = preg_replace("/[^0-9]/", "", $add_flags); $status = ZPushAdmin::AdditionalFolderAdd($user, $deviceId, $add_store, $add_folderid, $add_name, $add_type, $add_flags); if (!$status) { ZPush::GetTopCollector()->AnnounceInformation(ZLog::GetLastMessage(LOGLEVEL_ERROR), true); throw new SoapFault("ERROR", ZLog::GetLastMessage(LOGLEVEL_ERROR)); } ZLog::Write(LOGLEVEL_INFO, sprintf("WebserviceDevice::AdditionalFolderAdd(): added folder for device '%s' of user '%s': %s", $deviceId, $user, Utils::PrintAsString($status))); ZPush::GetTopCollector()->AnnounceInformation("Added additional folder", true); return $status; }