stage #2

Merged
ThaMunsta merged 122 commits from stage into main 2026-01-17 20:10:26 +00:00
Showing only changes of commit b7a9f9ea38 - Show all commits

View File

@@ -317,8 +317,6 @@ if (isset($_POST['export_credentials_csv'])) {
//get records from database //get records from database
$sql = mysqli_query($mysqli,"SELECT * FROM credentials LEFT JOIN clients ON client_id = credential_client_id WHERE credential_archived_at IS NULL $client_query ORDER BY credential_name ASC"); $sql = mysqli_query($mysqli,"SELECT * FROM credentials LEFT JOIN clients ON client_id = credential_client_id WHERE credential_archived_at IS NULL $client_query ORDER BY credential_name ASC");
$row = mysqli_fetch_array($sql);
$num_rows = mysqli_num_rows($sql); $num_rows = mysqli_num_rows($sql);
if ($num_rows > 0) { if ($num_rows > 0) {
@@ -331,14 +329,14 @@ if (isset($_POST['export_credentials_csv'])) {
$f = fopen('php://memory', 'w'); $f = fopen('php://memory', 'w');
//set column headers //set column headers
$fields = array('Name', 'Description', 'Username', 'Password', 'URI'); $fields = array('Name', 'Description', 'Username', 'Password', 'TOTP', 'URI');
fputcsv($f, $fields, $delimiter, $enclosure, $escape); fputcsv($f, $fields, $delimiter, $enclosure, $escape);
//output each row of the data, format line as csv and write to file pointer //output each row of the data, format line as csv and write to file pointer
while($row = mysqli_fetch_assoc($sql)){ while($row = mysqli_fetch_assoc($sql)){
$credential_username = decryptCredentialEntry($row['credential_username']); $credential_username = decryptCredentialEntry($row['credential_username']);
$credential_password = decryptCredentialEntry($row['credential_password']); $credential_password = decryptCredentialEntry($row['credential_password']);
$lineData = array($row['credential_name'], $row['credential_description'], $credential_username, $credential_password, $row['credential_uri']); $lineData = array($row['credential_name'], $row['credential_description'], $credential_username, $credential_password, $row['credential_otp_secret'], $row['credential_uri']);
fputcsv($f, $lineData, $delimiter, $enclosure, $escape); fputcsv($f, $lineData, $delimiter, $enclosure, $escape);
} }