Ticket #575 (closed Bug: wontfix)

Opened 3 months ago

Last modified 2 months ago

Auth Model issue

Reported by: mwells Assigned to: - No owner -
Priority: minor Milestone: 2.1.2
Component: Modules:Auth Version: SVN HEAD
Keywords: Cc:
SVN Revision (if applicable):

Description

I have been creating a project where I am extending the Auth module. I came across a possible problem you may (or may not) want to amend - thought I would post it up incase!

The username_exists has a hard coded reference to the table name in it, which karks if you extend the Model, currently the function is as below;

public function username_exists($name) {

return (bool) self::$db->where('username', $name)->count_records('users');

}

This could be amended to;

public function username_exists($name) {

return (bool) self::$db->where('username', $name)->count_records(inflector::plural($this->class));

}

Attachments

diff.patch (402 bytes) - added by mwells on 04/27/08 12:47:15.
Patch file for potential fix

Change History

04/27/08 12:47:15 changed by mwells

  • attachment diff.patch added.

Patch file for potential fix

05/28/08 18:27:04 changed by Shadowhand

  • status changed from new to closed.
  • resolution set to wontfix.

The User_Model can be overloaded or replaced, and 99% of the time, "users" will be the correct table name.