fix лишней рассылки админам
This commit is contained in:
11
.idea/workspace.xml
generated
11
.idea/workspace.xml
generated
@@ -7,13 +7,14 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_RemoveDistArraysFromIO.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/icons/Transformations/SPF_RemoveDistArraysFromIO.png" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/SSH/RepositoryServerSSHPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/SSH/RepositoryServerSSHPass.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Component/Sapfor/Sapfor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Component/Sapfor/Sapfor.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/CheckAccount.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/CheckAccount.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/Email.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/Email.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/GetComponentsActualVersions.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/GetComponentsActualVersions.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Component/UI/ComponentsForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Component/UI/ComponentsForm.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/RepositoryServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/RepositoryServer.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ComponentsServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ComponentsServer.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
"BackupHour": 5,
|
||||
"BackupMinute": 0,
|
||||
"EmailAdminsOnStart": false,
|
||||
"AutoUpdateSearch": false,
|
||||
"AutoUpdateSearch": true,
|
||||
"ConfirmPassesStart": true,
|
||||
"ShowPassesDone": true,
|
||||
"FocusPassesResult": true,
|
||||
"ProjectDBName": "new_project_base.sqlite",
|
||||
"BugReportsDBName": "bug_reports.sqlite",
|
||||
"TestsDBName": "tests.sqlite",
|
||||
"ComponentsWindowWidth": 843,
|
||||
"ComponentsWindowHeight": 519,
|
||||
"ComponentsWindowWidth": 924,
|
||||
"ComponentsWindowHeight": 250,
|
||||
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
||||
"Visualizer_2Path": "C:\\Users\\misha\\Documents",
|
||||
|
||||
@@ -60,8 +60,6 @@ public class CheckAccount extends Pass<Boolean> {
|
||||
if (Global.componentsServer.db.bugReports.getUI().getCurrent() != null)
|
||||
Global.mainModule.getUI().getMainWindow().getCallbackWindow().ShowCurrentBugReport();
|
||||
}
|
||||
if (Global.mainModule.getAccount().isAdmin())
|
||||
Global.mainModule.getPass(PassCode.PublishComponent).setControlsVisible(true);
|
||||
setControlsVisible(false); //если проверка успешна, кнопку больше не показывать.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
|
||||
import _VisualDVM.Repository.Subscribes.Subscriber;
|
||||
import _VisualDVM.Utils;
|
||||
|
||||
import java.util.Vector;
|
||||
//http://java-online.ru/javax-mail.xhtml
|
||||
@@ -34,11 +36,13 @@ public class Email extends ComponentsRepositoryPass<EmailMessage> {
|
||||
}
|
||||
}
|
||||
}
|
||||
Utils.addDefaultMails(target.targets);
|
||||
String text_ =
|
||||
"Адресаты: " + String.join(", ", targetsNames) + "\n" +
|
||||
target.text;
|
||||
//нужно разделить сообщение на несколько одинаковых, по числу адресатов.
|
||||
for (String recipient : target.targets) {
|
||||
System.out.println(recipient);
|
||||
EmailMessage part = new EmailMessage();
|
||||
part.subject = target.subject;
|
||||
part.text = text_;
|
||||
|
||||
@@ -21,7 +21,6 @@ public class GetComponentsActualVersions extends ComponentsRepositoryPass {
|
||||
protected void ServerAction() throws Exception {
|
||||
Vector<String> versions = new Vector<>();
|
||||
for (Component component : Global.components.Data.values())
|
||||
//if (component.isVisible())
|
||||
versions.add(component.getComponentType().toString());
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.GetComponentsVersions, String.join("\n", versions)));
|
||||
LinkedHashMap<ComponentType, String> response_actual_versions = (LinkedHashMap<ComponentType, String>) response.object;
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ComponentsForm extends DataSetControlForm<Component> {
|
||||
}
|
||||
}
|
||||
);
|
||||
MainModule_.instance.getPass(PassCode.PublishComponent).setControlsVisible(false);
|
||||
Global.mainModule.getPass(PassCode.PublishComponent).setControlsVisible(Global.mainModule.getAccount().isAdmin());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -105,8 +105,6 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
Utils_.bytesToFile(message_in.files.get(aName), f);
|
||||
innerFiles.put(aName, f);
|
||||
}
|
||||
Vector<String> targets_ = new Vector<>(message_in.targets);
|
||||
Utils.addDefaultMails(targets_);
|
||||
//------------------------------
|
||||
Session session = Session.getDefaultInstance(props,
|
||||
new Authenticator() {
|
||||
@@ -117,7 +115,7 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
Constants.MailPassword);
|
||||
}
|
||||
});
|
||||
for (String target : targets_) {
|
||||
for (String target : message_in.targets) {
|
||||
boolean done = false;
|
||||
int attempts = 5;
|
||||
while (!done && (attempts > 0)) {
|
||||
|
||||
@@ -108,6 +108,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
}
|
||||
@Override
|
||||
protected void checkTargets(EmailMessage message_in) {
|
||||
System.out.println("unckeched targets = "+String.join(" ", message_in.targets));
|
||||
Vector<String> checkedTargets = new Vector<>();
|
||||
for (String email : message_in.targets) {
|
||||
if (db.subscribers.containsKey(email)) {
|
||||
@@ -118,6 +119,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
} else checkedTargets.add(email); //если почта не зарегана значит это мейл с регистрацией.
|
||||
}
|
||||
message_in.targets = checkedTargets;
|
||||
System.out.println("checked targets = "+String.join(" ", message_in.targets));
|
||||
}
|
||||
@Override
|
||||
public void afterDeleteAction(DBObject object) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user