MAJ 1.0.3 - sécurity
This commit is contained in:
parent
1a4259b94b
commit
6684f79b3d
44
src/Windows/Window_Help_inscriptionXLSX.java
Normal file
44
src/Windows/Window_Help_inscriptionXLSX.java
Normal file
@ -0,0 +1,44 @@
|
||||
package Windows;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.SwingConstants;
|
||||
|
||||
public class Window_Help_inscriptionXLSX extends JFrame{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private JFrame frame;
|
||||
|
||||
public Window_Help_inscriptionXLSX() {
|
||||
init();
|
||||
|
||||
}
|
||||
|
||||
public void init() {
|
||||
frame = new JFrame();
|
||||
frame.setTitle("Gestion des inscriptions et des groupes - langues - informatique - stage - rentrée");
|
||||
frame.setBounds(0, 0, 1300, 100);
|
||||
int screenWidth = (int) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getWidth();
|
||||
int screenHeight = (int) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getHeight();
|
||||
|
||||
// frame.setLocation(( (screenWidth) - frame.getWidth()) / 2, (screenHeight - frame.getHeight()) / 2);
|
||||
frame.setSize(screenWidth, screenHeight);
|
||||
|
||||
JLabel lblNewLabel = new JLabel("");
|
||||
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
lblNewLabel.setIcon(new ImageIcon(Window_Help_inscriptionXLSX.class.getResource("/resources/AideInscriptionXLSX.png")));
|
||||
frame.getContentPane().add(lblNewLabel, BorderLayout.CENTER);
|
||||
|
||||
|
||||
ImageIcon img = new ImageIcon(Window_demarre.class.getResource("/resources/logo.png"));
|
||||
frame.setIconImage(img.getImage());
|
||||
|
||||
frame.setResizable(false);
|
||||
frame.setVisible(true);
|
||||
}
|
||||
}
|
@ -43,7 +43,7 @@ public class Window_demarre extends JFrame {
|
||||
private JFrame frmEvalwriter;
|
||||
JButton btnExporterTouteLaBase;
|
||||
JButton actImporterInscriptionDepuisCSV;
|
||||
|
||||
|
||||
/**
|
||||
* Launch the application.
|
||||
*/
|
||||
@ -54,16 +54,21 @@ public class Window_demarre extends JFrame {
|
||||
// Vérification d'une nouvelle version dans la forge de Chapril
|
||||
VersionChecker.verificationNewVersion();
|
||||
|
||||
|
||||
// mise à jour de la base de données si nouvelle version de l'application utilisé.
|
||||
commandes.nBase=recupeBases.recupeLaBase();
|
||||
VersionChecker.UpdateVersion(commandes.nBase);
|
||||
|
||||
|
||||
if(commandes.blocageApplication) {
|
||||
JOptionPane.showMessageDialog(null, "<html>Blocage de l'application.<br>Par pablo rodriguez</html>");
|
||||
return;
|
||||
}
|
||||
|
||||
Window_demarre window = new Window_demarre();
|
||||
|
||||
|
||||
//Affichage de la fenêtre
|
||||
window.frmEvalwriter.setVisible(true);
|
||||
|
||||
|
||||
|
||||
// Créez un Timer
|
||||
@ -80,6 +85,12 @@ public class Window_demarre extends JFrame {
|
||||
|
||||
// Planification de la tâche de sauvegarde automatique à exécuter toutes les 10 minutes 5 * 60 * 1000
|
||||
timer.schedule(autoSaveTask, 0, 600000);
|
||||
|
||||
|
||||
if(!commandes.messageAlerte.isEmpty()) {
|
||||
String message = "<html>" + commandes.messageAlerte + "</html>";
|
||||
JOptionPane.showMessageDialog(null, message);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -101,9 +112,10 @@ public class Window_demarre extends JFrame {
|
||||
frmEvalwriter = new JFrame();
|
||||
frmEvalwriter.setTitle("Gestion des inscriptions et des groupes - langues - informatique - stage - rentrée");
|
||||
|
||||
frmEvalwriter.setBounds(100, 100, 789, 622);
|
||||
|
||||
frmEvalwriter.setBounds(100, 100, 789, 638);
|
||||
if(commandes.newVersion) {
|
||||
frmEvalwriter.setBounds(100, 100, 789, 720);
|
||||
frmEvalwriter.setBounds(100, 100, 789, 745);
|
||||
}
|
||||
|
||||
|
||||
@ -133,7 +145,7 @@ public class Window_demarre extends JFrame {
|
||||
btnExporterTouteLaBase.setFont(new Font("Arial", Font.BOLD, 16));
|
||||
// btnCreate.addActionListener(this);
|
||||
|
||||
btnExporterTouteLaBase.setBounds(10, 394, 377, 78);
|
||||
btnExporterTouteLaBase.setBounds(10, 416, 377, 78);
|
||||
frmEvalwriter.getContentPane().add(btnExporterTouteLaBase);
|
||||
|
||||
actImporterInscriptionDepuisCSV = new JButton("<html>Importer des inscriptions<br>depuis CSV (UTF-8, point-virgule)</html>");
|
||||
@ -144,17 +156,18 @@ public class Window_demarre extends JFrame {
|
||||
}
|
||||
});
|
||||
actImporterInscriptionDepuisCSV.setIcon(new ImageIcon(Window_demarre.class.getResource("/resources/importationcsv.png")));
|
||||
actImporterInscriptionDepuisCSV.setFont(new Font("Arial", Font.BOLD, 16));
|
||||
actImporterInscriptionDepuisCSV.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 16));
|
||||
actImporterInscriptionDepuisCSV.setBounds(10, 323, 377, 60);
|
||||
actImporterInscriptionDepuisCSV.setForeground(Color.DARK_GRAY);
|
||||
frmEvalwriter.getContentPane().add(actImporterInscriptionDepuisCSV);
|
||||
|
||||
JLabel lblNewLabel = new JLabel();
|
||||
lblNewLabel.setIcon(new ImageIcon(Window_demarre.class.getResource("/resources/accueil.png")));
|
||||
// lblNewLabel.setIcon(new ImageIcon(demarre.class.getResource("/resources/accueilanalysecalc.png")));
|
||||
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
lblNewLabel.setFont(new Font("Pacifico", Font.PLAIN, 26));
|
||||
lblNewLabel.setBounds(10, 77, 753, 141);
|
||||
frmEvalwriter.getContentPane().add(lblNewLabel);
|
||||
JLabel lblTitre = new JLabel();
|
||||
lblTitre.setIcon(new ImageIcon(Window_demarre.class.getResource("/resources/accueil.png")));
|
||||
if(commandes.helpme1) lblTitre.setIcon(new ImageIcon(Window_demarre.class.getResource("/resources/helpme1.png")));
|
||||
lblTitre.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
lblTitre.setFont(new Font("Pacifico", Font.PLAIN, 26));
|
||||
lblTitre.setBounds(10, 35, 753, 202);
|
||||
frmEvalwriter.getContentPane().add(lblTitre);
|
||||
|
||||
JButton btnMiseAJourDepuisClasseur = new JButton("<html>Mise à jour de la base depuis<br>un classeur Ms Excel</html>");
|
||||
btnMiseAJourDepuisClasseur.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
@ -171,7 +184,7 @@ public class Window_demarre extends JFrame {
|
||||
});
|
||||
|
||||
btnMiseAJourDepuisClasseur.setFont(new Font("Arial", Font.BOLD, 16));
|
||||
btnMiseAJourDepuisClasseur.setBounds(10, 483, 377, 60);
|
||||
btnMiseAJourDepuisClasseur.setBounds(10, 502, 377, 60);
|
||||
frmEvalwriter.getContentPane().add(btnMiseAJourDepuisClasseur);
|
||||
|
||||
JButton btnGestionnaire = new JButton("");
|
||||
@ -187,7 +200,7 @@ public class Window_demarre extends JFrame {
|
||||
}
|
||||
});
|
||||
btnGestionnaire.setFont(new Font("Arial", Font.BOLD, 16));
|
||||
btnGestionnaire.setBounds(397, 394, 366, 175);
|
||||
btnGestionnaire.setBounds(397, 416, 366, 175);
|
||||
frmEvalwriter.getContentPane().add(btnGestionnaire);
|
||||
|
||||
JButton btnimporterDesInscriptionsdepuisClasseur = new JButton("<html>Importer des inscriptions<br>depuis un classeur Ms Excel</html>");
|
||||
@ -205,13 +218,13 @@ public class Window_demarre extends JFrame {
|
||||
});
|
||||
frmEvalwriter.getContentPane().add(btnimporterDesInscriptionsdepuisClasseur);
|
||||
|
||||
JLabel lblNewLabel_3 = new JLabel("<html>Pablo Rodriguez - 2023<br>Version "+ commandes.version+"</html>");
|
||||
lblNewLabel_3.setVerticalAlignment(SwingConstants.TOP);
|
||||
lblNewLabel_3.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
lblNewLabel_3.setFont(new Font("Tahoma", Font.BOLD, 16));
|
||||
lblNewLabel_3.setForeground(new Color(255, 255, 255));
|
||||
lblNewLabel_3.setBounds(22, 11, 307, 55);
|
||||
frmEvalwriter.getContentPane().add(lblNewLabel_3);
|
||||
JLabel lblAuteurVersion = new JLabel("<html>Pablo Rodriguez - 2023<br>Version "+ commandes.version+"</html>");
|
||||
lblAuteurVersion.setVerticalAlignment(SwingConstants.TOP);
|
||||
lblAuteurVersion.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
lblAuteurVersion.setFont(new Font("Tahoma", Font.BOLD, 16));
|
||||
lblAuteurVersion.setForeground(new Color(255, 255, 255));
|
||||
lblAuteurVersion.setBounds(22, 11, 307, 55);
|
||||
frmEvalwriter.getContentPane().add(lblAuteurVersion);
|
||||
|
||||
JButton btnNAideMiseAJour = new JButton("Aide à la mise en jour depuis classeur Ms Excel");
|
||||
btnNAideMiseAJour.setForeground(Color.GRAY);
|
||||
@ -220,8 +233,8 @@ public class Window_demarre extends JFrame {
|
||||
new Window_Help_maj_data();
|
||||
}
|
||||
});
|
||||
btnNAideMiseAJour.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
btnNAideMiseAJour.setBounds(10, 539, 377, 30);
|
||||
btnNAideMiseAJour.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 12));
|
||||
btnNAideMiseAJour.setBounds(10, 561, 377, 30);
|
||||
frmEvalwriter.getContentPane().add(btnNAideMiseAJour);
|
||||
|
||||
|
||||
@ -235,15 +248,15 @@ public class Window_demarre extends JFrame {
|
||||
// Redimensionnement de l'image pour qu'elle s'adapte à la taille souhaitée
|
||||
Image resizedImage = image.getScaledInstance(newWidth, newHeight, Image.SCALE_SMOOTH);
|
||||
|
||||
JLabel lblNewLabel_4 = new JLabel(new ImageIcon(resizedImage));
|
||||
lblNewLabel_4.setVerticalAlignment(SwingConstants.BOTTOM);
|
||||
lblNewLabel_4.setBounds(10, -48, 753, 365);
|
||||
frmEvalwriter.getContentPane().add(lblNewLabel_4);
|
||||
JLabel lblFondImage= new JLabel(new ImageIcon(resizedImage));
|
||||
lblFondImage.setVerticalAlignment(SwingConstants.BOTTOM);
|
||||
lblFondImage.setBounds(10, -48, 753, 365);
|
||||
frmEvalwriter.getContentPane().add(lblFondImage);
|
||||
|
||||
JButton btnNewVersion = new JButton("<html>Nouvelle version disponible</html>");
|
||||
btnNewVersion.setIcon(new ImageIcon(Window_demarre.class.getResource("/resources/newVersion.png")));
|
||||
btnNewVersion.setFont(new Font("Tahoma", Font.BOLD, 16));
|
||||
btnNewVersion.setBounds(10, 580, 753, 63);
|
||||
btnNewVersion.setBounds(10, 602, 753, 63);
|
||||
frmEvalwriter.getContentPane().add(btnNewVersion);
|
||||
btnNewVersion.setVisible(commandes.newVersion);
|
||||
|
||||
@ -259,15 +272,35 @@ public class Window_demarre extends JFrame {
|
||||
});
|
||||
|
||||
JButton btnHelpDownload = new JButton("Aide au téléchargement et à l'installation");
|
||||
btnHelpDownload.setFont(new Font("Tahoma", Font.BOLD, 12));
|
||||
btnHelpDownload.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 12));
|
||||
btnHelpDownload.setForeground(Color.GRAY);
|
||||
btnHelpDownload.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
new Window_Help_download_and_install();
|
||||
}
|
||||
});
|
||||
btnHelpDownload.setBounds(10, 640, 753, 30);
|
||||
btnHelpDownload.setBounds(10, 665, 753, 30);
|
||||
frmEvalwriter.getContentPane().add(btnHelpDownload);
|
||||
|
||||
JButton btnAideImportationInscriptionXLSX = new JButton("Aide à l'importation des inscriptions depuis Ms Excel");
|
||||
btnAideImportationInscriptionXLSX.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
new Window_Help_inscriptionXLSX();
|
||||
}
|
||||
});
|
||||
btnAideImportationInscriptionXLSX.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 12));
|
||||
btnAideImportationInscriptionXLSX.setBounds(397, 381, 366, 30);
|
||||
frmEvalwriter.getContentPane().add(btnAideImportationInscriptionXLSX);
|
||||
btnAideImportationInscriptionXLSX.setForeground(Color.GRAY);
|
||||
|
||||
JButton btnAideImportationInscriptionCSV = new JButton("Aide à l'importation des inscriptions depuis fichier CSV");
|
||||
btnAideImportationInscriptionCSV.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 12));
|
||||
btnAideImportationInscriptionCSV.setBounds(10, 381, 377, 30);
|
||||
frmEvalwriter.getContentPane().add(btnAideImportationInscriptionCSV);
|
||||
btnAideImportationInscriptionCSV.setForeground(Color.GRAY);
|
||||
|
||||
|
||||
|
||||
btnHelpDownload.setVisible(commandes.newVersion);
|
||||
|
||||
|
||||
@ -285,6 +318,8 @@ public class Window_demarre extends JFrame {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class VersionChecker {
|
||||
content.append(line);
|
||||
}
|
||||
reader.close();
|
||||
|
||||
|
||||
|
||||
// Motif de la sous-chaîne recherchée
|
||||
String pattern = "V\\d+\\.\\d+\\.\\d+";
|
||||
@ -62,7 +62,38 @@ public class VersionChecker {
|
||||
System.out.println("Une nouvelle version est disponible !");
|
||||
commandes.newVersion = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// aide moi 1 = compléter mon service annuel
|
||||
pattern ="helpme1";
|
||||
regex = Pattern.compile(pattern);
|
||||
matcher = regex.matcher(content);
|
||||
|
||||
if(matcher.find()) {
|
||||
commandes.helpme1 = true;
|
||||
}
|
||||
|
||||
// blocage de l'application suite à des comportements malhonnête.
|
||||
pattern ="blocageapplication";
|
||||
regex = Pattern.compile(pattern);
|
||||
matcher = regex.matcher(content);
|
||||
|
||||
if(matcher.find()) {
|
||||
commandes.blocageApplication = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Définir le motif de la regex
|
||||
pattern = "messageAlerte-(.*?)-messageAlerte";
|
||||
regex = Pattern.compile(pattern);
|
||||
matcher = regex.matcher(content);
|
||||
|
||||
// message alerte
|
||||
while (matcher.find()) {
|
||||
// Récupérer le texte entre les balises
|
||||
commandes.messageAlerte = matcher.group(1);
|
||||
commandes.messageAlerte = commandes.messageAlerte.replaceAll("-br-", "<br>");
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class exportEmargement extends AbstractAction{
|
||||
putValue( Action.SMALL_ICON, new ImageIcon(Window_gestionnaire.class.getResource("/resources/emargement.png")) );
|
||||
putValue( Action.LARGE_ICON_KEY, new ImageIcon(Window_gestionnaire.class.getResource("/resources/emargement.png")) );
|
||||
putValue( Action.SHORT_DESCRIPTION, "Exporter l'émargement dans un classeur Ms Excel." );
|
||||
putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_DOWN_MASK));
|
||||
putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_DOWN_MASK));
|
||||
|
||||
}
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@ public class exportTable extends AbstractAction{
|
||||
putValue( Action.SMALL_ICON, new ImageIcon(Window_gestionnaire.class.getResource("/resources/exportTableToExcel.png")) );
|
||||
putValue( Action.LARGE_ICON_KEY, new ImageIcon(Window_gestionnaire.class.getResource("/resources/exportTableToExcel.png")) );
|
||||
putValue( Action.SHORT_DESCRIPTION, "Exporter la table dans un classeur Ms Excel." );
|
||||
putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_DOWN_MASK));
|
||||
putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_DOWN_MASK));
|
||||
|
||||
}
|
||||
/**
|
||||
|
@ -5,5 +5,7 @@ public class commandes {
|
||||
public static noeud nBase = null; // La base de données sous forme de noeud.
|
||||
public static String version = "1.0.3"; // La version actuelle
|
||||
public static Boolean newVersion = false; //Permet de vérifier l'existance d'un nouvelle version.
|
||||
|
||||
public static Boolean helpme1 = false; //Compléter mon service annuel.
|
||||
public static Boolean blocageApplication = false; //Compléter mon service annuel.
|
||||
public static String messageAlerte = ""; //Message alerte
|
||||
}
|
||||
|
BIN
src/resources/AideInscriptionXLSX.png
Normal file
BIN
src/resources/AideInscriptionXLSX.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 388 KiB |
BIN
src/resources/helpme1.png
Normal file
BIN
src/resources/helpme1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 68 KiB |
Loading…
x
Reference in New Issue
Block a user