Закрытие уязвимости с именами тестов
v++
This commit is contained in:
@@ -197,13 +197,7 @@ public class CreateTestFromDirectory extends Pass<Test> {
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
ShowMessage1(dir.getName());
|
||||
//--
|
||||
File tempProject = packTestCode(); //создание копии папки, и архивация.
|
||||
//-- получить размерность консольным сапфором. папка уже отправлена и чистить ее не нужно!!
|
||||
ShowMessage2("Синтаксический анализ и определение размерности");
|
||||
if (group.language == LanguageName.fortran) {//если не определит, будут нули.
|
||||
Sapfor.getMinMaxDim(Sapfor.getTempCopy(Global.mainModule.getSapfor().getFile()), tempProject, target);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
|
||||
@@ -4,6 +4,7 @@ import _VisualDVM.Global;
|
||||
import _VisualDVM.ProjectData.Files.FileState;
|
||||
import _VisualDVM.ProjectData.Files.ProjectFile;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
//добавить в текущую группу новый тест из текущего проекта.
|
||||
public class CreateTestFromProject extends CreateTestFromDirectory {
|
||||
db_project_info project;
|
||||
@@ -13,15 +14,27 @@ public class CreateTestFromProject extends CreateTestFromDirectory {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Global.testingServer.db.groups.getUI().canModifyCurrent(Log) && Global.mainModule.Check(Log, Current.Project)) {
|
||||
project = Global.mainModule.getProject();
|
||||
if (super.canStart(
|
||||
project.Home,
|
||||
Global.testingServer.db.groups.getUI().getCurrent())) {
|
||||
from_files_chooser = true; //чтобы опубликовал.
|
||||
return true;
|
||||
if (args.length == 0) {
|
||||
if (Global.testingServer.db.groups.getUI().canModifyCurrent(Log) && Global.mainModule.Check(Log, Current.Project)) {
|
||||
project = Global.mainModule.getProject();
|
||||
if (super.canStart(
|
||||
project.Home,
|
||||
Global.testingServer.db.groups.getUI().getCurrent())) {
|
||||
from_files_chooser = true; //чтобы опубликовал.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
project = (db_project_info) args[0];
|
||||
group = (Group) args[1];
|
||||
//если проект не текущий, освежить его бд.
|
||||
if (!Global.mainModule.HasProject() || !Global.mainModule.getProject().Home.equals(project.Home)) {
|
||||
project.Open();
|
||||
project.Close();
|
||||
}
|
||||
return super.canStart(project.Home, group);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -22,7 +22,7 @@ public class CreateTestsGroupFromSelectedVersions extends PublishTests {
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = new Vector<>();
|
||||
//---
|
||||
if (Global.testingServer.db.groups.getUI().CheckCurrent(Log)) {
|
||||
if (Global.testingServer.db.groups.getUI().canModifyCurrent(Log)) {
|
||||
group = Global.testingServer.db.groups.getUI().getCurrent();
|
||||
} else
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user