AddUser() static private method

static private AddUser ( string server, string user ) : void
server string
user string
return void
        private void DoShowProjects()
        {
            int    result        = 0x29ed;
            string serverAddress = this.serverAddress;

            if (serverAddress.IndexOf(":") > 0)
            {
                int.TryParse(serverAddress.Substring(serverAddress.IndexOf(":") + 1), out result);
                serverAddress = serverAddress.Substring(0, serverAddress.IndexOf(":"));
            }
            AssetServer.AdminSetCredentials(serverAddress, result, this.userName, this.password);
            MaintDatabaseRecord[] recordArray = AssetServer.AdminRefreshDatabases();
            if (recordArray != null)
            {
                this.projectsList = new string[recordArray.Length];
                for (int i = 0; i < recordArray.Length; i++)
                {
                    this.projectsList[i] = recordArray[i].name;
                }
                this.projectsLv.totalRows = recordArray.Length;
                this.GetDefaultPListConfig();
                this.plc["Maint Server"]      = serverAddress;
                this.plc["Maint UserName"]    = this.userName;
                this.plc["Maint port number"] = this.port;
                this.plc.Save();
                ASEditorBackend.SetPassword(serverAddress, this.userName, this.password);
                ASEditorBackend.AddUser(this.serverAddress, this.userName);
            }
            else
            {
                this.projectsLv.totalRows = 0;
            }
        }
Example #2
0
        private void DoShowProjects()
        {
            int    num  = 10733;
            string text = this.serverAddress;

            if (text.IndexOf(":") > 0)
            {
                int.TryParse(text.Substring(text.IndexOf(":") + 1), out num);
                text = text.Substring(0, text.IndexOf(":"));
            }
            AssetServer.AdminSetCredentials(text, num, this.userName, this.password);
            MaintDatabaseRecord[] array = AssetServer.AdminRefreshDatabases();
            if (array != null)
            {
                this.projectsList = new string[array.Length];
                for (int i = 0; i < array.Length; i++)
                {
                    this.projectsList[i] = array[i].name;
                }
                this.projectsLv.totalRows = array.Length;
                this.GetDefaultPListConfig();
                this.plc["Maint Server"]      = text;
                this.plc["Maint UserName"]    = this.userName;
                this.plc["Maint port number"] = this.port;
                this.plc.Save();
                ASEditorBackend.SetPassword(text, this.userName, this.password);
                ASEditorBackend.AddUser(this.serverAddress, this.userName);
            }
            else
            {
                this.projectsLv.totalRows = 0;
            }
        }
        private void DoConnect()
        {
            AssetServer.RemoveMaintErrorsFromConsole();
            int    result        = 0x29ed;
            string serverAddress = this.serverAddress;

            if (serverAddress.IndexOf(":") > 0)
            {
                int.TryParse(serverAddress.Substring(serverAddress.IndexOf(":") + 1), out result);
                serverAddress = serverAddress.Substring(0, serverAddress.IndexOf(":"));
            }
            this.port = result.ToString();
            string str2 = AssetServer.GetDatabaseName(serverAddress, this.userName, this.password, this.port, this.projectName);

            this.GetDefaultPListConfig();
            this.plc["Maint Server"]        = serverAddress;
            this.plc["Maint UserName"]      = this.userName;
            this.plc["Maint database name"] = str2;
            this.plc["Maint port number"]   = this.port;
            this.plc["Maint project name"]  = this.projectName;
            this.plc.Save();
            if (ArrayUtility.Contains <string>(this.serversList, this.serverAddress))
            {
                ArrayUtility.Remove <string>(ref this.serversList, this.serverAddress);
            }
            ArrayUtility.Insert <string>(ref this.serversList, 0, this.serverAddress);
            ASEditorBackend.AddUser(this.serverAddress, this.userName);
            ASEditorBackend.SetPassword(this.serverAddress, this.userName, this.password);
            InternalEditorUtility.SaveEditorSettingsList("ASServer", this.serversList, 20);
            if (str2 != string.Empty)
            {
                ASEditorBackend.InitializeMaintBinding();
                this.parentWin.Reinit();
                GUIUtility.ExitGUI();
            }
            else
            {
                this.parentWin.NeedsSetup = true;
                this.parentWin.Repaint();
            }
        }