Improve accessibility and file handling in CRUD
Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
This commit is contained in:
@@ -82,8 +82,9 @@ switch ($_GET["form"] ?? '') {
|
|||||||
// Validate image
|
// Validate image
|
||||||
$image_info = getimagesize($tmp_name);
|
$image_info = getimagesize($tmp_name);
|
||||||
if ($image_info !== false) {
|
if ($image_info !== false) {
|
||||||
move_uploaded_file($tmp_name, $photo_path);
|
if (move_uploaded_file($tmp_name, $photo_path)) {
|
||||||
chmod($photo_path, 0644);
|
chmod($photo_path, 0644);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,8 +134,9 @@ switch ($_GET["form"] ?? '') {
|
|||||||
// Validate image
|
// Validate image
|
||||||
$image_info = getimagesize($tmp_name);
|
$image_info = getimagesize($tmp_name);
|
||||||
if ($image_info !== false) {
|
if ($image_info !== false) {
|
||||||
move_uploaded_file($tmp_name, $photo_path);
|
if (move_uploaded_file($tmp_name, $photo_path)) {
|
||||||
chmod($photo_path, 0644);
|
chmod($photo_path, 0644);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,7 +225,7 @@ switch ($_GET["action"] ?? '') {
|
|||||||
<?php if ($photo_exists): ?>
|
<?php if ($photo_exists): ?>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<img src="_filefetch.php?type=alumno_photo&alumno=<?= urlencode($nombre) ?>¢ro=<?= urlencode($centro_id) ?>&aulario=<?= urlencode($aulario_id) ?>"
|
<img src="_filefetch.php?type=alumno_photo&alumno=<?= urlencode($nombre) ?>¢ro=<?= urlencode($centro_id) ?>&aulario=<?= urlencode($aulario_id) ?>"
|
||||||
alt="<?= htmlspecialchars($nombre) ?>"
|
alt="Foto de <?= htmlspecialchars($nombre) ?>"
|
||||||
style="max-width: 200px; max-height: 200px; border: 2px solid #ddd; border-radius: 10px;">
|
style="max-width: 200px; max-height: 200px; border: 2px solid #ddd; border-radius: 10px;">
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
@@ -311,7 +313,7 @@ switch ($_GET["action"] ?? '') {
|
|||||||
<td>
|
<td>
|
||||||
<?php if ($photo_exists): ?>
|
<?php if ($photo_exists): ?>
|
||||||
<img src="_filefetch.php?type=alumno_photo&alumno=<?= urlencode($nombre) ?>¢ro=<?= urlencode($centro_id) ?>&aulario=<?= urlencode($aulario_id) ?>"
|
<img src="_filefetch.php?type=alumno_photo&alumno=<?= urlencode($nombre) ?>¢ro=<?= urlencode($centro_id) ?>&aulario=<?= urlencode($aulario_id) ?>"
|
||||||
alt="<?= htmlspecialchars($nombre) ?>"
|
alt="Foto de <?= htmlspecialchars($nombre) ?>"
|
||||||
style="width: 50px; height: 50px; object-fit: cover; border-radius: 5px;">
|
style="width: 50px; height: 50px; object-fit: cover; border-radius: 5px;">
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div style="width: 50px; height: 50px; background: #f0f0f0; display: flex; align-items: center; justify-content: center; border-radius: 5px; border: 2px dashed #ccc;">
|
<div style="width: 50px; height: 50px; background: #f0f0f0; display: flex; align-items: center; justify-content: center; border-radius: 5px; border: 2px dashed #ccc;">
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ $aulario = json_decode(file_get_contents("/DATA/entreaulas/Centros/$centro_id/Au
|
|||||||
</a>
|
</a>
|
||||||
<?php if (in_array("entreaulas:docente", $_SESSION["auth_data"]["permissions"] ?? [])): ?>
|
<?php if (in_array("entreaulas:docente", $_SESSION["auth_data"]["permissions"] ?? [])): ?>
|
||||||
<a href="/entreaulas/alumnos.php?aulario=<?= urlencode($aulario_id) ?>" class="btn btn-info grid-item">
|
<a href="/entreaulas/alumnos.php?aulario=<?= urlencode($aulario_id) ?>" class="btn btn-info grid-item">
|
||||||
<img src="/static/arasaac/alumnos.png" height="125" style="background: white; padding: 5px; border-radius: 10px;">
|
<img src="/static/arasaac/alumnos.png" height="125" style="background: white; padding: 5px; border-radius: 10px;" alt="Icono de gestión de alumnos">
|
||||||
<br>
|
<br>
|
||||||
Gestión de Alumnos
|
Gestión de Alumnos
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user