|
dolibarr
x.y.z
|
Class to manage Blocked Log. More...
Public Member Functions | |
| __construct (DoliDB $db) | |
| Constructor. More... | |
| loadTrackedEvents () | |
| Load list of tracked events into $this->trackedevents. More... | |
| getObjectLink () | |
| Try to retrieve source object (it it still exists). More... | |
| getUser () | |
| setObjectData (&$object, $action, $amounts, $fuser=null) | |
| Populate properties of log from object data. More... | |
| fetch ($id) | |
| Get object from database. More... | |
| dolEncodeBlockedData ($data, $mode=0) | |
| Encode data. More... | |
| dolDecodeBlockedData ($data, $mode=0) | |
| Decode data. More... | |
| setCertified () | |
| Set block certified by authority. More... | |
| create ($user, $forcesignature='') | |
| Create blocked log in database. More... | |
| checkSignature ($previoushash='', $returnarray=0) | |
| Check if current signature still correct compared to the value in chain. More... | |
| getPreviousHash ($withlock=0, $beforeid=0) | |
| Get previous signature/hash in chain. More... | |
| getLog ($element, $fk_object, $limit=0, $sortfield='', $sortorder='', $search_fk_user=-1, $search_start=-1, $search_end=-1, $search_ref='', $search_amount='', $search_code='') | |
| Return array of log objects (with criterias) More... | |
| getSignature () | |
| Return the signature (hash) of the "genesis-block" (Block 0). More... | |
| alreadyUsed ($ignoresystem=0) | |
| Check if module was already used or not for at least one recording. More... | |
Private Member Functions | |
| buildKeyForSignature () | |
| Return a string for signature. More... | |
Class to manage Blocked Log.
Definition at line 26 of file blockedlog.class.php.
| BlockedLog::__construct | ( | DoliDB | $db | ) |
Constructor.
Definition at line 126 of file blockedlog.class.php.
| BlockedLog::alreadyUsed | ( | $ignoresystem = 0 | ) |
Check if module was already used or not for at least one recording.
| int | $ignoresystem | Ignore system events for the test |
Definition at line 1195 of file blockedlog.class.php.
|
private |
Return a string for signature.
Note: rowid of line not included as it is not a business data and this allow to make backup of a year and restore it into another database with different id wihtout comprimising checksums
Definition at line 1020 of file blockedlog.class.php.
Referenced by checkSignature().
| BlockedLog::checkSignature | ( | $previoushash = '', |
|
$returnarray = 0 |
|||
| ) |
Check if current signature still correct compared to the value in chain.
| string | $previoushash | If previous signature hash is known, we can provide it to avoid to make a search of it in database. |
| int | $returnarray | 1=Return array of details, 2=Return array of details including keyforsignature, 0=Boolean |
Definition at line 982 of file blockedlog.class.php.
References buildKeyForSignature(), dol_hash(), and getPreviousHash().
| BlockedLog::create | ( | $user, | |
$forcesignature = '' |
|||
| ) |
Create blocked log in database.
| User | $user | Object user that create |
| int | $forcesignature | Force signature (for example '0000000000' when we disabled the module) |
Definition at line 855 of file blockedlog.class.php.
| BlockedLog::dolDecodeBlockedData | ( | $data, | |
$mode = 0 |
|||
| ) |
Decode data.
| string | $data | Data to unserialize |
| string | $mode | 0=unserialize, 1=json_decode |
Definition at line 819 of file blockedlog.class.php.
| BlockedLog::dolEncodeBlockedData | ( | $data, | |
$mode = 0 |
|||
| ) |
Encode data.
| string | $data | Data to serialize |
| string | $mode | 0=serialize, 1=json_encode |
Definition at line 799 of file blockedlog.class.php.
| BlockedLog::fetch | ( | $id | ) |
Get object from database.
| int | $id | Id of object to load |
Definition at line 734 of file blockedlog.class.php.
| BlockedLog::getLog | ( | $element, | |
| $fk_object, | |||
$limit = 0, |
|||
$sortfield = '', |
|||
$sortorder = '', |
|||
$search_fk_user = -1, |
|||
$search_start = -1, |
|||
$search_end = -1, |
|||
$search_ref = '', |
|||
$search_amount = '', |
|||
$search_code = '' |
|||
| ) |
Return array of log objects (with criterias)
| string | $element | element to search |
| int | $fk_object | id of object to search |
| int | $limit | max number of element, 0 for all |
| string | $sortfield | sort field |
| string | $sortorder | sort order |
| int | $search_fk_user | id of user(s) |
| int | $search_start | start time limit |
| int | $search_end | end time limit |
| string | $search_ref | search ref |
| string | $search_amount | search amount |
| string | $search_code | search code |
Definition at line 1087 of file blockedlog.class.php.
| BlockedLog::getObjectLink | ( | ) |
Try to retrieve source object (it it still exists).
Definition at line 223 of file blockedlog.class.php.
| BlockedLog::getPreviousHash | ( | $withlock = 0, |
|
$beforeid = 0 |
|||
| ) |
Get previous signature/hash in chain.
| int | $withlock | 1=With a lock |
| int | $beforeid | ID of a record |
Definition at line 1038 of file blockedlog.class.php.
Referenced by checkSignature().
| BlockedLog::getSignature | ( | ) |
Return the signature (hash) of the "genesis-block" (Block 0).
Definition at line 1169 of file blockedlog.class.php.
| BlockedLog::getUser | ( | ) |
| BlockedLog::loadTrackedEvents | ( | ) |
Load list of tracked events into $this->trackedevents.
Definition at line 137 of file blockedlog.class.php.
| BlockedLog::setCertified | ( | ) |
Set block certified by authority.
Definition at line 837 of file blockedlog.class.php.
| BlockedLog::setObjectData | ( | & | $object, |
| $action, | |||
| $amounts, | |||
$fuser = null |
|||
| ) |
Populate properties of log from object data.
| Object | $object | object to store |
| string | $action | action |
| string | $amounts | amounts |
| User | $fuser | User object (forced) |
Definition at line 366 of file blockedlog.class.php.