Exemple #1
0
        public SearchGroupWidget()
        {
            this.Build();
            image = new Gtk.Image();
            image.SetFromIconName("system-search", Gtk.IconSize.Dnd);

            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Search Group"));
            label.Show();

            userTreeview.Selection.Mode = Gtk.SelectionMode.Multiple;


            user_id_column        = new Gtk.TreeViewColumn();
            user_id_column.Title  = Mono.Unix.Catalog.GetString("Group ID");
            user_id_cell_renderer = new Gtk.CellRendererText();
            user_id_column.PackStart(user_id_cell_renderer, true);
            user_id_column.AddAttribute(user_id_cell_renderer, "text", 0);
            userTreeview.AppendColumn(user_id_column);
            store = new Gtk.ListStore(typeof(string), typeof(string));
            userTreeview.Model = store;

            Gtk.TreeViewColumn user_name_column = new Gtk.TreeViewColumn();
            user_name_column.Title = Mono.Unix.Catalog.GetString("Description");
            Gtk.CellRendererText user_name_cell_renderer = new Gtk.CellRendererText();
            user_name_column.PackStart(user_name_cell_renderer, true);
            user_name_column.AddAttribute(user_name_cell_renderer, "text", 1);
            userTreeview.AppendColumn(user_name_column);
            userTreeview.ShowAll();

            //store.AppendValues("a","b");
        }
Exemple #2
0
        public FreezeWidget()
        {
            this.Build();
            msgLabel.Text = "";

            image = new Gtk.Image();
            image.SetFromIconName("frostwire", Gtk.IconSize.Dnd);
            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Freeze Users"));
            label.Show();

            searchImage.Animation = new Gdk.PixbufAnimation(null, "llum.watch.gif");

            Gtk.TreeViewColumn available_groups_column = new Gtk.TreeViewColumn();
            available_groups_column.Title = Mono.Unix.Catalog.GetString("Available groups");
            Gtk.CellRendererText available_groups_cell = new Gtk.CellRendererText();
            available_groups_column.PackStart(available_groups_cell, true);
            available_groups_column.AddAttribute(available_groups_cell, "text", 0);
            availableGroupsTreeview.AppendColumn(available_groups_column);
            available_groups_store                 = new Gtk.TreeStore(typeof(string));
            availableGroupsTreeview.Model          = available_groups_store;
            availableGroupsTreeview.Selection.Mode = Gtk.SelectionMode.Multiple;


            Gtk.TreeViewColumn frozen_groups_column = new Gtk.TreeViewColumn();
            frozen_groups_column.Title = Mono.Unix.Catalog.GetString("Frozen groups");
            Gtk.CellRendererText frozen_groups_cell = new Gtk.CellRendererText();
            frozen_groups_column.PackStart(frozen_groups_cell, true);
            frozen_groups_column.AddAttribute(frozen_groups_cell, "text", 0);
            frozenGroupsTreeview.AppendColumn(frozen_groups_column);
            frozen_groups_store                 = new Gtk.TreeStore(typeof(string));
            frozenGroupsTreeview.Model          = frozen_groups_store;
            frozenGroupsTreeview.Selection.Mode = Gtk.SelectionMode.Multiple;



            Gtk.TreeViewColumn available_users_column = new Gtk.TreeViewColumn();
            available_users_column.Title = Mono.Unix.Catalog.GetString("Available users");
            Gtk.CellRendererText available_users_cell = new Gtk.CellRendererText();
            available_users_column.PackStart(available_users_cell, true);
            available_users_column.AddAttribute(available_users_cell, "text", 0);
            availableUsersTreeview.AppendColumn(available_users_column);
            available_users_store                 = new Gtk.TreeStore(typeof(string));
            availableUsersTreeview.Model          = available_users_store;
            availableUsersTreeview.Selection.Mode = Gtk.SelectionMode.Multiple;


            Gtk.TreeViewColumn frozen_users_column = new Gtk.TreeViewColumn();
            frozen_users_column.Title = Mono.Unix.Catalog.GetString("Frozen users");
            Gtk.CellRendererText frozen_users_cell = new Gtk.CellRendererText();
            frozen_users_column.PackStart(frozen_users_cell, true);
            frozen_users_column.AddAttribute(frozen_users_cell, "text", 0);
            frozenUsersTreeview.AppendColumn(frozen_users_column);
            frozen_users_store                 = new Gtk.TreeStore(typeof(string));
            frozenUsersTreeview.Model          = frozen_users_store;
            frozenUsersTreeview.Selection.Mode = Gtk.SelectionMode.Multiple;


            disable_gui();
        }
Exemple #3
0
        public RegenerateHomesWidget()
        {
            this.Build();

            image = new Gtk.Image();
            image.SetFromIconName("view-refresh", Gtk.IconSize.Dnd);
            label = new Gtk.Label(Mono.Unix.Catalog.GetString("/net operations"));
            label.Show();
        }
Exemple #4
0
        public ResetPasswordsWidget()
        {
            this.Build();

            image = new Gtk.Image();
            image.SetFromIconName("system-lock-screen", Gtk.IconSize.Dnd);
            image.Show();
            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Reset passwords"));
            label.Show();
        }
Exemple #5
0
        public ImportExportWidget()
        {
            this.Build();

            image = new Gtk.Image();
            image.SetFromIconName("document-revert", Gtk.IconSize.Dnd);
            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Import/Export operations"));
            label.Show();

            exportFilechooserbutton.SetCurrentFolder(System.Environment.GetEnvironmentVariable("HOME"));
        }
Exemple #6
0
        public ChangeOwnPassword()
        {
            image = new Gtk.Image();
            image.SetFromIconName("system-lock-screen", Gtk.IconSize.Dnd);

            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Change Own Password"));
            label.Show();


            this.Build();
        }
Exemple #7
0
        public AddGroupWidget()
        {
            this.Build();
            image = new Gtk.Image();
            image.SetFromIconName("gtk-add", Gtk.IconSize.Dnd);
            image.Show();
            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Add Group"));
            label.Show();
            //gtk-dialog-authentication

            acceptButton.Sensitive = false;
        }
Exemple #8
0
        public PasswordListWidget()
        {
            this.Build();
            image = new Gtk.Image();
            image.SetFromIconName("system-lock-screen", Gtk.IconSize.Dnd);
            image.Show();
            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Get password list"));
            label.Show();
            search_mode = 0;



            if (llum.Core.getCore().user_group == "teachers")
            {
                teachersRadiobutton.Sensitive = false;
                allRadiobutton.Sensitive      = false;
            }
        }
Exemple #9
0
        public AddUser()
        {
            this.Build();
            acceptButton.Sensitive = false;
            store = new Gtk.ListStore(typeof(string), typeof(int));
            store.AppendValues(Mono.Unix.Catalog.GetString("Students"), 0);
            store.AppendValues(Mono.Unix.Catalog.GetString("Teachers"), 1);
            store.AppendValues(Mono.Unix.Catalog.GetString("Other"), 2);
            templateCombobox.Model  = store;
            templateCombobox.Active = 0;
            image = new Gtk.Image();
            image.SetFromIconName("gtk-add", Gtk.IconSize.Dnd);

            groups_store = new Gtk.ListStore(typeof(string), typeof(int));
            groups_store.AppendValues("---", 0);

            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Add User"));
            label.Show();
        }
Exemple #10
0
        public DeleteEveryUserWidget()
        {
            this.Build();
            image = new Gtk.Image();
            image.SetFromIconName("dialog-cancel", Gtk.IconSize.Dnd);
            image.Show();
            label = new Gtk.Label(Mono.Unix.Catalog.GetString("User Deletion tool"));
            label.Show();

            store = new Gtk.ListStore(typeof(string), typeof(int));
            store.AppendValues(Mono.Unix.Catalog.GetString("Students"), 0);
            store.AppendValues(Mono.Unix.Catalog.GetString("Teachers"), 1);
            store.AppendValues(Mono.Unix.Catalog.GetString("Everyone"), 2);

            optionCombobox.Model  = store;
            optionCombobox.Active = 0;

            warningHbox.Hide();
        }
Exemple #11
0
        public ReadOnlyAdminWidget()
        {
            this.Build();
            //label5



            image = new Gtk.Image();
            image.SetFromIconName("actor", Gtk.IconSize.Dnd);
            image.Show();
            label = new Gtk.Label(Mono.Unix.Catalog.GetString("LDAP Read-Only Admin"));
            label.Show();
            try
            {
                string basedn = (string)llum.Core.getCore().xmlrpc.client.get_variable("LDAP_BASE_DN")["return"];
                dn_entry.Text = dn_entry.Text.Replace("%%LDAP_BASE_DN%%", basedn);
            }
            catch
            {
            }


            try
            {
                if (llum.Core.getCore().xmlrpc.is_roadmin_available())
                {
                    status_image.Pixbuf      = global::Stetic.IconLoader.LoadIcon(this, "user-available", global::Gtk.IconSize.Menu);
                    user_available           = true;
                    status_image.TooltipText = Mono.Unix.Catalog.GetString("User available");
                }
                else
                {
                    button1.Sensitive = false;
                }
            }
            catch
            {
                msg_label.Markup = "<span foreground='red'>" + Mono.Unix.Catalog.GetString("LDAP Connection is not ready") + "</span>";
            }
        }
Exemple #12
0
        public AddGenericUsersWidget()
        {
            this.Build();


            store = new Gtk.TreeStore(typeof(string), typeof(string));

            store.AppendValues(Mono.Unix.Catalog.GetString("Students"), "Students");
            store.AppendValues(Mono.Unix.Catalog.GetString("Teachers"), "Teachers");
            //store.AppendValues(Mono.Unix.Catalog.GetString("Other"),"Other");

            templateCombobox.Model = store;

            templateCombobox.Active = 0;



            image = new Gtk.Image();
            image.SetFromIconName("gtk-add", Gtk.IconSize.Dnd);
            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Add Generic Users"));
            label.Show();
        }
Exemple #13
0
        public GescenImportWidget()
        {
            this.Build();

            image = new Gtk.Image();
            image.SetFromIconName("document-new", Gtk.IconSize.Dnd);
            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Import Gescen/Itaca file"));
            label.Show();

            groupHbox.Sensitive = false;

            /*
             * Gtk.FileFilter filter=new Gtk.FileFilter();
             * filter.AddPattern("*.xml");
             * filter.AddPattern("*.XML");
             * gescenFilechooserbutton.Filter=filter;
             */

            group_store = new Gtk.TreeStore(typeof(bool), typeof(string));

            Gtk.TreeViewColumn     check_column      = new Gtk.TreeViewColumn();
            Gtk.CellRendererToggle check_column_cell = new Gtk.CellRendererToggle();

            /*
             *
             * user_id_column=new Gtk.TreeViewColumn();
             * user_id_column.Title=Mono.Unix.Catalog.GetString("User ID");
             * user_id_cell_renderer=new Gtk.CellRendererText();
             * user_id_column.PackStart(user_id_cell_renderer,true);
             * user_id_column.AddAttribute(user_id_cell_renderer,"text",0);
             * userListTreeview.AppendColumn(user_id_column);
             * store=new Gtk.ListStore(typeof(string),typeof(string),typeof(string));
             * userListTreeview.Model=store;
             *
             */
            check_column.Title = Mono.Unix.Catalog.GetString("Importable");
            check_column.PackStart(check_column_cell, true);
            check_column.AddAttribute(check_column_cell, "active", 0);

            groupListTreeview.AppendColumn(check_column);

            Gtk.TreeViewColumn group_name_column = new Gtk.TreeViewColumn();
            group_name_column.Title = Mono.Unix.Catalog.GetString("Group");
            Gtk.CellRendererText group_name_column_cell = new Gtk.CellRendererText();
            group_name_column.PackStart(group_name_column_cell, true);
            group_name_column.AddAttribute(group_name_column_cell, "text", 1);
            groupListTreeview.AppendColumn(group_name_column);

            groupListTreeview.Model = group_store;


            Gtk.TreeViewColumn user_uid_column = new Gtk.TreeViewColumn();
            user_uid_column.Title = "UID";
            Gtk.CellRendererText user_uid_cell = new Gtk.CellRendererText();
            user_uid_column.PackStart(user_uid_cell, true);
            user_uid_column.AddAttribute(user_uid_cell, "text", 0);
            usersToDeleteTreeview.AppendColumn(user_uid_column);

            Gtk.TreeViewColumn user_desc_column = new Gtk.TreeViewColumn();
            user_desc_column.Title = Mono.Unix.Catalog.GetString("Description");
            Gtk.CellRendererText user_desc_cell = new Gtk.CellRendererText();
            user_desc_column.PackStart(user_desc_cell, true);
            user_desc_column.AddAttribute(user_desc_cell, "text", 1);
            usersToDeleteTreeview.AppendColumn(user_desc_column);

            Gtk.TreeViewColumn user_group_column = new Gtk.TreeViewColumn();
            user_group_column.Title = Mono.Unix.Catalog.GetString("Group");
            Gtk.CellRendererText user_group_cell = new Gtk.CellRendererText();
            user_group_column.PackStart(user_group_cell, true);
            user_group_column.AddAttribute(user_group_cell, "text", 2);
            usersToDeleteTreeview.AppendColumn(user_group_column);

            user_store = new Gtk.TreeStore(typeof(string), typeof(string), typeof(string));
            usersToDeleteTreeview.Model = user_store;
            usersToDeleteHbox.Sensitive = false;
        }
