hi,
help me please
https://imgur.com/tmTRG7p
function student_form_before_insert(&$data, $memberInfo, &$args) {
if( $memberInfo['group']=='guest'){
Update membership_userpermission => insert=0, update=1 where username =$memberInfo['username'] for student_form table;
return TRUE;}}
I think I'll need to create userpermission first.
I have not enough knowledge coding
can u help me please
user permission auto change before insert
Re: user permission auto change before insert
sry for wrong color font
i'm so idiot
i'm so idiot
Re: user permission auto change before insert
you can try
But I'm not sure you need to set it in the before function. I would rather put it in the after_insert.
Code: Select all
$table = "student_form";
$sql = "INSERT INTO `membership_userpermissions`(`memberID`, `tableName`, `allowInsert`, `allowView`, `allowEdit`, `allowDelete`) VALUES ('" . $memberInfo['username'] . "', '" . $table . "', '0', '1', '1', '1')";
sqlvalue($sql);
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: user permission auto change before insert
It's work.
i used it in the after_insert.
Thank you so much kind Sir
i used it in the after_insert.
Thank you so much kind Sir