Current File : //scripts/enable_disble_apache_java_module.php |
<?php
//echo $argv[1];
// For enable and disable the module based on the first argument
// 1 -> Enable
// 0 -> Disable
if($argv[1]=="1")
{
// Need to Enable
require('/etc/sentora/panel/cnf/db.php');
$con = mysqli_connect($host, $user, $pass, $dbname) or die("Could not connect: " . mysqli_connect_error());
// mysql_select_db($dbname);
$query="select * from `x_modules` where `mo_folder_vc`='apachetotomcat'";
$result = mysqli_query($con, $query);
$row = mysqli_fetch_assoc($result);
$insert_id=$row['mo_id_pk'];
$query="INSERT INTO `sentora_core`.`x_permissions` (`pe_group_fk` ,`pe_module_fk`) VALUES ('3', '".$insert_id."');";
$result = mysqli_query($con,$query);
}
else if($argv[1]="0")
{
// Need to Disable
require('/etc/sentora/panel/cnf/db.php');
$con = mysqli_connect($host, $user, $pass, $dbname) or die("Could not connect: " . mysqli_connect_error());
// mysql_select_db($dbname);
$query="select * from `x_modules` where `mo_folder_vc`='apachetotomcat'";
$result = mysqli_query($con,$query);
$row = mysqli_fetch_assoc($result);
$insert_id=$row['mo_id_pk'];
$query="DELETE FROM `sentora_core`.`x_permissions` WHERE `pe_module_fk`= '".$insert_id."';";
$result = mysqli_query($con,$query);
}
?>