Hi!
First, thanks to all Dokuwiki community members! I'm evaluating Dokuwiki in order to respond to several use case, and it stick with almost everything!
I would like to use Bureaucracy plugin to allow some users to perform basic tasks based on informations filled in forms. The idea is to use informations provided by user as parameter for a custom php script.
I tried to use the exemple in the Bureaucracy help (
https://www.dokuwiki.org/plugin:bureaucracy#script_mode) without success ; My first objective is that users fill the following form, and the PHP page called by the plugin (example.php) simply write result in a file:
Code in form:
<form>
action script example.php
textbox "Your name"
textbox "Your department"
submit "Display it"
</form>
Could you tell me what the conf/plugin/bureaucracy/example.php page need to content for allow me to use "Your name" and "Your department" as php variable?
Can i send the "your name" and "Your department" as parameters to the php page directly in the form ? ex :
<form>
action script example.php @@You_name@@ @@your_department@@
textbox "Your name"
textbox "Your department"
submit "Display it"
</form>
This is really in order to understand how it works before trying to use script mode to performs other tasks (AD User creation, SCCM application creation, create directory structure in a filer etc...).
Ideally, i would like to know how to use fields as follow in the example.php file:
<?php
if(isset($_POST['Your_Name']) && isset($_POST['Your_Department'])) {
$data = $_POST['Your_Name'] . '-' . $_POST['Your_Department'] . "\r\n";
$ret = file_put_contents('/tmp/mydata.txt', $data, FILE_APPEND | LOCK_EX);
if($ret === false) {
die('There was an error writing this file');
}
else {
echo "$ret bytes written to file";
}
}
else {
die('no post data to process');
}
Thanks in advance!
Regards