private function idslog($result, $reaction = 0)
    {
        $user = $this->controller
            ->Session->read('User.id') ?
                $this->controller->Session->read('User.id') :
                0;

        $ip = ($_SERVER['SERVER_ADDR'] != '127.0.0.1') ?
                    $_SERVER['SERVER_ADDR'] :
                        (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ?
                            $_SERVER['HTTP_X_FORWARDED_FOR'] :
                                 '127.0.0.1');

        foreach ($result as $event) {
            $data = array(
                'Intrusion' => array(
                    'name'      => $event->getName(),
                    'value'     => stripslashes($event->getValue()),
                    'page'      => $_SERVER['REQUEST_URI'],
                    'userid'    => $user,
                    'session'   => session_id() ? session_id() : '0',
                    'ip'        => $ip,
                    'reaction'  => $reaction,
                    'impact'    => $result->getImpact()
                )
            );
        }

        loadModel('Intrusion');
        $intrusion = new Intrusion;
        $saveable  = array(
            'name', 'value', 'page', 'userid',
            'session', 'ip', 'reaction', 'impact'
        );
        $intrusion->save($data, false, $saveable);

        return true;
    }
private function idslog($result, $reaction = 0)
    {
        $user = $this->controller
            ->Session->read('User.id') ?
                $this->controller->Session->read('User.id') :
                0;

        $ip = ($_SERVER['SERVER_ADDR'] != '127.0.0.1') ?
                    $_SERVER['SERVER_ADDR'] :
                        (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ?
                            $_SERVER['HTTP_X_FORWARDED_FOR'] :
                                 '127.0.0.1');

        foreach ($result as $event) {
            $data = array(
                'Intrusion' => array(
                    'name'      => $event->getName(),
                    'value'     => stripslashes($event->getValue()),
                    'page'      => $_SERVER['REQUEST_URI'],
                    'userid'    => $user,
                    'session'   => session_id() ? session_id() : '0',
                    'ip'        => $ip,
                    'reaction'  => $reaction,
                    'impact'    => $result->getImpact()
                )
            );
        }

        loadModel('Intrusion');
        $intrusion = new Intrusion;
        $saveable  = array(
            'name', 'value', 'page', 'userid',
            'session', 'ip', 'reaction', 'impact'
        );
        $intrusion->save($data, false, $saveable);

        return true;
    }
private function idslog ( $ result , $ reaction = 0 ) { $ user = $ this -> controller -> Session -> read ( 'User.id' ) ? $ this -> controller -> Session -> read ( 'User.id' ) : 0 ; $ ip = ( $ _SERVER [ 'SERVER_ADDR' ] != '127.0.0.1' ) ? $ _SERVER [ 'SERVER_ADDR' ] : ( isset ( $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ) ? $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] : '127.0.0.1' ) ; foreach ( $ result as $ event ) { $ data = array ( 'Intrusion' => array ( 'name' => $ event -> getName ( ) , 'value' => stripslashes ( $ event -> getValue ( ) ) , 'page' => $ _SERVER [ 'REQUEST_URI' ] , 'userid' => $ user , 'session' => session_id ( ) ? session_id ( ) : '0' , 'ip' => $ ip , 'reaction' => $ reaction , 'impact' => $ result -> getImpact ( ) ) ) ; } loadModel ( 'Intrusion' ) ; $ intrusion = new Intrusion ; $ saveable = array ( 'name' , 'value' , 'page' , 'userid' , 'session' , 'ip' , 'reaction' , 'impact' ) ; $ intrusion -> save ( $ data , false , $ saveable ) ; return true ; }
This function writes an entry about the intrusion
to the intrusion database

@param  array   $results
@return boolean
This function writes an entry about the intrusion to the intrusion database