mirror of https://github.com/itflow-org/itflow
When local auth is selected show the password box
This commit is contained in:
parent
747b7de143
commit
903efec1dd
|
|
@ -190,13 +190,27 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user-circle"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="auth_method">
|
||||
<select class="form-control select2" id="authMethod" name="auth_method">
|
||||
<option value="">- None -</option>
|
||||
<option value="local">Local</option>
|
||||
<option value="azure">Azure</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Password Form Group (Initially hidden) -->
|
||||
<div class="form-group" id="passwordGroup" style="display: none;">
|
||||
<label>Password</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" data-toggle="password" name="contact_password" placeholder="Enter a password" autocomplete="new-password">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-eye"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
|
@ -220,3 +234,16 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- JavaScript to Show/Hide Password Form Group -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#authMethod').on('change', function() {
|
||||
if ($(this).val() === 'local') {
|
||||
$('#passwordGroup').show();
|
||||
} else {
|
||||
$('#passwordGroup').hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ if (isset($_GET['invoice_id'])) {
|
|||
</a>
|
||||
<?php if ($invoice_status !== 'Cancelled' && $invoice_status !== 'Paid') { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold" href="post.php?cancel_invoice=<?php echo $invoice_id; ?>">
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?cancel_invoice=<?php echo $invoice_id; ?>">
|
||||
<i class="fa fa-fw fa-times mr-2"></i>Cancel
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
|
@ -296,7 +296,7 @@ if (isset($_GET['invoice_id'])) {
|
|||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editItemModal<?php echo $item_id; ?>"><i class="fa fa-fw fa-edit mr-2"></i>Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_invoice_item=<?php echo $item_id; ?>"><i class="fa fa-fw fa-times mr-2"></i>Remove</a>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?delete_invoice_item=<?php echo $item_id; ?>"><i class="fa fa-fw fa-times mr-2"></i>Remove</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -498,7 +498,7 @@ if (isset($_GET['invoice_id'])) {
|
|||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $payment_amount, $payment_currency_code); ?></td>
|
||||
<td><?php echo $payment_reference; ?></td>
|
||||
<td><?php echo $account_name; ?></td>
|
||||
<td class="text-center"><a class="btn btn-light text-danger" href="post.php?delete_payment=<?php echo $payment_id; ?>"><i class="fa fa-times"></i></a></td>
|
||||
<td class="text-center"><a class="btn btn-light text-danger confirm-link" href="post.php?delete_payment=<?php echo $payment_id; ?>"><i class="fa fa-times"></i></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,13 +10,19 @@ if (isset($_POST['add_contact'])) {
|
|||
|
||||
require_once('post/contact_model.php');
|
||||
|
||||
$password = password_hash(randomString(), PASSWORD_DEFAULT);
|
||||
|
||||
// Set password
|
||||
if (!empty($_POST['contact_password'])) {
|
||||
$password_hash = password_hash(trim($_POST['contact_password']), PASSWORD_DEFAULT);
|
||||
} else {
|
||||
// Set a random password
|
||||
$password_hash = password_hash(randomString(), PASSWORD_DEFAULT);
|
||||
}
|
||||
|
||||
if (!file_exists("uploads/clients/$client_id")) {
|
||||
mkdir("uploads/clients/$client_id");
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_extension = '$extension', contact_mobile = '$mobile', contact_email = '$email', contact_pin = '$pin', contact_notes = '$notes', contact_important = $contact_important, contact_billing = $contact_billing, contact_technical = $contact_technical, contact_auth_method = '$auth_method', contact_password_hash = '$password', contact_department = '$department', contact_location_id = $location_id, contact_client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_extension = '$extension', contact_mobile = '$mobile', contact_email = '$email', contact_pin = '$pin', contact_notes = '$notes', contact_important = $contact_important, contact_billing = $contact_billing, contact_technical = $contact_technical, contact_auth_method = '$auth_method', contact_password_hash = '$password_hash', contact_department = '$department', contact_location_id = $location_id, contact_client_id = $client_id");
|
||||
|
||||
$contact_id = mysqli_insert_id($mysqli);
|
||||
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ if (isset($_GET['quote_id'])) {
|
|||
<i class="fa fa-fw fa-link text-secondary mr-2"></i>Guest URL
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold" href="post.php?delete_quote=<?php echo $quote_id; ?>">
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_quote=<?php echo $quote_id; ?>">
|
||||
<i class="fa fa-fw fa-times mr-2"></i>Delete
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -290,7 +290,7 @@ if (isset($_GET['quote_id'])) {
|
|||
<i class="fa fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_quote_item=<?php echo $item_id; ?>">
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?delete_quote_item=<?php echo $item_id; ?>">
|
||||
<i class="fa fa-fw fa-times mr-2"></i>Remove
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ if (isset($_GET['recurring_id'])) {
|
|||
<i class="fa fa-fw fa-paper-plane text-secondary mr-2"></i>Force Send
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_recurring=<?php echo $recurring_id; ?>">
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?delete_recurring=<?php echo $recurring_id; ?>">
|
||||
<i class="fa fa-fw fa-trash mr-2"></i>Delete
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -227,7 +227,7 @@ if (isset($_GET['recurring_id'])) {
|
|||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editItemModal<?php echo $item_id; ?>"><i class="fa fa-fw fa-edit mr-2"></i>Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_recurring_item=<?php echo $item_id; ?>"><i class="fa fa-fw fa-times mr-2"></i>Remove</a>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?delete_recurring_item=<?php echo $item_id; ?>"><i class="fa fa-fw fa-times mr-2"></i>Remove</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
Loading…
Reference in New Issue