Welcome Guest, Not a member yet? Register   Sign In
Community Auth inactive users
#1

I added a field o the users table called status, that I want to have 'active' or 'inactive' for the account, and when the user tries to login check the status on the users table.

I have a members controller where the login function is defined, everything is working perfectly I just need a way to deactivate accounts, since I didn't find that functionality built in.

I added a function on the model that return true or false for the status, like $active = $this->members->is_active but I need to pass the id or maybe the email but at what time can I do this?

My Login function:

    public function login()
    {
        // Method should not be directly accessible
        if( $this->uri->uri_string() == 'members/login')
            show_404();

        if( strtolower( $_SERVER['REQUEST_METHOD'] ) == 'post' ) {
            $this->require_min_level(2);
        }

        $this->setup_login_form();

        $this->load->view('login_view');

    }

Thank you for your help and for this great library
Reply
#2

(08-14-2016, 02:44 PM)joearm Wrote: I added a field o the users table called status, that I want to have 'active' or 'inactive' for the account, and when the user tries to login check the status on the users table.

I have a members controller where the login function is defined, everything is working perfectly I just need a way to deactivate accounts, since I didn't find that functionality built in.

I added a function on the model that return true or false for the status, like $active = $this->members->is_active but I need to pass the id or maybe the email but at what time can I do this?

My Login function:

    public function login()
    {
        // Method should not be directly accessible
        if( $this->uri->uri_string() == 'members/login')
            show_404();

        if( strtolower( $_SERVER['REQUEST_METHOD'] ) == 'post' ) {
            $this->require_min_level(2);
        }

        $this->setup_login_form();

        $this->load->view('login_view');

    }

Thank you for your help and for this great library

If you just need to deactivate accounts, there is a "banned" field. See the SQL:


Code:
`banned` enum('0','1') NOT NULL DEFAULT '0',


Community Auth will automatically not allow a banned user to login. Banned = 1.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB