Changeset 13812 for trunk/modules/boonex/spy/classes/BxSpyDb.php
- Timestamp:
- 03/20/10 04:28:57 (2 years ago)
- File:
-
- 1 edited
-
trunk/modules/boonex/spy/classes/BxSpyDb.php (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/boonex/spy/classes/BxSpyDb.php
r12399 r13812 58 58 function getActivityCount($sType = '') 59 59 { 60 $sType = $this -> escape($sType); 61 60 62 $sWhere = null; 61 63 if($sType && $sType != 'all'){ … … 77 79 function getLastActivityId($sType = '') 78 80 { 81 $sType = $this -> escape($sType); 79 82 $sWhere = null; 80 83 … … 98 101 function getLastFriendsActivityId($iProfileId, $sType = '') 99 102 { 103 $iProfileId = (int) $iProfileId; 104 $sType = $this -> escape($sType); 105 100 106 $sWhere = null; 101 107 … … 136 142 function getFriendsActivityCount($iProfileId, $sType = '') 137 143 { 144 $iProfileId = (int) $iProfileId; 145 $sType = $this -> escape($sType); 146 138 147 $sWhere = null; 139 148 … … 170 179 function getSettingsCategory($sValueName) 171 180 { 181 $sValueName = process_db_input($sValueName, BX_TAGS_STRIP); 172 182 return $this -> getOne('SELECT `kateg` FROM `sys_options` WHERE `Name` = "' . $sValueName . '"'); 173 183 } … … 181 191 function setViewed($iActivityId) 182 192 { 193 $iActivityId = (int) $iActivityId; 183 194 $sQuery = "UPDATE `{$this->sTablePrefix}data` SET `viewed` = 1"; 184 195 $this -> query($sQuery); … … 193 204 function setViewedProfileActivity($iProfileId) 194 205 { 206 $iProfileId = (int) $iProfileId; 195 207 $sQuery = "UPDATE `{$this->sTablePrefix}data` SET `viewed` = 1 WHERE `recipient_id` = {$iProfileId}"; 196 208 $this -> query($sQuery); … … 201 213 //--- Update Spy Handlers ---// 202 214 foreach($aData['handlers'] as $aHandler) 203 { 215 { 216 $aHandler['alert_unit'] = process_db_input($aHandler['alert_unit'], BX_TAGS_STRIP); 217 $aHandler['alert_action'] = process_db_input($aHandler['alert_action'], BX_TAGS_STRIP); 218 $aHandler['module_uri'] = process_db_input($aHandler['module_uri'], BX_TAGS_STRIP); 219 $aHandler['module_class'] = process_db_input($aHandler['module_class'], BX_TAGS_STRIP); 220 $aHandler['module_method'] = process_db_input($aHandler['module_method'], BX_TAGS_STRIP); 221 204 222 $sQuery = 205 223 " … … 217 235 } 218 236 219 $sAlertName = $this -> _oConfig -> getAlertSystemName();237 $sAlertName = $this -> escape($this -> _oConfig -> getAlertSystemName()); 220 238 221 239 //--- Update System Alerts ---// … … 235 253 foreach($aData['alerts'] as $aAlert) 236 254 { 255 $aAlert['unit'] = process_db_input($aAlert['unit'], BX_TAGS_STRIP); 256 $aAlert['action'] = process_db_input($aAlert['action'], BX_TAGS_STRIP); 257 237 258 $sQuery = 238 259 " … … 252 273 { 253 274 //--- Update Wall Handlers ---// 254 foreach($aData['handlers'] as $aHandler) { 275 foreach($aData['handlers'] as $aHandler) 276 { 277 $aHandler['alert_unit'] = process_db_input($aHandler['alert_unit'], BX_TAGS_STRIP); 278 $aHandler['alert_action'] = process_db_input($aHandler['alert_action'], BX_TAGS_STRIP); 279 $aHandler['module_uri'] = process_db_input($aHandler['module_uri'], BX_TAGS_STRIP); 280 $aHandler['module_class'] = process_db_input($aHandler['module_class'], BX_TAGS_STRIP); 281 $aHandler['module_method'] = process_db_input($aHandler['module_method'], BX_TAGS_STRIP); 282 255 283 $sQuery = 256 284 " … … 274 302 275 303 // define system alert name; 276 $sAlertName = $this -> _oConfig -> getAlertSystemName();304 $sAlertName = $this -> escape($this -> _oConfig -> getAlertSystemName()); 277 305 278 306 //--- Update System Alerts ---// … … 291 319 foreach($aData['alerts'] as $aAlert) 292 320 { 321 $aAlert['unit'] = process_db_input($aAlert['unit'], BX_TAGS_STRIP); 322 $aAlert['action'] = process_db_input($aAlert['action'], BX_TAGS_STRIP); 323 293 324 $sQuery = 294 325 " … … 321 352 function createActivity($iSenderId, $iRecipientId, $aActivityInfo) 322 353 { 354 $iSenderId = (int) $iSenderId; 355 $iRecipientId = (int) $iRecipientId; 356 323 357 // -- procces recived parameters -- // 324 $aParameters = $this->escape(serialize($aActivityInfo['params'])); 358 $aParameters = isset($aActivityInfo['params']) 359 ? process_db_input(serialize($aActivityInfo['params']), BX_TAGS_STRIP) 360 : ''; 325 361 326 362 // if isset activity's types will uset it; … … 328 364 ? $aActivityInfo['spy_type'] 329 365 : 'content_activity'; 366 367 //procces activity data 368 foreach($aActivityInfo as $sKey => $sValue) 369 { 370 $aActivityInfo[$sKey] = process_db_input($sValue, BX_TAGS_STRIP); 371 } 330 372 331 373 // execute query; … … 358 400 function attachFriendEvent($iEventId, $iSenderId, $iFriendId) 359 401 { 360 $sQuery = 402 $iEventId = (int) $iEventId; 403 $iSenderId = (int) $iSenderId; 404 $iFriendId = (int) $iFriendId; 405 406 $sQuery = 361 407 " 362 408 INSERT INTO … … 379 425 function deleteUselessData($iCount = 0) 380 426 { 427 $iCount = (int) $iCount; 428 381 429 $sQuery = "SELECT `id` FROM `{$this->sTablePrefix}data` ORDER BY `date` LIMIT {$iCount}"; 382 430 $aRows = $this -> getAll($sQuery);
Note: See TracChangeset
for help on using the changeset viewer.