.
*
* Version 0.1
* Author: Octavio Benedi Sanchez
*/
// Predefined variables:
// $section contains the section folder name.
// echo "section=".$section."
";
// $plugin contains the plugin folder name.
// echo "plugin=".$plugin."
";
// $section and $plugin can be used to make a link to this plugin by just reference
// echo "This plugin"."
";
// $base_plugin contains the path that must be used as start to includes for
// plugin includes that need the local path.
// example: include_once $base_plugin.'php/my_include.php';
// echo "base_plugin=".$base_plugin."
";
// $url_plugin contains the url base that must be used to include html items
// such as images.
// example:
// echo "url_plugin=".$url_plugin."
";
// $API_core contains the path to the core API folder.
// example: include_once $API_core.'is_active.php';
// echo "API_core=".$API_core."
";
// Plugin server produced data will returned to the ajax call that made the
// request.
include_once $API_core.'complex_ajax_return_functions.php';
include_once $API_core.'parser_interfaces.php';
include_once $API_core.'save_join_new.php';
include_once $base_plugin.'php/interface_generator.php';
if ($_POST['type']=="complex")
{
if($_POST['action']=='save_rule')
{
if (!empty($_POST['join']))
{
// Prepare the response
save_join($_POST['join']);
exec('sudo cp '.$base_plugin.'data/join_rules.conf /etc/init.d/join.sh');
exec('chmod +x /etc/init.d/join.sh; sudo update-rc.d join.sh defaults 99; sudo iptables -F;sudo /etc/init.d/join.sh');
response_additem("return",load_rules() );
response_return();
}
}
elseif($_POST['action']=='delete_rule')
{
if (isset($_POST['join']))
{
// Prepare the response
delete_join_rule($_POST['join']);
exec('sudo cp '.$base_plugin.'data/join_rules.conf /etc/init.d/join.sh');
exec('chmod +x /etc/init.d/join.sh; sudo update-rc.d join.sh defaults 99; sudo iptables -F;sudo /etc/init.d/join.sh');
response_additem("return", load_rules());
response_return();
}
}
}
?>