Beispiel #1
0
        ///<summary>
        /// Creation of iFolder Dialog
        ///</summary>
        ///<param name="args">String array of arguments needed</param>
        private static int showCreateDialog(string[] args)
        {
            DomainInformation[] domains = domainController.GetDomains();
            if (domains.Length <= 0)
            {
                return(0);
            }
            string            domainID      = domains[0].ID;
            DomainInformation defaultDomain = domainController.GetDefaultDomain();

            if (defaultDomain != null)
            {
                domainID = defaultDomain.ID;
            }

            string           path = args[1];
            DragCreateDialog cd   = new DragCreateDialog(null, domains, domainID, path, ifws);
            int rc = 0;

            do
            {
                rc = cd.Run();
                cd.Hide();

                if (rc == (int)ResponseType.Ok)
                {
                    ShowPassPhraseDialog(path, cd.DomainID, cd.Encrypted);
                    break;
                }
            }while(rc == (int)ResponseType.Ok);

            return(0);
        }
Beispiel #2
0
        /// <summary>
        /// Authenticate to a remote Simias server
        /// </summary>
        /// <returns>Simias.Client.Authentication.Status object</returns>
        public Status Authenticate(Uri webServiceUri, string simiasDataPath)
        {
            Status status = null;

            try
            {
                SimiasWebService simiasSvc = new SimiasWebService();
                simiasSvc.Url = webServiceUri.ToString() + "/Simias.asmx";
                LocalService.Start(simiasSvc, webServiceUri, simiasDataPath);

                DomainInformation cInfo = simiasSvc.GetDomainInformation(this.domainID);
                if (cInfo != null)
                {
                    // Call Simias for a remote domain authentication
                    status = simiasSvc.LoginToRemoteDomain(this.domainID, this.password);
                }
                else
                {
                    //status = new Status( StatusCodes.UnknownDomain );
                }
            }
            catch (Exception ex)
            {
                // DEBUG
                if (MyEnvironment.Mono)
                {
                    Console.WriteLine("Authentication - caught exception: {0}", ex.Message);
                }

                //status = new Status( StatusCodes.InternalException );
                //status.ExceptionMessage = ex.Message;
            }

            return(status);
        }
Beispiel #3
0
        /// <summary>
        /// Login to Domain
        /// </summary>
        /// <param name="dom">Domain Information</param>
        public void LoginDomain(DomainInformation dom)
        {
            try
            {
                LoginDialog =
                    new iFolderLoginDialog(dom.ID, dom.Name, dom.MemberName);
                if (!Util.RegisterModalWindow(LoginDialog))
                {
                    LoginDialog.Destroy();
                    LoginDialog = null;
                    return;
                }

                LoginDialog.Response +=
                    new ResponseHandler(OnLoginDialogResponse);

                LoginDialog.ShowAll();

                string password = domainController.GetDomainPassword(dom.ID);
                if (password != null)
                {
                    LoginDialog.Hide();
                    LoginDialog.Password = password;
                    LoginDialog.Respond(Gtk.ResponseType.Ok);
                }
            }
            catch
            {
                Util.ShowLoginError(topLevelWindow, StatusCodes.Unknown);

                UpdateDomainStatus(dom.ID);
            }
        }
Beispiel #4
0
        private void OnlineCellToggleDataFunc(Gtk.TreeViewColumn tree_column,
                                              Gtk.CellRenderer cell, Gtk.TreeModel tree_model,
                                              Gtk.TreeIter iter)
        {
            string            domainID = (string)tree_model.GetValue(iter, 0);
            DomainInformation dom      = domainController.GetDomain(domainID);

            IDomainProviderUI provider = domainProviderUI.GetProviderForID(domainID);

            if (provider != null)
            {
                if (dom.Active)
                {
                    ((CellRendererToggle)cell).Active = true;
                }
                else
                {
                    ((CellRendererToggle)cell).Active = false;
                }
            }
            else
            {
                if (dom != null && dom.Authenticated)
                {
                    ((CellRendererToggle)cell).Active = true;
                }
                else
                {
                    ((CellRendererToggle)cell).Active = false;
                }
            }
        }
Beispiel #5
0
        /// <summary>
        /// Constructs a ServerInfo object.
        /// </summary>
        /// <param name="domainInfo">The DomainInformation object for the domain.</param>



        public ServerInfo(iFolderWebService ifws, Manager simiasManager, DomainInformation domainInfo, string password)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.domainInfo    = domainInfo;
            this.simiasManager = simiasManager;
            this.ifWebService  = ifws;

            if (password != null)
            {
                this.password.Text       = password;
                rememberPassword.Checked = true;
            }

            // Resize/reposition controls
            int delta = calculateSize(serverLabel2, 0);

            delta = calculateSize(userLabel2, delta);
            delta = calculateSize(passwordLabel2, delta);

            if (delta > 0)
            {
                serverLabel2.Width = userLabel2.Width = passwordLabel2.Width += delta;
                int temp = serverName.Left;
                serverName.Left  = userName.Left = this.password.Left = rememberPassword.Left = serverLabel2.Left + serverLabel2.Width;
                serverName.Width = userName.Width = this.password.Width = rememberPassword.Width -= serverName.Left - temp;
            }
        }
Beispiel #6
0
 public Connecting( iFolderWebService ifws, SimiasWebService simiasWebService, Manager simiasManager, DomainInformation domainInfo, string password, bool rememberPassword )
     : this(ifws, simiasWebService, simiasManager, domainInfo, password)
 {
     this.updatePasswordPreference = true;
        this.rememberPassword = rememberPassword;
     this.autoAccountEnabled = false;
 }
 public BonjourAccountDialog(Window parent, DomainInformation curDomain)
     : base(parent, curDomain)
 {
     ifdata = iFolderData.GetData();
        this.simiasManager = Util.GetSimiasManager();
        domainController = DomainController.GetDomainController();
        SetupDialog();
 }
Beispiel #8
0
        public IActionResult Create()
        {
            ViewBag.Error        = false;
            ViewBag.ErrorMessage = "";
            DomainInformation newDomain = new DomainInformation();

            return(View("CreateOrUpdate", newDomain));
        }
 public DefaultiFolderPage(iFolderWebService ifws, SimiasWebService simws, DomainInformation domainInfo )
 {
     this.resManager = new System.Resources.ResourceManager(typeof(Novell.FormsTrayApp.FormsTrayApp));
        InitializeComponent();
     this.simws = simws;
        this.domainInfo = domainInfo;
        this.ifws = ifws;
 }
Beispiel #10
0
 /// <summary>
 /// Constructs a ServerPage object.
 /// </summary>
 public DefaultiFolderPage(iFolderWebService ifws, SimiasWebService simws, DomainInformation domainInfo)
 {
     // This call is required by the Windows Form Designer.
     this.resManager = new System.Resources.ResourceManager(typeof(Novell.FormsTrayApp.FormsTrayApp));
     InitializeComponent();
     this.simws      = simws;
     this.domainInfo = domainInfo;
     this.ifws       = ifws;
 }
Beispiel #11
0
        /// <summary>
        /// Event Handler for Login Dialog Response event
        /// </summary>
        private void OnLoginDialogResponse(object o, ResponseArgs args)
        {
            switch (args.ResponseId)
            {
            case Gtk.ResponseType.Ok:
                DomainInformation dom = domainController.GetDomain(LoginDialog.Domain);

                if (WaitDialog != null)
                {
                    WaitDialog.Hide();
                    WaitDialog.Destroy();
                    WaitDialog = null;
                }

                VBox  vbox            = new VBox(false, 0);
                Image connectingImage = new Image(Util.ImagesPath("ifolder-add-account48.png"));
                vbox.PackStart(connectingImage, false, false, 0);

                WaitDialog =
                    new iFolderWaitDialog(
                        topLevelWindow,
                        vbox,
                        iFolderWaitDialog.ButtonSet.None,
                        Util.GS("Connecting..."),
                        Util.GS("Connecting..."),
                        Util.GS("Please wait while your iFolder account is connecting."));

                if (!Util.RegisterModalWindow(WaitDialog))
                {
                    try
                    {
                        Util.CurrentModalWindow.Present();
                    }
                    catch {}
                    WaitDialog.Destroy();
                    return;
                }
                WaitDialog.Show();

                DomainLoginThread domainLoginThread =
                    new DomainLoginThread(domainController);

                domainLoginThread.Completed +=
                    new DomainLoginCompletedHandler(OnDomainLoginCompleted);

                domainLoginThread.Login(dom.ID, LoginDialog.Password, LoginDialog.ShouldSavePassword);

                break;

            case Gtk.ResponseType.Cancel:
            case Gtk.ResponseType.DeleteEvent:
                LoginDialog.Hide();
                LoginDialog.Destroy();
                LoginDialog = null;
                break;
            }
        }
Beispiel #12
0
        public async Task <IActionResult> Delete(int DomainInformationID)
        {
            DomainInformation domain = await factory.Domains.GetDomainInformationByDomainInformationID(DomainInformationID);

            if (domain == null)
            {
                return(NotFound());
            }
            return(View(domain));
        }
 public EnterpriseAccountDialog(Window parent, DomainInformation curDomain)
     : base(parent, curDomain)
 {
     ifdata = iFolderData.GetData();
        domainController = DomainController.GetDomainController();
        bServerAddressChanged = false;
        bPasswordChanged = false;
        SetupDialog();
        this.Response +=
     new ResponseHandler(OnDialogResponse);
 }
Beispiel #14
0
        /// <summary>
        /// Update Widget Sensitivity
        /// </summary>
        private void UpdateWidgetSensitivity()
        {
            TreeSelection tSelect = AccTreeView.Selection;

            // Nothing is selected
            AddButton.Sensitive     = true;
            RemoveButton.Sensitive  = false;
            DetailsButton.Sensitive = false;
            if (tSelect != null)
            {
                if (tSelect.CountSelectedRows() == 1)
                {
                    TreeModel tModel;
                    TreeIter  iter;

                    tSelect.GetSelected(out tModel, out iter);
                    string            domainID = (string)tModel.GetValue(iter, 0);
                    DomainInformation dom      = domainController.GetDomain(domainID);
                    if (dom == null)
                    {
                        return;                                         // Prevent null pointer
                    }
                    IDomainProviderUI provider = domainProviderUI.GetProviderForID(domainID);
                    if (provider != null)
                    {
                        if (provider.CanDelete)
                        {
                            RemoveButton.Sensitive = true;
                        }
                        else
                        {
                            RemoveButton.Sensitive = false;
                        }

                        if (provider.HasDetails)
                        {
                            DetailsButton.Sensitive = true;
                        }
                        else
                        {
                            DetailsButton.Sensitive = false;
                        }
                    }
                    else
                    {
                        RemoveButton.Sensitive  = true;
                        DetailsButton.Sensitive = true;
                    }

                    // Set the control states
                    AddButton.Sensitive = true;
                }
            }
        }
Beispiel #15
0
        public async Task <IActionResult> Edit(int DomainInformationID)
        {
            ViewBag.Error        = false;
            ViewBag.ErrorMessage = "";
            DomainInformation domain = await factory.Domains.GetDomainInformationByDomainInformationID(DomainInformationID);

            if (domain == null)
            {
                return(NotFound());
            }
            return(View("CreateOrUpdate", domain));
        }
     public DragCreateDialog(Gtk.Window parentWindow, DomainInformation[] domainArray, string defaultDomainID, string initialPath)
         : base(Util.GS("Convert to an iFolder..."), parentWindow,
 DialogFlags.Modal | DialogFlags.DestroyWithParent | DialogFlags.NoSeparator,
 Stock.Help, ResponseType.Help, Stock.Cancel, ResponseType.Cancel, Stock.Ok, ResponseType.Ok)
     {
         domains = domainArray;
            this.defaultDomainID = defaultDomainID;
            this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder24.png"));
            this.initialPath = initialPath;
            Widget widgets = SetupWidgets();
            widgets.ShowAll();
            this.VBox.Add(widgets);
     }
Beispiel #17
0
        public async Task <IActionResult> DeleteConfirmed(int DomainInformationID)
        {
            DomainInformation domain = await factory.Domains.GetDomainInformationByDomainInformationID(DomainInformationID);

            if (domain == null)
            {
                return(NotFound());
            }

            await factory.Domains.Delete(domain, int.Parse(User.Identity.Name));

            return(Redirect("Index"));
        }
Beispiel #18
0
        /// <summary>
        /// Event Handler for Remove Account
        /// </summary>
        private void OnRemoveAccount(object o, EventArgs args)
        {
            TreeSelection tSelect = AccTreeView.Selection;

            if (tSelect.CountSelectedRows() == 1)
            {
                TreeModel tModel;
                TreeIter  iter;

                tSelect.GetSelected(out tModel, out iter);
                string            domainID = (string)tModel.GetValue(iter, 0);
                DomainInformation dom      = domainController.GetDomain(domainID);

                RemoveAccountDialog rad = new RemoveAccountDialog(dom);
                rad.TransientFor = topLevelWindow;
                int rc = rad.Run();
                rad.Hide();
                if ((ResponseType)rc == ResponseType.Yes)
                {
                    try
                    {
                        removedDomains[dom.ID] = dom.ID;

                        domainController.RemoveDomain(dom.ID, rad.RemoveiFoldersFromServer);

                        RemoveDomain(dom.ID);
                    }
                    catch (Exception e)
                    {
                        if (removedDomains.ContainsKey(dom.ID))
                        {
                            removedDomains.Remove(dom.ID);
                        }

                        iFolderExceptionDialog ied =
                            new iFolderExceptionDialog(topLevelWindow, e);
                        ied.Run();
                        ied.Hide();
                        ied.Destroy();
                        rad.Destroy();                          // Clean up before bailing
                        return;
                    }

                    AddButton.Sensitive     = true;
                    RemoveButton.Sensitive  = false;
                    DetailsButton.Sensitive = false;
                }

                rad.Destroy();
            }
        }
Beispiel #19
0
 public CreateDialog(Gtk.Window parentWindow, DomainInformation[] domainArray, string filteredDomainID, string initialPath, iFolderWebService ifws)
     : base("", Util.GS("Create a new iFolder..."), parentWindow, FileChooserAction.CreateFolder, Stock.Cancel, ResponseType.Cancel,
         Stock.Ok, ResponseType.Ok)
 {
     domains = domainArray;
        this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder24.png"));
        this.initialPath = initialPath;
        this.ifws = ifws;
        keyReleasedTimeoutID = 0;
        if (this.initialPath != null && this.initialPath.Length > 0)
     this.SetCurrentFolder(this.initialPath);
        this.ExtraWidget = CreateMoreOptionsExpander(filteredDomainID);
        this.SetResponseSensitive(ResponseType.Ok, false);
 }
Beispiel #20
0
        private void NameCellTextDataFunc(Gtk.TreeViewColumn tree_column,
                                          Gtk.CellRenderer cell, Gtk.TreeModel tree_model,
                                          Gtk.TreeIter iter)
        {
            string            domainID = (string)tree_model.GetValue(iter, 0);
            DomainInformation dom      = domainController.GetDomain(domainID);

            if (dom != null)
            {
                ((CellRendererText)cell).Text = dom.MemberName;
            }
            else
            {
                ((CellRendererText)cell).Text = "";
            }
        }
Beispiel #21
0
        public void OnDomainInGraceLoginPeriodEvent(object sender, DomainInGraceLoginPeriodEventArgs args)
        {
            DomainInformation dom = domainController.GetDomain(args.DomainID);
            iFolderMsgDialog  dg  =
                new iFolderMsgDialog(
                    topLevelWindow,
                    iFolderMsgDialog.DialogType.Error,
                    iFolderMsgDialog.ButtonSet.Ok,
                    dom != null ? dom.Name : "",
                    Util.GS("Your password has expired"),
                    string.Format(Util.GS("You have {0} grace logins remaining."), args.RemainingGraceLogins));

            dg.Run();
            dg.Hide();
            dg.Destroy();
        }
Beispiel #22
0
        internal override void ActivatePage(int previousIndex)
        {
            base.ActivatePage(previousIndex);
            //display account name
            wizard = (KeyRecoveryWizard)this.Parent;
            ((KeyRecoveryWizard)this.Parent).WizardButtons = KeyRecoveryWizardButtons.Cancel | KeyRecoveryWizardButtons.Back;
            iFolderAcc.Text = wizard.DomainSelectionPage.SelectedDomain.Name + wizard.DomainSelectionPage.SelectedDomain.Host;
            //display user name
            string            domainID   = wizard.DomainSelectionPage.SelectedDomain.ID;
            DomainInformation domainInfo = (DomainInformation)this.simiasWebService.GetDomainInformation(domainID);

            userName.Text = domainInfo.MemberName;

            newPassphrase.Focus();
            UpdateSensitivity();
        }
Beispiel #23
0
        public async Task <IActionResult> Save(DomainInformation domain)
        {
            ViewBag.Error = true;

            var DomainNameUniqeControl = await factory.Domains.GetDomainByName(domain.DomainName);

            if (domain.DomainInformationID == 0)
            {
                if (!(User.IsInRole("DomainAdd") || User.IsInRole("AdminFull") || User.IsInRole("DomainAll")))
                {
                    return(Unauthorized());
                }

                if (DomainNameUniqeControl != null)
                {
                    ViewBag.ErrorMessage = "Domain name already exist in database!";
                    return(View("CreateOrUpdate", domain));
                }
                else
                {
                    await factory.Domains.Add(domain, int.Parse(User.Identity.Name));
                }
            }
            else
            {
                if (!(User.IsInRole("DomainUp") || User.IsInRole("AdminFull") || User.IsInRole("DomainAll")))
                {
                    return(Unauthorized());
                }
                if (DomainNameUniqeControl.DomainInformationID != domain.DomainInformationID)
                {
                    ViewBag.ErrorMessage = "Domain name already exist in database!";
                    return(View("CreateOrUpdate", domain));
                }
                else
                {
                    var foundDomain = await factory.Domains.GetDomainInformationByDomainInformationID(domain.DomainInformationID);

                    foundDomain.DomainName   = domain.DomainName;
                    foundDomain.DomainAdress = domain.DomainAdress;

                    await factory.Domains.Update(foundDomain, int.Parse(User.Identity.Name));
                }
            }
            return(Redirect("Index"));
        }
    public AddDomainThread(
 DomainController domainController,
 string serverName,
 string userName,
 string password,
 bool bRememberPassword,
 bool bSetAsDefault)
    {
        this.domainController = domainController;
           this.serverName = serverName;
           this.userName = userName;
           this.password = password;
           this.bRememberPassword = bRememberPassword;
           this.bSetAsDefault = bSetAsDefault;
           this.domain = null;
           this.e = null;
    }
Beispiel #25
0
        private void OnlineToggled(object o, ToggledArgs args)
        {
            // Disable the ability for the user to toggle the checkbox
            onlineToggleButton.Activatable = false;

            TreeIter iter;
            TreePath path = new TreePath(args.Path);

            if (AccTreeStore.GetIter(out iter, path))
            {
                string            domainID = (string)AccTreeStore.GetValue(iter, 0);
                DomainInformation dom      = domainController.GetDomain(domainID);
                IDomainProviderUI provider = domainProviderUI.GetProviderForID(domainID);
                if (provider != null)
                {
                    // FIXME: Add some functionality into the provider interface so we know what to do instead of just inactivating the account
                    if (dom.Active)
                    {
                        domainController.InactivateDomain(dom.ID);
                    }
                    else
                    {
                        domainController.ActivateDomain(dom.ID);
                    }
                }
                else
                {
                    if (dom != null)
                    {
                        if (!dom.Authenticated)
                        {
                            LoginDomain(dom);
                        }
                        else
                        {
                            LogoutDomain(dom);
                        }
                    }
                }
                UpdateDomainStatus(dom.ID);
            }

            // Reenable the ability for the user to toggle the checkbox
            onlineToggleButton.Activatable = true;
        }
 public AddAccountWizard(SimiasWebService simws)
     : base(WindowType.Toplevel)
 {
     this.Title = Util.GS("iFolder Account Assistant");
        this.Resizable = false;
        this.Modal = true;
        this.WindowPosition = Gtk.WindowPosition.Center;
        this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder24.png"));
        this.simws = simws;
        domainController = DomainController.GetDomainController();
        ConnectedDomain = null;
        WaitDialog = null;
        this.Add(CreateWidgets());
        ControlKeyPressed = false;
        KeyPressEvent += new KeyPressEventHandler(KeyPressHandler);
        KeyReleaseEvent += new KeyReleaseEventHandler(KeyReleaseHandler);
        SetUpButtons();
 }
        ///
        /// Event Handlers
        ///
        public void OnDomainHostModified(object sender, DomainEventArgs args)
        {
            // Make sure that the domain event is for the domain this dialog is showing
            if (args.DomainID == domain.ID)
            {
                DomainInformation updatedDomain =
                    domainController.GetDomain(args.DomainID);
                if (updatedDomain != null)
                {
                    domain = updatedDomain;

                    ServerAddressEntry.Changed -= new EventHandler(OnServerAddressChanged);
                    ServerAddressEntry.Text     = GetHostUrl(domain.HostUrl);
                    bServerAddressChanged       = false;
                    ServerAddressEntry.Changed += new EventHandler(OnServerAddressChanged);
                }
            }
        }
Beispiel #28
0
        public async Task <IActionResult> Run(int DomainInformationID)
        {
            DomainInformation domain = await factory.Domains.GetDomainInformationByDomainInformationID(DomainInformationID);

            if (domain == null)
            {
                return(NotFound());
            }

            var templates = await factory.Templates.GetAll();

            var servers = await factory.ServerInformations.GetServerList();

            ViewBag.servers   = new SelectList(servers, "ServerInformationID", "ServerName");
            ViewBag.Templates = new SelectList(templates, "TemplateID", "TemplateName");

            return(View(domain));
        }
 public iFoldersListView( DomainInformation domainInfo, ImageList largeImageList )
 {
     this.domainInfo = domainInfo;
        InitializeComponent();
        tileListView1.LargeImageList = largeImageList;
        this.richTextBox1.Text = string.Format( richTextBox1.Text, domainInfo.Name + " - " + domainInfo.Host );
     this.richTextBox2.Text = string.Format(" ");
        Graphics g = richTextBox1.CreateGraphics();
        try
        {
     SizeF textSize = g.MeasureString(richTextBox1.Text, richTextBox1.Font);
     this.Width = (int)(textSize.Width * 1.1);
        }
        finally
        {
     g.Dispose();
        }
        base.DoubleClick += new EventHandler(iFoldersListView_DoubleClick);
 }
Beispiel #30
0
 /// <summary>
 /// This should be called anytime the authentication status of a domain
 /// changes because of events external to this page.
 /// </summary>
 public void UpdateDomainStatus(string domainID)
 {
     if (curDomains.ContainsKey(domainID))
     {
         TreeIter          iter = (TreeIter)curDomains[domainID];
         DomainInformation dom  = domainController.GetDomain(domainID);
         if (dom != null)
         {
             AccTreeStore.SetValue(iter, 0, dom.ID);
         }
         else
         {
             // Remove the domain from the list
             AccTreeStore.Remove(ref iter);
             curDomains.Remove(domainID);
         }
     }
     UpdateWidgetSensitivity();
 }
