упразднение старого объекта аккаунта
This commit is contained in:
31
.idea/workspace.xml
generated
31
.idea/workspace.xml
generated
@@ -6,7 +6,36 @@
|
|||||||
</artifacts-to-build>
|
</artifacts-to-build>
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="" />
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
|
<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/ComponentsServer/BugReport/BugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReport.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/Subscriber.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/Subscriber.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberDialog.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberDialog.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberFields.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberFields.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubsribersForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubsribersForm.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountDialog.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountDialog.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountFields.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountFields.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UserAccount.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UserAccount.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/Account/Account.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/Account/AccountRole.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/AccountRole.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/Account/AccountsDBTable.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/GlobalDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/GlobalDatabase.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/MainModule.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/MainModule.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/NormalProperties.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/NormalProperties.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AddBugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AddBugReport.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/CheckRegistrationOnServer.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishComponent.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishComponent.java" 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/Repository/Server/ServerCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerCode.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMPackage/DVMPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMPackage/DVMPackage.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforPackage/SapforPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforPackage/SapforPackage.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/CallbackForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/CallbackForm.java" afterDir="false" />
|
||||||
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"Email": "vmk-post@yandex.ru",
|
"Email": "vmk-post@yandex.ru",
|
||||||
"Name": "M",
|
"Name": "M",
|
||||||
"Role": "Admin",
|
|
||||||
"Workspace": "E:\\Tests",
|
"Workspace": "E:\\Tests",
|
||||||
"ProjectsSearchDirectory": "E:\\BUG",
|
"ProjectsSearchDirectory": "E:\\BUG",
|
||||||
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import _VisualDVM.ComponentsServer.BugReport.Json.RecipientsJson;
|
|||||||
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingsJson;
|
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingsJson;
|
||||||
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
||||||
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
||||||
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Constants;
|
import _VisualDVM.Constants;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.Account;
|
|
||||||
import _VisualDVM.ProjectData.SapforData.SapforProperties;
|
import _VisualDVM.ProjectData.SapforData.SapforProperties;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ public class BugReport extends rDBObject {
|
|||||||
}
|
}
|
||||||
public String getSettingsSummary() {
|
public String getSettingsSummary() {
|
||||||
Vector<String> res = new Vector_<String>(
|
Vector<String> res = new Vector_<String>(
|
||||||
(Global.mainModule.HasAccount() ? (Global.mainModule.getAccount().isAdmin() ? ("Адрес отправителя: " + sender_address + "\n") : "") : ""),
|
(Global.mainModule.getAccount().isAdmin() ? ("Адрес отправителя: " + sender_address + "\n") : ""),
|
||||||
"Версия SAPFOR: " + sapfor_version,
|
"Версия SAPFOR: " + sapfor_version,
|
||||||
"Версия визуализатора: " + visualiser_version,
|
"Версия визуализатора: " + visualiser_version,
|
||||||
"----------------------------------"
|
"----------------------------------"
|
||||||
@@ -177,7 +177,7 @@ public class BugReport extends rDBObject {
|
|||||||
public SapforProperties getPropertiesJson() {
|
public SapforProperties getPropertiesJson() {
|
||||||
return packedSettingsJson.isEmpty() ? new SapforProperties() : Utils_.gson.fromJson(packedSettingsJson, SapforProperties.class);
|
return packedSettingsJson.isEmpty() ? new SapforProperties() : Utils_.gson.fromJson(packedSettingsJson, SapforProperties.class);
|
||||||
}
|
}
|
||||||
public boolean canAppend(Account account, TextLog log) {
|
public boolean canAppend(UserAccount account, TextLog log) {
|
||||||
if (account.CheckRegistered(log)) {
|
if (account.CheckRegistered(log)) {
|
||||||
if (account.email.equals(sender_address) || account.email.equals(executor_address)) {
|
if (account.email.equals(sender_address) || account.email.equals(executor_address)) {
|
||||||
return true;
|
return true;
|
||||||
@@ -195,7 +195,7 @@ public class BugReport extends rDBObject {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public boolean canModify(Account account, TextLog log) {
|
public boolean canModify(UserAccount account, TextLog log) {
|
||||||
if (account.CheckRegistered(log)) {
|
if (account.CheckRegistered(log)) {
|
||||||
switch (account.role) {
|
switch (account.role) {
|
||||||
case Admin:
|
case Admin:
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
|||||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Constants;
|
import _VisualDVM.Constants;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.Account;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
|
||||||
import _VisualDVM.GlobalData.Machine.Machine;
|
import _VisualDVM.GlobalData.Machine.Machine;
|
||||||
import _VisualDVM.GlobalData.Machine.MachineType;
|
import _VisualDVM.GlobalData.Machine.MachineType;
|
||||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||||
@@ -237,20 +236,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
throw new RepositoryRefuseException("Баг репорт с ключом " + oldBugReport.id + " не существует.");
|
throw new RepositoryRefuseException("Баг репорт с ключом " + oldBugReport.id + " не существует.");
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
void CheckSubscriberRole() throws Exception {
|
|
||||||
Account account = (Account) request.object;
|
|
||||||
Subscriber subscriber = null;
|
|
||||||
if (db.subscribers.containsKey(account.email)) {
|
|
||||||
subscriber = db.subscribers.get(account.email);
|
|
||||||
} else {
|
|
||||||
subscriber = new Subscriber();
|
|
||||||
subscriber.name = account.name;
|
|
||||||
subscriber.address = account.email;
|
|
||||||
subscriber.mailOn = 1;
|
|
||||||
db.Insert(subscriber);
|
|
||||||
}
|
|
||||||
response.object = subscriber; //возвращаем информацию о подписчике.
|
|
||||||
}
|
|
||||||
void GetComponentsBackUps() throws Exception {
|
void GetComponentsBackUps() throws Exception {
|
||||||
File backupsDirectory = Paths.get(Utils_.getHomePath(), "Components", request.arg, "Backups").toFile();
|
File backupsDirectory = Paths.get(Utils_.getHomePath(), "Components", request.arg, "Backups").toFile();
|
||||||
//--
|
//--
|
||||||
@@ -364,9 +349,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
case GetUserAccountByEmail:
|
case GetUserAccountByEmail:
|
||||||
GetUserAccountByEmail();
|
GetUserAccountByEmail();
|
||||||
break;
|
break;
|
||||||
case CheckSubscriberRole: //todo устарело
|
|
||||||
CheckSubscriberRole();
|
|
||||||
break;
|
|
||||||
case GetComponentsBackups:
|
case GetComponentsBackups:
|
||||||
GetComponentsBackUps();
|
GetComponentsBackUps();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package _VisualDVM.ComponentsServer.Subscribes;
|
package _VisualDVM.ComponentsServer.Subscribes;
|
||||||
import Common.Database.Objects.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
public class Subscriber extends DBObject {
|
public class Subscriber extends DBObject {
|
||||||
//todo скорее всего вывести.ибо дублер UserAccount
|
//todo скорее всего вывести.ибо дублер UserAccount
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Common.Visual.UI;
|
|||||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||||
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
public class SubscriberDialog extends DBObjectDialog<Subscriber, SubscriberFields> {
|
public class SubscriberDialog extends DBObjectDialog<Subscriber, SubscriberFields> {
|
||||||
public SubscriberDialog() {
|
public SubscriberDialog() {
|
||||||
super(SubscriberFields.class);
|
super(SubscriberFields.class);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package _VisualDVM.ComponentsServer.Subscribes.UI;
|
package _VisualDVM.ComponentsServer.Subscribes.UI;
|
||||||
import Common.Visual.TextField.StyledTextField;
|
import Common.Visual.TextField.StyledTextField;
|
||||||
import Common.Visual.Windows.Dialog.DialogFields;
|
import Common.Visual.Windows.Dialog.DialogFields;
|
||||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import Common.Visual.Windows.Dialog.DBObjectDialog;
|
|||||||
import Common.Visual.Windows.Dialog.DialogFields;
|
import Common.Visual.Windows.Dialog.DialogFields;
|
||||||
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package _VisualDVM.GlobalData.Account;
|
package _VisualDVM.ComponentsServer.UserAccount;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
public enum AccountRole implements Serializable {
|
public enum AccountRole implements Serializable {
|
||||||
Undefined,
|
Undefined,
|
||||||
@@ -4,7 +4,7 @@ import Common.Visual.UI;
|
|||||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
public class UserAccountDialog extends DBObjectDialog<UserAccount, UserAccountFields> {
|
public class UserAccountDialog extends DBObjectDialog<UserAccount, UserAccountFields> {
|
||||||
public UserAccountDialog() {
|
public UserAccountDialog() {
|
||||||
super(UserAccountFields.class);
|
super(UserAccountFields.class);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package _VisualDVM.ComponentsServer.UserAccount.UI;
|
package _VisualDVM.ComponentsServer.UserAccount.UI;
|
||||||
import Common.Visual.TextField.StyledTextField;
|
import Common.Visual.TextField.StyledTextField;
|
||||||
import Common.Visual.Windows.Dialog.DialogFields;
|
import Common.Visual.Windows.Dialog.DialogFields;
|
||||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package _VisualDVM.ComponentsServer.UserAccount;
|
package _VisualDVM.ComponentsServer.UserAccount;
|
||||||
import Common.Database.Objects.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
import Common.Database.Objects.iDBObject;
|
import Common.Database.Objects.iDBObject;
|
||||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
import Common.Utils.TextLog;
|
||||||
|
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||||
|
import _VisualDVM.Global;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
public class UserAccount extends iDBObject {
|
public class UserAccount extends iDBObject {
|
||||||
public String name = "";
|
public String name = "";
|
||||||
@@ -31,4 +33,55 @@ public class UserAccount extends iDBObject {
|
|||||||
name = name_in;
|
name = name_in;
|
||||||
email=email_in;
|
email=email_in;
|
||||||
}
|
}
|
||||||
|
//todo часть устарело.разобрать.
|
||||||
|
public boolean CheckRegistered(TextLog Log) {
|
||||||
|
if (role.equals(AccountRole.Undefined)) {
|
||||||
|
if (Log != null) {
|
||||||
|
Log.Writeln("Пользователь не зарегистрирован");
|
||||||
|
if (Global.mainModule.getUI().hasMainWindow())
|
||||||
|
Global.mainModule.getUI().getMainWindow().FocusCallback();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public boolean isRegistered() {
|
||||||
|
return !role.equals(AccountRole.Undefined);
|
||||||
|
}
|
||||||
|
public boolean CheckAuthorship(String address_in, TextLog log) {
|
||||||
|
if (!isAdmin() && (!email.equals(address_in))) {
|
||||||
|
if (log != null)
|
||||||
|
log.Writeln_("Вы не являетесь автором или администратором");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public boolean CheckAccessRights(String address_in, TextLog log) {
|
||||||
|
return (CheckRegistered(log) && CheckAuthorship(address_in, log));
|
||||||
|
}
|
||||||
|
public boolean ExtendedCheckAccessRights(BugReport bugReport, TextLog log) {
|
||||||
|
if (CheckRegistered(log)) {
|
||||||
|
if (email.equals(bugReport.executor_address)) {
|
||||||
|
//метод вывести как нерабочий.когда будет изменена схема админства.
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
if (!isAdmin() && (!email.equals(bugReport.sender_address))) {
|
||||||
|
log.Writeln_("Вы не являетесь автором, исполнителем, или администратором");
|
||||||
|
return false;
|
||||||
|
} else return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public boolean isAdmin() {
|
||||||
|
return role.equals(AccountRole.Admin);
|
||||||
|
}
|
||||||
|
public boolean CheckAdmin(TextLog log) {
|
||||||
|
if (!isAdmin()) {
|
||||||
|
log.Writeln_("Вы не являетесь администратором!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//---
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
package _VisualDVM.GlobalData.Account;
|
|
||||||
import Common.Database.Objects.DBObject;
|
|
||||||
import Common.Utils.TextLog;
|
|
||||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
|
||||||
import _VisualDVM.Global;
|
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
|
||||||
public class Account extends DBObject {
|
|
||||||
@Description("PRIMARY KEY,NOT NULL")
|
|
||||||
public int id = 0;
|
|
||||||
public String name = "?";
|
|
||||||
public String email = "?";
|
|
||||||
//--
|
|
||||||
@Description("IGNORE")
|
|
||||||
public AccountRole role = AccountRole.Undefined; //роль незареганного пользователя
|
|
||||||
//--
|
|
||||||
public boolean CheckRegistered(TextLog Log) {
|
|
||||||
if (role.equals(AccountRole.Undefined)) {
|
|
||||||
if (Log != null) {
|
|
||||||
Log.Writeln("Пользователь не зарегистрирован");
|
|
||||||
if (Global.mainModule.getUI().hasMainWindow())
|
|
||||||
Global.mainModule.getUI().getMainWindow().FocusCallback();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public boolean isRegistered() {
|
|
||||||
return !role.equals(AccountRole.Undefined);
|
|
||||||
}
|
|
||||||
public boolean CheckAuthorship(String address_in, TextLog log) {
|
|
||||||
if (!isAdmin() && (!email.equals(address_in))) {
|
|
||||||
if (log != null)
|
|
||||||
log.Writeln_("Вы не являетесь автором или администратором");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public boolean CheckAccessRights(String address_in, TextLog log) {
|
|
||||||
return (CheckRegistered(log) && CheckAuthorship(address_in, log));
|
|
||||||
}
|
|
||||||
public boolean ExtendedCheckAccessRights(BugReport bugReport, TextLog log) {
|
|
||||||
if (CheckRegistered(log)) {
|
|
||||||
if (email.equals(bugReport.executor_address)) {
|
|
||||||
//метод вывести как нерабочий.когда будет изменена схема админства.
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
if (!isAdmin() && (!email.equals(bugReport.sender_address))) {
|
|
||||||
log.Writeln_("Вы не являетесь автором, исполнителем, или администратором");
|
|
||||||
return false;
|
|
||||||
} else return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public boolean isAdmin() {
|
|
||||||
return role.equals(AccountRole.Admin);
|
|
||||||
}
|
|
||||||
public boolean CheckAdmin(TextLog log) {
|
|
||||||
if (!isAdmin()) {
|
|
||||||
log.Writeln_("Вы не являетесь администратором!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public Object getPK() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package _VisualDVM.GlobalData.Account;
|
|
||||||
import Common.Database.Tables.DBTable;
|
|
||||||
public class AccountsDBTable extends DBTable<Integer, Account> {
|
|
||||||
public AccountsDBTable() {
|
|
||||||
super(Integer.class, Account.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,8 +4,6 @@ import Common.Database.VisualiserDatabase;
|
|||||||
import Common.MainModule_;
|
import Common.MainModule_;
|
||||||
import _VisualDVM.Current;
|
import _VisualDVM.Current;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.Account;
|
|
||||||
import _VisualDVM.GlobalData.Account.AccountsDBTable;
|
|
||||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||||
import _VisualDVM.GlobalData.Compiler.CompilersDBTable;
|
import _VisualDVM.GlobalData.Compiler.CompilersDBTable;
|
||||||
import _VisualDVM.GlobalData.DBLastProject.LastProjectsDBTable;
|
import _VisualDVM.GlobalData.DBLastProject.LastProjectsDBTable;
|
||||||
@@ -43,7 +41,6 @@ public class GlobalDatabase extends VisualiserDatabase {
|
|||||||
public DVMParameterDBTable dvmParameters;
|
public DVMParameterDBTable dvmParameters;
|
||||||
//----- ДАННЫЕ ВИЗУАЛИЗАТОРА---------------------------------
|
//----- ДАННЫЕ ВИЗУАЛИЗАТОРА---------------------------------
|
||||||
public LastProjectsDBTable lastProjects;
|
public LastProjectsDBTable lastProjects;
|
||||||
public AccountsDBTable accounts;
|
|
||||||
//-
|
//-
|
||||||
public SapforProfilesDBTable sapforProfiles = null;
|
public SapforProfilesDBTable sapforProfiles = null;
|
||||||
//---------
|
//---------
|
||||||
@@ -65,7 +62,6 @@ public class GlobalDatabase extends VisualiserDatabase {
|
|||||||
addTable(runConfigurations = new RunConfigurationsDBTable());
|
addTable(runConfigurations = new RunConfigurationsDBTable());
|
||||||
addTable(environmentValues = new EnvironmentValuesDBTable());
|
addTable(environmentValues = new EnvironmentValuesDBTable());
|
||||||
addTable(lastProjects = new LastProjectsDBTable());
|
addTable(lastProjects = new LastProjectsDBTable());
|
||||||
addTable(accounts = new AccountsDBTable());
|
|
||||||
addTable(dvmParameters = new DVMParameterDBTable());
|
addTable(dvmParameters = new DVMParameterDBTable());
|
||||||
addTable(sapforProfiles = new SapforProfilesDBTable());
|
addTable(sapforProfiles = new SapforProfilesDBTable());
|
||||||
addTable(sapforProfilesSettings = new SapforProfileSettingsDBTable());
|
addTable(sapforProfilesSettings = new SapforProfileSettingsDBTable());
|
||||||
@@ -73,10 +69,6 @@ public class GlobalDatabase extends VisualiserDatabase {
|
|||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
@Override
|
@Override
|
||||||
public void Init() throws Exception {
|
public void Init() throws Exception {
|
||||||
Global.mainModule.set(Current.Account,
|
|
||||||
accounts.Data.isEmpty() ? Insert(new Account()) :
|
|
||||||
accounts.getFirstRecord()
|
|
||||||
);
|
|
||||||
//настройки компонент
|
//настройки компонент
|
||||||
runConfigurations.Patch();
|
runConfigurations.Patch();
|
||||||
//---
|
//---
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package _VisualDVM;
|
|||||||
import Common.MainModule_;
|
import Common.MainModule_;
|
||||||
import Common.Utils.Vector_;
|
import Common.Utils.Vector_;
|
||||||
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
||||||
import _VisualDVM.GlobalData.Account.Account;
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.GlobalData.GlobalDatabase;
|
import _VisualDVM.GlobalData.GlobalDatabase;
|
||||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
@@ -16,6 +16,7 @@ import javax.swing.tree.DefaultMutableTreeNode;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
||||||
|
UserAccount account = null;
|
||||||
//--
|
//--
|
||||||
Vector<PassCode> accountRoleDependentPasses = new Vector_<>(
|
Vector<PassCode> accountRoleDependentPasses = new Vector_<>(
|
||||||
PassCode.AddSubscriber,
|
PassCode.AddSubscriber,
|
||||||
@@ -40,6 +41,7 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
|||||||
);
|
);
|
||||||
public MainModule() throws Exception {
|
public MainModule() throws Exception {
|
||||||
super(GlobalDatabase.class, MainUI.class);
|
super(GlobalDatabase.class, MainUI.class);
|
||||||
|
account = new UserAccount(Global.normalProperties.Name, Global.normalProperties.Email);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public Class getPassCodesEnum() {
|
public Class getPassCodesEnum() {
|
||||||
@@ -50,13 +52,12 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
|||||||
return "_VisualDVM.Passes.All.";
|
return "_VisualDVM.Passes.All.";
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
public boolean HasAccount() {
|
public UserAccount getAccount() {
|
||||||
return get(Current.Account) != null;
|
return account;
|
||||||
|
}
|
||||||
|
public void setAccount(UserAccount account_in) {
|
||||||
|
account = account_in;
|
||||||
}
|
}
|
||||||
//todo Бессмысленно. аккаунт всегда подразумевается. вывести.
|
|
||||||
public Account getAccount() {
|
|
||||||
return (Account) get(Current.Account);
|
|
||||||
} //временно
|
|
||||||
public boolean HasProject() {
|
public boolean HasProject() {
|
||||||
return get(Current.Project) != null;
|
return get(Current.Project) != null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package _VisualDVM;
|
package _VisualDVM;
|
||||||
import Common.CommonConstants;
|
import Common.CommonConstants;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
@@ -13,8 +13,6 @@ public class NormalProperties extends VisualDVMProperties {
|
|||||||
public String Email = "";
|
public String Email = "";
|
||||||
@Expose
|
@Expose
|
||||||
public String Name = "";
|
public String Name = "";
|
||||||
@Expose
|
|
||||||
public AccountRole Role = AccountRole.Undefined;
|
|
||||||
//--->
|
//--->
|
||||||
@Expose
|
@Expose
|
||||||
public String Workspace = "";
|
public String Workspace = "";
|
||||||
@@ -173,7 +171,6 @@ public class NormalProperties extends VisualDVMProperties {
|
|||||||
public void SynchronizeAccount(UserAccount account){
|
public void SynchronizeAccount(UserAccount account){
|
||||||
Name = account.name;
|
Name = account.name;
|
||||||
Email = account.email;
|
Email = account.email;
|
||||||
Role = account.role;
|
|
||||||
Update();
|
Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
|||||||
import _VisualDVM.ComponentsServer.BugReport.BugReportState;
|
import _VisualDVM.ComponentsServer.BugReport.BugReportState;
|
||||||
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ import Common.Utils.Utils_;
|
|||||||
import Common.Visual.UI;
|
import Common.Visual.UI;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
import _VisualDVM.Passes.Server.ComponentsServerPass;
|
import _VisualDVM.Passes.Server.ComponentsServerPass;
|
||||||
import _VisualDVM.Repository.Server.ServerCode;
|
import _VisualDVM.Repository.Server.ServerCode;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.Serializable;
|
public class CheckAccount extends ComponentsServerPass {
|
||||||
public class CheckAccount extends ComponentsServerPass<UserAccount> {
|
|
||||||
@Override
|
@Override
|
||||||
public String getIconPath() {
|
public String getIconPath() {
|
||||||
return "/icons/Registry.png";
|
return "/icons/Registry.png";
|
||||||
@@ -23,22 +22,18 @@ public class CheckAccount extends ComponentsServerPass<UserAccount> {
|
|||||||
File keyFile;
|
File keyFile;
|
||||||
void confirmEmail() throws Exception{
|
void confirmEmail() throws Exception{
|
||||||
ConfirmEmail confirmEmailPass = (ConfirmEmail) Global.mainModule.getPass(PassCode.ConfirmEmail);;
|
ConfirmEmail confirmEmailPass = (ConfirmEmail) Global.mainModule.getPass(PassCode.ConfirmEmail);;
|
||||||
if (confirmEmailPass.Do(
|
if (confirmEmailPass.Do(Global.mainModule.getAccount())) {
|
||||||
new UserAccount(Global.normalProperties.Name, Global.normalProperties.Email))
|
|
||||||
) {
|
|
||||||
UserAccount userAccount = confirmEmailPass.target;
|
|
||||||
//подтвердили почту. теперь проверяем ее роль на сервере. если на сервере нет акка будет создан
|
//подтвердили почту. теперь проверяем ее роль на сервере. если на сервере нет акка будет создан
|
||||||
if (SendRequest(ServerCode.GetUserAccountByEmail, "",userAccount)){
|
if (SendRequest(ServerCode.GetUserAccountByEmail, "",Global.mainModule.getAccount())){
|
||||||
target = (UserAccount) request.server_response.object;
|
Global.mainModule.setAccount((UserAccount) request.server_response.object);
|
||||||
FileUtils.writeStringToFile(keyFile, target.security_key);
|
FileUtils.writeStringToFile(keyFile, Global.mainModule.getAccount().security_key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
protected boolean canStart(Object... args) throws Exception {
|
||||||
target =null;
|
Global.mainModule.getAccount().role = AccountRole.Undefined;
|
||||||
keyFile = new File(Global.KeyDirectory, "key");
|
keyFile = new File(Global.KeyDirectory, "key");
|
||||||
Global.normalProperties.Role = AccountRole.Undefined;
|
|
||||||
Global.normalProperties.Update();
|
Global.normalProperties.Update();
|
||||||
//--
|
//--
|
||||||
//1. Ищем ключ.
|
//1. Ищем ключ.
|
||||||
@@ -50,7 +45,7 @@ public class CheckAccount extends ComponentsServerPass<UserAccount> {
|
|||||||
if (request.server_response.object!=null){
|
if (request.server_response.object!=null){
|
||||||
//ключ актуальный.
|
//ключ актуальный.
|
||||||
System.out.println("ключ совпал");
|
System.out.println("ключ совпал");
|
||||||
target = (UserAccount) request.server_response.object;
|
Global.mainModule.setAccount((UserAccount) request.server_response.object);
|
||||||
}else {
|
}else {
|
||||||
System.out.println("ключ не совпал!");
|
System.out.println("ключ не совпал!");
|
||||||
//ключ неактуальный. регистрируемся по новой.
|
//ключ неактуальный. регистрируемся по новой.
|
||||||
@@ -63,11 +58,11 @@ public class CheckAccount extends ComponentsServerPass<UserAccount> {
|
|||||||
System.out.println("ключ не найден!");
|
System.out.println("ключ не найден!");
|
||||||
confirmEmail();
|
confirmEmail();
|
||||||
}
|
}
|
||||||
return target!=null;
|
return !Global.mainModule.getAccount().role.equals(AccountRole.Undefined);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void body() throws Exception {
|
protected void body() throws Exception {
|
||||||
Global.normalProperties.SynchronizeAccount(target);
|
Global.normalProperties.SynchronizeAccount(Global.mainModule.getAccount());
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void showDone() throws Exception {
|
protected void showDone() throws Exception {
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package _VisualDVM.Passes.All;
|
|
||||||
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
|
|
||||||
import _VisualDVM.Global;
|
|
||||||
import _VisualDVM.Passes.Server.ComponentsServerPass;
|
|
||||||
import _VisualDVM.Repository.Server.ServerCode;
|
|
||||||
public class CheckRegistrationOnServer extends ComponentsServerPass<Subscriber> {
|
|
||||||
@Override
|
|
||||||
protected boolean isSafe() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
|
||||||
return SendRequest(ServerCode.CheckSubscriberRole, "", Global.mainModule.getAccount());
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void body() throws Exception {
|
|
||||||
target = (Subscriber) request.server_response.object;
|
|
||||||
Global.mainModule.getAccount().role = target.role;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,7 +7,7 @@ import _VisualDVM.ComponentsServer.Component.Json.ComponentPublicationInfoJson;
|
|||||||
import _VisualDVM.ComponentsServer.Component.UI.PublishForm;
|
import _VisualDVM.ComponentsServer.Component.UI.PublishForm;
|
||||||
import _VisualDVM.Constants;
|
import _VisualDVM.Constants;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
import _VisualDVM.Passes.Server.ComponentsServerPass;
|
import _VisualDVM.Passes.Server.ComponentsServerPass;
|
||||||
import _VisualDVM.Repository.EmailMessage;
|
import _VisualDVM.Repository.EmailMessage;
|
||||||
@@ -32,10 +32,6 @@ public class PublishComponent extends ComponentsServerPass<Component> {
|
|||||||
Log.Writeln_("Публикация компонент разрешена только для Windows");
|
Log.Writeln_("Публикация компонент разрешена только для Windows");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Global.mainModule.HasAccount()) {
|
|
||||||
Log.Writeln_("Окно компонент было открыто до синхронизации прав");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!Global.mainModule.getAccount().role.equals(AccountRole.Admin)) {
|
if (!Global.mainModule.getAccount().role.equals(AccountRole.Admin)) {
|
||||||
Log.Writeln_("Вы не являетесь администратором");
|
Log.Writeln_("Вы не являетесь администратором");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ public enum PassCode implements PassCode_ {
|
|||||||
DeleteProfile,
|
DeleteProfile,
|
||||||
//-
|
//-
|
||||||
CheckAccount,
|
CheckAccount,
|
||||||
CheckRegistrationOnServer,
|
|
||||||
EditAccount,
|
EditAccount,
|
||||||
AddSubscriber,
|
AddSubscriber,
|
||||||
EditSubscriber,
|
EditSubscriber,
|
||||||
@@ -492,8 +491,6 @@ public enum PassCode implements PassCode_ {
|
|||||||
return "Массовый выбор массивов";
|
return "Массовый выбор массивов";
|
||||||
case CheckAccount:
|
case CheckAccount:
|
||||||
return "Проверка учётной записи";
|
return "Проверка учётной записи";
|
||||||
case CheckRegistrationOnServer:
|
|
||||||
return "Проверка регистрации учетной записи на сервере";
|
|
||||||
case DeleteSelectedFiles:
|
case DeleteSelectedFiles:
|
||||||
return "Удалить отмеченные файлы проекта";
|
return "Удалить отмеченные файлы проекта";
|
||||||
case SetSelectedFilesLanguage:
|
case SetSelectedFilesLanguage:
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ public enum ServerCode {
|
|||||||
Ping,
|
Ping,
|
||||||
ReceiveFile,
|
ReceiveFile,
|
||||||
//--
|
//--
|
||||||
CheckSubscriberRole,
|
|
||||||
//-
|
|
||||||
GetComponentsBackups,
|
GetComponentsBackups,
|
||||||
//-
|
//-
|
||||||
UpdateBugReport,
|
UpdateBugReport,
|
||||||
@@ -115,8 +113,6 @@ public enum ServerCode {
|
|||||||
return "Скачивание компонента с сервера";
|
return "Скачивание компонента с сервера";
|
||||||
case DeleteObjectByPK:
|
case DeleteObjectByPK:
|
||||||
return "Удаление объекта с сервера";
|
return "Удаление объекта с сервера";
|
||||||
case CheckSubscriberRole:
|
|
||||||
return "Проверка роли подписчика на сервере";
|
|
||||||
case CloneObjectByPK:
|
case CloneObjectByPK:
|
||||||
return "Дублирование объекта на сервере";
|
return "Дублирование объекта на сервере";
|
||||||
case UpdateActiveDVMPackages:
|
case UpdateActiveDVMPackages:
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ import Common.Utils.TextLog;
|
|||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import Common.Utils.Vector_;
|
import Common.Utils.Vector_;
|
||||||
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
||||||
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Constants;
|
import _VisualDVM.Constants;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.Account;
|
|
||||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||||
import _VisualDVM.Passes.All.DownloadRepository;
|
import _VisualDVM.Passes.All.DownloadRepository;
|
||||||
import _VisualDVM.Passes.All.ZipFolderPass;
|
import _VisualDVM.Passes.All.ZipFolderPass;
|
||||||
@@ -296,7 +297,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
response.object = Utils_.fileToBytes(db.getFile());
|
response.object = Utils_.fileToBytes(db.getFile());
|
||||||
}
|
}
|
||||||
Pair<Group, Vector<File>> ConvertDirectoryToGroup(File src, LanguageName languageName, TestType
|
Pair<Group, Vector<File>> ConvertDirectoryToGroup(File src, LanguageName languageName, TestType
|
||||||
testType, Account account) throws Exception {
|
testType, UserAccount account) throws Exception {
|
||||||
Group object = new Group();
|
Group object = new Group();
|
||||||
Vector<File> groupFiles = null; //транспорт.
|
Vector<File> groupFiles = null; //транспорт.
|
||||||
//->>
|
//->>
|
||||||
@@ -319,7 +320,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
return new Pair<>(object, groupFiles);
|
return new Pair<>(object, groupFiles);
|
||||||
}
|
}
|
||||||
void RefreshDVMTests() throws Exception {
|
void RefreshDVMTests() throws Exception {
|
||||||
Account account = (Account) request.object;
|
UserAccount account = (UserAccount) request.object;
|
||||||
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
|
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
|
||||||
DownloadRepository downloadRepository = new DownloadRepository();
|
DownloadRepository downloadRepository = new DownloadRepository();
|
||||||
if (!downloadRepository.Do())
|
if (!downloadRepository.Do())
|
||||||
@@ -565,9 +566,10 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
}
|
}
|
||||||
SapforPackage tryAutoSapforTesting(TextLog Log) throws Exception {
|
SapforPackage tryAutoSapforTesting(TextLog Log) throws Exception {
|
||||||
//--
|
//--
|
||||||
Account account = new Account();
|
UserAccount account = new UserAccount();
|
||||||
account.name = "server";
|
account.name = "server";
|
||||||
account.email = Constants.MailAddress;
|
account.email = Constants.MailAddress;
|
||||||
|
account.role= AccountRole.Admin;
|
||||||
//-
|
//-
|
||||||
int sapforId = Integer.parseInt(request.arg);
|
int sapforId = Integer.parseInt(request.arg);
|
||||||
if (!db.serverSapfors.containsKey(sapforId)) {
|
if (!db.serverSapfors.containsKey(sapforId)) {
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import Common.Database.SQLITE.SQLiteDatabase;
|
|||||||
import Common.Utils.TextLog;
|
import Common.Utils.TextLog;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
||||||
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Constants;
|
import _VisualDVM.Constants;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.Account;
|
|
||||||
import _VisualDVM.Passes.All.ZipFolderPass;
|
import _VisualDVM.Passes.All.ZipFolderPass;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||||
@@ -210,7 +210,7 @@ public class TestsDatabase extends SQLiteDatabase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
public void CreateTestFromSingleFile(Account account, ServerSapfor sapfor, Group group, File file, String testDescription) throws Exception {
|
public void CreateTestFromSingleFile(UserAccount account, ServerSapfor sapfor, Group group, File file, String testDescription) throws Exception {
|
||||||
Test test = new Test();
|
Test test = new Test();
|
||||||
test.description = testDescription;
|
test.description = testDescription;
|
||||||
test.sender_name = account.name;
|
test.sender_name = account.name;
|
||||||
@@ -221,7 +221,7 @@ public class TestsDatabase extends SQLiteDatabase {
|
|||||||
//->>
|
//->>
|
||||||
SaveTestFromSingleFile(sapfor, group, test, file);
|
SaveTestFromSingleFile(sapfor, group, test, file);
|
||||||
}
|
}
|
||||||
public void RefreshGroup(Account account, ServerSapfor sapfor, Pair<Group, Vector<File>> groupData) throws Exception {
|
public void RefreshGroup(UserAccount account, ServerSapfor sapfor, Pair<Group, Vector<File>> groupData) throws Exception {
|
||||||
Group group = groupData.getKey();
|
Group group = groupData.getKey();
|
||||||
Vector<File> files = groupData.getValue();
|
Vector<File> files = groupData.getValue();
|
||||||
//--
|
//--
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package _VisualDVM.TestingSystem.DVM.DVMPackage;
|
package _VisualDVM.TestingSystem.DVM.DVMPackage;
|
||||||
import Common.CommonConstants;
|
import Common.CommonConstants;
|
||||||
import Common.Database.Objects.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.Account;
|
|
||||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||||
import _VisualDVM.GlobalData.Machine.Machine;
|
import _VisualDVM.GlobalData.Machine.Machine;
|
||||||
import _VisualDVM.GlobalData.Machine.MachineType;
|
import _VisualDVM.GlobalData.Machine.MachineType;
|
||||||
@@ -31,7 +31,7 @@ public class DVMPackage extends TestingPackage<DVMPackage_json> {
|
|||||||
//---
|
//---
|
||||||
public DVMPackage() {
|
public DVMPackage() {
|
||||||
}
|
}
|
||||||
public DVMPackage(Account account,
|
public DVMPackage(UserAccount account,
|
||||||
Machine machine,
|
Machine machine,
|
||||||
User user,
|
User user,
|
||||||
Compiler compiler,
|
Compiler compiler,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import Common.CommonConstants;
|
|||||||
import Common.Database.Objects.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
import Common.Utils.TextLog;
|
import Common.Utils.TextLog;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Account.Account;
|
|
||||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||||
import _VisualDVM.TestingSystem.Common.TasksPackageState;
|
import _VisualDVM.TestingSystem.Common.TasksPackageState;
|
||||||
import _VisualDVM.TestingSystem.Common.TestingPackage.TestingPackage;
|
import _VisualDVM.TestingSystem.Common.TestingPackage.TestingPackage;
|
||||||
@@ -32,7 +32,7 @@ public class SapforPackage extends TestingPackage<SapforPackage_json> {
|
|||||||
//---------
|
//---------
|
||||||
//конструктор. если 0 задач по итогу,значит пакет не запускаем вообще, и смотрим журнал.
|
//конструктор. если 0 задач по итогу,значит пакет не запускаем вообще, и смотрим журнал.
|
||||||
//Запрещено выполнять на нитях, так как прямой доступ к бд.
|
//Запрещено выполнять на нитях, так как прямой доступ к бд.
|
||||||
public SapforPackage(Account account, ServerSapfor serverSapfor, Vector<SapforConfiguration> configurations,
|
public SapforPackage(UserAccount account, ServerSapfor serverSapfor, Vector<SapforConfiguration> configurations,
|
||||||
int neeedsEmail_in,
|
int neeedsEmail_in,
|
||||||
TextLog Log) throws Exception {
|
TextLog Log) throws Exception {
|
||||||
id = CommonConstants.Nan;
|
id = CommonConstants.Nan;
|
||||||
|
|||||||
@@ -425,11 +425,11 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
lAccountName.setText(Utils_.Brackets(Global.normalProperties.Name));
|
lAccountName.setText(Utils_.Brackets(Global.mainModule.getAccount().name));
|
||||||
lAccountMail.setText(Utils_.Brackets(Global.normalProperties.Email));
|
lAccountMail.setText(Utils_.Brackets(Global.mainModule.getAccount().email));
|
||||||
lAccountRole.setText(Utils_.Brackets(Global.normalProperties.Role.getDescription()));
|
lAccountRole.setText(Utils_.Brackets(Global.mainModule.getAccount().role.getDescription()));
|
||||||
System.out.println("ROLE IS "+Global.normalProperties.Role.getDescription());
|
System.out.println("ROLE IS "+Global.mainModule.getAccount().role.getDescription());
|
||||||
switch (Global.normalProperties.Role) {
|
switch (Global.mainModule.getAccount().role) {
|
||||||
case Undefined:
|
case Undefined:
|
||||||
setUdefinedRights();
|
setUdefinedRights();
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user