Configuration settings for drupal services module
コード例 #1
0
ファイル: LoginForm.cs プロジェクト: panosadamop/DrutNet
 private void Login()
 {
     txbMessage.Text = "";
     try
     {
         bool loginRes = false;
         this.Cursor = Cursors.WaitCursor;
         writeMessage("Connecting...\n", "Login Form", Enums.MessageType.Error, false);
         ServicesSettings setttings = new ServicesSettings();
         setttings.DrupalURL = textBoxURL.Text;
         _user    = new User(setttings);
         loginRes = _user.Login(UserName, Password);//login with new user
         if (loginRes)
         {
             if (!_user.LoadUser())
             {
                 writeMessage(" Cannot load user", "Login Form", Enums.MessageType.Error, false);
             }
             else
             {
                 SaveUserSettings(UserName, Password, checkBoxSavePass.Checked);
                 this.DialogResult = DialogResult.OK;
                 closing           = true;
                 this.Close();
             }
         }
         this.Cursor = Cursors.Default;
     }
     catch (Exception ex)
     {
         txbMessage.Text += ex.Message + "\n";
         this.Cursor      = Cursors.Default;
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: bricel/DrutNet
        private void button_login_Click(object sender, EventArgs e)
        {
            // Create a settings object to define connection settings.
            ServicesSettings settings = new ServicesSettings();
            settings.DrupalURL = textBox_url.Text; //
            settings.UseSessionID = checkBox_sessionID.Checked;
            settings.EndPoint = textBox_endpoint.Text;
            settings.CleanURL = true;

            /*settings.UseKeys = true;//Not Implemented yet
            //settings.Key = "03cfd62180a67dcbcb1be9a7f78dc726";
            settings.DomainName = "localhost";*/

            // Create a connection object
            _serviceCon = new Services(settings);

               if (_serviceCon.Login(textBox_userName.Text, textBox_password.Text))
                   DrutNETBase.sendLogEvent("Login to services successful \n", "Sample", Enums.MessageType.Info);
        }
コード例 #3
0
ファイル: Services.cs プロジェクト: panosadamop/DrutNet
 /// <summary>
 /// Single Tone constructor
 /// </summary>
 public Services(ServicesSettings settings)
 {
     _settings = settings;
 }
コード例 #4
0
 //string _serversURL;
 /// <summary>
 /// Not loading any user, just init class
 /// </summary>
 /// <param name="serviceCon"></param>
 public User(ServicesSettings settings)
 {
     _servicesCon = new Services(settings);
     _settings    = settings;
     // _serversURL = serverURL;
 }
コード例 #5
0
ファイル: LoginForm.cs プロジェクト: bricel/DrutNet
        private void Login()
        {
            txbMessage.Text = "";
            try
            {

                bool loginRes = false;
                this.Cursor = Cursors.WaitCursor;
                writeMessage("Connecting...\n", "Login Form", Enums.MessageType.Error,false);
                ServicesSettings setttings = new ServicesSettings();
                setttings.DrupalURL = textBoxURL.Text;
                _user = new User(setttings);
                loginRes = _user.Login(UserName, Password);//login with new user
                if (loginRes)
                {
                    if (!_user.LoadUser())
                        writeMessage(" Cannot load user", "Login Form", Enums.MessageType.Error, false);
                    else
                    {
                        SaveUserSettings(UserName, Password, checkBoxSavePass.Checked);
                        this.DialogResult = DialogResult.OK;
                        closing = true;
                        this.Close();
                    }
                }
                this.Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                txbMessage.Text += ex.Message + "\n";
                this.Cursor = Cursors.Default;

            }
        }
コード例 #6
0
ファイル: Form1.cs プロジェクト: bricel/DrutNet
        private void button_login_curl_Click(object sender, EventArgs e)
        {
            ServicesSettings settings = new ServicesSettings();
            settings.DrupalURL = textBox_url.Text; //
            settings.UseSessionID = checkBox_sessionID.Checked;
            // Login to drupal
            _curlCon = new Curl(settings.DrupalURL);

             if (_curlCon.Login(textBox_userName.Text, textBox_password.Text))
                 DrutNETBase.sendLogEvent("Login to curl successful \n","Sample",Enums.MessageType.Info);
        }
コード例 #7
0
ファイル: Services.cs プロジェクト: bricel/DrutNet
 /// <summary>
 /// Single Tone constructor
 /// </summary>
 public Services(ServicesSettings settings)
 {
     _settings = settings;
 }