|
284 | 284 | if ($new || (!$new && $_SESSION['overwrite'] == 'yes')) { |
285 | 285 | $query = ''; |
286 | 286 | ++$count['dataupdate']; |
287 | | - $old_data = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d', $tables['user'], |
| 287 | + $old_data = Sql_Fetch_Assoc_Query(sprintf('select * from %s where id = %d', $tables['user'], |
288 | 288 | $userid)); |
289 | 289 | $old_data = array_merge($old_data, getUserAttributeValues('', $userid)); |
290 | 290 | foreach ($user['systemvalues'] as $column => $value) { |
|
397 | 397 | } |
398 | 398 | } |
399 | 399 | } |
400 | | - $current_data = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d', $tables['user'], |
| 400 | + $current_data = Sql_Fetch_Assoc_Query(sprintf('select * from %s where id = %d', $tables['user'], |
401 | 401 | $userid)); |
402 | 402 | $current_data = array_merge($current_data, getUserAttributeValues('', $userid)); |
403 | 403 | $information_changed = 0; |
| 404 | + |
404 | 405 | foreach ($current_data as $key => $val) { |
405 | | - if (!is_numeric($key)) { |
406 | | - if (isset($old_data[$key]) && $old_data[$key] != $val && $old_data[$key] && $key != 'password' && $key != 'modified') { |
407 | | - $information_changed = 1; |
408 | | - $history_entry .= "$key = $val\n*changed* from $old_data[$key]\n"; |
409 | | - } |
| 406 | + if ($key == 'password' || $key == 'modified') { |
| 407 | + continue; |
| 408 | + } |
| 409 | + $old_value = isset($old_data[$key]) ? $old_data[$key] : ''; |
| 410 | + |
| 411 | + if ($old_value != $val) { |
| 412 | + $information_changed = 1; |
| 413 | + $history_entry .= "$key = $val\n*changed* from $old_value\n"; |
410 | 414 | } |
411 | 415 | } |
412 | 416 | if (!$information_changed) { |
|
0 commit comments