FusionDirectory
|
Static Public Member Functions | |
static | add ($object, string $user=NULL) |
Add a lock for object(s) More... | |
static | deleteByObject ($object) |
Remove a lock for object(s) More... | |
static | deleteByUser (string $userdn) |
Remove all locks owned by a specific userdn. More... | |
static | get ($objects, bool $allow_readonly=FALSE) |
Get locks for objects. More... | |
static | addOrFail ($object, string $user=NULL, int $retries=10) |
Add a lock for object(s) or fail. More... | |
static | genLockedMessage (array $locks, bool $allowReadonly=FALSE, string $action=NULL) |
Generate a lock message. More... | |
Definition at line 22 of file class_Lock.inc.
|
static |
Add a lock for object(s)
Adds a lock by the specified user for one or multiple objects. If a lock for that object already exists from another user, an error is triggered.
array | $object | The object or array of objects to lock |
string | $user | The user who shall own the lock |
Definition at line 47 of file class_Lock.inc.
References get_ou(), session\get_ref(), htmlescape(), session\is_set(), and session\set().
Referenced by addOrFail(), management\editEntry(), and config\set_current().
|
static |
Add a lock for object(s) or fail.
Adds a lock by the specified user for one ore multiple objects. If the lock for that object already exists, waits a bit and retry. If a lock cannot be set, throws.
array | string | $object | The object or array of objects to lock |
string | $user | The user who shall own the lock |
int | $retries | how many times we can retry (waiting a second each time) |
Definition at line 294 of file class_Lock.inc.
Referenced by templateHandling\listFields().
|
static |
Remove a lock for object(s)
Remove a lock for object(s)
mixed | $object | object or array of objects for which a lock shall be removed |
Definition at line 135 of file class_Lock.inc.
References get_ou(), session\get_ref(), and session\is_set().
Referenced by templateHandling\listFields(), management\removeLocks(), and config\set_current().
|
static |
Remove all locks owned by a specific userdn.
For a given userdn remove all existing locks. This is usually called on logout.
string | $userdn | the subject whose locks shall be deleted |
Definition at line 185 of file class_Lock.inc.
References get_ou().
|
static |
Generate a lock message.
This message shows a warning to the user, that a certain object is locked and presents some choices how the user can proceed. By default this is 'Cancel' or 'Edit anyway', but depending on the function call its possible to allow readonly access, too.
Example usage:
string | $locks | the locks as returned by Lock::get |
boolean | $allowReadonly | TRUE if readonly access should be permitted, FALSE if not (default). |
string | $action | Label of the action button, "Edit anyway" by default. Will be escaped. |
Definition at line 331 of file class_Lock.inc.
References session\get(), session\is_set(), and session\set().
Referenced by management\editEntry().
|
static |
Get locks for objects.
mixed | $objects | Array of dns for which a lock will be searched or dn of a single object |
boolean | $allow_readonly | TRUE if readonly access should be permitted, FALSE if not (default). |
Definition at line 211 of file class_Lock.inc.
References get_ou().
Referenced by addOrFail(), and management\editEntry().