english/administrator/components/com_aicontactsafe/models/messages.php
// function to select the IPs to ban
function to select the IPs to ban
function to select the IPs to ban
function readSelectedIps() {
		if(!$this->ban_ips_rowlist) {
			$db = &JFactory::getDBO();
			$cid = JRequest::getVar( 'cid', array(), 'post', 'array' );
			JArrayHelper::toInteger($cid);
			if (count($cid) > 0) {
				$cids = implode(',', $cid);
			} else {
				$cids = '-1';
			}
			$query = 'SELECT * FROM #__aicontactsafe_messages WHERE id IN ( ' . $cids . ') GROUP BY sender_ip ORDER BY sender_ip';
			$this->ban_ips_rowlist = $this->_getList($query, 0, 0);
			if (!is_array($this->ban_ips_rowlist)) {
				$this->ban_ips_rowlist = array();
			}
		}
		return $this->ban_ips_rowlist;
	}
function readSelectedIps ( ) { if ( ! $ this -> ban_ips_rowlist ) { $ db = & JFactory :: getDBO ( ) ; $ cid = JRequest :: getVar ( 'cid' , array ( ) , 'post' , 'array' ) ; JArrayHelper :: toInteger ( $ cid ) ; if ( count ( $ cid ) > 0 ) { $ cids = implode ( ',' , $ cid ) ; } else { $ cids = '-1' ; } $ query = 'SELECT * FROM #__aicontactsafe_messages WHERE id IN ( ' . $ cids . ') GROUP BY sender_ip ORDER BY sender_ip' ; $ this -> ban_ips_rowlist = $ this -> _getList ( $ query , 0 , 0 ) ; if ( ! is_array ( $ this -> ban_ips_rowlist ) ) { $ this -> ban_ips_rowlist = array ( ) ; } } return $ this -> ban_ips_rowlist ; }
function to select the IPs to ban
function to select the IPs to ban
// initialize the database // get the condition for the selected records // get the IPs to ban