Beispiel #31
0
        /// <summary>
        /// Event Handler for Details Clicked
        /// </summary>
        private void OnDetailsClicked(object o, EventArgs args)
        {
            TreeSelection tSelect = AccTreeView.Selection;

            if (tSelect.CountSelectedRows() == 1)
            {
                TreeModel tModel;
                TreeIter  iter;

                tSelect.GetSelected(out tModel, out iter);
                string            domainID = (string)tModel.GetValue(iter, 0);
                DomainInformation dom      = domainController.GetDomain(domainID);

                AccountDialog accDialog = null;
                if (detailsDialogs.ContainsKey(domainID))
                {
                    accDialog = (AccountDialog)detailsDialogs[domainID];
                    accDialog.Present();
                }
                else
                {
                    IDomainProviderUI provider = domainProviderUI.GetProviderForID(domainID);
                    if (provider != null)
                    {
                        accDialog = provider.CreateAccountDialog(topLevelWindow, dom);
                    }
                    else
                    {
                        accDialog = new EnterpriseAccountDialog(topLevelWindow, dom);
                    }

                    if (accDialog != null)
                    {
                        detailsDialogs[domainID] = accDialog;
                        accDialog.SetPosition(WindowPosition.Center);
                        accDialog.Destroyed +=
                            new EventHandler(OnAccountDialogDestroyedEvent);

                        accDialog.ShowAll();
                    }
                }
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="parent">GTK Parent Window</param>
        /// <param name="curDomain">Current Domain</param>
        public EnterpriseAccountDialog(Window parent, DomainInformation curDomain)
            : base(parent, curDomain)
        {
            ifdata = iFolderData.GetData();
//			this.simiasManager = Util.GetSimiasManager();

            domainController = DomainController.GetDomainController();

            bServerAddressChanged = false;
            bPasswordChanged      = false;

            SetupDialog();

            this.Response +=
                new ResponseHandler(OnDialogResponse);

            // FIXME: Figure out if we need to register for when the window closes so that fields will be saved.
            // I believe that the FocusOutEventHandlers should already take care of it, but you never know
        }
Beispiel #33
0
 public ServerInfo(Manager simiasManager, DomainInformation domainInfo, string password)
 {
     InitializeComponent();
        this.domainInfo = domainInfo;
        this.simiasManager = simiasManager;
        if (password != null)
        {
     this.password.Text = password;
     rememberPassword.Checked = true;
        }
        int delta = calculateSize(serverLabel2, 0);
        delta = calculateSize(userLabel2, delta);
        delta = calculateSize(passwordLabel2, delta);
        if (delta > 0)
        {
     serverLabel2.Width = userLabel2.Width = passwordLabel2.Width += delta;
     int temp = serverName.Left;
     serverName.Left = userName.Left = this.password.Left = rememberPassword.Left = serverLabel2.Left + serverLabel2.Width;
     serverName.Width = userName.Width = this.password.Width = rememberPassword.Width -= serverName.Left - temp;
        }
 }
Beispiel #34
0
        /// <summary>
        /// Method used to connect to the Simias server.
        /// </summary>
        /// <returns><b>True</b> if successfully connected; otherwise, <b>False</b> is returned.</returns>
        public bool ConnectToServer()
        {
            bool result = false;

            Connecting connecting = new Connecting(this.ifWebService, simiasWebService, simiasManager, serverPage.ServerAddress, identityPage.Username, identityPage.Password, serverPage.DefaultServer, identityPage.RememberPassword);

            connecting.EnterpriseConnect += new Novell.FormsTrayApp.Connecting.EnterpriseConnectDelegate(connecting_EnterpriseConnect);
            if (connecting.ShowDialog() == DialogResult.OK)
            {
                result     = true;
                domainInfo = connecting.DomainInformation;
                this.defaultiFolderPage.DomainInfo   = this.domainInfo;
                this.defaultiFolderPage.defaultPath  = this.GetDefaultPath(this.identityPage.Username, this.defaultiFolderPage.DomainInfo.Name);
                this.defaultiFolderPage.defaultPath += "\\" + Resource.GetString("DefaultDirName") + "_" + this.identityPage.Username;
                Novell.FormsTrayApp.FormsTrayApp.globalProp().updateifListViewDomainStatus(domainInfo.ID, domainInfo.Authenticated);
                if (true == domainInfo.Authenticated)
                {
                    Novell.FormsTrayApp.FormsTrayApp.globalProp().AddDomainToUIList(domainInfo);
                }
            }

            return(result);
        }
Beispiel #35
0
        public void ToggelDomainState(DomainInformation domainInfo, bool login)
        {
            // disable the ability for the user to toggle the checkbox
            onlineToggleButton.Activatable = false;
            //TODO: Refere code from function OnlineToggled and add needed code
            IDomainProviderUI provider = domainProviderUI.GetProviderForID(domainInfo.ID);

            if (provider != null)
            {
                if (domainInfo.Active)
                {
                    domainController.InactivateDomain(domainInfo.ID);
                }
                else
                {
                    domainController.ActivateDomain(domainInfo.ID);
                }
            }
            else
            {
                if (true == login)
                {
                    LoginDomain(domainInfo);
                }
                else
                {
                    LogoutDomain(domainInfo);
                }
            }
            iFolderWindow ifwin = Util.GetiFolderWindow();

            ifwin.UpdateiFolderCount(domainInfo);
            UpdateDomainStatus(domainInfo.ID);

            // Reenable the ability for the user to toggle the checkbox
            onlineToggleButton.Activatable = true;
        }
Beispiel #36
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="domainInfo">Domain Information</param>
        /// <param name="largeImageList">List of Large Images</param>
        public iFoldersListView(DomainInformation domainInfo, ImageList largeImageList)
        {
            this.domainInfo = domainInfo;

            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();
            tileListView1.LargeImageList = largeImageList;

            this.richTextBox1.Text = string.Format(richTextBox1.Text, domainInfo.Name + " - " + domainInfo.Host);
            this.richTextBox2.Text = string.Format(" ");
            Graphics g = richTextBox1.CreateGraphics();

            try
            {
                SizeF textSize = g.MeasureString(richTextBox1.Text, richTextBox1.Font);
                this.Width = (int)(textSize.Width * 1.1);
            }
            finally
            {
                g.Dispose();
            }

            base.DoubleClick += new EventHandler(iFoldersListView_DoubleClick);
        }
Beispiel #37
0
        /// <summary>
        /// Logout
        /// </summary>
        /// <param name="dom">Domain Information</param>
        public void LogoutDomain(DomainInformation dom)
        {
            try
            {
                domainController.LogoutDomain(dom.ID);

                dom.Authenticated = false;

                // In the new accounts model, when a user makes an
                // account go offline, we should also disable the account.
//				if (dom.Active)
//				{
//					domainController.InactivateDomain(dom.ID);
//					UpdateDomainStatus(dom.ID);
//				}
//				else
//				{
                //UpdateDomainStatus(dom.ID);
                iFolderData ifdata = iFolderData.GetData();
                ifdata.Refresh();
//				}
            }
            catch (Exception)
            {
                iFolderMsgDialog dg = new iFolderMsgDialog(
                    topLevelWindow,
                    iFolderMsgDialog.DialogType.Error,
                    iFolderMsgDialog.ButtonSet.Ok,
                    "",
                    Util.GS("Unable to log out of the iFolder Server"),
                    Util.GS("An error was encountered while logging out of the iFolder Server.  If the problem persists, please contact your network administrator."));
                dg.Run();
                dg.Hide();
                dg.Destroy();
            }
        }
 public void ToggelDomainState(DomainInformation domainInfo, bool login)
 {
     onlineToggleButton.Activatable = false;
        IDomainProviderUI provider = domainProviderUI.GetProviderForID(domainInfo.ID);
        if(provider != null)
        {
     if (domainInfo.Active)
      domainController.InactivateDomain(domainInfo.ID);
     else
      domainController.ActivateDomain(domainInfo.ID);
        }
        else
        {
     if(true == login)
     {
       LoginDomain(domainInfo);
     }
     else
     {
       LogoutDomain(domainInfo);
     }
        }
       UpdateDomainStatus(domainInfo.ID);
        onlineToggleButton.Activatable = true;
 }
 public void LogoutDomain(DomainInformation dom)
 {
     try
        {
     domainController.LogoutDomain(dom.ID);
     dom.Authenticated = false;
      iFolderData ifdata = iFolderData.GetData();
      ifdata.Refresh();
        }
        catch (Exception ex)
        {
     iFolderMsgDialog dg = new iFolderMsgDialog(
      topLevelWindow,
      iFolderMsgDialog.DialogType.Error,
      iFolderMsgDialog.ButtonSet.Ok,
      "",
      Util.GS("Unable to log out of the iFolder Server"),
      Util.GS("An error was encountered while logging out of the iFolder Server.  If the problem persists, please contact your network administrator."));
     dg.Run();
     dg.Hide();
     dg.Destroy();
        }
 }
Beispiel #40
0
 public void UpdateiFolderCount(DomainInformation currentDomain)
 {
     DomainInformation domain = currentDomain;
                 if(null == domain)
                 {
                         domain = UpdateCurrentServer();
                 }
                 labeliFolderCount.Text = string.Format(Util.GS("No. of iFolder: {0}"),ifws.GetiFoldersForDomain(domain.ID).Length);
 }
 public override async Task Delete(DomainInformation domainInformation, int deleterRef)
 {
     await repository.Remove(domainInformation.DomainInformationID, deleterRef);
 }
 private void removeDomainFromFile(DomainInformation domainInfo, string defaultDomainID)
 {
     XmlDocument domainsDoc;
        domainsDoc = new XmlDocument();
        domainsDoc.Load(domainList);
        XmlElement element = (XmlElement)domainsDoc.SelectSingleNode("/domains");
        XmlNode domainNode = null;
        XmlNodeList nodeList = element.GetElementsByTagName("domain");
        foreach (XmlNode node in nodeList)
        {
     string id = ((XmlElement)node).GetAttribute("ID");
     if (id.Equals(domainInfo.ID))
     {
      domainNode = node;
      break;
     }
        }
        if (domainNode != null)
        {
     element.RemoveChild(domainNode);
        }
        if (defaultDomainID != null)
        {
     element = (XmlElement)domainsDoc.SelectSingleNode("/domains/defaultDomain");
     if (!element.GetAttribute("ID").Equals(defaultDomainID))
     {
      element.SetAttribute("ID", defaultDomainID);
     }
        }
        saveXmlFile(domainsDoc);
 }
Beispiel #43
0
 public void UpdateSelectedServerDetails(DomainInformation domain)
 {
     DomainInformation currentDomain = domain;
       if(labelUser != null && currentDomain != null)
        {
        labelUser.Text = string.Format(Util.GS("User: {0}"), currentDomain.MemberName);
        }
     if (labeliFolderCount != null && labeliDiskUsed != null
     && labeliDiskAvailable != null
     && currentDomain != null)
     {
      UriBuilder serverUri = new UriBuilder(currentDomain.HostUrl);
      labelServer.Text = string.Format(Util.GS("Server: {0}"), serverUri.Host);
      labeliFolderCount.Text = string.Format(Util.GS("No. of iFolder: {0}"),ifws.GetiFoldersForDomain(currentDomain.ID).Length);
      PopulateUsedAvailableQuotaData(currentDomain);
      labeliDiskAvailable.Text =string.Format(Util.GS("Available:") + diskQuotaAvailable);
      labeliDiskUsed.Text = string.Format(Util.GS("Used:") + diskQuotaUsed);
     }
 }
 public void RemoveDomainFromList(DomainInformation domainInfo, string defaultDomainID)
 {
     RemoveDomainFromList( domainInfo.ID, defaultDomainID );
 }
 public void LoginDomain(DomainInformation dom)
 {
     try
        {
     LoginDialog =
      new iFolderLoginDialog(dom.ID, dom.Name, dom.MemberName);
     if (!Util.RegisterModalWindow(LoginDialog))
     {
      LoginDialog.Destroy();
      LoginDialog = null;
      return;
     }
     LoginDialog.Response +=
      new ResponseHandler(OnLoginDialogResponse);
     LoginDialog.ShowAll();
     string password = domainController.GetDomainPassword(dom.ID);
     if (password != null)
     {
      LoginDialog.Hide();
      LoginDialog.Password = password;
      LoginDialog.Respond(Gtk.ResponseType.Ok);
     }
        }
        catch
        {
     Util.ShowLoginError(topLevelWindow, StatusCodes.Unknown);
     UpdateDomainStatus(dom.ID);
        }
 }
 public void AddDomainToList(DomainInformation domainInfo)
 {
     if (domainInfo.IsDefault)
        {
     if ((defaultDomainInfo != null) && !defaultDomainInfo.ID.Equals(domainInfo.ID))
     {
      defaultDomainInfo.IsDefault = false;
     }
     defaultDomainInfo = domainInfo;
        }
        addDomainToFile(domainInfo);
 }
 public iFoldersListView AddDomainToUIList(DomainInformation domainInfo)
 {
     lock (iFolderListViews)
     {
         iFoldersListView ifListView = (iFoldersListView)iFolderListViews[domainInfo.ID];
         if (ifListView == null)
         {
             ifListView = new iFoldersListView(domainInfo, largeImageList);
             ifListView.SelectedIndexChanged += new Novell.FormsTrayApp.iFoldersListView.SelectedIndexChangedDelegate(ifListView_SelectedIndexChanged);
             ifListView.DoubleClick += new EventHandler(iFolderView_DoubleClick);
             ifListView.NavigateItem += new Novell.FormsTrayApp.iFoldersListView.NavigateItemDelegate(iFolderView_NavigateItem);
             iFolderListViews.Add(domainInfo.ID, ifListView);
             updateWidth();
             ifListView.Visible = !hide;
             panel2.Controls.Add(ifListView);
             updateView();
         }
         return ifListView;
     }
 }
 private void updateDomainInfo(DomainInformation dw)
 {
     titleUser.Text = TrayApp.Properties.Resources.user + ":  " + dw.MemberName;
     titleServer.Text = TrayApp.Properties.Resources.server + ":  " + dw.Host;
     titleAvailable.Text = TrayApp.Properties.Resources.availableQuota + ":  " +
                                         calcAvailableQuota(dw.MemberUserID);
     titleUsed.Text = TrayApp.Properties.Resources.usedQuota + ":  " +
                                         calcUsedQuota(dw.MemberUserID);
     titleNOFolders.Text = TrayApp.Properties.Resources.noifolder + ":  " +
                                         this.ifWebService.GetiFoldersForDomain(dw.ID).Length;
 }
 private void setAuthState(DomainInformation dw)
 {
     if (dw.Authenticated)
     {
         LoginLogoff.Text = TrayApp.Properties.Resources.logoff;
         pictureBox1.Image = new Bitmap(Path.Combine(Application.StartupPath, @"res\ifolder_connect_128.png"));
     }
     else
     {
         LoginLogoff.Text = TrayApp.Properties.Resources.login;
         pictureBox1.Image = new Bitmap(Path.Combine(Application.StartupPath, @"res\ifolder_discon_128.png"));
     }
 }
 private void serverListComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     DomainInformation[] domains;
     domains = this.simiasWebService.GetDomains(false);
     int index = 0;
     foreach (DomainInformation dw in domains)
     {
         try
         {
             if (index == ((ComboBox)sender).SelectedIndex)
             {
                 selectedDomain = dw;
                 updateDomainInfo(dw);
                 setAuthState(dw);
                 break;
             }
             index++;
         }
         catch { }
     }
 }
Beispiel #51
0
 public void AddDomainToList(DomainInformation domainInfo)
 {
     Domain domain = null;
     foreach (ListViewItem lvi in accounts.Items)
     {
         Domain d = (Domain)lvi.Tag;
         if (d.ID.Equals(domainInfo.ID))
         {
             domain = d;
             break;
         }
     }
     if (domain == null)
     {
         domain = new Domain(domainInfo);
         if (domainInfo.IsDefault)
         {
             if ((currentDefaultDomain != null) && !currentDefaultDomain.ID.Equals(domainInfo.ID))
             {
                 currentDefaultDomain.DomainInfo.IsDefault = false;
             }
             currentDefaultDomain = domain;
             if (ChangeDefaultDomain != null)
             {
                 ChangeDefaultDomain(this, new DomainConnectEventArgs(currentDefaultDomain.DomainInfo));
             }
         }
         ListViewItem lvi = new ListViewItem(
             new string[] { string.Empty, domain.Name,
       domainInfo.MemberName });
         lvi.Checked = domainInfo.Authenticated;
         lvi.Tag = domain;
         lvi.Selected = domainInfo.IsDefault;
         accounts.Items.Add(lvi);
     }
 }
 public void UpdateDomain(DomainInformation domainInfo)
 {
 }
Beispiel #53
0
 public void RemoveDomainFromList(DomainInformation domainInfo, string defaultDomainID)
 {
     ListViewItem lvitem = null;
     Domain defaultDomain = null;
     try
     {
         foreach (ListViewItem lvi in accounts.Items)
         {
             Domain d = (Domain)lvi.Tag;
             if (d.ID.Equals(domainInfo.ID))
             {
                 lvitem = lvi;
             }
             else if ((defaultDomainID != null) && d.ID.Equals(defaultDomainID))
             {
                 defaultDomain = d;
             }
         }
         if (lvitem != null)
         {
             lvitem.Remove();
         }
         if (defaultDomain != null)
         {
             if ((currentDefaultDomain != null) && !currentDefaultDomain.ID.Equals(defaultDomainID))
             {
                 currentDefaultDomain.DomainInfo.IsDefault = false;
             }
             currentDefaultDomain = defaultDomain;
         }
     }
     catch { }
 }
 private void addDomainToFile(DomainInformation domainInfo)
 {
     XmlDocument domainsDoc;
        domainsDoc = new XmlDocument();
        domainsDoc.Load(domainList);
        XmlElement element = (XmlElement)domainsDoc.SelectSingleNode("/domains");
        bool found = false;
        XmlNodeList nodeList = element.GetElementsByTagName("domain");
        foreach (XmlNode node in nodeList)
        {
     string id = ((XmlElement)node).GetAttribute("ID");
     if (id.Equals(domainInfo.ID))
     {
      found = true;
      break;
     }
        }
        if (!found)
        {
     XmlElement domain = domainsDoc.CreateElement("domain");
     domain.SetAttribute("name", domainInfo.Name);
     domain.SetAttribute("ID", domainInfo.ID);
     element.AppendChild(domain);
        }
        if (domainInfo.IsDefault)
        {
     XmlElement defaultDomainElement = (XmlElement)domainsDoc.SelectSingleNode("/domains/defaultDomain");
     if (defaultDomainElement == null)
     {
      defaultDomainElement = domainsDoc.CreateElement("defaultDomain");
      defaultDomainElement.SetAttribute("ID", domainInfo.ID);
      element.AppendChild(defaultDomainElement);
     }
     else
     {
      string id = defaultDomainElement.GetAttribute("ID");
      if (!id.Equals(domainInfo.ID))
      {
       defaultDomainElement.SetAttribute("ID", domainInfo.ID);
      }
     }
        }
        saveXmlFile(domainsDoc);
 }
Beispiel #55
0
 private void UpdateQoutaData(DomainInformation domain)
 {
     string str,str1 = null;
     iFolderViewGroup ifGrp = null;
     if (domain == null) return;
        try
     {
        PopulateUsedAvailableQuotaData(domain);
      str = string.Format(Util.GS("Disk Space Available: {0}"), diskQuotaAvailable );
      str1 = string.Format(Util.GS("Disk Space Used: {0}"), diskQuotaUsed ) ;
      str = str + "            " + str1;
      ifGrp = (iFolderViewGroup)serverGroups[domain.ID];
      if(ifGrp != null)
      {
      ifGrp.QoutaLabel.Markup = string.Format("<span size=\"small\">{0}</span>", GLib.Markup.EscapeText(str));
      }
     }
     catch
     {
     }
 }
 private void menuCreate_Click(object sender, System.EventArgs e)
 {
     ArrayList domains = new ArrayList();
     DomainInformation[] domainsInfo = simiasWebService.GetDomains(false);
     if( defaultDomainInfo == null && domainsInfo!= null && domainsInfo.Length > 0)
         defaultDomainInfo = domainsInfo[0];
        DomainItem selectedDomainItem = null;
     if( defaultDomainInfo != null)
         selectedDomainItem = new DomainItem( defaultDomainInfo.Name, defaultDomainInfo.ID );
     if (null != domainsInfo)
     {
         for (int i = 0; i < domainsInfo.Length; i++)
         {
             DomainItem domainItem = new DomainItem(domainsInfo[i].Name, domainsInfo[i].ID, domainsInfo[i].Host, domainsInfo[i].HostUrl);
             domains.Add(domainItem);
         }
     }
        CreateiFolder createiFolder = new CreateiFolder();
     try
     {
         createiFolder.Servers = domains;
         if (selectedDomainItem != null)
             createiFolder.SelectedDomain = selectedDomainItem;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
        createiFolder.LoadPath = Application.StartupPath;
        createiFolder.iFolderWebService = ifWebService;
        createiFolder.simiasWebService = this.simiasWebService;
        if ((DialogResult.OK == createiFolder.ShowDialog()) && iFolderComponent.DisplayConfirmationEnabled)
        {
     new iFolderComponent().NewiFolderWizard(Application.StartupPath, createiFolder.iFolderPath);
        }
 }
 public override async Task Add(DomainInformation domainInformation, int adderRef)
 {
     await repository.Add(domainInformation, adderRef);
 }
Beispiel #58
0
 public void PopulateUsedAvailableQuotaData(DomainInformation domain)
 {
     if (domain == null ) return;
        try{
     diskQuotaUsed = CalculateDiskUsed(domain.MemberUserID);
     diskQuotaAvailable = CalculateDiskQouta(domain.MemberUserID);
       }
       catch
       {
     diskQuotaUsed = Util.GS("N/A");
     diskQuotaAvailable = Util.GS("N/A");
       }
 }
 public override async Task Update(DomainInformation DomainInformation, int updaterRef)
 {
     await repository.Update(DomainInformation, updaterRef);
 }
Beispiel #60
0
 public DomainInformation UpdateCurrentServer()
 {
     int count=0, index = 0 ;
        DomainInformation dom = null;
      if(ViewUserDomainList != null)
      {
     index = ViewUserDomainList.Active;
     ComboBoxSelectionIndex = ViewUserDomainList.Active;
      }
        DomainInformation[] domains = domainController.GetDomains();
        foreach (DomainInformation domain in domains)
        {
       dom = domain;
      if(count == index)
        {
        break;
        }
      count++;
         }
      ServerDomain = dom;
      UpdateServerStatButton();
      return dom;
 }