рефакторинг. переносил текущие объекты в другое место

This commit is contained in:
2024-10-13 22:08:13 +03:00
parent 09b64218bd
commit 6afa2dc892
240 changed files with 1472 additions and 1518 deletions

View File

@@ -21,11 +21,11 @@ public class InitialiseUser extends Pass {
}
@Override
protected boolean canStart(Object... args) throws Exception {
return Current_.Check(Log, Current.Machine, Current.User);
return Global.mainModule.Check(Log, Current.Machine, Current.User);
}
@Override
protected void body() throws Exception {
switch (Current.getMachine().type) {
switch (Global.mainModule.getMachine().type) {
case Local:
passes.get(PassCode.LocalInitaliseUser).Do();
break;
@@ -36,23 +36,23 @@ public class InitialiseUser extends Pass {
if (workspace == null) {
if (passes.get(PassCode.RemoteInitialiseUser).Do()){
workspace = new SubscriberWorkspace();
workspace.email=Current.getAccount().email;
workspace.URL=Current.getMachine().getURL();
workspace.login=Current.getUser().login;
workspace.email=Global.mainModule.getAccount().email;
workspace.URL=Global.mainModule.getMachine().getURL();
workspace.login=Global.mainModule.getUser().login;
workspace.path=((RemoteFile) passes.get(PassCode.RemoteInitialiseUser).target).full_name;
//---
if (passes.get(PassCode.PublishRemoteWorkspace).Do(workspace)) {
Current.getUser().workspace = workspace.path;
Current.getUser().state = UserState.ready_to_work;
Global.mainModule.getDb().Update(Current.getUser());
Global.mainModule.getUser().workspace = workspace.path;
Global.mainModule.getUser().state = UserState.ready_to_work;
Global.mainModule.getDb().Update(Global.mainModule.getUser());
}
}
}
else {
//рега была. просто заносим то что там пользователю
Current.getUser().workspace = workspace.path;
Current.getUser().state = UserState.ready_to_work;
Global.mainModule.getDb().Update(Current.getUser());
Global.mainModule.getUser().workspace = workspace.path;
Global.mainModule.getUser().state = UserState.ready_to_work;
Global.mainModule.getDb().Update(Global.mainModule.getUser());
}
}
break;