Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Functions for Provisioning Modules #51

Closed
ghost opened this issue Jun 23, 2017 · 1 comment
Closed

Custom Functions for Provisioning Modules #51

ghost opened this issue Jun 23, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 23, 2017

I wroted a Provisioning Module called license and it works well. But i am confused with Custom Functions.
For example, i wroted this:

function license_reset($vars){
    file_put_contents('/homw/wwwroot/leotome.org/a.txt','a');
    die();
}

and the TPL file is like this:

                    <form method="post" action="clientarea.php?action=productdetails">
                        <input type="hidden" name="id" value="{$serviceid}" />
                        <input type="hidden" name="modop" value="custom" />
                        <input type="hidden" name="a" value="reset" />
                        <input class="btn btn-warning btn-xs" type="submit" value="Reset License" />
                    </form>

But once i click that button, i only get the page refreshed.
How can i deal with that?

@mattpugh
Copy link
Member

mattpugh commented Jul 4, 2017

Please ensure you have added the custom function 'reset' to the list of functions that a client is allowed to invoke. Please refer to the _ClientAreaCustomButtonArray function inside the Sample Provisioning Module for an example of how to do this:

https://github.com/WHMCS/sample-provisioning-module/blob/master/modules/servers/provisioningmodule/provisioningmodule.php#L443

WHMCSPeter pushed a commit that referenced this issue Feb 21, 2022
…EN/developerdocscontent:bugfix/MODULE-7519-update-mail-provider-developer-docs-to-provide-functional-example to master

* commit '3d94fc8cb4e26c4f76866f4a7ca7aa8b4726437b':
  Update Mail Provider Docs to provide a functional example MODULE-7519 * Added a functional example for mail providers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants