Beispiel #1
0
        public void login_with_password(string username, string password, string version, string originator)
        {
            try
            {
                if (JsonRpcClient != null)
                {
                    opaque_ref = JsonRpcClient.session_login_with_password(username, password, version, originator);
                }
                else
                {
                    opaque_ref = XmlRpcProxy.session_login_with_password(username, password, version, originator).parse();
                }

                SetupSessionDetails();
            }
            catch (Failure exn)
            {
                if (exn.ErrorDescription[0] == Failure.MESSAGE_PARAMETER_COUNT_MISMATCH)
                {
                    // Call the pre-2.0 version instead.
                    login_with_password(username, password, version);
                }
                else
                {
                    throw;
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// Change the password on the given session2, using this session for the connection.
 /// </summary>
 /// <param name="session2">The session to change</param>
 /// <param name="oldPassword"></param>
 /// <param name="newPassword"></param>
 public void change_password(Session session2, string oldPassword, string newPassword)
 {
     if (JsonRpcClient != null)
     {
         JsonRpcClient.session_change_password(session2.opaque_ref, oldPassword, newPassword);
     }
     else
     {
         XmlRpcProxy.session_change_password(session2.opaque_ref, oldPassword, newPassword).parse();
     }
 }
Beispiel #3
0
 public void slave_local_login_with_password(string username, string password)
 {
     if (JsonRpcClient != null)
     {
         opaque_ref = JsonRpcClient.session_slave_local_login_with_password(username, password);
     }
     else
     {
         opaque_ref = XmlRpcProxy.session_slave_local_login_with_password(username, password).parse();
     }
     //assume the latest API
     APIVersion = API_Version.LATEST;
 }
Beispiel #4
0
        public void login_with_password(string username, string password)
        {
            if (JsonRpcClient != null)
            {
                opaque_ref = JsonRpcClient.session_login_with_password(username, password);
            }
            else
            {
                opaque_ref = XmlRpcProxy.session_login_with_password(username, password).parse();
            }

            SetupSessionDetails();
        }
Beispiel #5
0
        public void local_logout(string opaqueRef)
        {
            if (opaqueRef == null)
            {
                return;
            }

            if (JsonRpcClient != null)
            {
                JsonRpcClient.session_local_logout(opaqueRef);
            }
            else
            {
                XmlRpcProxy.session_local_logout(opaqueRef).parse();
            }
        }
Beispiel #6
0
        /// <summary>
        /// Log out of the session with the given reference, using this session for the connection.
        /// </summary>
        /// <param name="_self">The session to log out</param>
        public void logout(string _self)
        {
            if (_self == null)
            {
                return;
            }

            if (JsonRpcClient != null)
            {
                JsonRpcClient.session_logout(_self);
            }
            else
            {
                XmlRpcProxy.session_logout(_self).parse();
            }
        }