mfyvie
06-21-2007, 09:08 PM
I'm having a bit of trouble.
I'm writing a mod where I'd like to alter a new field in the user table via the edit user page of the admincp.
I added the relevant phrases and then added this to the useradmin_edit_column2 hook:
print_table_break('', $INNERTABLEWIDTH);
print_table_header($vbphrase['ae_header']);
print_yes_no_row($vbphrase['ae_user_exempt_option'], 'user[mloginexempt]', $user['mloginexempt']);
This seems to work fine - it reads the value from the database, however the problem comes when I hit the "save" button. I get the following message:
Fatal error: Field mloginexempt is not defined in $validfields in class vb_datamanager_user in /includes/class_dm.php on line 485
I've looked for somewhere to add this new variable, but so far I can't find it.
I tried adding this to useradmin_edit_start:
$user = array_merge($user, array('mloginexempt' => 0));
But this just had the effect of always reporting this option as "no", regardless of what the database said.
Does anyone know what the missing piece of code might be, and the hook where I should place it?
This could be useful for anyone else who tries to add an additional option to the edit user function of the admincp.
Mark
I'm writing a mod where I'd like to alter a new field in the user table via the edit user page of the admincp.
I added the relevant phrases and then added this to the useradmin_edit_column2 hook:
print_table_break('', $INNERTABLEWIDTH);
print_table_header($vbphrase['ae_header']);
print_yes_no_row($vbphrase['ae_user_exempt_option'], 'user[mloginexempt]', $user['mloginexempt']);
This seems to work fine - it reads the value from the database, however the problem comes when I hit the "save" button. I get the following message:
Fatal error: Field mloginexempt is not defined in $validfields in class vb_datamanager_user in /includes/class_dm.php on line 485
I've looked for somewhere to add this new variable, but so far I can't find it.
I tried adding this to useradmin_edit_start:
$user = array_merge($user, array('mloginexempt' => 0));
But this just had the effect of always reporting this option as "no", regardless of what the database said.
Does anyone know what the missing piece of code might be, and the hook where I should place it?
This could be useful for anyone else who tries to add an additional option to the edit user function of the admincp.
Mark