public void Execute() { List<string> argList =ArgumentsParser.Parse(_Request.Content); int appType = argList[3].ToInt(); LoginParameter loginParameter = new LoginParameter() { LoginId = argList[0], Password=argList[1], Version=argList[2], AppType=(AppType)argList[3].ToInt(), Request=_Request }; LoginManager loginManager = new LoginManager(); loginManager.StateLoadingCompleted += OnLoginStateLoadingCompleteCallback; loginManager.Login(loginParameter); }
public override void ViewDidLoad() { base.ViewDidLoad(); LoginManager login = new LoginManager(); login.LogInWithReadPermissions(readPermissions.ToArray(), delegate(LoginManagerLoginResult result, NSError error) { if (error != null) { UpdateCredentials(string.Empty); } else if (result.IsCancelled) { UpdateCredentials(string.Empty); } else { var accessToken = result.Token; UpdateCredentials(accessToken.TokenString); ((AppDelegate)UIApplication.SharedApplication.Delegate).UpdateRootViewController(new TODOViewController()); } }); }
public void LoginWithValidCredentials() { // Arrange var mockEmployeeRepository = new Mock<IEmployeeRepository>(); var username = "******"; var password = "******"; var employee = new Employee { UserName = username, Password = password }; mockEmployeeRepository.Setup( r => r.Find(It.IsAny<ISpecification<Employee>>())) .Returns(new List<Employee>{ employee }); var sut = new LoginManager(mockEmployeeRepository.Object); // Act var result = sut.Login(username, password); // Assert Assert.AreEqual("Login successful!", result); }
private void btnSingIn_Click(object sender, EventArgs e) { string portal = textBoxPortal.Text; string name = textBoxLogin.Text; string password = textBoxPass.Text; Properties.Settings.Default.Portal = portal; Properties.Settings.Default.UserName = name; if (checkBoxPass.Checked) { Properties.Settings.Default.Password = password; Properties.Settings.Default.SavePassword = true; } else { Properties.Settings.Default.Password = ""; Properties.Settings.Default.SavePassword = false; } Properties.Settings.Default.Save(); try { ILoginManager lm = new LoginManager(); lm.Authentificate(portal, name, password); } catch (TeamLabExpception ex) { labelWrongCredentials.Text = ex.Message; this.DialogResult = System.Windows.Forms.DialogResult.Retry; } }
public static bool Login(string login, string password) { if (File.Exists(CommunConfig.getInstance().userDirectory + login + ".xml")) { manager = new LoginManager(login, password); isLogged = manager.isLogged; if (isLogged) { _login = login; SurfaceWindow1.HideLoginButton(); } else { SurfaceWindow1.ShowLoginButton(); } if (addImage != null && wantToAddImageAfterLogin) { SelectionUser.getInstance().AddImage(addImage); wantToAddImageAfterLogin = false; } return isLogged; } else { SurfaceWindow1.ShowLoginButton(); return false; } }
public static void Disconnect() { isLogged = false; manager = null; _login = ""; SurfaceWindow1.ShowLoginButton(); SurfaceWindow1.StaticGotoMenu(); }
void Start() { playerName = GameObject.Find ("InputName").GetComponent<InputField> (); Address = GameObject.Find ("InputAddress").GetComponent<InputField> (); RoomNo = GameObject.Find ("InputRoomNo").GetComponent<InputField> (); loginManager = GameObject.Find ("LoginManager").GetComponent<LoginManager> (); }
public AccountController( LoginManager loginManager, UsersManager usersManager, IAuthenticationManager authenticationManager) { this.loginManager = loginManager; this.usersManager = usersManager; this.authenticationManager = authenticationManager; }
public void LogOut() { try { var loginManager = new LoginManager(); loginManager.LogOut(); } catch (Exception ex) { //Handle exception } }
public void Login() { try { var loginManager = new LoginManager(); loginManager.LogOut(); loginManager.LogInWithReadPermissions(_readPermissions, LoginManagerRequestTokenHandler); } catch (Exception ex) { //Handle exception } }
private Sdk(string gameId, string gameSecret) { initialized = true; loginManager = new LoginManager(gameId, gameSecret); AndroidJavaClass RESTAPI = new AndroidJavaClass("kr.ac.korea.ee.shygiants.gameunivlogin.RESTAPI"); RESTAPI.CallStatic("init", url); // // Get main activity // AndroidJavaClass UnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); // mainActivity = UnityPlayer.GetStatic<AndroidJavaObject>("currentActivity"); }
public iOSFacebookProbe() { _loginManager = new LoginManager(); _loginResultHandler = new LoginManagerRequestTokenHandler((loginResult, error) => { if (error == null && loginResult.Token != null) SensusServiceHelper.Get().Logger.Log("Facebook login succeeded.", SensusService.LoggingLevel.Normal, GetType()); else if (loginResult != null && loginResult.IsCancelled) SensusServiceHelper.Get().Logger.Log("Facebook login cancelled.", SensusService.LoggingLevel.Normal, GetType()); else SensusServiceHelper.Get().Logger.Log("Facebook login failed.", SensusService.LoggingLevel.Normal, GetType()); }); }
public static LoginManager getLoginManager() { if (isLogged && _login!="") { if (manager == null) { manager = new LoginManager(_login); } else { return manager; } } return null; }
void Start() { wrapper = GameObject.Find("Wrapper").GetComponent<Wrapper>(); userManager = GameObject.Find("UserManager").GetComponent<UserManager>(); loginManager = GameObject.Find("LoginManager").GetComponent<LoginManager>(); // 駒のprefab情報を取得 koma = (GameObject)Resources.Load ("Prefabs/koma"); parentObject = GameObject.Find ("board"); url = "http://" + loginManager.GetURL() + "/plays/" + userManager.play_id.ToString() + "/pieces"; //KomaInfoGet (); }
public async Task<FacebookUser> GetFacebookToken() { var loginManager = new LoginManager(); var token = Facebook.CoreKit.AccessToken.CurrentAccessToken; if (token == null) { var result = await loginManager.LogInWithReadPermissionsAsync(new string[] {"public_profile", "email", "user_friends"}); token = result.Token; } if (token == null) return null; var fbUser = await getUserData(token); return fbUser; }
void Awake() { if (!mInstance) mInstance = this; else { Destroy(this.gameObject); return; } DontDestroyOnLoad(this.gameObject); loginManager = GetComponent<LoginManager>(); userData = GetComponent<UserData>(); ranking = GetComponent<Ranking>(); // userData.Init(); }
public void LoginBlankUserNameShouldNotCallRepositoryFind() { // arrange var mockEmployeeRepository = new Mock<IEmployeeRepository>(); mockEmployeeRepository.Setup( r => r.Find(It.IsAny<ISpecification<Employee>>())) .Returns(new List<Employee>()); IEmployeeRepository repository = mockEmployeeRepository.Object; var sut = new LoginManager(repository); // act var result = sut.Login(string.Empty, "Bl@st123"); // Assert mockEmployeeRepository.Verify(r => r.Find(It.IsAny<ISpecification<Employee>>()), Times.Never); }
private void OnLoginStateLoadingCompleteCallback(LoginManager sender,AppType appType) { sender.StateLoadingCompleted -= OnLoginStateLoadingCompleteCallback; if (AppType.Mobile == appType) { Token token = SessionManager.Default.GetToken(_Request.ClientInfo.Session); _Request.UpdateContent(new PacketContent( Mobile.Manager.Login(token))); SendCenter.Default.Send(_Request); } else if (appType == AppType.CppTrader) { LoginResult result = new LoginResult { SessionId = _Request.ClientInfo.Session.ToString(), ServerDateTime=DateTime.Now.ToStandrandDateTimeStr() }; _Request.UpdateContent(JsonResponse.NewResult(_Request.ClientInfo.ClientInvokeId,result)); SendCenter.Default.Send(_Request); } if (System.Configuration.ConfigurationManager.AppSettings["MobileDebug"] == "true") { } }
public TCSplashControl(UserEntity user) { InitializeComponent(); _user = user; _loginManager = new LoginManager(); if (_user != null && _user.Photo != null) avatarControl1.SetAvatar(_user.Photo); avatarControl1.SetPictureSize(); _selectHospitalCtl = new SelectHospitalControl(); _selectHospitalCtl.Dock = DockStyle.Top; _selectHospitalCtl.SelectHospital += new Action<HospitalEventArgs>(_selectHospitalCtl_SelectHospital); _selectHospitalCtl.CancelEvent += new CancelEventHandler(_selectHospitalCtl_CancelEvent); _msg = _user.UserName + " 正在登录..."; _waitCtl = new WaitControl(_msg); _waitCtl.CancelEvent += new CancelEventHandler(_waitCtl_CancelEvent); _waitCtl.Dock = DockStyle.Top; panel1.Controls.Clear(); panel1.Controls.Add(_waitCtl); }
private void HandleFacebookLoginClicked() { LoginManager login = new LoginManager(); login.LogInWithReadPermissions(readPermissions.ToArray(), delegate(LoginManagerLoginResult result, NSError error) { if (error != null) { App.OnFacebookAuthFailed(); } else if (result.IsCancelled) { App.OnFacebookAuthFailed(); } else { var accessToken = result.Token; App.OnFacebookAuthSuccess(accessToken.TokenString); } }); }
public void LoginWithInvalidPasswordThrowsException() { // arrange var mockEmployeeRepository = new Mock<IEmployeeRepository>(); var employee = new Employee { UserName = "******", Password = "******" }; mockEmployeeRepository.Setup( r => r.Find(It.IsAny<ISpecification<Employee>>())) .Returns(new List<Employee> { employee }); IEmployeeRepository repository = mockEmployeeRepository.Object; var sut = new LoginManager(repository); // act var result = sut.Login("*****@*****.**", "WrongPassword"); }
// Use this for initialization void Start() { wrapper = GameObject.Find ("Wrapper").GetComponent<Wrapper> (); userManager = GameObject.Find("UserManager").GetComponent<UserManager>(); loginManager = GameObject.Find("LoginManager").GetComponent<LoginManager>(); komaGenerator = GameObject.Find("KomaGenerator").GetComponent<KomaGenerator>(); playerInfo = this.GetComponent<PlayerInformation>(); playInfo = this.GetComponent<PlayingInformation>(); UsersURL = "http://" + loginManager.GetURL() + "/plays/" + userManager.play_id.ToString() + "/users"; PlayURL = "http://" + loginManager.GetURL() + "/plays/" + userManager.play_id.ToString(); Debug.Log (UsersURL); Debug.Log (PlayURL); UsersInfoGet (); PlayInfoGet (); }
void Awake() { if (!mInstance) mInstance = this; else { Destroy(this.gameObject); return; } DontDestroyOnLoad(this.gameObject); loginManager = GetComponent<LoginManager>(); facebookFriends = GetComponent<FacebookFriends>(); userData = GetComponent<UserData>(); userHiscore = GetComponent<UserHiscore>(); ranking = GetComponent<Ranking>(); challengesManager = GetComponent<ChallengersManager>(); challengeData = GetComponent<ChallengeData>(); userData.Init(); }
public void ProcessRequest(HttpContext context) { HttpRequest request = context.Request; HttpResponse response = context.Response; string Status = request.Params["Status"]; string Token = request.Params["Token"]; try { if (Status.Equals("Accept")) { string privateKey = System.Configuration.ConfigurationManager.AppSettings["privateKey"]; string serviceUrl = System.Configuration.ConfigurationManager.AppSettings["serviceUrl"]; string entryPoint = System.Configuration.ConfigurationManager.AppSettings["entryPoint"]; ; LoginManager client = new LoginManager(new Uri(serviceUrl)); ProcessLoginOut result = client.ProcessAuthentication(Token, privateKey, entryPoint); switch (result.OperationStatus) { case OperationStatus.Ok: HttpCookie myCookie = new HttpCookie("User"); DateTime now = DateTime.Now; myCookie.Value = result.User; myCookie.Expires = now.AddMinutes(5); context.Response.Cookies.Add(myCookie); context.Response.Redirect("Private.aspx"); break; case OperationStatus.NotFound: context.Response.Redirect("Index.aspx"); break; } context.Response.Redirect("Index.aspx"); } } catch (Exception ex) { } }
public async Task AlwaysReturnsASingleResult() { await LoginManager .RefreshToken(Password) .SingleAsync(); }
/// <summary> /// Tries to Login to the Forums /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void LoginBtnClick(object sender, EventArgs e) { if (this.ForumUrl.Text.StartsWith("http://")) { if (!this.ForumUrl.Text.EndsWith("/")) { this.ForumUrl.Text += "/"; } CacheController.Instance().UserSettings.CurrentForumUrl = this.ForumUrl.Text; } string welcomeString = this.rm.GetString("lblWelcome"), lblFailed = this.rm.GetString("lblFailed"); if (this.GuestLogin.Checked) { this.UserNameField.Text = "Guest"; this.PasswordField.Text = "Guest"; this.label3.Text = string.Format("{0}{1}", welcomeString, this.UserNameField.Text); this.label3.ForeColor = Color.Green; this.LoginButton.Enabled = false; if ( CacheController.Instance().UserSettings.ForumsAccount.Any( item => item.ForumURL == CacheController.Instance().UserSettings.CurrentForumUrl)) { CacheController.Instance().UserSettings.ForumsAccount.RemoveAll( item => item.ForumURL == CacheController.Instance().UserSettings.CurrentForumUrl); } var forumsAccount = new ForumAccount { ForumURL = CacheController.Instance().UserSettings.CurrentForumUrl, UserName = this.UserNameField.Text, UserPassWord = this.PasswordField.Text, GuestAccount = false }; CacheController.Instance().UserSettings.ForumsAccount.Add(forumsAccount); CacheController.Instance().UserSettings.CurrentUserName = this.UserNameField.Text; this.timer1.Enabled = true; } else { // Encrypt Password this.PasswordField.Text = Utility.EncodePassword(this.PasswordField.Text).Replace("-", string.Empty).ToLower(); var loginManager = new LoginManager(this.UserNameField.Text, this.PasswordField.Text); if (loginManager.DoLogin(CacheController.Instance().UserSettings.CurrentForumUrl)) { this.label3.Text = string.Format("{0}{1}", welcomeString, this.UserNameField.Text); this.label3.ForeColor = Color.Green; this.LoginButton.Enabled = false; if ( CacheController.Instance().UserSettings.ForumsAccount.Any( item => item.ForumURL == CacheController.Instance().UserSettings.CurrentForumUrl)) { CacheController.Instance().UserSettings.ForumsAccount.RemoveAll( item => item.ForumURL == CacheController.Instance().UserSettings.CurrentForumUrl); } var forumsAccount = new ForumAccount { ForumURL = CacheController.Instance().UserSettings.CurrentForumUrl, UserName = this.UserNameField.Text, UserPassWord = this.PasswordField.Text, GuestAccount = false }; CacheController.Instance().UserSettings.ForumsAccount.Add(forumsAccount); CacheController.Instance().UserSettings.CurrentUserName = this.UserNameField.Text; this.timer1.Enabled = true; } else { this.label3.Text = lblFailed; this.label3.ForeColor = Color.Red; } } }
/// <summary> /// 登录校验 /// </summary> private void ValidateLogin() { StringBuilder str = new StringBuilder(); HttpContext context = System.Web.HttpContext.Current; string username = context.Request.Params["username"]; string password = context.Request.Params["password"]; string verificationCode = context.Request.Params["verificationCode"]; if (string.IsNullOrEmpty(username)) { str.Append("{\"IsSuccess\":false,\"Msg\":\"用户名不能为空\"}"); context.Response.Write(str.ToString()); return; } if (string.IsNullOrEmpty(password)) { str.Append("{\"IsSuccess\":false,\"Msg\":\"密码不能为空\"}"); context.Response.Write(str.ToString()); return; } if (string.IsNullOrEmpty(verificationCode)) { str.Append("{\"IsSuccess\":false,\"Msg\":\"验证码不能为空\"}"); context.Response.Write(str.ToString()); return; } object verificationCodeServer = context.Session[ConfigManager.GetVerificationCode_SessionName()]; if (verificationCodeServer == null || verificationCodeServer.Equals(String.Empty)) { str.Append("{\"IsSuccess\":false,\"Msg\":\"服务器端找不到验证码\"}"); context.Response.Write(str.ToString()); return; } if (string.IsNullOrEmpty(verificationCode) || !verificationCode.ToString().Equals(verificationCodeServer.ToString(), StringComparison.CurrentCultureIgnoreCase)) { str.Append("{\"IsSuccess\":false,\"Msg\":\"验证码不正确\"}"); context.Response.Write(str.ToString()); return; } object loginCount = context.Session["loginCount"]; int waitTime = ConfigManager.GetLoginErrorWait(); if (loginCount != null && loginCount.ToInt32(0) >= ConfigManager.GetAllowLoginCount() && !string.IsNullOrEmpty(context.Session["loginForbidTime"].ToString2())) { DateTime oldTime = DateTime.Parse(context.Session["loginForbidTime"].ToString2()); TimeSpan span = DateTime.Now - oldTime; if (span.Minutes < waitTime) { str.Append("{\"IsSuccess\":false,\"Msg\":\"你登录错误已超过" + ConfigManager.GetAllowLoginCount() + "次,请" + (waitTime - span.Minutes) + "分钟后重试\"}"); context.Response.Write(str.ToString()); return; } else { context.Session["loginCount"] = 0; context.Session["loginForbidTime"] = ""; } } if (systemBLL.UserLogin(username, password)) { if (loginCount != null) { context.Session["loginCount"] = 0; } AppUser workUser = new AppUser(); workUser = systemBLL.InitAppUser(username, password).Result; //更新用户登录时间 systemBLL.UpdateLoginTime(workUser.UserID, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); context.Session[ConfigManager.GetSignInAppUserSessionName()] = workUser; LoginManager.SetLoginID(workUser.UserID); if (string.IsNullOrEmpty(workUser.qyID)) { str.Append("{\"IsSuccess\":true,\"Msg\":\"登录成功\",\"url\":\"/WxjzgcjczyPage/MainPage/Index.aspx\"}"); } else { str.Append("{\"IsSuccess\":true,\"Msg\":\"登录成功\",\"url\":\"/WxjzgcjczyPage/MainPage/Index2.aspx\"}"); } context.Response.Write(str.ToString()); } else { loginCount = context.Session["loginCount"]; if (loginCount == null) { loginCount = 1; } else { loginCount = loginCount.ToInt32(0) + 1; } context.Session["loginCount"] = loginCount; if (loginCount != null && loginCount.ToInt32(0) == ConfigManager.GetAllowLoginCount()) { context.Session["loginForbidTime"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } str.Append("{\"IsSuccess\":false,\"Msg\":\"用户名或密码错误\"}"); context.Response.Write(str.ToString()); } }
private bool LoadChallengeDetail() { UIViewController controller = null; if (Challenge.TypeCode == "SHARE") { controller = LoadChallengeDetail("ShareViewController"); ShareViewController shareViewController = controller as ShareViewController; shareViewController.SubmitButton = SubmitButton; } else if (Challenge.TypeCode == "INVITE") { SL.Manager.RefreshShareTemplate(Challenge.ShareTemplateURL, SendInviteMessage); } else if (Challenge.TypeCode == "POSTERING")//else if (Challenge.TypeCode == "COLLATERAL TRACKING" && Challenge.TypeCodeDisplayName == "Postering") { controller = LoadChallengeDetail("PosteringViewController"); } else if (Challenge.TypeCode == "COLLATERAL TRACKING") { //controller = LoadChallengeDetail("CollateralViewController"); controller = LoadChallengeDetail("PosteringViewController");//display always Postering } else if (Challenge.TypeCode == "FB ENGAGEMENT") {//controller = LoadChallengeDetail("FacebookEngagementViewController"); var permissions = new string[] { "user_posts" }; var loginManager = new LoginManager(); if (Facebook.CoreKit.AccessToken.CurrentAccessToken != null) { var graphRequest = new Facebook.CoreKit.GraphRequest("me/permissions", null); graphRequest.Start(new Facebook.CoreKit.GraphRequestHandler( (Facebook.CoreKit.GraphRequestConnection connection, NSObject result, NSError error) => { bool hasPermission = false; if (error == null) { NSArray permissions1 = (NSArray)result.ValueForKey(new NSString("data")); foreach (NSDictionary dict in NSArray.FromArray <NSObject>(permissions1)) { if (dict.ValueForKey(new NSString("permission")).Description == permissions[0]) { if (dict.ValueForKey(new NSString("status")).Description == "granted") { hasPermission = true; } } } } if (hasPermission) { if (Challenge?.IsReshareReq ?? false) { CheckFacebookSharingEnabled(permissions); } else { SubmitEngagement(); } } } )); } else { loginManager.LogInWithReadPermissions(permissions, this, (LoginManagerLoginResult result, NSError error) => { LogHelper.LogUserMessage("FB_USER_POST", "asking for permissions"); if (result?.GrantedPermissions != null && result.GrantedPermissions.Contains(permissions[0])) { LogHelper.LogUserMessage("FB_USER_POST", "permission failed"); if (Challenge?.IsReshareReq ?? false) { CheckFacebookSharingEnabled(permissions); } else { SubmitEngagement(); } } else { LogHelper.LogUserMessage("FB_USER_POST", "permission failed"); new UIAlertView(null, "There was a problem getting permission for " + permissions[0], this, "Ok").Show(); } }); } } if (controller != null) { NavigationController.PushViewController(controller, true); } return(controller != null); }
public async Task TheUserToBePersistedShouldHaveIsDirtySetToFalse() { await LoginManager.Login(Email, Password); await Database.User.Received().Create(Arg.Is <IDatabaseUser>(receivedUser => receivedUser.IsDirty == false)); }
public async Task CallsTheGetMethodOfTheUserApi() { await LoginManager.RefreshToken(Password); await Api.User.Received().Get(); }
public ManageController(ApplicationUserManager userManager, LoginManager signInManager) { UserManager = userManager; SignInManager = signInManager; }
public async Task CallsTheGetMethodOfTheUserApi() { await LoginManager.Login(Email, Password); await Api.User.Received().Get(); }
public static bool createLogin(string login, string password,string Date,String name,String firstname) { manager = new LoginManager(); return manager.CreateNewLogin(login, password, Date, name, firstname); }
// Verifies if you have granted the permissions, if not, ask for them void AskPermissions (string title, string message, string[] permissions, Action successHandler) { ShowMessageBox (title, message, "Maybe Later", new [] { "Ok" }, () => { // If they let you do things, ask for a new Access Token with the new permission var login = new LoginManager (); login.LogInWithPublishPermissions (permissions, this, (result, error) => { // Handle if something went wrong with the request if (error != null) { new UIAlertView ("Error...", error.Description, null, "Ok", null).Show (); return; } // Handle if the user cancelled the request if (result.IsCancelled) { new UIAlertView ("The request was cancelled", "If you are using a Test App Id, please, make sure that your account have an Administrator role at:\rhttps://developers.facebook.com/apps/appid/roles/", null, "OK", null).Show (); return; } // Do your magic if the request was successful successHandler (); }); }); }
public async Task AlwaysReturnsASingleResult() { await LoginManager .SignUp(Email, Password, TermsAccepted, CountryId) .SingleAsync(); }
public LoginController(LoginManager loginManager) { _loginManager = loginManager; }
public ActionResult RegisterUser(Employee register) { LoginManager login = new LoginManager(); return(Json(login.RegisterUser(register), JsonRequestBehavior.AllowGet)); }
public ActionResult CheckLogin(Employee emp) { LoginManager login = new LoginManager(); return(Json(login.CheckLogin(emp))); }
public async Task PersistsTheUserWithTheSyncStatusSetToInSync() { await LoginManager.RefreshToken(Password); await Database.User.Received().Update(Arg.Is <IDatabaseUser>(receivedUser => receivedUser.SyncStatus == SyncStatus.InSync)); }
public async Task AlwaysReturnsASingleResult() { await LoginManager .SignUp(Email, Password) .SingleAsync(); }
public async Task PersistsTheUserToTheDatabase() { await LoginManager.RefreshToken(Password); await Database.User.Received().Update(Arg.Is <IDatabaseUser>(receivedUser => receivedUser.Id == User.Id)); }
public async Task CallsTheSignUpMethodOfTheUserApi() { await LoginManager.SignUp(Email, Password); await Api.User.Received().SignUp(Email, Password); }
void OnGUI() { high = 10; if (CreateBtn("connect")) { SocketHelper.GetInstance().Connect(ConnectCallBack, null); } if (CreateBtn("send")) { } if (CreateBtn("login")) { LoginManager.Instance().httpFinishedDelegate = LoginSuccess; LoginManager.Instance().Login("liufeng1", "123456"); } if (CreateBtn("reg")) { LoginManager.Instance().httpFinishedDelegate = LoginSuccess; LoginManager.Instance().Regist("liufeng1", "123456"); } if (CreateBtn("shopping")) { PlayerRequest req = new PlayerRequest(); req.Shopping(1001); req.Send(); } if (CreateBtn("CHANGENAME")) { PlayerRequest req = new PlayerRequest(); req.ChangeName("打算"); req.Send(); } if (CreateBtn("Set name color")) { PlayerRequest req = new PlayerRequest(); req.SetNameColor(4001002); req.Send(); } if (CreateBtn("Set role")) { PlayerRequest req = new PlayerRequest(); req.SetRoleId(2001034); req.Send(); } if (CreateBtn("Buy item")) { PlayerRequest req = new PlayerRequest(); req.BuyItem(2002001); req.Send(); } if (CreateBtn("Use item")) { PlayerRequest req = new PlayerRequest(); req.UseItem(4001002, 1); req.Send(); } // if(CreateBtn( "CreateRoom")) // { // RoomRequest req = new RoomRequest(); // req.CreateRoom(0); // req.Send(); // } if (CreateBtn("InRoom")) { RoomRequest req = new RoomRequest(); req.InRoom("5555"); req.Send(); } if (CreateBtn("Move")) { PlayerActionRequest req = new PlayerActionRequest(); req.Move(new Vector3(1231, 324, 123), new Vector3(1, 1, 1)); req.Send(); } if (CreateBtn("TEST")) { TestRequest req = new TestRequest(); req.Send(); } }
// Use this for initialization void Start() { loginManager = GameObject.Find ("LoginManager").GetComponent<LoginManager> (); userManager = GameObject.Find ("UserManager").GetComponent<UserManager> (); }
public async Task PersistsTheUserToTheDatabase() { await LoginManager.Login(Email, Password); await Database.User.Received().Create(Arg.Is <IDatabaseUser>(receivedUser => receivedUser.Id == User.Id)); }
public CustomerController(CustomerManager custRepo, AccountManager acctRepo, TransactionManager transRepo, LoginManager loginRepo, BillpayManager bpayRepo, PayeeManager payeeRepo) { _custRepo = custRepo; _acctRepo = acctRepo; _loginRepo = loginRepo; }
public async Task NotifiesShortcutCreatorAboutLogin() { await LoginManager.SignUp(Email, Password); ApplicationShortcutCreator.Received().OnLogin(Arg.Any <ITogglDataSource>()); }
public async Task NotifiesShortcutCreatorAboutLogin() { await LoginManager.LoginWithGoogle(); ApplicationShortcutCreator.Received().OnLogin(Arg.Any <ITogglDataSource>()); }
public async Task PersistsTheUserWithTheSyncStatusSetToInSync() { await LoginManager.SignUp(Email, Password); await Database.User.Received().Create(Arg.Is <IDatabaseUser>(receivedUser => receivedUser.SyncStatus == SyncStatus.InSync)); }
public async Task AlwaysReturnsASingleResult() { await LoginManager .LoginWithGoogle() .SingleAsync(); }
public async Task ShouldAlwaysReturnASingleResult() { await LoginManager .Login(Email, Password) .SingleAsync(); }
public async Task PersistsTheUserWithTheSyncStatusSetToInSync() { await LoginManager.LoginWithGoogle(); await Database.User.Received().Create(Arg.Is <IDatabaseUser>(receivedUser => receivedUser.SyncStatus == SyncStatus.InSync)); }
public async Task<string> GetFacebookToken() { var loginManager = new LoginManager(); var result = await loginManager.LogInWithReadPermissionsAsync(new string[] {"public_profile", "email", "user_friends"}); return result != null && result.Token != null ? result.Token.TokenString : null; }
public async Task CallsTheGetWithGoogleOfTheUserApi() { await LoginManager.LoginWithGoogle(); await Api.User.Received().GetWithGoogle(); }
public static TranslateableEnum <UserGroupId> GetEditableGroups(LoginManager manager) { var groups = EnumVal <UserGroupId> .Values.Where(g => EntryPermissionManager.CanEditGroupTo(manager, g)).ToArray(); return(new TranslateableEnum <UserGroupId>(() => global::Resources.UserGroupNames.ResourceManager, groups)); }
public async Task UsesTheGoogleServiceToGetTheToken() { await LoginManager.LoginWithGoogle(); await GoogleService.Received().GetAuthToken(); }
public ServerEntryViewModel(ServerStatusCache cache, DataManager cfg, Updater updater, LoginManager loginMgr, string address) { _cache = cache; _cacheData = cache.GetStatusFor(address); _cfg = cfg; _updater = updater; _loginMgr = loginMgr; this.WhenAnyValue(x => x.IsAltBackground) .Subscribe(_ => this.RaisePropertyChanged(nameof(BackgroundColor))); this.WhenAnyValue(x => x._cacheData.PlayerCount) .Subscribe(_ => this.RaisePropertyChanged(nameof(ServerStatusString))); this.WhenAnyValue(x => x._cacheData.Status) .Subscribe(_ => { this.RaisePropertyChanged(nameof(IsOnline)); this.RaisePropertyChanged(nameof(ServerStatusString)); }); this.WhenAnyValue(x => x._cacheData.Name) .Subscribe(_ => this.RaisePropertyChanged(nameof(Name))); this.WhenAnyValue(x => x._cacheData.Ping) .Subscribe(_ => this.RaisePropertyChanged(nameof(PingText))); _cfg.FavoriteServers.Connect() .Subscribe(_ => { this.RaisePropertyChanged(nameof(FavoriteButtonText)); }); }
public static void SignOut() { LoginManager.OnSignOut(); FormsAuthentication.SignOut(); }
// Revoke all the permissions that you had granted, you will need to login again for ask the permissions again // You can also revoke a single permission, for more info, visit this link: // https://developers.facebook.com/docs/facebook-login/permissions/v2.3#revoking void RevokeAllPermissions (string userId) { // Create the request for delete all the permissions var request = new GraphRequest ("/" + userId + "/permissions", null, AccessToken.CurrentAccessToken.TokenString, null, "DELETE"); var requestConnection = new GraphRequestConnection (); requestConnection.AddRequest (request, (connection, result, error) => { // Handle if something went wrong if (error != null) { ShowMessageBox ("Error...", error.Description, "Ok", null, null); return; } // If the revoking was successful, logout from FB if ((result as NSDictionary) ["success"].ToString () == "1") InvokeOnMainThread (() => { ShowMessageBox ("Successful", "All permissions have been revoked", "Ok", null, null); var login = new LoginManager (); login.LogOut (); LoggedOut (); }); else InvokeOnMainThread (() => ShowMessageBox ("Ups...", "A problem has ocurred", "Ok", null, null)); }); requestConnection.Start (); }
public ServerEntryViewModel(ServerStatusCache cache, DataManager cfg, Updater updater, LoginManager loginMgr, FavoriteServer favorite) : this(cache, cfg, updater, loginMgr, favorite.Address) { Favorite = favorite; }