Fix: include public/avatars in backups and restoration, add graceful fallback for missing contact photos
This commit is contained in:
1 parent
2bd1ae0777
commit
45011d8c59
4 files changed
+56
-13
No files matched your search
+23
-1
@@ -257,7 +257,16 @@ class BackupManager
|
||||
}
|
||||
$manifestFiles['asterisk_custom_conf'] = ['count' => count(glob($destConfs . '/*'))];
|
||||
|
||||
// F. Création du Manifeste
|
||||
// F. Avatars et photos des contacts de l'annuaire (/var/www/nexus-pbx/public/avatars/)
|
||||
$publicAvatars = '/var/www/nexus-pbx/public/avatars';
|
||||
if (is_dir($publicAvatars)) {
|
||||
$destAvatars = $stageDir . '/public_avatars';
|
||||
mkdir($destAvatars, 0755, true);
|
||||
self::copyDirectoryRecursive($publicAvatars, $destAvatars);
|
||||
$manifestFiles['public_avatars'] = ['count' => count(glob($destAvatars . '/*'))];
|
||||
}
|
||||
|
||||
// G. Création du Manifeste
|
||||
$manifest = [
|
||||
'nexus_version' => self::VERSION,
|
||||
'created_at' => date('c'),
|
||||
@@ -573,6 +582,19 @@ class BackupManager
|
||||
}
|
||||
}
|
||||
|
||||
// 9b. Restauration des avatars et photos des contacts de l'annuaire
|
||||
if (is_dir($stageDir . '/public_avatars')) {
|
||||
$destAvatars = '/var/www/nexus-pbx/public/avatars';
|
||||
if (!is_dir($destAvatars)) {
|
||||
@mkdir($destAvatars, 0775, true);
|
||||
}
|
||||
self::copyDirectoryRecursive($stageDir . '/public_avatars', $destAvatars, true);
|
||||
@chown($destAvatars, 'www-data');
|
||||
@chgrp($destAvatars, 'asterisk');
|
||||
exec("chown -R www-data:asterisk " . escapeshellarg($destAvatars));
|
||||
exec("chmod -R 775 " . escapeshellarg($destAvatars));
|
||||
}
|
||||
|
||||
// 10. Régénération intégrale des configurations Asterisk avec la nouvelle base restaurée
|
||||
Database::resetConnection();
|
||||
$dbFresh = Database::getConnection(true);
|
||||
|
||||
Reference in new issue
Block a user