no message

This commit is contained in:
2024-10-14 12:14:01 +03:00
parent 3a29898d5f
commit 452c4c7268
466 changed files with 1255 additions and 1100 deletions

View File

@@ -0,0 +1,69 @@
package _VisualDVM.Passes.All;
import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
import _VisualDVM.Passes.PassCode;
import Common.Passes.Pass;
public class CheckAccount extends Pass<Boolean> {
@Override
protected boolean canStart(Object... args) throws Exception {
target = false;
return true;
}
@Override
public String getIconPath() {
return "/icons/Registry.png";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected void body() throws Exception {
/*
switch (Current.getAccount().email){
case "vmk-post@yandex.ru":
case "79854210702@ya.ru":
Current.getAccount().role = AccountRole.Admin;
target = true;
break;
case "npodderyugina@gmail.com":
case "savol@keldysh.ru":
case "mkocharmin@yandex.ru":
case "juk.06@list.ru":
Current.getAccount().role = AccountRole.Developer;
target = true;
break;
case "?":
Current.getAccount().role = AccountRole.Undefined;
target = false;
break;
default:
Current.getAccount().role =AccountRole.User;
target = true;
break;
}
*/
//временно. оффлайн проверка по почте
target = Global.mainModule.getAccount().email.equals("?") ?
( Global.mainModule.getPass(PassCode.EditAccount).Do() &&
Global.mainModule.getPass(PassCode.CheckRegistrationOnServer).Do()) :
( Global.mainModule.getPass(PassCode.CheckRegistrationOnServer).Do());
}
@Override
protected boolean validate() {
return target;
}
@Override
protected void showDone() throws Exception {
if (UI.getMainWindow() != null) {
UI.getMainWindow().getCallbackWindow().ShowAccount();
if (Global.mainModule.HasBugReport())
UI.getMainWindow().getCallbackWindow().ShowCurrentBugReport();
}
if (Global.mainModule.getAccount().isAdmin())
Global.mainModule.getPass(PassCode.PublishComponent).setControlsVisible(true);
setControlsVisible(false); //если проверка успешна, кнопку больше не показывать.
}
}