public SmokeNavigationSteps(Context context)
 {
     Context  = context;
     login    = new LogIn(Context.Page);
     logOff   = new LogOff(Context.Page);
     navigate = new NavigatePages(Context.Page);
 }
示例#2
0
        //
        // GET: /Common/LogOff/

        /// <summary>
        /// Indexes the specified is session time out.
        /// </summary>
        /// <param name="isSessionTimeOut">if set to <c>true</c> [is session time out].</param>
        /// <returns></returns>
        ///FIXED-NOV15--Use Constants and area as Common
        public ActionResult Index(bool isSessionTimeOut)
        {
            UserInfo userInfoViewModel = GetUserInfo();

            //Audit logging for FacilityAdmin and User login but not for SSIAdmin login (UserTypeId = 1)
            if (userInfoViewModel != null && userInfoViewModel.AssignedFacilities != null && userInfoViewModel.AssignedFacilities.Any() && userInfoViewModel.UserTypeId != Constants.One)
            {
                List <FacilityViewModel> facilityDetails = GetAssignedFacilities().ToList();
                List <Facility>          facilities      = AutoMapper.Mapper.Map <List <FacilityViewModel>, List <Facility> >(facilityDetails);

                LogOff logOffInfo = new LogOff
                {
                    UserName         = userInfoViewModel.UserName,
                    IsSessionTimeOut = isSessionTimeOut,
                    UserFacilities   = facilities
                };
                //Save Logout/Session Timeout Audit Log for Contract Management
                PostApiResponse <bool>(Constants.LogOff, Constants.InsertAuditLog,
                                       logOffInfo, true);
            }
            if (isSessionTimeOut)
            {
                AuditLogReport auditLog = new AuditLogReport
                {
                    RequestedUserName = GetLoggedInUserName(),
                    Description       = Constants.UserSessionTimedOut
                };
                //Save Logout Audit Log
                PostApiResponse <int>(Constants.User, Constants.SaveAuditLog, auditLog, true);
            }

            return(RedirectToAction(Constants.LogOff, Constants.Account, new { area = Constants.Common }));
        }
示例#3
0
        public static void doActionByTypes(ActionModel action)
        {
            if (action.actionType == config.actionTypes.lockComputer)
            {
                Lock.Computer();
            }

            if (action.actionType == config.actionTypes.sleepComputer)
            {
                Sleep.Computer();
            }

            if (action.actionType == config.actionTypes.turnOffMonitor)
            {
                TurnOff.Monitor();
            }

            if (action.actionType == config.actionTypes.shutdownComputer)
            {
                ShutdownComputer();
            }

            if (action.actionType == config.actionTypes.restartComputer)
            {
                RestartComputer();
            }

            if (action.actionType == config.actionTypes.logOffWindows)
            {
                LogOff.Windows();
            }
        }
示例#4
0
        public static LogOff read(BinaryReader binaryReader)
        {
            LogOff newObj = new LogOff();

            newObj.gid = binaryReader.ReadUInt32();
            return(newObj);
        }
示例#5
0
        public void LogOff(IUserID user)
        {
            Objects.LogOff req = new LogOff(user);
            IObjects       s   = (IObjects)req;

            db.SEND(ref s);
        }
 public AdHocReportingStep(Context context)
 {
     Context  = context;
     login    = new LogIn(Context.Page);
     logOff   = new LogOff(Context.Page);
     navigate = new NavigatePages(Context.Page);
     adHoc    = new AdHocReporting(Context.Page);
 }
示例#7
0
 //FIXED-NON15--Rename sp to LogOffAuditLog and SaveIntoAuditLog to InsertAuditLog
 /// <summary>
 /// Inserts the audit log.
 /// </summary>
 /// <param name="logOffInfo">The log off information.</param>
 /// <returns></returns>
 public void InsertAuditLog(LogOff logOffInfo)
 {
     //FIXED-2016-R2-S3 : change parameter type of FacilityID from VARCHAR(MAX) to INT in store procedure
     _databaseCommand = _databaseObj.GetStoredProcCommand("LogOffAuditLog");
     _databaseObj.AddInParameter(_databaseCommand, "@UserName", DbType.String, logOffInfo.UserName);
     _databaseObj.AddInParameter(_databaseCommand, "@IsSessionTimeOut", DbType.Boolean, logOffInfo.IsSessionTimeOut);
     _databaseObj.AddInParameter(_databaseCommand, "@UserFacilities", DbType.String, logOffInfo.FacilityIds);
     _databaseObj.ExecuteScalar(_databaseCommand);
 }
示例#8
0
    public override IObjects Get(IObjects request)
    {
        LogOff tmp = (LogOff)request;

        WatchingUsers t = new WatchingUsers();

        t.RemoveUser(tmp.deleted.GetValue);

        return(null);
    }
