public AppLayoutModel(DeveloperUser User, int ActivePanel) { this.UserName = User.nickname; this.UserIconImageAddress = User.headimgurl; this.ActivePanel = ActivePanel; this.AppCount = User.MyApps.Count(); }
public async Task Recover( DeveloperUser user, App thisApp, CoreApiService coreApiService, AppsContainer appsContainer, SitesService sitesService, EventService eventService, ChannelService channelService, int pageNumber) { RootRecover(user); var token = await appsContainer.AccessToken(thisApp.AppId, thisApp.AppSecret); Grants = await coreApiService.AllUserGrantedAsync(token, pageNumber, 15); var sites = await sitesService.ViewMySitesAsync(token); Sites = sites.Sites; var errorLogs = await eventService.ViewAsync(token); ErrorLogs = errorLogs.Logs; var channels = await channelService.ViewMyChannelsAsync(token); Channels = channels.Channels; }
public EditBucketViewModel(DeveloperUser user, ViewBucketViewModel thisBucket) : base(user) { this.NewBucketName = thisBucket.BucketName; this.BucketId = thisBucket.BucketId; this.OpenToRead = thisBucket.OpenToRead; this.OpenToUpload = thisBucket.OpenToUpload; }
public static async Task <ViewAppViewModel> SelfCreateAsync(DeveloperUser User, App ThisApp, DeveloperDbContext _dbContext) { var model = new ViewAppViewModel(User, ThisApp); await model.Recover(User, ThisApp, _dbContext); return(model); }
public void RootRecover(DeveloperUser user) { this.NickName = user.NickName; this.AppCount = user.MyApps.Count(); this.AllApps = user.MyApps; this.EmailConfirmed = user.EmailConfirmed; }
public ViewAppViewModel(DeveloperUser User, App ThisApp) : base(User, 1) { this.AppName = ThisApp.AppName; this.AppDescription = ThisApp.AppDescription; this.AppCategory = ThisApp.AppCategory; this.AppPlatform = ThisApp.AppPlatform; }
public async Task Recover( DeveloperUser user, DeveloperApp appInDb, CoreApiService coreApiService, AppsContainer appsContainer, SitesService sitesService, EventService eventService, ChannelService channelService, RecordsService recordsService, int pageNumber) { RootRecover(user); var token = await appsContainer.AccessToken(appInDb.AppId, appInDb.AppSecret); Grants = await coreApiService.AllUserGrantedAsync(token, pageNumber, 15); var sites = await sitesService.ViewMySitesAsync(token); Sites = sites.Sites; var errorLogs = await eventService.ViewAsync(token); ErrorLogs = errorLogs.Logs; var channels = await channelService.ViewMyChannelsAsync(token); Channels = channels.Channels; var records = await recordsService.ViewMyRecordsAsync(token, Array.Empty <string>()); Records = records.Records; Trusted = appInDb.TrustedApp; }
private ViewAppViewModel(DeveloperUser user, DeveloperApp thisApp) : base(user) { if (thisApp.CreatorId != user.Id) { throw new InvalidOperationException("The app is not the user's app!"); } AppName = thisApp.AppName; AppDescription = thisApp.AppDescription; AppCategory = thisApp.AppCategory; AppPlatform = thisApp.AppPlatform; AppId = thisApp.AppId; AppSecret = thisApp.AppSecret; EnableOAuth = thisApp.EnableOAuth; ForceInputPassword = thisApp.ForceInputPassword; ForceConfirmation = thisApp.ForceConfirmation; DebugMode = thisApp.DebugMode; PrivacyStatementUrl = thisApp.PrivacyStatementUrl; LicenseUrl = thisApp.LicenseUrl; IconPath = thisApp.IconPath; AppDomain = thisApp.AppDomain; AppFailCallbackUrl = thisApp.AppFailCallbackUrl; ViewOpenId = thisApp.ViewOpenId; ViewPhoneNumber = thisApp.ViewPhoneNumber; ChangePhoneNumber = thisApp.ChangePhoneNumber; ConfirmEmail = thisApp.ConfirmEmail; ChangeBasicInfo = thisApp.ChangeBasicInfo; ChangePassword = thisApp.ChangePassword; ChangeGrantInfo = thisApp.ChangeGrantInfo; ViewAuditLog = thisApp.ViewAuditLog; ManageSocialAccount = thisApp.ManageSocialAccount; }
private ViewAppViewModel(DeveloperUser User, App ThisApp) : base(User) { if (ThisApp.CreaterId != User.Id) { throw new InvalidOperationException("The app is not the user's app!"); } AppName = ThisApp.AppName; AppDescription = ThisApp.AppDescription; AppCategory = ThisApp.AppCategory; AppPlatform = ThisApp.AppPlatform; AppId = ThisApp.AppId; AppSecret = ThisApp.AppSecret; EnableOAuth = ThisApp.EnableOAuth; ForceInputPassword = ThisApp.ForceInputPassword; ForceConfirmation = ThisApp.ForceConfirmation; DebugMode = ThisApp.DebugMode; PrivacyStatementUrl = ThisApp.PrivacyStatementUrl; LicenseUrl = ThisApp.LicenseUrl; AppIconAddress = ThisApp.AppIconAddress; AppDomain = ThisApp.AppDomain; ViewOpenId = ThisApp.ViewOpenId; ViewPhoneNumber = ThisApp.ViewPhoneNumber; ChangePhoneNumber = ThisApp.ChangePhoneNumber; ConfirmEmail = ThisApp.ConfirmEmail; ChangeBasicInfo = ThisApp.ChangeBasicInfo; ChangePassword = ThisApp.ChangePassword; }
public virtual void RootRecover(DeveloperUser user, int activePanel) { this.NickName = user.NickName; this.ActivePanel = activePanel; this.AppCount = user.MyApps.Count(); this.AllApps = user.MyApps; this.EmailConfirmed = user.EmailConfirmed; }
public virtual void Recover(DeveloperUser User, int ActivePanel) { this.NickName = User.NickName; this.UserIconImageAddress = User.HeadImgUrl; this.ActivePanel = ActivePanel; this.AppCount = User.MyApps.Count(); this.AllApps = User.MyApps; }
public static async Task <ViewAppViewModel> SelfCreateAsync( DeveloperUser User, App ThisApp, CoreApiService coreApiService, OSSApiService ossApiService, AppsContainer appsContainer) { var model = new ViewAppViewModel(User, ThisApp); await model.Recover(User, ThisApp, coreApiService, ossApiService, appsContainer); return(model); }
public static async Task <ViewAppViewModel> SelfCreateAsync( DeveloperUser user, App thisApp, CoreApiService coreApiService, AppsContainer appsContainer, SitesService sitesService, EventService eventService) { var model = new ViewAppViewModel(user, thisApp); await model.Recover(user, thisApp, coreApiService, appsContainer, sitesService, eventService); return(model); }
public async Task Recover(DeveloperUser User, App ThisApp, DeveloperDbContext _dbContext) { base.Recover(User, 1); var token = AppsContainer.AccessToken(ThisApp.AppId, ThisApp.AppSecret); var buckets = await ApiService.ViewMyBucketsAsync(await token()); Buckets = buckets.Buckets; var grants = await Pylon.Services.ToAPIServer.ApiService.AllUserGrantedAsync(await token()); Grants = grants.Grants; }
public static async Task <ViewAppViewModel> SelfCreateAsync( DeveloperUser user, DeveloperApp appInDb, CoreApiService coreApiService, AppsContainer appsContainer, SitesService sitesService, EventService eventService, ChannelService channelService, int pageNumber) { var model = new ViewAppViewModel(user, appInDb); await model.Recover(user, appInDb, coreApiService, appsContainer, sitesService, eventService, channelService, pageNumber); return(model); }
public async Task Recover( DeveloperUser User, App ThisApp, CoreApiService coreApiService, OSSApiService ossApiService, AppsContainer appsContainer) { base.Recover(User, 1); var token = await appsContainer.AccessToken(ThisApp.AppId, ThisApp.AppSecret); var buckets = await ossApiService.ViewMyBucketsAsync(token); Buckets = buckets.Buckets; var grants = await coreApiService.AllUserGrantedAsync(token); Grants = grants.Grants; }
public async Task <IActionResult> AuthResult() { var _controller = this; var code = int.Parse(_controller.HttpContext.Request.Query["code"]); var state = _controller.HttpContext.Request.Query["state"]; if (!_controller.User.Identity.IsAuthenticated && code > 0) { var _accessToken = await OAuthService.AuthCodeToAccessTokenAsync(code); var _userinfo = await OAuthService.AccessTokenToUserInfo(AccessToken : _accessToken.access_token, openid : _accessToken.openid); var current = await _controller._userManager.FindByIdAsync(_userinfo.openid); if (current == null) { current = new DeveloperUser { Id = _userinfo.openid, nickname = _userinfo.nickname, sex = _userinfo.sex, headimgurl = _userinfo.headimgurl, UserName = _userinfo.openid, preferedLanguage = _userinfo.preferedLanguage, accountCreateTime = _userinfo.accountCreateTime }; var result = await _controller._userManager.CreateAsync(current); } else { current.nickname = _userinfo.nickname; current.sex = _userinfo.sex; current.headimgurl = _userinfo.headimgurl; current.preferedLanguage = _userinfo.preferedLanguage; current.accountCreateTime = _userinfo.accountCreateTime; await _controller._userManager.UpdateAsync(current); } await _controller._signInManager.SignInAsync(current, true); } return(Redirect(state)); }
private ViewAppViewModel(DeveloperUser User, App ThisApp) : base(User) { if (ThisApp.CreaterId != User.Id) { throw new AiurCrossAuthorityException("The app is not the user's app!"); } this.AppName = ThisApp.AppName; this.AppDescription = ThisApp.AppDescription; this.AppCategory = ThisApp.AppCategory; this.AppPlatform = ThisApp.AppPlatform; this.AppId = ThisApp.AppId; this.AppSecret = ThisApp.AppSecret; this.EnableOAuth = ThisApp.EnableOAuth; this.ForceInputPassword = ThisApp.ForceInputPassword; this.ForceConfirmation = ThisApp.ForceConfirmation; this.DebugMode = ThisApp.DebugMode; this.PrivacyStatementUrl = ThisApp.PrivacyStatementUrl; this.LicenseUrl = ThisApp.LicenseUrl; this.AppIconAddress = ThisApp.AppIconAddress; this.AppDomain = ThisApp.AppDomain; }
public async Task Recover( DeveloperUser user, App thisApp, CoreApiService coreApiService, OSSApiService ossApiService, AppsContainer appsContainer, SitesService sitesService) { base.RootRecover(user, 1); var token = await appsContainer.AccessToken(thisApp.AppId, thisApp.AppSecret); var buckets = await ossApiService.ViewMyBucketsAsync(token); Buckets = buckets.Buckets; var grants = await coreApiService.AllUserGrantedAsync(token); Grants = grants.Grants; var sites = await sitesService.ViewMySitesAsync(token); Sites = sites.Sites; }
public async Task Recover( DeveloperUser user, App thisApp, CoreApiService coreApiService, AppsContainer appsContainer, SitesService sitesService, EventService eventService) { RootRecover(user); var token = await appsContainer.AccessToken(thisApp.AppId, thisApp.AppSecret); var grants = await coreApiService.AllUserGrantedAsync(token); Grants = grants.Grants; var sites = await sitesService.ViewMySitesAsync(token); Sites = sites.Sites; var errorLogs = await eventService.ViewAsync(token); ErrorLogs = errorLogs.Logs; }
public void Recover(DeveloperUser user) { RootRecover(user); }
public CreateRecordViewModel(DeveloperUser user) : base(user) { }
public void Recover(DeveloperUser user, string appName) { RootRecover(user); AppName = appName; }
public NewFolderViewModel(DeveloperUser user) : base(user) { }
public EditViewModel(DeveloperUser user) : base(user) { }
public DeleteViewModel(DeveloperUser user) : base(user) { }
public NewFileViewModel(DeveloperUser user) : base(user, 5) { }
public IndexViewModel(DeveloperUser User) : base(User, 2) { }
public void Recover(Controller c, DeveloperUser User) { this.Recover(User, 2); c.ViewData["PartId"] = new SelectList(this.AllApps, nameof(App.AppId), nameof(App.AppName)); }
public CreateBucketViewModel(Controller c, DeveloperUser User) : base(User, 2) { c.ViewData["PartId"] = new SelectList(this.AllApps, nameof(App.AppId), nameof(App.AppName)); }