Hi Mark,

I am only dealing on a small project, so I don't get as much emails
luckely :-)

I will try your code, thanks a lot!!

Bye



On 22 Nov., 17:55, euromark <[email protected]> wrote:
> I did that for while - after upgrading the application
> jesus christ. I can tell you.
> I would have gotten hundreds of mails per second
>
> With session token (and one email per session every HOUR)
> it went down to "a lot" ;)
>
> Anyway - the thing is, that a browser opens invalid urls all the time
> especially InternetExplorer, especially with some bogus and rotten
> software/plugins
> (including some Antivirus Utility).
> So even if you just log them away, there are quite a lot of entries to
> log.
>
> so if you do that, you should restrict the logging to session (as
> above) and even better
> to a valid logged in user. this is better than letting all bots of
> this world create mail traffic for you.
> that works for me in in upgrading phases and reports back to be in
> real time.
> most times it is a click then which will have a valid referer you can
> work with.
>
> for the referer you can use
>
>         /**
>          * get the current referer
>          * @param bool $full (defaults to false and leaves the url untouched)
>          * @return string $referer (local or foreign)
>          * 2011-11-02 ms
>          */
>         public static function getReferer($full = false) {
>                 $ref = env('HTTP_REFERER');
>                 $forwarded = env('HTTP_X_FORWARDED_HOST');
>                 if ($forwarded) {
>                         $ref = $forwarded;
>                 }
>                 if (empty($ref)) {
>                         return $ref;
>                 }
>                 if ($full) {
>                         $ref = Router::url($full);
>                 }
>                 return $res;
>         }
>
> On 22 Nov., 11:54, AD7six <[email protected]> wrote:
>
>
>
> > On Tuesday, 22 November 2011 11:45:42 UTC+1, heohni wrote:
>
> > > Hi,
>
> > > I using this app_error handler:
>
> > > <?php
> > > class AppError extends ErrorHandler{
>
> > >     function __construct($method, $messages) {
> > >         Configure::write('debug', 2);
> > >         parent::__construct($method, $messages);
> > >     }
> > >     function _outputMessage($template) {
> > >         $this->controller->render($template);
> > >         $this->controller->afterFilter();
>
> > >         App::import('Core', 'Email');
> > >         $email = new EmailComponent;
>
> > >         $email->from = 'CakePHP <[email protected]<>';
> > >         $email->to = 'Developer <[email protected]>';
> > >         $email->sendAs = 'html';
> > >         $email->subject = 'Error!';
>
> > >         $email->send($this->controller->output);
>
> > >         $this->controller->output = null;
> > >         $this->controller->render('error404');
> > >         echo $this->controller->output;
> > >     }
> > > }
> > > ?>
>
> > > How can I also send the referer in order to see what link the user
> > > used to get to this 404 error page?
> > > Any ideas?
>
> > How about: By including it in the message?
>
> > I think you'll find emailing someone every time there's a 404 will just
> > drown their email whenever a problem occurs.
>
> > AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to