protected void Page_Load(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); myLoginModule.checkPermission(1); WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]); if (!IsPostBack) { try { Employer myEmployer = new Employer(); //LoginModule myLoginModule = new LoginModule(); String[] stringArray = myEmployer.getInfoToForm((String)Session["userID"]); fName.Text = stringArray[0]; mName.Text = stringArray[1]; lName.Text = stringArray[2]; company.Text = stringArray[4]; personalPhone.Text = stringArray[9]; personalEmail.Text = stringArray[3]; companyPhone.Text = stringArray[10]; companyEmail.Text = stringArray[8]; number.Text = stringArray[5]; street.Text = stringArray[6]; town.Text = stringArray[7]; } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(Page.GetType(), "showAlert", "showAlert();", true); } } }
public BooksEntityApp() : base("BookStore", CurrentVersion) { //Areas var booksArea = this.AddArea("books"); var infoArea = this.AddArea("info"); var loginArea = this.AddArea("login"); //main module MainModule = new BooksModule(booksArea); //Standard modules var dbInfoModule = new DbInfoModule(infoArea); //Job exec module - disabled for now //var jobExecModule = new Modules.JobExecution.JobExecutionModule(booksArea); // LoginModule var loginStt = new LoginModuleSettings(passwordExpirationPeriod: TimeSpan.FromDays(180)); loginStt.RequiredPasswordStrength = PasswordStrength.Medium; loginStt.DefaultEmailFrom = "*****@*****.**"; var loginModule = new LoginModule(loginArea, loginStt); //api config - register controllers defined in Vita.Modules.Login assembly; books controllers are registered by BooksModule base.ApiConfiguration.RegisterControllerTypes( typeof(LoginController), typeof(PasswordResetController), typeof(LoginSelfServiceController), typeof(LoginAdministrationController) ); }
public void Login_Test(string username, bool isvalid) { var password = "******"; var dt = (username == "100") ? CreateDataTable(new List <Dictionary <string, string> > { { new Dictionary <string, string> { { nameof(username), "100" }, { nameof(password), password }, } } }) : new DataTable(); var sqlMock = GetSqlHelperBase(dt); loginModule = new LoginModule(sqlMock); if (isvalid) { loginModule.UserLogin(username, password); } else { Assert.Throws <Exception>(() => loginModule.UserLogin(username, password)); } }
public IActionResult Get(LoginModule login) { if (ModelState.IsValid) { if (!(login.UserName == "geekfm" && login.PassWord == "123qweA")) { return(BadRequest()); } var claims = new Claim[] { new Claim(ClaimTypes.Name, "geekfm"), //new Claim(ClaimTypes.Role,"admin"), new Claim("Admin", "true"), }; var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_jwtSetting.SecretKey)); var credentials = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); var token = new JwtSecurityToken( _jwtSetting.Issuer, _jwtSetting.Audience, claims, null, DateTime.Now.AddMinutes(120), credentials ); return(Ok(new { token = new JwtSecurityTokenHandler().WriteToken(token) })); } return(BadRequest()); }
public BooksEntityApp() : base("BookStore", CurrentVersion) { //Areas var booksArea = this.AddArea("books"); var infoArea = this.AddArea("info"); var loginArea = this.AddArea("login"); //main module MainModule = new BooksModule(booksArea); //Standard modules var dbInfoModule = new DbInfoModule(infoArea); //Job exec module - disabled for now //var jobExecModule = new Modules.JobExecution.JobExecutionModule(booksArea); // LoginModule var loginStt = new LoginModuleSettings(passwordExpirationPeriod: TimeSpan.FromDays(180)); loginStt.RequiredPasswordStrength = PasswordStrength.Medium; loginStt.DefaultEmailFrom = "*****@*****.**"; var loginModule = new LoginModule(loginArea, loginStt); // Setup encrypted data module. var encrModule = new EncryptedDataModule(booksArea); // Use TestGenerateCryptoKeys test in BasicTests project to generate // and print crypto keys for all algorithms. var cryptoKey = "8E487AD4C490AC43DF15D33AB654E5A222A02C9C904BC51E48C4FE5B7D86F90A"; var cryptoBytes = HexUtil.HexToByteArray(cryptoKey); encrModule.AddChannel(cryptoBytes); //creates default channel Instance = this; }
void OnEnable() { // get user credentials user_credential = GameObject.Find("AIOGameManager").GetComponent <LoginModule>(); StartCoroutine(QueryConsistency()); var user_level = int.Parse(user_credential.accountLevel); fullName.text = user_credential.fullName; // identify account level if (user_level == 1) { Debug.Log("Admin account"); user_grade_or_account_level.text = "Admin"; } else if (user_level == 2) { Debug.Log("Teacher account"); user_grade_or_account_level.text = "Teacher"; } else { // request the class section information of the student Debug.Log("Student account."); user_grade_or_account_level.text = "Grade: " + user_credential.gradeLevel; } }
private void doCheckVerify(AbstractActionFuture future) { LoginModule login = (LoginModule)getContext().getModule(AbstractModule.Type.LOGIN); QQAccount account = (QQAccount)getContext().getAccount(); login.checkVerify(account.getUsername(), delegate(QQActionEvent evt) { if (evt.getType() == QQActionEvent.Type.EVT_OK) { CheckVerifyArgs args = (CheckVerifyArgs)(evt.getTarget()); account.setUin(args.uin); if (args.result == 0) { doWebLogin(args.code, future); } else { doGetVerify("为了保证您账号的安全,请输入验证码中字符继续登录。", future); } } else if (evt.getType() == QQActionEvent.Type.EVT_ERROR) { future.notifyActionEvent( QQActionEvent.Type.EVT_ERROR, evt.getTarget()); } }); }
private void doGetVerify(String reason, AbstractActionFuture future) { QQAccount account = (QQAccount)(getContext().getAccount()); LoginModule login = (LoginModule)getContext().getModule(AbstractModule.Type.LOGIN); login.getCaptcha(account.getUin(), delegate(QQActionEvent evt) { if (evt.getType() == QQActionEvent.Type.EVT_OK) { QQNotifyEventArgs.ImageVerify verify = new QQNotifyEventArgs.ImageVerify(); verify.type = QQNotifyEventArgs.ImageVerify.VerifyType.LOGIN; verify.image = (BitmapImage)evt.getTarget(); verify.reason = reason; verify.future = future; getContext().fireNotify(new QQNotifyEvent(QQNotifyEvent.Type.CAPACHA_VERIFY, verify)); } else if (evt.getType() == QQActionEvent.Type.EVT_ERROR) { future.notifyActionEvent( QQActionEvent.Type.EVT_ERROR, (QQException)evt.getTarget()); } }); }
protected void Button2_Click(object sender, EventArgs e) { int role = 0; if (!RadioButton2.Checked && RadioButton1.Checked) { role = 1; } if (TextBox2.Text.Equals("") || TextBox3.Text.Equals("") || ReEnterPassword.Text.Equals("") || (!RadioButton1.Checked && !RadioButton2.Checked) ) { WarningLabel.Text = "Your Response is incomplete"; } else { LoginModule myLogin = new LoginModule(); if (TextBox3.Text == ReEnterPassword.Text) { WarningLabel.Text = myLogin.createAccount(TextBox2.Text, TextBox3.Text, EmailTextBox.Text, role); } else { WarningLabel.Text = "Passwords don't match!"; } } }
public async Task UpdateAsync() { LoginConfigData config = await LoginConfigDataProvider.GetConfigAsync(); RegisterModule regMod = (RegisterModule)await ModuleDefinition.CreateUniqueModuleAsync(typeof(RegisterModule)); LoginModule loginMod = (LoginModule)await ModuleDefinition.CreateUniqueModuleAsync(typeof(LoginModule)); bool closeOnLogin; Manager.TryGetUrlArg <bool>("CloseOnLogin", out closeOnLogin, false); ModuleAction logAction = await loginMod.GetAction_LoginAsync(config.LoginUrl, Force : true, CloseOnLogin : closeOnLogin); if (logAction != null) { logAction.AddToOriginList = false; } Actions.New(logAction); ModuleAction regAction = await regMod.GetAction_RegisterAsync(config.RegisterUrl, Force : true, CloseOnLogin : closeOnLogin); if (regAction != null) { regAction.AddToOriginList = false; } Actions.New(regAction); }
public IActionResult OnPost() { var username = HttpContext.Request.Form["username"]; var password = HttpContext.Request.Form["password"]; User user = LoginModule.Login(username, password); if (user == null) { // HTTP 302 // Location /Message?MessageCode=1 return(RedirectToPage("/Message", new { MessageCode = "1" })); } // See Auth.SessionExtensions HttpContext.Session.SetUser(user); Message = user.Username + " logged"; IsUserLogged = true; if (Type != null && Type.Equals("json")) { return(Content("{username=\"" + user.Username + "\"}", "application/json", System.Text.Encoding.UTF8)); } return(Page()); }
public void ApplySettings() { link = InputLink.text; bloom = Toggle_Bloom.isOn; motionblur = Toggle_MotionBlur.isOn; resolutionIndex = dropdown_resolution.value; Screen.SetResolution(resolutions[dropdown_resolution.value].width, resolutions[dropdown_resolution.value].height, Screen.fullScreen); SettingsAndControls.Settings.SetSetting("link", new SACString(link), Setting.SettingType.STRING); SettingsAndControls.Settings.SetSetting("bloom", new SACBool(bloom), Setting.SettingType.BOOLEAN); SettingsAndControls.Settings.SetSetting("blur", new SACBool(motionblur), Setting.SettingType.BOOLEAN); SettingsAndControls.Settings.SetSetting("resolution_index", new SACInt(resolutionIndex), Setting.SettingType.INTEGER); SettingsAndControls.Save(); if (gameObject.name == "SettingsPanel") { //display messagebox from login module LoginModule loginModule = GameObject.FindGameObjectWithTag("GameController").GetComponent <LoginModule>(); loginModule.messagePrompt("Settings has been changed successfully", 2); } else if (gameObject.name == "InGameSettingsPanel") { gameObject.SetActive(false); } }
private IEnumerator WaitSendLogin() { LockPanel.Show("用戶:" + _inputFieldAccount.text + " 正在登陆游戏"); yield return(new WaitForSeconds(1.0f)); LoginModule.GetInstance().NetWork_Request_Login(_inputFieldAccount.text, ""); }
private void doWebLogin(String verifyCode, AbstractActionFuture future) { LoginModule login = (LoginModule)getContext().getModule(AbstractModule.Type.LOGIN); QQAccount account = (QQAccount)getContext().getAccount(); login.webLogin(account.getUsername(), account.getPassword(), account.getUin(), verifyCode, delegate(QQActionEvent evt) { if (evt.getType() == QQActionEvent.Type.EVT_OK) { doCheckLoginSig((String)evt.getTarget(), future); } else if (evt.getType() == QQActionEvent.Type.EVT_ERROR) { QQException ex = (QQException)(evt.getTarget()); if (ex.getError() == QQWpfApplication1.action.QQException.QQErrorCode.WRONG_CAPTCHA) { doGetVerify(ex.Message, future); } else { future.notifyActionEvent( QQActionEvent.Type.EVT_ERROR, (QQException)evt.getTarget()); } } }); }
public override void InitializeReplication(LoginModule module) { List <string> filters = new List <string>(); filters.Add("user_" + module.LoggedInStaff.Id + ""); this.Replicate("user_info_" + module.LoggedInStaff.Id, "staff", filters); }
protected void Page_Load(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]); }
public int UserType(LoginModule LoginInfo) { StringBuilder str = new StringBuilder(); str.AppendLine("select Role from LoginUser where IsDelete=0 and Username=@UserName"); SqlParameter[] paras = new SqlParameter[1]; paras[0] = new SqlParameter("@UserName", Common.VariableConvert.ConvertStringToDBValue(LoginInfo.UserName)); SqlAccess mySqlAccess = new SqlAccess(); DataSet myds = mySqlAccess.ExecuteAdapter(str.ToString(), paras); if (myds.Tables[0] != null && myds.Tables[0].Rows.Count > 0) { if (myds.Tables[0].Rows[0].ItemArray[0].ToString().Trim() == "admin") { return(1); } else if (myds.Tables[0].Rows[0].ItemArray[0].ToString().Trim() == "superuser") { return(2); } } return(3); }
protected void LoginButton_Click(object sender, EventArgs e) { LoginModule myLogin = new LoginModule(); int x = myLogin.checkPassword(UserNameLogin.Text, PasswordLogin.Text); if (x == 1) { //ConfirmationLabel.Text = "Password is correct."; // creating the session variable to store the ID of the user Session["userID"] = myLogin.getID(UserNameLogin.Text); if (Session["prevPage"] == null) { if (myLogin.getUserRole() == 0) { Response.Redirect("HomePage.aspx"); } else if (myLogin.getUserRole() == 1) { Response.Redirect("ManagerHomePage.aspx"); } else if (myLogin.getUserRole() == 2) { Response.Redirect("WarnBanUsers.aspx"); } } else { Response.Redirect((String)Session["prevPage"]); } } else {// ConfirmationLabel.Text = "Password is incorrect."; } } }
protected void GetForumButton_Click(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); ForumModule myForumMoudule = new ForumModule(); //ConfirmationLabel.Text = myForumMoudule.createForum(myLoginModule.getID(Username.Text), ForumName.Text); ConfirmationLabel.Text = myForumMoudule.createForum((String)Session["userID"], ForumName.Text); }
/// <summary>Calls when a process requests authorization.</summary> /// <param name="actionContext">The action context, which encapsulates information for using <see cref="T:System.Web.Http.Filters.AuthorizationFilterAttribute" />.</param> public override void OnAuthorization(HttpActionContext actionContext) { if (actionContext.Request.Headers.Authorization == null) { actionContext.Response = actionContext.Request.CreateResponse(HttpStatusCode.Unauthorized); } else { try { var auth = Encoding.UTF8 .GetString(Convert.FromBase64String(actionContext.Request.Headers.Authorization.Parameter)).Split(':'); auth.ToList().ForEach(x => BasicValidator.ValidateAsNonSpacedString(x, errorLogger)); var username = auth[0]; var password = auth[1]; var login = new LoginModule(new SqlHelperBase(errorLogger)); if (login.UserLogin(username, password)) { Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(username), null); } else { actionContext.Response = actionContext.Request.CreateResponse(HttpStatusCode.Unauthorized); } } catch (Exception e) { actionContext.Response = actionContext.Request.CreateResponse(HttpStatusCode.Unauthorized); } } }
//Here return type represents the result of an action method public IActionResult Login(LoginModule user) { try { if (ModelState.IsValid) { UserAccount result = this.userBL.Login(user); var tokenString = this.userBL.GenerateToken(result); if (result != null) { //this.Ok returns the data in json format return(this.Ok(new { Success = true, Message = "Login Successfully", token = tokenString, Users = result })); } else { return(this.BadRequest(new { Success = false, Message = "Login Unsuccessfully" })); } } else { throw new Exception("Model is not valid"); } } catch (Exception ex) { return(BadRequest(new { Success = false, ex.Message })); } }
/** * <p>doLogout.</p> * * @param listener a {@link iqq.im.QQActionListener.OnActionEvent} object. * @return a {@link iqq.im.evt.AbstractActionFuture} object. */ public AbstractActionFuture doLogout(QQActionListener.OnActionEvent listener) { AbstractActionFuture future = new AbstractActionFuture(listener); LoginModule loginModule = (LoginModule)getContext().getModule(AbstractModule.Type.LOGIN); loginModule.logout(listener); return(future); }
// Use this for initialization void Start() { loginModule = ModuleManager.Instance().FindModule <LoginModule>(); confirm.onClick.AddListener(onConfirmClick); //loginModule.Connect("192.168.18.168", 18888); }
public void pwUpdate() { gsettings = GameObject.Find("AIOGameManager").GetComponent <GameSettingsManager>(); login_module = GameObject.Find("AIOGameManager").GetComponent <LoginModule>(); // update password from the database StartCoroutine(dbPassUpdate(gsettings.link, txt_accPassword.text, txt_newPassword.text, txt_confirmNewPassword.text)); }
void OnClickLogin() { if (isUseNameValid && isPasswordValid) { LoginModule loginModule = ModuleManager.Instance.EnsureModule <LoginModule>(); loginModule.Login((uint)new System.Random().Next(100000, 999999), input_userName.text, input_password.text); } }
protected void confirmButton_Click(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); statusLabel.Text = myLoginModule.manageChangePassword((String)Session["userID"],oldPsd.Text, newPsd.Text, reEntNewPsd.Text); //if (statusLabel.Text.Equals("Password changed")) { // Response.Redirect("Homepage.aspx"); //} }
public TidsRegController() { var sqlHelperBase = new SqlHelperBase(errorLogger); loginModule = new LoginModule(sqlHelperBase); projectModule = new ProjectModule(sqlHelperBase); timeLogModule = new TimeLogModule(sqlHelperBase); }
protected void Page_Load(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); myLoginModule.checkPermission(0); FunctionCallerLabel.Text = String.Empty; WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]); }
protected void Button2_Click(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); EmailModule myEmailModule = new EmailModule(); myEmailModule.deleteAccountConfirmation((String)Session["userID"]); myLoginModule.deleteAccount((String)Session["userID"]); Response.Redirect("WhereIsMyJob.aspx"); }
protected override void RegisterTypes()/* See https://dansiegel.net/post/2017/08/02/breaking-changes-for-prism-autofac-users*/ { LoginModule.Initialize(Builder); VoucherModule.Initialize(Builder); Builder.RegisterType <SessionManager>().As <ISessionManager>().SingleInstance(); Builder.RegisterType <UIServices>().As <IUIServices>().SingleInstance(); Builder.RegisterType <ConnectivityService>().As <IConnectivityService>(); Builder.RegisterGeneric(typeof(BaseRepository <>)).As(typeof(IBaseRepository <>)).SingleInstance(); Builder.RegisterGeneric(typeof(PolicyWrapper <>)).As(typeof(IPolicyWrapper <>)).SingleInstance(); }
/** * <p>doPollMsg.</p> */ public void doPollMsg() { LoginModule login = (LoginModule)getContext().getModule(AbstractModule.Type.LOGIN); login.pollMsg(delegate(QQActionEvent evt) { // 回调通知事件函数 if (evt.getType() == QQActionEvent.Type.EVT_OK) { List <QQNotifyEvent> evts = (List <QQNotifyEvent>)evt.getTarget(); foreach (QQNotifyEvent e in evts) { getContext().fireNotify(e); } // 准备提交下次poll请求 QQSession session = getContext().getSession(); if (session.getState() == QQSession.State.ONLINE) { doPollMsg(); } else if (session.getState() != QQSession.State.KICKED) { relogin(); } } else if (evt.getType() == QQActionEvent.Type.EVT_ERROR) { QQSession session = getContext().getSession(); QQAccount account = (QQAccount)getContext().getAccount(); session.setState(QQSession.State.OFFLINE); account.setStatus(QQStatus.OFFLINE); //因为自带了错误重试机制,如果出现了错误回调,表明已经超时多次均失败,这里直接返回网络错误的异常 QQException ex = (QQException)evt.getTarget(); QQWpfApplication1.action.QQException.QQErrorCode code = ex.getError(); if (code == QQWpfApplication1.action.QQException.QQErrorCode.INVALID_LOGIN_AUTH) { relogin(); } else if (code == QQWpfApplication1.action.QQException.QQErrorCode.IO_ERROR || code == QQWpfApplication1.action.QQException.QQErrorCode.IO_TIMEOUT) { //粗线了IO异常,直接报网络错误 getContext().fireNotify(new QQNotifyEvent(QQNotifyEvent.Type.NET_ERROR, ex)); } else { relogin(); doPollMsg(); } } else if (evt.getType() == QQActionEvent.Type.EVT_RETRY) { } }); }
public override void InitializeReplication(LoginModule module) { List <string> filters = new List <string>(); foreach (Subcontractor contract in module.LoggedInStaff.Contracts) { filters.Add("work_" + contract.Id + ""); } this.Replicate(module.GetSettings().WorkDb(), module.GetSettings().WorkDb(), filters); }
public override void InitializeReplication(LoginModule module) { List <string> filters = new List <string>(); foreach (Subcontractor contract in module.LoggedInStaff.Contracts) { Console.WriteLine("Subcon Id : " + contract.Id); filters.Add("time_blocks_" + contract.Id + ""); } Replicate(module.GetSettings().TimeblocksDb(), module.GetSettings().TimeblocksDb(), filters); }
public static LoginModule Login(UserDetailDto model) { var data = new LoginModule { UserId = model.Id, status = true, createdOn = Utility.GetDateTime(), RoleId = model.RoleId }; return(data); }
protected void ConnectFBButton_Click(object sender, EventArgs e) { /*HttpClient client = new HttpClient(); client.BaseAddress = new Uri("http://localhost:4840"); client.PostAsJsonAsync("http://localhost:4840/Temp_Code/test4.aspx", "does this work?"); */ LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); InfoModule myModule = new InfoModule(); String token = myModule.facebookCheckAuthorisation(); var client = new FacebookClient(token); client.Post("/me/feed", new { message = "Hello World!" }); }
protected void Page_Load(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); myLoginModule.checkPermission(1); WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]); if (!IsPostBack) { ForumModule myForumModule = new ForumModule(); List<String> myList = new List<string>(); myList = myForumModule.getListOfForums(); } }
protected void Page_Load(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); myLoginModule.checkPermission(1); WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]); PositionId.Visible = false; showHideApplyButton(); populatePage(); }
protected void Page_Load(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); myLoginModule.checkPermission(0); WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]); try { if (!IsPostBack) { CVModule myCVModule = new CVModule(); //LoginModule myLoginModule = new LoginModule(); String[] stringArray = myCVModule.getDetailsToForm((String)Session["userID"]); fName.Text = stringArray[0]; mName.Text = stringArray[1]; lName.Text = stringArray[2]; //String date = stringArray[3]; DateTime myDateTime = new DateTime(); myDateTime = DateTime.Parse(stringArray[3]); Datepicker.Text = myDateTime.ToString("MM/dd/yyyy"); //DateTime dt = Convert.ToDateTime(date); //Calendar1.SelectedDate = dt; //Calendar1.VisibleDate = dt; int genderIndex; if (stringArray[5].Equals("True")) { genderIndex = 1; } else { genderIndex = 0; } Gender.SelectedIndex = genderIndex; int mStatusIndex; if (stringArray[6].Equals("True")) { mStatusIndex = 1; } else { mStatusIndex = 0; } mStatus.SelectedIndex = mStatusIndex; number.Text = stringArray[7]; street.Text = stringArray[8]; town.Text = stringArray[9]; email.Text = stringArray[10]; phone.Text = stringArray[11]; school.Text = stringArray[12]; } } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(Page.GetType(), "showAlert", "showAlert();", true); } }
IEnumerator Start() { LoginModule.GetInstance().LoginPanel = this; LoginModule.GetInstance().CreateRolePanel = transform.parent.Find("UICreateRolePanel").GetComponent <UICreateRolePanel> (); _widget = Widget.Create(gameObject); _widget.BandingBtn_OnClick(OnBtnClick_Login, "ViewPort_Login/Btn_Login"); _widget.BandingBtn_OnClick(OnBtnClick_LoginWithOutNet, "ViewPort_Login/Btn_LoginWithOutNet"); _widget.BandingBtn_OnClick(OnBtnClick_SelectServerList, "ViewPort_Login/Group_CurServer/Btn_SelectServer"); _inputFieldAccount = _widget.GetComponent <InputField> ("ViewPort_Login/IF_Account/InputField"); _serverItem_Prefab = _widget.GetComponent <Transform> ("ViewPort_ServerList/Scroll View/Viewport/Content/ServerItem"); _txtCurServerName = _widget.GetComponent <Text> ("ViewPort_Login/Group_CurServer/Txt_CurServer"); _goServerListPanel = _widget.GetComponent <Transform> ("ViewPort_ServerList").gameObject; yield return(InitServerList()); }
// We need to have a parameterless constructor (it might be internal) if we want to use vdbtool to generate DDL scripts internal BooksEntityApp() : base("BookStore", CurrentVersion) { //Areas var booksArea = this.AddArea("books"); var infoArea = this.AddArea("info"); var loginArea = this.AddArea("login"); //main module MainModule = new BooksModule(booksArea); //Standard modules var dbInfoModule = new DbInfoModule(infoArea); // Deprecatedl EncryptedData was used by login module; now only to run migration script var cryptDataModule_Deprecated = new EncryptedDataModule(loginArea); //data history - we track history for book review, it is marked with WithHistory attribute var histModule = new DataHistoryModule(booksArea); // job execution module var jobExecModule = new Modules.JobExecution.JobExecutionModule(booksArea); // LoginModule var loginStt = new LoginModuleSettings(passwordExpirationPeriod: TimeSpan.FromDays(180)); loginStt.RequiredPasswordStrength = PasswordStrength.Medium; loginStt.DefaultEmailFrom = "*****@*****.**"; var loginModule = new LoginModule(loginArea, loginStt); //Notification service var notificationService = new Vita.Modules.Notifications.NotificationService(this); // Authorization object Authorization = new BooksAuthorization(this); //api config - register controllers defined in Vita.Modules assembly; books controllers are registered by BooksModule base.ApiConfiguration.RegisterControllerTypes( typeof(LoginController), typeof(PasswordResetController), typeof(LoginSelfServiceController), typeof(LoginAdministrationController), typeof(LogsDataController), typeof(LogsPostController), typeof(DiagnosticsController), typeof(UserSessionInfoController) ); LogsPostController.EnablePublicEvents = true; //logging app - linked to main app this.LoggingApp = new LoggingEntityApp("log"); LoggingApp.LinkTo(this); //short expir period, just for testing var sessionStt = LoggingApp.GetConfig <UserSessionSettings>(); sessionStt.SessionTimeout = TimeSpan.FromMinutes(5); }
public async Task <string> RenderAsync(string model) { HtmlBuilder hb = new HtmlBuilder(); YTagBuilder tag = new YTagBuilder("span"); FieldSetup(tag, FieldType.Anonymous); ModuleAction actionDisplay = null; ModuleAction actionLoginAs = null; using (UserDefinitionDataProvider userDefDP = new UserDefinitionDataProvider()) { UserDefinition user = null; string userName = ""; if (!string.IsNullOrWhiteSpace(model)) { user = await userDefDP.GetItemByEmailAsync(model); if (user == null) { userName = model; } else { userName = user.Email; UsersDisplayModule modDisp = new UsersDisplayModule(); actionDisplay = modDisp.GetAction_Display(null, user.UserName); LoginModule modLogin = (LoginModule)await ModuleDefinition.CreateUniqueModuleAsync(typeof(LoginModule)); actionLoginAs = await modLogin.GetAction_LoginAsAsync(user.UserId, user.UserName); } } else { userName = __ResStr("noEmail", "(not specified)"); } tag.SetInnerText(userName); } hb.Append(tag.ToString(YTagRenderMode.Normal)); if (actionDisplay != null) { hb.Append(await actionDisplay.RenderAsync(ModuleAction.RenderModeEnum.IconsOnly)); } if (actionLoginAs != null) { hb.Append(await actionLoginAs.RenderAsync(ModuleAction.RenderModeEnum.IconsOnly)); } return(hb.ToString()); }
public void Run_amenities_booking_cancellation_test(string url, string username, string password, string amenity, string time, string approvalDecision, string reply) { Browsers.Goto(url); // 1.Log in as a resident(i.e.use test user account) // 2. Enter bazinga Test Building community LoginModule login = new LoginModule(); login.Login(username, password); Pages.home.WaitForWindowLoad(); // 3. On the side navigation bar, click on Amenities Pages.home.ClickAmenities(); System.Threading.Thread.Sleep(5000); // 4. Click on the Toddler Bootcamp amenity Pages.home.SelectAmenity(amenity); RequestABooking requestBooking = new RequestABooking(); //5. From the datepicker, select a day when the amenity is open and bookable requestBooking.RequestaBooking(); // 6.Click on Request a Booking // 7.Select a 1.5 hour time slot // 8.Click on Next // 9.Enter a custom message // 10.Click on Submit Request requestBooking.SetBooking("6 pm", time); // 11.Verify the accuracy of the info in the amenity booking card // 13.Verify the newly submitted booking request is shown as an orange block in the timeline bar //requestBooking.VerifyBooking("6:00pm - 10:45pm"); // 12. Take note of the ticket number (e.g. A00780) string ticketNubmer = requestBooking.GetBookingTicket(); Console.WriteLine("Ticket number " + ticketNubmer); HelpDeskModule helpdesk = new HelpDeskModule(); //14.On the side navigation bar, click on Help Desk //15.Search for the new amenity booking request by ticket number //16.Click on the newly created ticket //17.On the ticket detail page, post a reply(e.g.I want to cancel my booking) in the thread with an image attachment //18.Verify the reply was correctly posted with an image attachment in the message thread //19.On top of the page, click on Cancel this booking helpdesk.CancelBooking(ticketNubmer, reply); //20.Verify the amenity booking request has been moved to a status of Denied and the ticket has been archived helpdesk.VerifyBookingStatus(approvalDecision); Pages.home.SignOut(); }
protected void Page_Load(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); myLoginModule.checkPermission(1); JobsModule myJobsModule = new JobsModule(); if (!myJobsModule.doesJobBelongToUser((String)Session["userID"], Request["pId"])) { myLoginModule.checkPermission(3); } WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]); setTable(); }
protected void Page_Load(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); myLoginModule.checkPermission(0); WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]); /* JobsModule myJobsModule = new JobsModule(); myJobsModule.setUserId((String)Session["userId"]); JobsGridView.DataSource = myJobsModule.viewMentionedJobs(); JobsGridView.DataBind(); */ this.setTable(); this.setTable2(); }
protected void Page_Load(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); myLoginModule.checkPermission(0); WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]); SearchByDropDownList.AutoPostBack = true; JobTypeDropDownList.Visible = false; JobTypeLabel.Visible = false; if (SearchByDropDownList.SelectedValue.Equals("JobPosition")) { JobTypeDropDownList.Visible = true; JobTypeLabel.Visible = true; } search(); }
protected void LoginButton_Click(object sender, EventArgs e) { LoginModule myLogin = new LoginModule(); int x = myLogin.checkPassword(UserNameLogin.Text, PasswordLogin.Text); if (x == 1) { ConfirmationLabel.Text = "Password is correct."; // creating the session variable to store the ID of the user Session["userID"] = myLogin.getID(UserNameLogin.Text); if (Session["prevPage"] == null) { Response.Redirect("~/Login_Register.aspx"); } /*if (Session["prevPage"] == null) { if (RadioButton2.Checked) { Response.Redirect("HomePage.aspx"); } else if (RadioButton1.Checked) { Response.Redirect("ManagerHomePage.aspx"); } else { ConfirmationLabel.Text = "Please select Candidate or Employer"; } } else { Response.Redirect((String)Session["prevPage"]); }*/ Response.Redirect((String)Session["prevPage"]); } else { ConfirmationLabel.Text = "Password is incorrect."; } }
protected void Page_Load(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); myLoginModule.checkPermission(1); WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]); if (!IsPostBack) { ForumModule myForumModule = new ForumModule(); List<String> myList = new List<string>(); myList = myForumModule.getListOfForums(); ListOfForumsDropDownList.DataSource = myList; ListOfForumsDropDownList.DataBind(); } else { ForumModule myForumModule = new ForumModule(); String forumID = myForumModule.getForumID(ListOfForumsDropDownList.SelectedValue); GridView1.DataSource = myForumModule.getPostsOFForum(forumID); GridView1.DataBind(); Page.ClientScript.RegisterStartupScript(Page.GetType(), "animateGridView", "animateGridView();", true); } }
protected void VerifyButton_Click(object sender, EventArgs e) { LoginModule myLogin = new LoginModule(); if (myLogin.checkAvailability(TextBox2.Text, EmailTextBox.Text) >= 1) { ShowAvailabilityLabel.Text = "Username is available"; } else { ShowAvailabilityLabel.Text = "Username or/and email already exists!"; } }
protected void Page_Load(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); }
protected void Page_Load(object sender, EventArgs e) { LoginModule myLoginModule = new LoginModule(); myLoginModule.checkLoginStatus(); myLoginModule.checkPermission(0); WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]); HttpContext context = System.Web.HttpContext.Current; //Added code CVModule myCVModule = new CVModule(); myCVModule.setUserID(context.Request.QueryString["userId"]); picone.ImageUrl = "ShowPhoto.aspx?userId=" + context.Request.QueryString["userId"]; //String[] stringArray = myCVModule.getDetailsToForm(myLoginModule.getID(TextBox2.Text)); String[] stringArray = myCVModule.getDetailsToForm(context.Request.QueryString["userId"]); name.Text = stringArray[0] + " " + stringArray[1] + " " + stringArray[2]; String dob = stringArray[3]; DateTime myDateTime = new DateTime(); myDateTime = DateTime.Parse(stringArray[3]); String stringAge = myDateTime.Subtract(DateTime.Now).ToString("dhms"); long age = Int64.Parse(stringAge); age /= 1000000; age /= 365; Calendar1.Text = age.ToString(); if (stringArray[5].Equals("True")) { Gender.Text = "Female"; } else { Gender.Text = "Male"; } if (stringArray[6].Equals("True")) { mStatus.Text = "Married"; } else { mStatus.Text = "Single"; } number.Text = stringArray[7]; street.Text = stringArray[8]; town.Text = stringArray[9]; email.Text = stringArray[10]; //phone.Text = stringArray[11]; school.Text = stringArray[12]; FirstDegreeGridView.DataSource = myCVModule.getFirstDegree(); FirstDegreeGridView.DataBind(); FirstDegreeGridView.GridLines = GridLines.None; if (FirstDegreeGridView.Rows.Count == 0) { FirstDegreesLabel.Visible = false; } MastersDegreeGridView.DataSource = myCVModule.getMastersDegree(); MastersDegreeGridView.DataBind(); MastersDegreeGridView.GridLines = GridLines.None; if (MastersDegreeGridView.Rows.Count == 0) { MastersDegreeLabel.Visible = false; } PhdGridView.DataSource = myCVModule.getPhd(); PhdGridView.DataBind(); PhdGridView.GridLines = GridLines.None; if (PhdGridView.Rows.Count == 0) { PhdLabel.Visible = false; } SoftSkillGridView.DataSource = myCVModule.getSoftSkill(); SoftSkillGridView.DataBind(); SoftSkillGridView.GridLines = GridLines.None; if (SoftSkillGridView.Rows.Count == 0) { SoftSkillLabel.Visible = false; } PhoneGridView.DataSource = myCVModule.getPhoneNumbers(); PhoneGridView.DataBind(); PhoneGridView.GridLines = GridLines.None; if (PhoneGridView.Rows.Count == 0) { PhoneLabel.Visible = false; } SeekingJobsGridView.DataSource = myCVModule.getSeekingJobs(); SeekingJobsGridView.DataBind(); SeekingJobsGridView.GridLines = GridLines.None; if (SeekingJobsGridView.Rows.Count == 0) { SeekingJobsLabel.Visible = false; } }