Welcome Guest, Not a member yet? Register   Sign In
Call to a member function on a non-object
#10

[eluser]Muncken[/eluser]
Hi again.

I have found the root of the problem. It is in my security library. The thing that causes the problem is that it extends the Controller class. Here's Security.php

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Security extends Controller
{
    function is_logged_in($logged_in)
    {
        $error = "<h1>Stop</h1><p>You do not have acces to view this page.<br /><a >Return</a></p>";
        
        if ($logged_in != md5(1))
        {
            die($error);
        }
        else
        {
            $segment = $this->uri->segment(1);
            $priv = $this->session->userdata("$segment");
            
            if($priv != 1)
            {
                die($error);
            }
        }
    }
}

If I remove the "extends Controller" part, I get rid of the error, but then I can't use $this-> to access uri- and session-library, which is neccessary for the library to work out. How can I handle this?


Messages In This Thread
Call to a member function on a non-object - by El Forum - 01-13-2011, 09:10 AM
Call to a member function on a non-object - by El Forum - 01-13-2011, 09:22 AM
Call to a member function on a non-object - by El Forum - 01-13-2011, 11:37 AM
Call to a member function on a non-object - by El Forum - 01-13-2011, 11:38 AM
Call to a member function on a non-object - by El Forum - 01-13-2011, 11:39 AM
Call to a member function on a non-object - by El Forum - 01-13-2011, 12:12 PM
Call to a member function on a non-object - by El Forum - 01-13-2011, 12:21 PM
Call to a member function on a non-object - by El Forum - 01-13-2011, 12:50 PM
Call to a member function on a non-object - by El Forum - 01-13-2011, 02:15 PM
Call to a member function on a non-object - by El Forum - 01-13-2011, 02:30 PM
Call to a member function on a non-object - by El Forum - 01-13-2011, 02:54 PM
Call to a member function on a non-object - by El Forum - 01-13-2011, 02:55 PM
Call to a member function on a non-object - by El Forum - 05-26-2011, 12:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB