void InitialisePermissions()
        {
            _groups     = new GroupTable();
            _nodes      = new PermissionTable();
            _userPerms  = new UserPermissionsTable();
            _groupPerms = new GroupPermissionsTable();
            _users      = new UserGroupsTable();

            _nodes.Initialise(this);
            _userPerms.Initialise(this);
            _groupPerms.Initialise(this);
            _users.Initialise(this);

            //Used to create default permissions
            _groups.Initialise(this);

//            try
//            {
//                ProgramLog.Error.Log("tdsm.help: " + IsPermitted("tdsm.help", true, "DeathCradle"));
//                ProgramLog.Error.Log("tdsm.oplogin: "******"tdsm.oplogin", true, "DeathCradle"));
//                ProgramLog.Error.Log("tdsm.exit: " + IsPermitted("tdsm.exit", true, "DeathCradle"));
//                ProgramLog.Error.Log("tdsm.exit,a: " + IsPermitted("tdsm.exit", false, "DeathCradle"));
//            }
//            catch (Exception e)
//            {
//                ProgramLog.Log(e);
//            }
        }
Exemplo n.º 2
0
        public static long CreateGroup(string name, bool guest, string parent, byte r, byte g, byte b, SQLiteConnector conn, string[] nodes = null, string prefix = null, string suffix = null)
        {
            long id;

            using (var bl = new SQLiteQueryBuilder(Plugin.SQLSafeName))
            {
                bl.InsertInto(TableDefinition.TableName,
                              new DataParameter(TableDefinition.ColumnNames.Name, name),
                              new DataParameter(TableDefinition.ColumnNames.ApplyToGuests, guest),
                              new DataParameter(TableDefinition.ColumnNames.Parent, parent),
                              new DataParameter(TableDefinition.ColumnNames.Chat_Red, r),
                              new DataParameter(TableDefinition.ColumnNames.Chat_Green, g),
                              new DataParameter(TableDefinition.ColumnNames.Chat_Blue, b),
                              new DataParameter(TableDefinition.ColumnNames.Chat_Prefix, prefix),
                              new DataParameter(TableDefinition.ColumnNames.Chat_Suffix, suffix)
                              );

                id = ((IDataConnector)conn).ExecuteInsert(bl);
            }

            if (nodes != null)
            {
                foreach (var nd in nodes)
                {
                    var nodeId = PermissionTable.InsertRecord(conn, nd, false);
                    GroupPermissionsTable.InsertRecord(conn, id, nodeId);
                }
            }

            return(id);
        }
        void InitialisePermissions()
        {
            _groups     = new GroupTable();
            _nodes      = new PermissionTable();
            _userPerms  = new UserPermissionsTable();
            _groupPerms = new GroupPermissionsTable();
            _users      = new UserGroupsTable();

            _groups.Initialise(this);
            _nodes.Initialise(this);
            _userPerms.Initialise(this);
            _groupPerms.Initialise(this);
            _users.Initialise(this);

            ProgramLog.Error.Log("tdsm.help: " + IsPermitted("tdsm.help", true, "DeathCradle"));
            ProgramLog.Error.Log("tdsm.oplogin: "******"tdsm.oplogin", true, "DeathCradle"));
            ProgramLog.Error.Log("tdsm.exit: " + IsPermitted("tdsm.exit", true, "DeathCradle"));
            ProgramLog.Error.Log("tdsm.exit,a: " + IsPermitted("tdsm.exit", false, "DeathCradle"));
        }
        void InitialisePermissions()
        {
            _groups = new GroupTable();
            _nodes = new PermissionTable();
            _userPerms = new UserPermissionsTable();
            _groupPerms = new GroupPermissionsTable();
            _users = new UserGroupsTable();

            _nodes.Initialise(this);
            _userPerms.Initialise(this);
            _groupPerms.Initialise(this);
            _users.Initialise(this);

            //Used to create default permissions
            _groups.Initialise(this);

            //            try
            //            {
            //                ProgramLog.Error.Log("tdsm.help: " + IsPermitted("tdsm.help", true, "DeathCradle"));
            //                ProgramLog.Error.Log("tdsm.oplogin: "******"tdsm.oplogin", true, "DeathCradle"));
            //                ProgramLog.Error.Log("tdsm.exit: " + IsPermitted("tdsm.exit", true, "DeathCradle"));
            //                ProgramLog.Error.Log("tdsm.exit,a: " + IsPermitted("tdsm.exit", false, "DeathCradle"));
            //            }
            //            catch (Exception e)
            //            {
            //                ProgramLog.Log(e);
            //            }
        }