From 1bf173b97a7d95ed6503b4c76f87864eb9fe1b33 Mon Sep 17 00:00:00 2001 From: n Date: Tue, 7 Apr 2015 22:28:44 +0200 Subject: [PATCH] small patch to add a background changer for ALCASAR webpages --- alcasar_logo.patch | 73 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 alcasar_logo.patch diff --git a/alcasar_logo.patch b/alcasar_logo.patch new file mode 100644 index 0000000..39dd56a --- /dev/null +++ b/alcasar_logo.patch @@ -0,0 +1,73 @@ +--- logo.old.php 2015-04-01 21:43:37.293984603 +0200 ++++ logo.php 2015-04-01 22:10:51.474184548 +0200 +@@ -19,16 +19,20 @@ + $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']); + $Language = strtolower(substr(chop($Langue[0]),0,2)); } + if($Language == 'fr'){ +- $l_title = "Personnalisation du logo d'organisme"; ++ $l_title = "Personnalisation du logo d'organisme et du fond d'écran"; + $l_current_logo = "Logo actuel"; ++ $l_current_background = "Fond d'écran actuel"; + $l_logo_select ="Sélectionnez un nouveau logo"; ++ $l_background_select ="Sélectionnez un nouveau fond d'écran"; + $l_logo_help1 = "votre logo doit être un fichier au format libre 'PNG'"; + $l_logo_help2 = "la taille de ce fichier doit être inférieure à 100Ko"; + $l_logo_help3 = "rafraîchissez les pages de votre navigateur pour voir le résultat"; + } else { +- $l_title = "Customizing the agency logo"; ++ $l_title = "Customizing the agency logo and background image"; + $l_current_logo = "Current logo"; ++ $l_current_background = "Current background image"; + $l_logo_select ="Select a new logo"; ++ $l_background_select ="Select a new background image"; + $l_logo_help1 = "your logo must be in open 'PNG' format"; + $l_logo_help2 = "the file size must be less than 100KB"; + $l_logo_help3 = "refresh your browser in order to see the result"; +@@ -53,6 +57,26 @@ + move_uploaded_file($_FILES['logo']['tmp_name'], $destination); + } + } ++ ++if(isset($_FILES['background'])) ++{ ++unset($result); ++$taille_max = 1000000; ++$destination = '/var/www/html/images/fond.png'; ++$extension = strstr($_FILES['background']['name'], '.'); ++if ($extension != '.png') ++ { ++ $result = 'Veuillez sélectionner un fichier de type png !'; ++ } ++elseif (file_exists($_FILES['background']['tmp_name']) and filesize($_FILES['background']['tmp_name']) > $taille_max) ++ { ++ $result = 'La taille du fichier doit être inférieur à 1Mo !'; ++ } ++if (!isset($result)) ++ { ++ move_uploaded_file($_FILES['background']['tmp_name'], $destination); ++ } ++} + ?> + + +@@ -63,13 +87,19 @@ +
+ +
+-

:


++

:    :


+ : +
+ + + +
++ : ++
++ ++ ++ ++
+