Beispiel #1
0
        private void KillSessionItem_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in Sessions.SelectedRows)
            {
                var session = (Session)row.DataBoundItem;
                int targetsid;

                if (!int.TryParse(session.Sid, System.Globalization.NumberStyles.HexNumber, null, out targetsid))
                {
                    continue;
                }

                if (targetsid == _sid)
                {
                    MessageBox.Show(Strings.ADMINFORM_KILL_OWN_SESSION, string.Empty, MessageBoxButtons.OK,
                                    MessageBoxIcon.Warning);
                }
                else
                {
                    IMinimalResponse response = _tunnel.KillSession(new KillSessionRequest(targetsid, _sid));
                    if (!response.Success)
                    {
                        HandleResponse(response);
                    }
                }
            }

            RefreshSessions();
        }
Beispiel #2
0
        public override void Execute(string[] parameters, ILogger logger, ITunnel tunnel, int sid)
        {
            int targetsid;

            if (int.TryParse(parameters[0], System.Globalization.NumberStyles.HexNumber, null, out targetsid))
            {
                var response = tunnel.KillSession(new KillSessionRequest(targetsid, sid));
                logger.Log(this, response.Message, response.Success ? ESeverity.INFO : ESeverity.ERROR);
            }
            else
            {
                logger.Log(this, Strings.CHECK_PARAMETERS, ESeverity.ERROR);
            }
        }
Beispiel #3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Lance la commande
        /// </summary>
        /// <param name="parameters">les parametres</param>
        /// <param name="logger">le logger</param>
        /// <param name="tunnel">le tunnel</param>
        /// <param name="sid">le jeton de session</param>
        /// -----------------------------------------------------------------------------
        public override void Execute(string[] parameters, ILogger logger, ITunnel tunnel, int sid)
        {
            int targetsid;

            if (int.TryParse(parameters[0], System.Globalization.NumberStyles.HexNumber, null, out targetsid))
            {
	            var response = tunnel.KillSession(new KillSessionRequest(targetsid, sid));
	            logger.Log(this, response.Message, response.Success ? ESeverity.INFO : ESeverity.ERROR);
            }
            else
            {
                logger.Log(this, Strings.CHECK_PARAMETERS, ESeverity.ERROR);
            }
        }