LLMS_Controller_Certificates::maybe_handle_reporting_actions()
Handle certificate form actions
Description Description
Manages frontend actions to download and manage certificate sharing settings and reporting (admin) actions to download and delete.
The method name is a misnomer as this method handles actions on reporting screens as well as on the site’s frontend when actually viewing a certificate
Return Return
(void)
Source Source
File: includes/controllers/class.llms.controller.certificates.php
public function maybe_handle_reporting_actions() {
if ( ! llms_verify_nonce( '_llms_cert_actions_nonce', 'llms-cert-actions' ) ) {
return;
}
$cert_id = absint( llms_filter_input( INPUT_POST, 'certificate_id', FILTER_SANITIZE_NUMBER_INT ) );
if ( isset( $_POST['llms_generate_cert'] ) ) {
$this->download( $cert_id );
} elseif ( isset( $_POST['llms_delete_cert'] ) ) {
$this->delete( $cert_id );
} elseif ( isset( $_POST['llms_enable_cert_sharing'] ) ) {
$this->change_sharing_settings( $cert_id, (bool) $_POST['llms_enable_cert_sharing'] );
}
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.9.0 | Stop using deprecated FILTER_SANITIZE_STRING. |
| 4.5.0 | Add handler for changing certificate sharing settings. |
| 3.35.0 | Sanitize $_POST data. |
| 3.18.0 | Introduced. |