Giter VIP home page Giter VIP logo

Comments (11)

REJack avatar REJack commented on June 2, 2024 1

Where did you placed this lines, inside the Aauth Class?

function is_admin()
{
    return is_member('admin');
}

If you placed this inside Aauth Class, try this

public function is_admin()
{
    return $this->is_member('admin');
}

also you can add this for a custom function

public function is_customer()
{
    return $this->is_member('customer');
}

from codeigniter-aauth.

REJack avatar REJack commented on June 2, 2024

You mean is_member(), you can check with this functions if an user is member of a desired group, e.g. is_member('customer')

from codeigniter-aauth.

ikramkhizar avatar ikramkhizar commented on June 2, 2024

i have to check for a group like admin is a group and customer is also a group so i want to check like this aauth->is_customer? is it possible?

from codeigniter-aauth.

emreakay avatar emreakay commented on June 2, 2024

Hi @ikramkhizar
actually you can extend and create a function inside your your controller file (such as My_Controller) and create functions that u want.

from codeigniter-aauth.

ikramkhizar avatar ikramkhizar commented on June 2, 2024

i tried to extend is_admin() function in aauth file but it won't work.

from codeigniter-aauth.

ikramkhizar avatar ikramkhizar commented on June 2, 2024

can you please guide me properly in detail?

from codeigniter-aauth.

yahyaerturan avatar yahyaerturan commented on June 2, 2024
function is_admin()
{
    return is_member('admin');
}

Something like this, I presume.

from codeigniter-aauth.

ikramkhizar avatar ikramkhizar commented on June 2, 2024

I have tried this but it won't work.

from codeigniter-aauth.

emreakay avatar emreakay commented on June 2, 2024

Where did you placed this lines, inside the Aauth Class?

function is_admin()
{
    return is_member('admin');
}

If you placed this inside Aauth Class, try this

public function is_admin()
{
    return $this->is_member('admin');
}

also you can add this for a custom function

public function is_customer()
{
    return $this->is_member('customer');
}

it should have worked.

from codeigniter-aauth.

ikramkhizar avatar ikramkhizar commented on June 2, 2024

could i have to do this in application->libraries->aauth ?

from codeigniter-aauth.

REJack avatar REJack commented on June 2, 2024

should be yes, but you can create a helper for this too ^^

the content for the helper could look like this:

function is_admin()
{
   $CII =& get_instance();
   $CII->load->library('aauth');
    return $CII->aauth->is_member('admin');
}
function is_customer()
{
   $CII =& get_instance();
   $CII->load->library('aauth');
    return $CII->aauth->is_member('customer');
}

from codeigniter-aauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.