Closed (fixed)
Project:
Diff
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Oct 2013 at 05:30 UTC
Updated:
26 Oct 2013 at 14:50 UTC
This provides a way to compare the main user properties as well as the additional fields on user objects.
It adds a new entity settings local tab.

Two users with a couple of fields (A name and file field).
$account_a = user_load(1);
$account_b = user_load(5);
module_load_include('pages.inc', 'diff');
$header = _diff_default_header(entity_label('user', $account_a), entity_label('user', $account_b));
$rows = diff_entity_body_rows('user', $account_a, $account_b);
$build['diff_table'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
'#attributes' => array('class' => array('diff')),
'#colgroups' => _diff_default_cols(),
'#sticky' => FALSE,
);
print drupal_render($build['diff_table']);
Which outputs:
| admin | test | ||
|---|---|---|---|
| Changes to Username | |||
| - |
admin
|
+ |
test
|
| Changes to E-mail address | |||
| - |
developers@glodigital.com.au
|
+ |
test@example.com
|
| Changes to Status | |||
| - |
Active
|
+ |
Blocked
|
| Changes to Time zone | |||
| - |
Australia/Brisbane: Saturday, October 12, 2013 - 15:24 +1000
|
+ |
Atlantic/Stanley: Saturday, October 12, 2013 - 02:24 -0300
|
| Changes to Password Hash | |||
| - |
$S$DtNMVC8MT0gDA58mTJ9WbFV38XCnSvrosHTCw4p4xneRnbdrIXpz
|
+ |
$S$Dr7m6ex3JDzIPgNYfD8NQEbmSrQ8SiCgFe/RdtiDXychNKEfgscj
|
| Changes to Roles | |||
| + |
test
|
||
| Changes to Name | |||
| - |
test name 2
|
+ |
test test2 test
|
| Changes to test | |||
| + |
File: test.txt; File ID: 2; Displayed
|
||
| Comment | File | Size | Author |
|---|---|---|---|
| diff-user-entity-support.patch | 6.75 KB | alan d. | |
| diff-user-settings.png | 18 KB | alan d. |
Comments
Comment #1
alan d. commentedAdded in c4e7ac8
Comment #2.0
(not verified) commentedAdded separator between code and output