Устранены пропущенные уязвимости в некоторых проходах
v++
This commit is contained in:
2025-02-22 16:10:21 +03:00
parent f7973e0991
commit c83cfd9eff
9 changed files with 24 additions and 23 deletions

View File

@@ -300,6 +300,14 @@ public abstract class Database {
}
return log.isEmpty();
}
public boolean canModifyCurrent(TextLog log, Class... tablesClasses) {
for (Class tableClass : tablesClasses) {
DBTable table = getTable(tableClass);
if (table.getUI() != null)
table.getUI().canModifyCurrent(log);
}
return log.isEmpty();
}
public abstract PassCode_ getSynchronizePassCode(); //если бд есть на сервере.
//--
public void ReplaceFileAndReconnect(File file_in) throws Exception{

View File

@@ -3,7 +3,7 @@ import Common.Utils.Vector_;
import java.util.Vector;
public class Constants {
public static final int version = 1181;
public static final int version = 1182;
public static final int planner_version = 10;
public static final int testingMaxKernels = 64; //вообще говоря, это параметр машины.
//--

View File

@@ -33,7 +33,8 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
PassCode.StartTestingServer,
PassCode.PublishTestingServer,
PassCode.CreateTestsGroupFromSelectedVersions,
PassCode.RefreshDVMPackageResults
PassCode.RefreshDVMPackageResults,
PassCode.ConvertCorrectnessTests
);
public MainModule() throws Exception {
super(GlobalDatabase.class, MainUI.class);

View File

@@ -40,14 +40,11 @@ public class CheckAccount extends ComponentsServerPass {
if (keyFile.exists()) {
//ключ есть. проверить его актуальность.
String key = FileUtils.readFileToString(keyFile);
System.out.println("ключ найден.");
if (SendRequest(ServerCode.GetUserAccountByKey,key)){
if (request.server_response.object!=null){
//ключ актуальный.
System.out.println("ключ совпал");
Global.mainModule.setAccount((UserAccount) request.server_response.object);
}else {
System.out.println("ключ не совпал!");
//ключ неактуальный. регистрируемся по новой.
UI.Error("Текущий ключ неверен. Он будет удален.");
Utils_.forceDeleteWithCheck(keyFile);
@@ -55,7 +52,6 @@ public class CheckAccount extends ComponentsServerPass {
}
}
}else {
System.out.println("ключ не найден!");
confirmEmail();
}
return !Global.mainModule.getAccount().role.equals(AccountRole.Undefined);

View File

@@ -36,10 +36,10 @@ public class ReplaceTestsFromFiles extends TestingServerPass<Vector<Test>> {
//--->>>
Utils.RestoreSelectedDirectory(fileChooser);
Vector<File> files = fileChooser.ShowMultiDialog();
//---------------------------------------------------------------
//----------------ROLE is-----------------------------------------------
//--
File dir = fileChooser.getCurrentDirectory();
Global.mainModule.getPass(PassCode.UpdateProperty).Do("ProjectsSearchDirectory", dir);
Global.mainModule.getPass(PassCode.UpdateProperty).Do("ProjectsSearchDirectory", dir.getAbsolutePath());
//---------------
if (dir.getName().equals(Constants.data)) {
Log.Writeln_(Utils_.Brackets(dir) + "\nявляется служебной папкой визуализатора!");

View File

@@ -14,7 +14,7 @@ public abstract class AbortTestingPackage extends TestingServerPass<TestingPacka
@Override
protected boolean canStart(Object... args) throws Exception {
packageToKill = null;
if (getServer().db.CheckCurrent(Log, currentClass())) {
if (getServer().db.canModifyCurrent(Log, currentClass())) {
target = (TestingPackage) getServer().db.getTable(currentClass()).getUI().getCurrent();
switch (target.state) {
case Done:

View File

@@ -407,7 +407,6 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
lAccountName.setText(Utils_.Brackets(Global.mainModule.getAccount().name));
lAccountMail.setText(Utils_.Brackets(Global.mainModule.getAccount().email));
lAccountRole.setText(Utils_.Brackets(Global.mainModule.getAccount().role.getDescription()));
System.out.println("ROLE IS "+Global.mainModule.getAccount().role.getDescription());
switch (Global.mainModule.getAccount().role) {
case Undefined:
setUdefinedRights();