Welcome Guest, Not a member yet? Register   Sign In
Do I have the right idea with this?
#1

[eluser]Kinsbane[/eluser]
Trying to make my password-protected part of my site let my Google Mini search appliance through so it can index the content so the people with a username and password can search for things. I'm trying with the code below, but it's not working - I put in my IP and it still asks me to login. Should I be using $this->input->ip_address() instead?

Code:
if($_SERVER['REMOTE_ADDR'] !== 'x.x.x.x'){
            if(!$this->session->userdata('session_id') || !$this->session->userdata('user_id'))
            {
                
                    $this->session->set_flashdata('message', 'Your session has expired. Please log in again.');
                    redirect('');
                
                
            }
            $this->users_name = $this->session->userdata('firstname').' '.$this->session->userdata('lastname');
        }

Just want my search appliance to be able to get through, but I don't think I'm doing this right. Thanks for the help!
#2

[eluser]@rno[/eluser]
It seems to me that the session variables firstname and lastname aren't even there when you bypass the login this way, so you might want to set the correct session variables when the search engine comes by.

Good luck
Arno
#3

[eluser]Kinsbane[/eluser]
Okay, so I've been working on this problem for a while now, and I just can't seem to figure anything out.

So, I can't reliably detect when the Google Mini is accessing the protected part of the site, because the web server is behind a firewall, and the IP addresses of the sessions table I am storing the sessions all say the same IP address.

So, I found out from Google Groups that I can actually pass Cookie information through the headers I can setup with the Google mini itself. The problem I am having now is, where do I set all of this up so it happens almost before anything else? Should I make modified methods in the Session libary? Should I use hooks? I need to give the Google Mini this cookie information so the system can recognize it as being valid, as well as giving it a far-away expiration date.

I just don't know where to do it. (system-level or app-level)
#4

[eluser]Kinsbane[/eluser]
Also, got some updated info.

The Google Mini does not sit behind the firewall like the webserver does. And, apparently, the firewall strips out any forwarded IP address info - so the only IP that the webserver finds and is able to record is the firewall's IP address. Unfortunately, there's no way to adjust the firewall to leave in that forwarded IP information in the headers, nor can it be configured to ignore certain IP addresses.

...and, after looking through other data in other tables that records IP addresses, they, too, now have the firewall's IP address.
#5

[eluser]@rno[/eluser]
Hi,

Seems like your firewall is acting as a proxy. I'd check the config of the firewall to see how you can pass through the originating ip address.

Arno
#6

[eluser]Jondolar[/eluser]
If you can configure the appliance with a static cookie, then you can just reference the cookie in your code in the same location that you were trying to reference the server IP address.

if ($_COOKIE['mygooglecookie'] != 'secretcode'){...

Good luck.




Theme © iAndrew 2016 - Forum software by © MyBB