рефакторинг. переносил текущие объекты в другое место
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user