Re: limit access to a site?

2009-03-25 Thread Aurelius

thx

On 26 Mrz., 01:43, Pablo Viojo  wrote:
> $ip = gethostbyname('www.example.com');
>
> http://www.php.net/gethostbyname
>
> Saludos,
>
> Pablo Viojo
> pvi...@gmail.comhttp://pviojo.net
> (#260 y creciendo!)
>
> 
> Ayudar nos hace felices!http://needish.com -http://helperman.org
>
> On Wed, Mar 25, 2009 at 5:01 PM, Aurelius  wrote:
>
> > ???
> > I've already written two books about CakePHP,
> > but there were nothing in it.
>
> > I now tried to use your tip "read a book", but there's
> > nothing in the dictionary as well, maybe you can help me...
>
> > thx
> > Aurelius
>
> > On 24 Mrz., 13:52, Smelly Eddie  wrote:
> > > yes, read a book
>
> > > On Mar 24, 8:41 am, Aurelius  wrote:
>
> > > > Thanks!
> > > > One more problem, when it is going live, the Allow from would be a
> > > > domain like "service.mydomain.de" and not a IP address, any solutions
> > > > for that?
>
> > > > thx
> > > > Aurelius
>
> > > > On 24 Mrz., 01:22, Graham Weldon  wrote:
>
> > > > > class AppController extends Controller {
>
> > > > >     var $allowedHosts = array('127.0.0.1', '::1', '85.127.249.210');
> > > > >     var $accessDeniedRedirect = ... // Define your action to redirect 
> > > > > to
> > > > > here.
>
> > > > >     function beforeFilter() {
> > > > >         if (!in_array(env('REMOTE_ADDR'), $this->allowedHosts)) {
> > > > >             $this->redirect($this->accessDeniedRedirect);
> > > > >             die();
> > > > >         }
> > > > >     }
>
> > > > > }
>
> > > > > That would cover it.
> > > > > The only thing I have not considered is that you need to allow anyone
> > > > > access to the $accessDeniedRedirect address.
> > > > > So you will need a check in or around your if statement in the
> > > > > beforeFilter there to ensure unrestricted access to whatever you set
> > > > > $accessDeniedRedirect is set to.
> > > > > But I will leave that for you to sort out. Can't give you all the
> > > > > solutions. That would be boring!
>
> > > > > Cheers,
> > > > > Graham
>
> > > > > Aurelius wrote:
> > > > > > Hi!
>
> > > > > > I Would like to limit the access to a controller function in the 
> > > > > > same
> > > > > > way as .htaccess would do it with these lines:
> > > > > > Order deny,allow
> > > > > > Deny from all
> > > > > > Allow from 85.127.249.210
>
> > > > > > How can I achieve that?
>
> > > > > > thx
> > > > > > Aurelius
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: limit access to a site?

2009-03-25 Thread Pablo Viojo

$ip = gethostbyname('www.example.com');

http://www.php.net/gethostbyname

Saludos,

Pablo Viojo
pvi...@gmail.com
http://pviojo.net
(#260 y creciendo!)


Ayudar nos hace felices!
http://needish.com  - http://helperman.org



On Wed, Mar 25, 2009 at 5:01 PM, Aurelius  wrote:
>
> ???
> I've already written two books about CakePHP,
> but there were nothing in it.
>
> I now tried to use your tip "read a book", but there's
> nothing in the dictionary as well, maybe you can help me...
>
> thx
> Aurelius
>
> On 24 Mrz., 13:52, Smelly Eddie  wrote:
> > yes, read a book
> >
> > On Mar 24, 8:41 am, Aurelius  wrote:
> >
> > > Thanks!
> > > One more problem, when it is going live, the Allow from would be a
> > > domain like "service.mydomain.de" and not a IP address, any solutions
> > > for that?
> >
> > > thx
> > > Aurelius
> >
> > > On 24 Mrz., 01:22, Graham Weldon  wrote:
> >
> > > > class AppController extends Controller {
> >
> > > >     var $allowedHosts = array('127.0.0.1', '::1', '85.127.249.210');
> > > >     var $accessDeniedRedirect = ... // Define your action to redirect to
> > > > here.
> >
> > > >     function beforeFilter() {
> > > >         if (!in_array(env('REMOTE_ADDR'), $this->allowedHosts)) {
> > > >             $this->redirect($this->accessDeniedRedirect);
> > > >             die();
> > > >         }
> > > >     }
> >
> > > > }
> >
> > > > That would cover it.
> > > > The only thing I have not considered is that you need to allow anyone
> > > > access to the $accessDeniedRedirect address.
> > > > So you will need a check in or around your if statement in the
> > > > beforeFilter there to ensure unrestricted access to whatever you set
> > > > $accessDeniedRedirect is set to.
> > > > But I will leave that for you to sort out. Can't give you all the
> > > > solutions. That would be boring!
> >
> > > > Cheers,
> > > > Graham
> >
> > > > Aurelius wrote:
> > > > > Hi!
> >
> > > > > I Would like to limit the access to a controller function in the same
> > > > > way as .htaccess would do it with these lines:
> > > > > Order deny,allow
> > > > > Deny from all
> > > > > Allow from 85.127.249.210
> >
> > > > > How can I achieve that?
> >
> > > > > thx
> > > > > Aurelius
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: limit access to a site?

2009-03-25 Thread Aurelius

???
I've already written two books about CakePHP,
but there were nothing in it.

I now tried to use your tip "read a book", but there's
nothing in the dictionary as well, maybe you can help me...

thx
Aurelius

On 24 Mrz., 13:52, Smelly Eddie  wrote:
> yes, read a book
>
> On Mar 24, 8:41 am, Aurelius  wrote:
>
> > Thanks!
> > One more problem, when it is going live, the Allow from would be a
> > domain like "service.mydomain.de" and not a IP address, any solutions
> > for that?
>
> > thx
> > Aurelius
>
> > On 24 Mrz., 01:22, Graham Weldon  wrote:
>
> > > class AppController extends Controller {
>
> > >     var $allowedHosts = array('127.0.0.1', '::1', '85.127.249.210');
> > >     var $accessDeniedRedirect = ... // Define your action to redirect to
> > > here.
>
> > >     function beforeFilter() {
> > >         if (!in_array(env('REMOTE_ADDR'), $this->allowedHosts)) {
> > >             $this->redirect($this->accessDeniedRedirect);
> > >             die();
> > >         }
> > >     }
>
> > > }
>
> > > That would cover it.
> > > The only thing I have not considered is that you need to allow anyone
> > > access to the $accessDeniedRedirect address.
> > > So you will need a check in or around your if statement in the
> > > beforeFilter there to ensure unrestricted access to whatever you set
> > > $accessDeniedRedirect is set to.
> > > But I will leave that for you to sort out. Can't give you all the
> > > solutions. That would be boring!
>
> > > Cheers,
> > > Graham
>
> > > Aurelius wrote:
> > > > Hi!
>
> > > > I Would like to limit the access to a controller function in the same
> > > > way as .htaccess would do it with these lines:
> > > > Order deny,allow
> > > > Deny from all
> > > > Allow from 85.127.249.210
>
> > > > How can I achieve that?
>
> > > > thx
> > > > Aurelius
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: limit access to a site?

2009-03-24 Thread Smelly Eddie

yes, read a book

On Mar 24, 8:41 am, Aurelius  wrote:
> Thanks!
> One more problem, when it is going live, the Allow from would be a
> domain like "service.mydomain.de" and not a IP address, any solutions
> for that?
>
> thx
> Aurelius
>
> On 24 Mrz., 01:22, Graham Weldon  wrote:
>
> > class AppController extends Controller {
>
> >     var $allowedHosts = array('127.0.0.1', '::1', '85.127.249.210');
> >     var $accessDeniedRedirect = ... // Define your action to redirect to
> > here.
>
> >     function beforeFilter() {
> >         if (!in_array(env('REMOTE_ADDR'), $this->allowedHosts)) {
> >             $this->redirect($this->accessDeniedRedirect);
> >             die();
> >         }
> >     }
>
> > }
>
> > That would cover it.
> > The only thing I have not considered is that you need to allow anyone
> > access to the $accessDeniedRedirect address.
> > So you will need a check in or around your if statement in the
> > beforeFilter there to ensure unrestricted access to whatever you set
> > $accessDeniedRedirect is set to.
> > But I will leave that for you to sort out. Can't give you all the
> > solutions. That would be boring!
>
> > Cheers,
> > Graham
>
> > Aurelius wrote:
> > > Hi!
>
> > > I Would like to limit the access to a controller function in the same
> > > way as .htaccess would do it with these lines:
> > > Order deny,allow
> > > Deny from all
> > > Allow from 85.127.249.210
>
> > > How can I achieve that?
>
> > > thx
> > > Aurelius
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: limit access to a site?

2009-03-24 Thread Aurelius

Thanks!
One more problem, when it is going live, the Allow from would be a
domain like "service.mydomain.de" and not a IP address, any solutions
for that?

thx
Aurelius

On 24 Mrz., 01:22, Graham Weldon  wrote:
> class AppController extends Controller {
>
>     var $allowedHosts = array('127.0.0.1', '::1', '85.127.249.210');
>     var $accessDeniedRedirect = ... // Define your action to redirect to
> here.
>
>     function beforeFilter() {
>         if (!in_array(env('REMOTE_ADDR'), $this->allowedHosts)) {
>             $this->redirect($this->accessDeniedRedirect);
>             die();
>         }
>     }
>
> }
>
> That would cover it.
> The only thing I have not considered is that you need to allow anyone
> access to the $accessDeniedRedirect address.
> So you will need a check in or around your if statement in the
> beforeFilter there to ensure unrestricted access to whatever you set
> $accessDeniedRedirect is set to.
> But I will leave that for you to sort out. Can't give you all the
> solutions. That would be boring!
>
> Cheers,
> Graham
>
> Aurelius wrote:
> > Hi!
>
> > I Would like to limit the access to a controller function in the same
> > way as .htaccess would do it with these lines:
> > Order deny,allow
> > Deny from all
> > Allow from 85.127.249.210
>
> > How can I achieve that?
>
> > thx
> > Aurelius
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: limit access to a site?

2009-03-23 Thread Miles J

Perhaps take a look at the SecurityComponent.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: limit access to a site?

2009-03-23 Thread Graham Weldon

class AppController extends Controller {

var $allowedHosts = array('127.0.0.1', '::1', '85.127.249.210');
var $accessDeniedRedirect = ... // Define your action to redirect to 
here.

function beforeFilter() {
if (!in_array(env('REMOTE_ADDR'), $this->allowedHosts)) {
$this->redirect($this->accessDeniedRedirect);
die();
}
}

}


That would cover it.
The only thing I have not considered is that you need to allow anyone 
access to the $accessDeniedRedirect address.
So you will need a check in or around your if statement in the 
beforeFilter there to ensure unrestricted access to whatever you set 
$accessDeniedRedirect is set to.
But I will leave that for you to sort out. Can't give you all the 
solutions. That would be boring!

Cheers,
Graham



Aurelius wrote:
> Hi!
>
> I Would like to limit the access to a controller function in the same
> way as .htaccess would do it with these lines:
> Order deny,allow
> Deny from all
> Allow from 85.127.249.210
>
> How can I achieve that?
>
> thx
> Aurelius
> >
>   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



limit access to a site?

2009-03-23 Thread Aurelius

Hi!

I Would like to limit the access to a controller function in the same
way as .htaccess would do it with these lines:
Order deny,allow
Deny from all
Allow from 85.127.249.210

How can I achieve that?

thx
Aurelius
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---