Set demande_our to username if blank
This commit is contained in:
parent
05c0b9a1af
commit
dcc822d9ac
@ -117,6 +117,11 @@ if($_POST['btnprocess'] && $isAdmin) {
|
|||||||
// Escape string, mostly in case of quotes
|
// Escape string, mostly in case of quotes
|
||||||
$d = $mysqli->real_escape_string(serialize($_POST));
|
$d = $mysqli->real_escape_string(serialize($_POST));
|
||||||
if(!$aid) {
|
if(!$aid) {
|
||||||
|
// Make sure we set the demande_our value to current user if blank
|
||||||
|
// This would happen upon submission of a new record by non-admin person
|
||||||
|
if($d['demande_pour']=='') {
|
||||||
|
$d['demande_pour'] = $username;
|
||||||
|
}
|
||||||
$query = "INSERT INTO submissions (uid, status, name, created, formdata,modified) values('$userid',$status,'$username',null,'".$d."',NOW())";
|
$query = "INSERT INTO submissions (uid, status, name, created, formdata,modified) values('$userid',$status,'$username',null,'".$d."',NOW())";
|
||||||
syslog(LOG_INFO, "Create entry by uid: $userid / $uname from: {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})");
|
syslog(LOG_INFO, "Create entry by uid: $userid / $uname from: {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user