Exemple #14
0
        public SearchUser(bool from_core)
        {
            this.Build();

            searchImage.Animation = new Gdk.PixbufAnimation(null, "llum.watch.gif");

            searchEntry.Sensitive = false;



            System.Threading.ThreadStart tstart = delegate {
                //user_list=llum.Core.getCore().xmlrpc.light_get_user_list();

                user_list = llum.Core.getCore().xmlrpc.get_user_list();


                Gtk.Application.Invoke(delegate {
                    if (user_list == null)
                    {
                        msgLabel.Markup = "<span foreground='red'>" + Mono.Unix.Catalog.GetString("There was an error connecting to the n4d(XMLRPC) server") + "</span>";
                    }
                    else
                    {
                        msgLabel.Text = "";
                    }
                    searchEntry.Sensitive = true;
                    searchImage.Visible   = false;
                });
            };

            thread = new System.Threading.Thread(tstart);

            if (!from_core)
            {
                thread.Start();
            }


            editButton.Sensitive    = false;
            promoteButton.Sensitive = false;



            userTreeview.Selection.Mode = Gtk.SelectionMode.Multiple;
            image = new Gtk.Image();
            image.SetFromIconName("system-search", Gtk.IconSize.Dnd);

            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Search User"));
            label.Show();

            store = new Gtk.ListStore(typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
            store.SetSortFunc(0, sort_users);
            store.SetSortFunc(1, sort_groups);
            userTreeview.Model = store;

            user_group_column               = new Gtk.TreeViewColumn();
            user_group_column.Title         = Mono.Unix.Catalog.GetString("User ID");
            user_group_column.Clickable     = true;
            user_group_column.SortIndicator = true;
            user_group_column.Clicked      += user_id_column_clicked;



            Gtk.CellRendererText user_group_cell_renderer = new Gtk.CellRendererText();
            user_group_column.PackStart(user_group_cell_renderer, true);
            user_group_column.AddAttribute(user_group_cell_renderer, "text", 0);
            user_group_column.AddAttribute(user_group_cell_renderer, "foreground", 4);
            userTreeview.AppendColumn(user_group_column);

            user_id_column        = new Gtk.TreeViewColumn();
            user_id_column.Title  = Mono.Unix.Catalog.GetString("Group");
            user_id_cell_renderer = new Gtk.CellRendererText();
            user_id_column.PackStart(user_id_cell_renderer, true);
            user_id_column.AddAttribute(user_id_cell_renderer, "text", 1);
            userTreeview.AppendColumn(user_id_column);
            user_id_column.Clickable     = true;
            user_id_column.SortIndicator = true;
            user_id_column.Clicked      += user_group_column_clicked;



            Gtk.TreeViewColumn user_name_column = new Gtk.TreeViewColumn();
            user_name_column.Title = Mono.Unix.Catalog.GetString("Name");
            Gtk.CellRendererText user_name_cell_renderer = new Gtk.CellRendererText();
            user_name_column.PackStart(user_name_cell_renderer, true);
            user_name_column.AddAttribute(user_name_cell_renderer, "text", 2);
            userTreeview.AppendColumn(user_name_column);

            Gtk.TreeViewColumn user_surname_column = new Gtk.TreeViewColumn();
            user_surname_column.Title = Mono.Unix.Catalog.GetString("Surname");
            Gtk.CellRendererText user_surname_cell_renderer = new Gtk.CellRendererText();
            user_surname_column.PackEnd(user_surname_cell_renderer, true);
            user_surname_column.AddAttribute(user_surname_cell_renderer, "text", 3);
            userTreeview.AppendColumn(user_surname_column);



            userTreeview.ShowAll();
        }