示例#9
0
 private Task HandleLogOnLogOffNotifications(SessionNotification notification)
 {
     switch (notification.NotificationType)
     {
     case SessionNotificationType.SignIn:
     case SessionNotificationType.SignOut:
         LogOnAsync.RaiseCanExecuteChanged();
         LogOff.RaiseCanExecuteChanged();
         break;
     }
     return(Constant.CompletedTask);
 }
示例#10
0
        public static LogOff read(BinaryReader binaryReader)
        {
            LogOff newObj = new LogOff();

            if (binaryReader.BaseStream.Length == 8) // Client message
            {
                newObj.gid = binaryReader.ReadUInt32();
            }
            else // Server message
            {
                newObj.clientMessage = false;
            }
            return(newObj);
        }
示例#11
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            if (!TestCon(true))
            {
                return;
            }
            string    _sql   = "select * from [User] where Username = '******'";
            DataTable _table = Functions.DataTable(_sql);

            if (_table.Rows.Count > 0)
            {
                if (_table.Rows[0].Field <string>("Password") != txtPassword.Text)
                {
                    txtPassword.Clear();
                    txtPassword.Focus();
                    MetroMessageBox.Show(_owner, "Invalid password!",
                                         Application.ProductName, MessageBoxButtons.OK,
                                         MessageBoxIcon.Warning);
                    return;
                }
            }
            else
            {
                txtUsername.Clear();
                txtPassword.Clear();
                txtUsername.Focus();
                MetroMessageBox.Show(_owner, "Username not found!",
                                     Application.ProductName, MessageBoxButtons.OK,
                                     MessageBoxIcon.Warning);
                return;
            }

            FrmMain.Username = txtUsername.Text;
            EventHandler handler = LogInSuccess;

            if (handler != null)
            {
                handler(this, EventArgs.Empty);
            }
            else
            {
                LogOff?.Invoke(this, EventArgs.Empty);
            }
        }
        public void InsertAuditLog(LogOff logOffInfo)
        {
            if (logOffInfo != null)
            {
                //Fetches the distinct Facility Connection string
                List <string> facilityConnectionStrings =
                    logOffInfo.UserFacilities.Select(facility => facility.DataSource).Distinct().ToList();

                //Logs into database looping through each conectionstrings
                foreach (string connectionString in facilityConnectionStrings)
                {
                    logOffInfo.FacilityIds = String.Join(Constants.Comma,
                                                         logOffInfo.UserFacilities.Where(facility => facility.DataSource == connectionString)
                                                         .Select(facility => facility.FacilityId)
                                                         .ToList());
                    _logOffLogic = new LogOffLogic(connectionString);
                    _logOffLogic.InsertAuditLog(logOffInfo);
                }
            }
        }
示例#13
0
    public override bool acceptMessageData(BinaryReader messageDataReader, TreeView outputTreeView)
    {
        bool handled = true;

        PacketOpcode opcode = Util.readOpcode(messageDataReader);

        switch (opcode)
        {
        case PacketOpcode.CLIENT_REQUEST_ENTER_GAME_EVENT:
        case PacketOpcode.Evt_Admin__GetServerVersion_ID: {
            EmptyMessage message = new EmptyMessage(opcode);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.CHARACTER_GENERATION_VERIFICATION_RESPONSE_EVENT: {
            CharGenVerificationResponse message = CharGenVerificationResponse.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.CHARACTER_EXIT_GAME_EVENT: {
            LogOff message = LogOff.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        // TODO: CHARACTER_PREVIEW_EVENT
        case PacketOpcode.CHARACTER_DELETE_EVENT: {
            CharacterDelete message = CharacterDelete.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.CHARACTER_CREATE_EVENT: {
            CharacterCreate message = CharacterCreate.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.CHARACTER_ENTER_GAME_EVENT: {
            EnterWorld message = EnterWorld.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.CONTROL_FORCE_OBJDESC_SEND_EVENT: {
            ForceObjdesc message = ForceObjdesc.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Admin__Friends_ID: {
            Friends message = Friends.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Admin__AdminRestoreCharacter_ID: {
            AdminRestoreCharacter message = AdminRestoreCharacter.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.ACCOUNT_BOOTED_EVENT:
        {
            AccountBootedEvent message = AccountBootedEvent.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        default: {
            handled = false;
            break;
        }
        }

        return(handled);
    }
示例#14
0
 public LogInSteps(Context context)
 {
     Context = context;
     login   = new LogIn(Context.Page);
     logOff  = new LogOff(Context.Page);
 }
示例#15
0
 /// <summary>
 /// Inserts the audit log.
 /// </summary>
 /// <param name="logOffInfo">The log off information.</param>
 /// <returns></returns>
 public void InsertAuditLog(LogOff logOffInfo)
 {
     _logOffRepository.InsertAuditLog(logOffInfo);
 }