Skip to main content
added 28 characters in body
Source Link
wildpeaks
  • 919
  • 10
  • 17

Your module could intercept the value of "Default 403 (access denied) page" which is modified by the page "Administer > Site configuration > Error reporting":

  1. In hook_enable, using variable_get/variable_set, copy the existing value to a secondary variable and replace the variable by your own path (which you registered using hook_menu).

  2. alter the "Error reporting" form using hook_form_FORM_ID_alter to read from/write to the secondary variable

  3. If you want to be completely invisible to the user, your page callback to could call drupal_goto( the_value_of_the_secondary_variable ).

  4. In hook_disable, restore the value from the secondary variable.


And that's it, your module gets notified in a clean way (and invisible to the user) when "Access denied" is triggered.

Your module could intercept the value of "Default 403 (access denied) page" which is modified by the page "Administer > Site configuration > Error reporting":

  1. In hook_enable, using variable_get/variable_set, copy the existing value to a secondary variable and replace the variable by your own path (which you registered using hook_menu).

  2. alter the "Error reporting" form using hook_form_FORM_ID_alter to read from/write to the secondary variable

  3. If you want to be completely invisible to the user, your page callback to could call drupal_goto( the_value_of_the_secondary_variable ).

  4. In hook_disable, restore the value from the secondary variable.


And that's it, your module gets notified in a clean way when "Access denied" is triggered.

Your module could intercept the value of "Default 403 (access denied) page" which is modified by the page "Administer > Site configuration > Error reporting":

  1. In hook_enable, using variable_get/variable_set, copy the existing value to a secondary variable and replace the variable by your own path (which you registered using hook_menu).

  2. alter the "Error reporting" form using hook_form_FORM_ID_alter to read from/write to the secondary variable

  3. If you want to be completely invisible to the user, your page callback to could call drupal_goto( the_value_of_the_secondary_variable ).

  4. In hook_disable, restore the value from the secondary variable.


And that's it, your module gets notified in a clean way (and invisible to the user) when "Access denied" is triggered.

added 122 characters in body; deleted 1 characters in body; added 79 characters in body; added 32 characters in body; added 4 characters in body; deleted 10 characters in body
Source Link
wildpeaks
  • 919
  • 10
  • 17

Otherwise yourYour module could intercept the value of "Default 403 (access denied) page" which is modified by the page "Administer > Site configuration > Error reporting":

  1. when the module is installedIn hook_enable, using variable_get/variable_set, copy the existing value to a secondary variable and replace the variable by your own path (which you registered using hook_menu).

  2. alter the "Error reporting" form using hook_form_FORM_ID_alter to read from/write to the secondary variable

  3. whenIf you want to be completely invisible to the module is uninstalleduser, your page callback to could call drupal_goto( the_value_of_the_secondary_variable ).

  4. In hook_disable, restore the value from the secondary variable.


And that's it, your module gets notified in a clean wayin a clean way when "Access denied" is triggered.

Otherwise your module could intercept the value of "Default 403 (access denied) page" which is modified by the page "Administer > Site configuration > Error reporting":

  1. when the module is installed, copy the existing value to a secondary variable and replace the variable by your own path

  2. alter the "Error reporting" form to read from/write to the secondary variable

  3. when the module is uninstalled, restore the value from the secondary variable.


And that's it, your module gets notified in a clean way when "Access denied" is triggered.

Your module could intercept the value of "Default 403 (access denied) page" which is modified by the page "Administer > Site configuration > Error reporting":

  1. In hook_enable, using variable_get/variable_set, copy the existing value to a secondary variable and replace the variable by your own path (which you registered using hook_menu).

  2. alter the "Error reporting" form using hook_form_FORM_ID_alter to read from/write to the secondary variable

  3. If you want to be completely invisible to the user, your page callback to could call drupal_goto( the_value_of_the_secondary_variable ).

  4. In hook_disable, restore the value from the secondary variable.


And that's it, your module gets notified in a clean way when "Access denied" is triggered.

Source Link
wildpeaks
  • 919
  • 10
  • 17

Otherwise your module could intercept the value of "Default 403 (access denied) page" which is modified by the page "Administer > Site configuration > Error reporting":

  1. when the module is installed, copy the existing value to a secondary variable and replace the variable by your own path

  2. alter the "Error reporting" form to read from/write to the secondary variable

  3. when the module is uninstalled, restore the value from the secondary variable.


And that's it, your module gets notified in a clean way when "Access denied" is triggered.