예제 #1
0
 /// <summary>
 /// Remove the busy object from the list which has been stopped
 /// </summary>
 /// <param name="Obj"></param>
 void DeregisterBusyComponent(IServiceSystem Obj)
 {
     if (BusyComponents.Contains(Obj))
     {
         BusyComponents.Remove(Obj);
     }
 }
예제 #2
0
 /// <summary>
 /// Add the busy object to the list to stop it
 /// </summary>
 /// <param name="Obj"></param>
 void RegisterBusyComponent(IServiceSystem Obj)
 {
     if (!BusyComponents.Contains(Obj))
     {
         BusyComponents.Add(Obj);
     }
 }
예제 #3
0
        /// <summary>
        /// Connecting to the gamenoise Site
        /// </summary>
        /// <returns>Information about the user</returns>
        public void Connect()
        {
            //Connecting to gamenoise.de with password ... no more needed
            //NetworkCredential networkCredential = new NetworkCredential("*****", "******");

            try
            {
                _iss = XmlRpcProxyGen.Create<IServiceSystem>();
                //_iss.Credentials = networkCredential;
                _connection = _iss.Connect();
                _sessionID = _connection.sessid;

                _connected = true;
                OnConnected();
            }
            catch(Exception ex)
            {
                Logout();
                throw ex;
            }
        }
예제 #4
0
        public bool Login(string user, string password, string debugURL)
        {
            try
            {
                _username           = user;
                _password           = password;
                drupalServiceSystem = XmlRpcProxyGen.Create <IServiceSystem>();
                string xmlrpcServer;
                // Clean URL pref
                if (!_settings.CleanURL)
                {
                    xmlrpcServer = "?q=" + _settings.EndPoint;
                }
                else
                {
                    xmlrpcServer = "/" + _settings.EndPoint;
                }

                drupalServiceSystem.Url = _settings.DrupalURL + xmlrpcServer + debugURL;
                Drupal    cnct = drupalServiceSystem.Connect();
                DrupalCon lgn;
                // SesionID pref

                if (_settings.UseSessionID)
                {
                    if (_settings.UseKeys)
                    {
                        string hash      = ""; // GetHMAC("", _settings.Key);
                        string timestamp = ""; // = GetUnixTimestamp();
                        string nonce     = GetNonce(10);
                        lgn = drupalServiceSystem.Login(ref hash, _settings.DomainName, ref timestamp, nonce, cnct.sessid, user, password);
                    }
                    else
                    {
                        lgn = drupalServiceSystem.Login(cnct.sessid, user, password);
                    }
                }
                else
                {
                    lgn = drupalServiceSystem.Login(user, password);
                }
                // Check that login was succesfull by comparing username returned.
                if (lgn.user.name == _username)
                {
                    _sessionID  = lgn.sessid;
                    _uID        = lgn.user.uid; //returned from login
                    _isLoggedIn = true;
                }
                else
                {
                    _isLoggedIn = false;
                    handleExeption(new Exception("Unable to login"), "Login");
                }
            }
            catch (Exception ex)
            {
                handleExeption(ex, "Login");
                _isLoggedIn = false;
            }
            return(_isLoggedIn);
        }
 public DrupalServices(string url)
 {
     drupalServiceSystem     = XmlRpcProxyGen.Create <IServiceSystem>();
     drupalServiceSystem.Url = url;
 }
예제 #6
0
파일: Services.cs 프로젝트: bricel/DrutNet
        public bool Login(string user, string password, string debugURL)
        {
            try
            {
                _username = user;
                _password = password;
                drupalServiceSystem = XmlRpcProxyGen.Create<IServiceSystem>();
                string xmlrpcServer;
                // Clean URL pref
                if (!_settings.CleanURL)
                     xmlrpcServer = "?q=" + _settings.EndPoint;
                else
                    xmlrpcServer = "/" +_settings.EndPoint;

                drupalServiceSystem.Url = _settings.DrupalURL + xmlrpcServer + debugURL;
                Drupal cnct = drupalServiceSystem.Connect();
                DrupalCon lgn ;
                // SesionID pref

                if (_settings.UseSessionID)
                {
                    if (_settings.UseKeys)
                    {
                        string hash = "";// GetHMAC("", _settings.Key);
                        string timestamp = "";// = GetUnixTimestamp();
                        string nonce = GetNonce(10);
                        lgn = drupalServiceSystem.Login(ref hash, _settings.DomainName, ref timestamp, nonce, cnct.sessid, user, password);
                    }
                    else
                        lgn = drupalServiceSystem.Login(cnct.sessid, user, password);

                }
                else
                {
                    lgn = drupalServiceSystem.Login(user, password);
                }
                // Check that login was succesfull by comparing username returned.
                if (lgn.user.name == _username)
                {
                    _sessionID = lgn.sessid;
                    _uID = lgn.user.uid; //returned from login
                    _isLoggedIn = true;
                }
                else
                {
                    _isLoggedIn = false;
                    handleExeption(new Exception("Unable to login"), "Login");
                }

            }
            catch (Exception ex)
            {
                handleExeption(ex, "Login");
                _isLoggedIn = false;
            }
            return _isLoggedIn;
        }