Profile Image
#14659
Replies: 1 comment
-
I was able to fix this by modifying the following file Changing to But I assume this will be overwritten when there's an upgrade or update on SnipeIT. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently using the following PHP Script to inject the profile photo and it works perfectly and I can see the Photos if I visit the users from People but when the user would edit the profile it should just show a broken image URL as below
https://asset.mywebsite.com/uploads/avatars/https://mywebsite.com/photos/employee_num.jpg
How can I fix the edit profile page so that it has just the https://mywebsite.com/photos/employee_num.jpg instead of https://asset.mywebsite.com/uploads/avatars/https://mywebsite.com/photos/employee_num.jpg please
`<?php
// Database connection parameters
$servername = "localhost";
$username = "snipeit";
$password = "";
$dbname = "snipeit";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Query users with non-empty employee_num field
$sql = "SELECT * FROM users WHERE employee_num IS NOT NULL AND employee_num <> ''";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// Update avatar URLs for each user
while($row = $result->fetch_assoc()) {
$employee_num = $row['employee_num'];
$avatar_url = "https://mywebsite.com/photos/$employee_num.jpg";
$user_id = $row['id'];
} else {
echo "No users found with non-empty employee_num field\n";
}
// Close connection
$conn->close();
?>`
Beta Was this translation helpful? Give feedback.
All reactions