mirror of
https://github.com/itflow-org/itflow
synced 2026-08-22 07:25:12 +00:00
Update Credential Important to Favorite
This commit is contained in:
@@ -419,7 +419,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<div class="media">
|
<div class="media">
|
||||||
<i class="fa fa-fw fa-2x fa-key mr-3"></i>
|
<i class="fa fa-fw fa-2x fa-key mr-3"></i>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
<div><?php echo $credential_name; ?></div>
|
<div><?php echo $credential_name; ?> <?php if ($credential_favorite) { echo "<i class='fas fa-fw fa-star text-warning' title='Favorite'></i>"; } ?></div>
|
||||||
<div><small class="text-secondary"><?php echo $credential_description; ?></small></div>
|
<div><small class="text-secondary"><?php echo $credential_description; ?></small></div>
|
||||||
<?php
|
<?php
|
||||||
if (!empty($credential_tags_display)) { ?>
|
if (!empty($credential_tags_display)) { ?>
|
||||||
|
|||||||
@@ -75,7 +75,9 @@ ob_start();
|
|||||||
<input type="text" class="form-control" name="name" placeholder="Name of Login" maxlength="200" required autofocus>
|
<input type="text" class="form-control" name="name" placeholder="Name of Login" maxlength="200" required autofocus>
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<div class="input-group-text">
|
<div class="input-group-text">
|
||||||
<input type="checkbox" name="important" value="1">
|
<label class="star-toggle mb-0" title="Favorite">
|
||||||
|
<input type="checkbox" name="favorite" value="1"><i class="far fa-star"></i>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ $credential_otp_secret = nullable_htmlentities($row['credential_otp_secret']);
|
|||||||
$credential_note = nullable_htmlentities($row['credential_note']);
|
$credential_note = nullable_htmlentities($row['credential_note']);
|
||||||
$credential_created_at = nullable_htmlentities($row['credential_created_at']);
|
$credential_created_at = nullable_htmlentities($row['credential_created_at']);
|
||||||
$credential_archived_at = nullable_htmlentities($row['credential_archived_at']);
|
$credential_archived_at = nullable_htmlentities($row['credential_archived_at']);
|
||||||
$credential_important = intval($row['credential_important']);
|
$credential_favorite = intval($row['credential_favorite']);
|
||||||
$credential_contact_id = intval($row['credential_contact_id']);
|
$credential_contact_id = intval($row['credential_contact_id']);
|
||||||
$credential_asset_id = intval($row['credential_asset_id']);
|
$credential_asset_id = intval($row['credential_asset_id']);
|
||||||
|
|
||||||
@@ -75,7 +75,13 @@ ob_start();
|
|||||||
<input type="text" class="form-control" name="name" placeholder="Name of Credential" maxlength="200" value="<?php echo $credential_name; ?>" required>
|
<input type="text" class="form-control" name="name" placeholder="Name of Credential" maxlength="200" value="<?php echo $credential_name; ?>" required>
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<div class="input-group-text">
|
<div class="input-group-text">
|
||||||
<input type="checkbox" name="important" value="1" <?php if ($credential_important == 1) { echo "checked"; } ?>>
|
<label class="star-toggle mb-0" title="Favorite">
|
||||||
|
<input type="checkbox"
|
||||||
|
name="favorite"
|
||||||
|
value="1"
|
||||||
|
<?php if($credential_favorite) { echo 'checked'; } ?>>
|
||||||
|
<i class="far fa-star"></i>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ if (isset($_POST['add_credential'])) {
|
|||||||
|
|
||||||
require_once 'credential_model.php';
|
require_once 'credential_model.php';
|
||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO credentials SET credential_name = '$name', credential_description = '$description', credential_uri = '$uri', credential_uri_2 = '$uri_2', credential_username = '$username', credential_password = '$password', credential_otp_secret = '$otp_secret', credential_note = '$note', credential_important = $important, credential_contact_id = $contact_id, credential_asset_id = $asset_id, credential_client_id = $client_id");
|
mysqli_query($mysqli,"INSERT INTO credentials SET credential_name = '$name', credential_description = '$description', credential_uri = '$uri', credential_uri_2 = '$uri_2', credential_username = '$username', credential_password = '$password', credential_otp_secret = '$otp_secret', credential_note = '$note', credential_favorite = $favorite, credential_contact_id = $contact_id, credential_asset_id = $asset_id, credential_client_id = $client_id");
|
||||||
|
|
||||||
$credential_id = mysqli_insert_id($mysqli);
|
$credential_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ if (isset($_POST['edit_credential'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update the credential entry with the new details
|
// Update the credential entry with the new details
|
||||||
mysqli_query($mysqli,"UPDATE credentials SET credential_name = '$name', credential_description = '$description', credential_uri = '$uri', credential_uri_2 = '$uri_2', credential_username = '$username', credential_password = '$password', credential_otp_secret = '$otp_secret', credential_note = '$note', credential_important = $important, credential_contact_id = $contact_id, credential_asset_id = $asset_id WHERE credential_id = $credential_id");
|
mysqli_query($mysqli,"UPDATE credentials SET credential_name = '$name', credential_description = '$description', credential_uri = '$uri', credential_uri_2 = '$uri_2', credential_username = '$username', credential_password = '$password', credential_otp_secret = '$otp_secret', credential_note = '$note', credential_favorite = $favorite, credential_contact_id = $contact_id, credential_asset_id = $asset_id WHERE credential_id = $credential_id");
|
||||||
|
|
||||||
// Tags
|
// Tags
|
||||||
// Delete existing tags
|
// Delete existing tags
|
||||||
|
|||||||
@@ -11,6 +11,6 @@ $username = encryptCredentialEntry(trim($_POST['username']));
|
|||||||
$password = encryptCredentialEntry(trim($_POST['password']));
|
$password = encryptCredentialEntry(trim($_POST['password']));
|
||||||
$otp_secret = sanitizeInput($_POST['otp_secret']);
|
$otp_secret = sanitizeInput($_POST['otp_secret']);
|
||||||
$note = sanitizeInput($_POST['note']);
|
$note = sanitizeInput($_POST['note']);
|
||||||
$important = intval($_POST['important'] ?? 0);
|
$favorite = intval($_POST['favorite'] ?? 0);
|
||||||
$contact_id = intval($_POST['contact'] ?? 0);
|
$contact_id = intval($_POST['contact'] ?? 0);
|
||||||
$asset_id = intval($_POST['asset'] ?? 0);
|
$asset_id = intval($_POST['asset'] ?? 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user