mirror of
https://github.com/itflow-org/itflow
synced 2026-03-05 05:14:51 +00:00
Moved Mesh Central and Azure settings from general to its own tab called integrations
This commit is contained in:
@@ -96,6 +96,13 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="settings-integrations.php" class="nav-link <?php if(basename($_SERVER["PHP_SELF"]) == "settings-integrations.php") { echo "active"; } ?>">
|
||||||
|
<i class="nav-icon fas fa-puzzle-piece"></i>
|
||||||
|
<p>Integrations</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?php if(basename($_SERVER["PHP_SELF"]) == "settings-update.php") { echo "active"; } ?>"
|
<a class="nav-link <?php if(basename($_SERVER["PHP_SELF"]) == "settings-update.php") { echo "active"; } ?>"
|
||||||
href="settings-update.php">
|
href="settings-update.php">
|
||||||
|
|||||||
33
post.php
33
post.php
@@ -804,13 +804,8 @@ if(isset($_POST['edit_general_settings'])){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$config_base_url = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_base_url'])));
|
$config_base_url = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_base_url'])));
|
||||||
$mesh_uri = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['meshcentral_uri'])));
|
|
||||||
$mesh_user = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['meshcentral_user'])));
|
|
||||||
$mesh_secret = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['meshcentral_secret'])));
|
|
||||||
$azure_client_id = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['azure_client_id'])));
|
|
||||||
$azure_client_secret = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['azure_client_secret'])));
|
|
||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_base_url = '$config_base_url', config_meshcentral_uri = '$mesh_uri', config_meshcentral_user = '$mesh_user', config_meshcentral_secret = '$mesh_secret', config_azure_client_id = '$azure_client_id', config_azure_client_secret = '$azure_client_secret' WHERE company_id = $session_company_id");
|
mysqli_query($mysqli,"UPDATE settings SET config_base_url = '$config_base_url' WHERE company_id = $session_company_id");
|
||||||
|
|
||||||
//Logging
|
//Logging
|
||||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modify', log_description = '$session_name modified general settings', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_created_at = NOW(), log_user_id = $session_user_id, company_id = $session_company_id");
|
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modify', log_description = '$session_name modified general settings', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_created_at = NOW(), log_user_id = $session_user_id, company_id = $session_company_id");
|
||||||
@@ -1074,6 +1069,32 @@ if(isset($_POST['edit_online_payment_settings'])){
|
|||||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($_POST['edit_integrations_settings'])){
|
||||||
|
|
||||||
|
if($session_user_role != 3){
|
||||||
|
$_SESSION['alert_type'] = "danger";
|
||||||
|
$_SESSION['alert_message'] = "You are not permitted to do that!";
|
||||||
|
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$mesh_uri = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['meshcentral_uri'])));
|
||||||
|
$mesh_user = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['meshcentral_user'])));
|
||||||
|
$mesh_secret = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['meshcentral_secret'])));
|
||||||
|
$azure_client_id = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['azure_client_id'])));
|
||||||
|
$azure_client_secret = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['azure_client_secret'])));
|
||||||
|
|
||||||
|
mysqli_query($mysqli,"UPDATE settings SET config_meshcentral_uri = '$mesh_uri', config_meshcentral_user = '$mesh_user', config_meshcentral_secret = '$mesh_secret', config_azure_client_id = '$azure_client_id', config_azure_client_secret = '$azure_client_secret' WHERE company_id = $session_company_id");
|
||||||
|
|
||||||
|
//Logging
|
||||||
|
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modify', log_description = '$session_name modified integrations settings', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_created_at = NOW(), log_user_id = $session_user_id, company_id = $session_company_id");
|
||||||
|
|
||||||
|
$_SESSION['alert_message'] = "Integrations settings updated";
|
||||||
|
|
||||||
|
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($_POST['edit_backup_settings'])){
|
if(isset($_POST['edit_backup_settings'])){
|
||||||
|
|
||||||
if($session_user_role != 3){
|
if($session_user_role != 3){
|
||||||
|
|||||||
@@ -20,69 +20,6 @@
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<h4>Mesh Central Asset Integration</h4>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>MeshCentral URI & Port</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="meshcentral_uri" placeholder="Format: wss://mesh.itflow.org:443" value="<?php echo $config_meshcentral_uri; ?>">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>MeshCentral Token User</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="meshcentral_user" placeholder="~t:ABCDEF" value="<?php echo $config_meshcentral_user; ?>">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>MeshCentral Token Password</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-keyboard"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="password" class="form-control" name="meshcentral_secret" placeholder="Auto-generated on MeshCentral" value="<?php echo $config_meshcentral_secret; ?>" autocomplete="new-password">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="alert alert-warning">
|
|
||||||
This token/user only requires <b>read access</b> to MeshCentral and is stored in <b>plaintext</b>.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<h4>Client Portal SSO via Microsoft Azure AD</h4>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>MS Azure OAuth App (Client) ID</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="azure_client_id" placeholder="e721e3b6-01d6-50e8-7f22-c84d951a52e7" value="<?php echo $config_azure_client_id; ?>">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>MS Azure OAuth Secret</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="password" class="form-control" name="azure_client_secret" placeholder="Auto-generated from App Registration" value="<?php echo $config_azure_client_secret; ?>" autocomplete="new-password">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<button type="submit" name="edit_general_settings" class="btn btn-primary">Save</button>
|
<button type="submit" name="edit_general_settings" class="btn btn-primary">Save</button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
79
settings-integrations.php
Normal file
79
settings-integrations.php
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<?php include("inc_all_admin.php"); ?>
|
||||||
|
|
||||||
|
<div class="card card-dark">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title"><i class="fa fa-fw fa-puzzle-piece"></i> Integration Settings</h3>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
|
|
||||||
|
<h4>Mesh Central Asset Integration</h4>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>MeshCentral URI & Port</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="meshcentral_uri" placeholder="Format: wss://mesh.itflow.org:443" value="<?php echo $config_meshcentral_uri; ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>MeshCentral Token User</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="meshcentral_user" placeholder="~t:ABCDEF" value="<?php echo $config_meshcentral_user; ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>MeshCentral Token Password</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-keyboard"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="password" class="form-control" name="meshcentral_secret" placeholder="Auto-generated on MeshCentral" value="<?php echo $config_meshcentral_secret; ?>" autocomplete="new-password">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
This token/user only requires <b>read access</b> to MeshCentral and is stored in <b>plaintext</b>.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h4>Client Portal SSO via Microsoft Azure AD</h4>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>MS Azure OAuth App (Client) ID</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="azure_client_id" placeholder="e721e3b6-01d6-50e8-7f22-c84d951a52e7" value="<?php echo $config_azure_client_id; ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>MS Azure OAuth Secret</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="password" class="form-control" name="azure_client_secret" placeholder="Auto-generated from App Registration" value="<?php echo $config_azure_client_secret; ?>" autocomplete="new-password">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<button type="submit" name="edit_integrations_settings" class="btn btn-primary">Save</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include("footer.php");
|
||||||
Reference in New Issue
Block a user