Gossamer Forum
Quote Reply
Users Plug In help
Hi

Several of my 'Users Plug in' users have experinced a trouble when they upgraded to the new Links SQL version..

Upon submission of the modified user information form they get:

Error: Failed to execute query: 'SELECT Newsletter,Password,user_header,Name,d,Username,Email,ReceiveMail FROM links_Users WHERE Username = ? ' Reason: Unknown column 'd' in 'field list'

I have not been able to figure this out..

The forms are the same, all the plug in hooks are still there..Crazy

Any ideas?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Users Plug In help In reply to
You need to make sure you only pass fields to the update, that are present in the User table. The error you report probably occurs if somebody uses your plugin in dynamic mode. A quick solution (which is not the most secure one) is to delete a few possible inputs, such as
Code:
delete $args->{d};
delete $args->{s};
delete $args->{t};
A better solution would be to get a list of fields in the Users table, assign the user input to them, delete the dangerous ones (such as Username, Status, etc), and then update the desired record. You'll need
Code:
my $cols = $DB->table('Users')->{schema}->{cols};
where $cols is a hashref whose keys are the field names of the Users table.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Users Plug In help In reply to
Thanks Ivan
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory