Skip to content

Commit

Permalink
Doc for unlock hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
coudot committed Oct 30, 2024
1 parent 743f7e6 commit 9e92a0a
Showing 1 changed file with 43 additions and 10 deletions.
53 changes: 43 additions & 10 deletions docs/hook.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
Hook
====

Hook feature allows to run a script before or after the password modification.
Hook feature allows to run a script before or after an action:
* Password reset
* Password unlock

The script is called with two parameters: login and new password.
The script must return 0 if no error occured. Any text printed on STDOUT
will be displayed as an error message (see options).

Parameters
----------
Login
-----

Define prehook or posthook script (and enable the feature):
Define which attribute will be used as login in prehook and posthook scripts:

.. code-block:: php
$prehook = "/usr/share/service-desk/prehook.sh";
$posthook = "/usr/share/service-desk/posthook.sh";
$prehook_login = "uid";
$posthook_login = "uid";
Define which attribute will be used as login:
Password reset
--------------

The script is called with two parameters: login and new password.

Define prehook or posthook script (and enable the feature):

.. code-block:: php
$prehook_login = "uid";
$posthook_login = "uid";
$prehook = "/usr/share/service-desk/prehook.sh";
$posthook = "/usr/share/service-desk/posthook.sh";
You can choose to display an error if the script return code is greater
than 0:
Expand Down Expand Up @@ -48,3 +56,28 @@ if it fails, but still try to update password in the directory.
.. code-block:: php
$ignore_prehook_error = true;
Password unlock
---------------

The script is called with one parameter: login.

Define prehook or posthook script (and enable the feature):

.. code-block:: php
$prehook_unlock = "/usr/share/service-desk/prehook_unlock.sh";
$posthook_unlock = "/usr/share/service-desk/posthook_unlock.sh";
To display hook error:

.. code-block:: php
$display_prehook_unlock_error = true;
$display_posthook_unlock_error = true;
To ignore prehook error:

.. code-block:: php
$ignore_prehook_unlock_error = true;

0 comments on commit 9e92a0a

Please sign in to comment.