CodeIgniter Forums
CommunityAuth and My_Model - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7)
+--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13)
+--- Thread: CommunityAuth and My_Model (/showthread.php?tid=69744)



CommunityAuth and My_Model - chrismartinez99 - 01-11-2018

I'm interested in using CommunityAuth, but am trying to figure out how it will integrate with MY_Model (https://github.com/avenirer/CodeIgniter-MY_Model) since CommunityAuth has a similarly named file in the same directory.

Has anyone used both add-ins? IF so, how?

Thank you.


RE: CommunityAuth and My_Model - skunkbad - 01-11-2018

Community Auth's MY_Model.php currently has:

Properties

  1. $acl
Methods

  1. acl_query
  2. acl_permits
  3. is_role
  4. db_table
Take these properties and methods and put them in your existing MY_Model.php file. That's all you need to do.

Also note, if you're not going to use CodeIgniter's ACL feature, you wouldn't need the $acl property and the first two methods.


RE: CommunityAuth and My_Model - chrismartinez99 - 01-12-2018

(01-11-2018, 11:22 PM)skunkbad Wrote: Community Auth's MY_Model.php currently has:

Properties

  1. $acl
Methods

  1. acl_query
  2. acl_permits
  3. is_role
  4. db_table
Take these properties and methods and put them in your existing MY_Model.php file. That's all you need to do.

Also note, if you're not going to use CodeIgniter's ACL feature, you wouldn't need the $acl property and the first two methods.

Sounds simple enough. Thanks!!


RE: CommunityAuth and My_Model - chrismartinez99 - 01-14-2018

(01-12-2018, 07:15 AM)chrismartinez99 Wrote:
(01-11-2018, 11:22 PM)skunkbad Wrote: Community Auth's MY_Model.php currently has:

Properties

  1. $acl
Methods

  1. acl_query
  2. acl_permits
  3. is_role
  4. db_table
Take these properties and methods and put them in your existing MY_Model.php file. That's all you need to do.

Also note, if you're not going to use CodeIgniter's ACL feature, you wouldn't need the $acl property and the first two methods.

Sounds simple enough. Thanks!!

Hi, I'm receiving this error at /examples/create_user:

Code:
A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant LOGIN_PAGE - assumed 'LOGIN_PAGE'
Filename: config/routes.php
Line Number: 56
Backtrace:
File: /Users/chrismartinez/www/www.nfinitepursuit.com/public_html/booking/application/config/routes.php
Line: 56
Function: _error_handler
File: /Users/chrismartinez/www/www.nfinitepursuit.com/public_html/booking/index.php
Line: 314
Function: require_once

Any ideas?


RE: CommunityAuth and My_Model - chrismartinez99 - 01-14-2018

Got that fixed, but now I get this error:

Message: Call to undefined method Examples::is_logged_in()
Filename: /Users/chrismartinez/www/www.nfinitepursuit.com/public_html/booking/application/controllers/Examples.php
Line Number: 201


RE: CommunityAuth and My_Model - skunkbad - 01-14-2018

Read: https://forum.codeigniter.com/thread-69389.html?highlight=is_logged_in

Examples controller extends MY_Controller, which should extend Auth_Controller. If this isn't the case, then you need to fix that. So if you already had a MY_Controller, you need to have it extend Auth_Controller. See the MY_Controller that ships with Community Auth for the details.


RE: CommunityAuth and My_Model - chrismartinez99 - 01-15-2018

Thanks for the help!! I got it working!