Welcome Guest, Not a member yet? Register   Sign In
MeNeedz Auth

[eluser]davidbehler[/eluser]
@Mat-Moo
What type is your group_id column of? If your standard group is "user", then your group_id has to be varchar and not integer. If it's integer an error/warning occures and 0 is set as the value for the column.

@splufdaddy:
You are absolutly right, that's a bug. I have fixed it and uploaded the new version.

@abmcr:
Is the user logged in?
What value have you set for use_database_multi_user_groups?

[eluser]Mat-Moo[/eluser]
Hi Waldmeister, I just set it as the example. Not too worried at the moment though as it's not in use yet.... However I have hit on one minor issue. My key field/login field is the email address. I have a form where the users can update there details, and one option is to change your email address! When this happens the Auth library can no longer find this user and it all goes wrong. Which way should I update the primary key? You have one for password, maybe you need a new function for primary key?

[eluser]davidbehler[/eluser]
Is the email address your primary key?

In general all you have to do is setting the input_config and database_config according to your setup.

Updating the email address should not be a problem.
The login function searches the user table for an entry where user_identifier_column from the database_config equals the identifier field in the input_config. So after updating the user_identifer_column, in your case the email address, the user has to use the new email address to login.

[eluser]Mat-Moo[/eluser]
Primary key is record_id (auto inc), but "user_identifier_column" is email address.

If the user is already logged in to update their details, then the current login (email) is stored in a stored in a session, so once you update it, when auth nexts "get_user" the database record will not be be found.

[eluser]davidbehler[/eluser]
Ah, ok.
Now I get your problem.

I have updated the library. I now no longer store the use_identifier but the user_primary_key. That should solve your problem.

[eluser]meteor[/eluser]
Not bad library ... Wink
Thx.
As a side note ... It would be great to remove foreign keys from the tables ... and swap them for the join tables ... Wink
As mentioned , it is just a sidenote ... The most important conclusion is that Your lib is working ... and config is customizable, flexible , in general passable Wink

Good job man ...
regards

[eluser]davidbehler[/eluser]
Quote:It would be great to remove foreign keys from the tables ... and swap them for the join tables ...

Could you elaborate on that? Cause I don't really get what you are talking about Big Grin

[eluser]meteor[/eluser]
Well, I like when database tables are aware only themeselves(They do not contain any something_id columns) ... This is more elegant solution, it offers more flexibility and is easier to use in many cases...
I like ActiveRecord and the way it handles relations ... but I like DataMapper even more ...
this is just matter of preferences but when things are getting complex it is better to have tables which have join tables between them ... All this resembles situation with functions ... If you push too much code into a function , and it does more then one thing , its usage will be more limited in comparison to a function which deos exactly one thing ...

Coming back to to Your library ... It works .. this is the most important thing ... but when you try to use it in complex projects when a lot of queries, which require some joins on the tables, are carried out things are getting really complex ... So, as I said ... This library works ... now I think is time for refining it and decoupling certain parts which are coupled now(because of the default database design ) ... so that it is easy to use it not only with activeRecord like tables but also with more elaborate database schemas Smile

You know , people are never happy .. Wink)

best regards

regards

[eluser]davidbehler[/eluser]
Just set
Code:
$config['use_database_user_groups'] = TRUE;
$config['use_database_multi_user_groups'] = TRUE;
, now you can delete the group foreign key column in the user table and only use the member_table => you have your extra table that joins user and user group. By inserting only one entry per user you have the same behaviour as having the group foreign key column in your user table.

Is this what you are talking about?

[eluser]meteor[/eluser]
yup ... I have already changed some paremeters of your library to work with join tables. Any way thanks for the extra explanation. I do appreciate effort you have put in preparation of the code ... your commitment and ... very good documentation...

regards




Theme © iAndrew 2016 - Forum software by © MyBB