コード例 #1
0
            internal static string ToCreateWorkspace(IPlasticWebRestApi plasticWebRestApi)
            {
                string clientConfServer = PlasticGui.Plastic.ConfigAPI.GetClientConfServer();

                if (!EditionToken.IsCloudEdition())
                {
                    return(clientConfServer);
                }

                string cloudServer = PlasticGuiConfig.Get().
                                     Configuration.DefaultCloudServer;

                if (!string.IsNullOrEmpty(cloudServer))
                {
                    return(cloudServer);
                }

                CloudEditionCreds.Data config =
                    CloudEditionCreds.GetFromClientConf();

                cloudServer = GetFirstCloudServer.
                              GetCloudServer(plasticWebRestApi, config.Email, config.Password);

                if (string.IsNullOrEmpty(cloudServer))
                {
                    return(clientConfServer);
                }

                SaveCloudServer.ToPlasticGuiConfig(cloudServer);

                return(cloudServer);
            }
コード例 #2
0
        internal static void JoinCloudServer(
            string cloudServer,
            string username,
            string accessToken)
        {
            SaveCloudServer.ToPlasticGuiConfig(cloudServer);
            SaveCloudServer.ToPlasticGuiConfigFile(
                cloudServer, GetPlasticConfigFileToSaveOrganization());
            SaveCloudServer.ToPlasticGuiConfigFile(
                cloudServer, GetGluonConfigFileToSaveOrganization());

            KnownServers.ServersFromCloud.InitializeForWindows(
                PlasticGuiConfig.Get().Configuration.DefaultCloudServer);

            CloudEditionWelcome.WriteToTokensConf(
                cloudServer, username, accessToken);

            if (sAutoLogin)
            {
                ClientConfigData clientConfigData = ConfigurationChecker.GetClientConfigData();
                clientConfigData.WorkspaceServer = cloudServer;
                clientConfigData.WorkingMode     = SEIDWorkingMode.SSOWorkingMode.ToString();
                clientConfigData.SecurityConfig  = username;
                ClientConfig.Get().Save(clientConfigData);

                GetWindow <PlasticWindow>().GetWelcomeView().autoLoginState = AutoLogin.State.OrganizationChoosed;
            }
        }
コード例 #3
0
        internal static void JoinOrganization(string organization, string username, string accessToken)
        {
            SaveCloudServer.ToPlasticGuiConfig(organization);
            SaveCloudServer.ToPlasticGuiConfigFile(
                organization, GetPlasticConfigFileToSaveOrganization());
            SaveCloudServer.ToPlasticGuiConfigFile(
                organization, GetGluonConfigFileToSaveOrganization());

            KnownServers.ServersFromCloud.InitializeForWindows(
                PlasticGuiConfig.Get().Configuration.DefaultCloudServer);

            CloudEditionWelcome.WriteToTokensConf(
                organization,
                username,
                accessToken);

            ClientConfigData clientConfigData = ClientConfig.Get().GetClientConfigData();

            clientConfigData.WorkspaceServer = organization;
            ClientConfig.Get().Save(clientConfigData);
        }