Skip to content

Commit

Permalink
constants
Browse files Browse the repository at this point in the history
  • Loading branch information
auguzsto committed Mar 5, 2023
1 parent f70777c commit 0da8068
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/src/constants/commands.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
abstract class Commands {
static const String cidShareAdd = 'sudo cid share add mode=common';
static const String cidImportAccount = 'sudo cid account add';
static const String cidShareDel = 'sudo cid share del';
static const String cidJoin = 'sudo cid join';
static const String cidLeave = 'sudo cid leave';
Expand Down
3 changes: 3 additions & 0 deletions lib/src/constants/groupmanager.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
abstract class GroupManager {
static const String main = "domain admins";
}
16 changes: 8 additions & 8 deletions lib/src/controllers/cid_controller.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:cidgui/src/constants/commands.dart';
import 'package:cidgui/src/constants/groupmanager.dart';
import 'package:cidgui/src/constants/routes.dart';
import 'package:cidgui/src/controllers/domain_controller.dart';
import 'package:cidgui/src/controllers/folder_controller.dart';
Expand Down Expand Up @@ -35,7 +36,7 @@ class CidController {
//Group files administrator.
await shell.run(
'''
${Commands.cidShareAdd} name='$name' path='$path' rule='${Commands.ruleAddGroup}domain admins${Commands.ruleReadAndWrite}'
${Commands.cidShareAdd} name='$name' path='$path' rule='${Commands.ruleAddGroup}${GroupManager.main}${Commands.ruleReadAndWrite}'
'''
);

Expand Down Expand Up @@ -101,13 +102,12 @@ class CidController {
await shell.run('''
${Commands.cidJoin} domain='$domain' user='$adminAccount' pass='$password'
''').then((value) async {
//Conditions to insert data domain in database.
if (stdout.enterDomain(value)) {
await domainController.add(domain);
} else {
return handlers.message(
context: context, message: "Check that the fields are correct.");
}
if (stdout.enterDomain(value)) {
await domainController.add(domain);
} else {
return handlers.message(
context: context, message: "Check that the fields are correct.");
}
});
if (context.mounted) {
Navigator.pushNamed(context, RoutesPages.checkDomain);
Expand Down

0 comments on commit 0da8068

Please sign in to comment.