[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 3 include_once 'Horde/SyncML/State.php'; 4 include_once 'Horde/SyncML/Command.php'; 5 6 /** 7 * $Horde: framework/SyncML/SyncML/Command/Put.php,v 1.12 2004/07/02 19:24:44 chuck Exp $ 8 * 9 * Copyright 2003-2004 Anthony Mills <amills@pyramid6.com> 10 * 11 * See the enclosed file COPYING for license information (LGPL). If you 12 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. 13 * 14 * @author Anthony Mills <amills@pyramid6.com> 15 * @version $Revision: 18844 $ 16 * @since Horde 3.0 17 * @package Horde_SyncML 18 */ 19 class Horde_SyncML_Command_Put extends Horde_SyncML_Command { 20 21 /** 22 * @var string $_manufacturer 23 */ 24 25 var $_manufacturer; 26 27 /** 28 * @var string $_model 29 */ 30 31 var $_model; 32 33 /** 34 * @var string $_oem 35 */ 36 37 var $_oem; 38 39 /** 40 * @var string $_softwareVersion 41 */ 42 43 var $_softwareVersion; 44 45 function endElement($uri, $element) 46 { 47 #Horde::logMessage('SyncML: put endelement ' . $element . ' stack ' . $this->_xmlStack, __FILE__, __LINE__, PEAR_LOG_DEBUG); 48 switch ($this->_xmlStack) { 49 case 5: 50 switch($element) { 51 case 'DataStore': 52 $this->_deviceInfo['dataStore'][$this->_sourceReference] = array( 53 'maxGUIDSize' => $this->_maxGUIDSize, 54 'rxPreference' => $this->_rxPreference, 55 'txPreference' => $this->_txPreference, 56 'syncCapabilities' => $this->_syncCapabilities, 57 ); 58 break; 59 case 'DevID': 60 $this->_deviceInfo['deviceID'] = trim($this->_chars); 61 break; 62 case 'DevTyp': 63 $this->_deviceInfo['deviceType'] = trim($this->_chars); 64 break; 65 case 'Man': 66 $this->_deviceInfo['manufacturer'] = trim($this->_chars); 67 break; 68 case 'Mod': 69 $this->_deviceInfo['model'] = trim($this->_chars); 70 break; 71 case 'OEM': 72 $this->_deviceInfo['oem'] = trim($this->_chars); 73 break; 74 case 'SwV': 75 $this->_deviceInfo['softwareVersion'] = trim($this->_chars); 76 break; 77 case 'SupportLargeObjs': 78 $this->_deviceInfo['supportLargeObjs'] = true; 79 break; 80 case 'SupportNumberOfChanges': 81 $this->_deviceInfo['supportNumberOfChanges'] = true; 82 break; 83 case 'VerDTD': 84 $this->_deviceInfo['DTDVersion'] = trim($this->_chars); 85 break; 86 } 87 break; 88 case 6: 89 switch($element) { 90 case 'MaxGUIDSize': 91 $this->_maxGUIDSize = trim($this->_chars); 92 break; 93 case 'Rx-Pref': 94 $this->_rxPreference = array( 95 'contentType' => $this->_contentType, 96 'contentVersion' => $this->_contentVersion, 97 ); 98 break; 99 case 'SourceRef': 100 $this->_sourceReference = trim($this->_chars); 101 break; 102 case 'Tx-Pref': 103 $this->_txPreference = array( 104 'contentType' => $this->_contentType, 105 'contentVersion' => $this->_contentVersion, 106 ); 107 break; 108 } 109 break; 110 case 7: 111 switch($element) { 112 case 'CTType': 113 $this->_contentType = trim($this->_chars); 114 break; 115 case 'SyncType': 116 $this->_syncCapabilities[] = trim($this->_chars); 117 break; 118 case 'VerCT': 119 $this->_contentVersion = trim($this->_chars); 120 break; 121 } 122 break; 123 } 124 125 parent::endElement($uri, $element); 126 } 127 128 function output($currentCmdID, &$output ) 129 { 130 $state = &$_SESSION['SyncML.state']; 131 132 $status = &new Horde_SyncML_Command_Status((($state->isAuthorized()) ? RESPONSE_OK : RESPONSE_INVALID_CREDENTIALS), 'Put'); 133 $status->setCmdRef($this->_cmdID); 134 135 $ref = ($state->getVersion() == 0) ? './devinf10' : './devinf11'; 136 137 $status->setSourceRef($ref); 138 139 if($state->isAuthorized()) 140 { 141 if(count((array)$this->_deviceInfo) > 0) 142 { 143 $state->setClientDeviceInfo($this->_deviceInfo); 144 $state->writeClientDeviceInfo(); 145 } 146 } 147 148 return $status->output($currentCmdID, $output); 149 } 150 151 function startElement($uri, $element, $attrs) 152 { 153 #Horde::logMessage('SyncML: put startelement ' . $element, __FILE__, __LINE__, PEAR_LOG_DEBUG); 154 parent::startElement($uri, $element, $attrs); 155 } 156 157 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |