Skip to content

Commit 88c04f3

Browse files
Merge pull request #1 from CloudBreadPaPa/master
initial commit
2 parents b4c4b53 + 92d1243 commit 88c04f3

File tree

209 files changed

+68344
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+68344
-0
lines changed

AdminMembers.cs

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
2+
//------------------------------------------------------------------------------
3+
// <auto-generated>
4+
// This code was generated from a template.
5+
//
6+
// Manual changes to this file may cause unexpected behavior in your application.
7+
// Manual changes to this file will be overwritten if the code is regenerated.
8+
// </auto-generated>
9+
//------------------------------------------------------------------------------
10+
11+
12+
namespace CloudBreadAdminWeb
13+
{
14+
15+
using System;
16+
using System.Collections.Generic;
17+
18+
public partial class AdminMembers
19+
{
20+
21+
public string AdminMemberID { get; set; }
22+
23+
public string AdminMemberPWD { get; set; }
24+
25+
public string AdminMemberEmail { get; set; }
26+
27+
public string IDCreateAdminMember { get; set; }
28+
29+
public string AdminGroup { get; set; }
30+
31+
public string TimeZoneID { get; set; }
32+
33+
public string PINumber { get; set; }
34+
35+
public string Name1 { get; set; }
36+
37+
public string Name2 { get; set; }
38+
39+
public string Name3 { get; set; }
40+
41+
public string DOB { get; set; }
42+
43+
public string LastIPaddress { get; set; }
44+
45+
public string LastLoginDT { get; set; }
46+
47+
public string LastLogoutDT { get; set; }
48+
49+
public string sCol1 { get; set; }
50+
51+
public string sCol2 { get; set; }
52+
53+
public string sCol3 { get; set; }
54+
55+
public string sCol4 { get; set; }
56+
57+
public string sCol5 { get; set; }
58+
59+
public string sCol6 { get; set; }
60+
61+
public string sCol7 { get; set; }
62+
63+
public string sCol8 { get; set; }
64+
65+
public string sCol9 { get; set; }
66+
67+
public string sCol10 { get; set; }
68+
69+
public string HideYN { get; set; }
70+
71+
public string DeleteYN { get; set; }
72+
73+
public System.DateTimeOffset CreatedAt { get; set; }
74+
75+
public System.DateTimeOffset UpdatedAt { get; set; }
76+
77+
public string DataFromRegion { get; set; }
78+
79+
public System.DateTimeOffset DataFromRegionDT { get; set; }
80+
81+
}
82+
83+
}

App_Start/BundleConfig.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System.Web;
2+
using System.Web.Optimization;
3+
4+
namespace CloudBreadAdminWeb
5+
{
6+
public class BundleConfig
7+
{
8+
// 번들 작성에 대한 자세한 내용은 http://go.microsoft.com/fwlink/?LinkId=301862를 참조하십시오.
9+
public static void RegisterBundles(BundleCollection bundles)
10+
{
11+
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
12+
"~/Scripts/jquery-{version}.js"));
13+
14+
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
15+
"~/Scripts/jquery.validate*"));
16+
17+
// Modernizr의 개발 버전을 사용하여 개발하고 배우십시오. 그런 다음
18+
// 프로덕션할 준비가 되면 http://modernizr.com의 빌드 도구를 사용하여 필요한 테스트만 선택하십시오.
19+
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
20+
"~/Scripts/modernizr-*"));
21+
22+
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
23+
"~/Scripts/bootstrap.js",
24+
"~/Scripts/respond.js"));
25+
26+
bundles.Add(new StyleBundle("~/Content/css").Include(
27+
"~/Content/bootstrap.css",
28+
"~/Content/site.css"));
29+
30+
// 디버깅하려면 EnableOptimizations를 false로 설정합니다. 자세한 내용을 보려면
31+
// http://go.microsoft.com/fwlink/?LinkId=301862를 방문하십시오.
32+
BundleTable.EnableOptimizations = true;
33+
}
34+
}
35+
}

App_Start/FilterConfig.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Web;
2+
using System.Web.Mvc;
3+
4+
namespace CloudBreadAdminWeb
5+
{
6+
public class FilterConfig
7+
{
8+
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
9+
{
10+
filters.Add(new HandleErrorAttribute());
11+
}
12+
}
13+
}

App_Start/IdentityConfig.cs

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Data.Entity;
4+
using System.Linq;
5+
using System.Security.Claims;
6+
using System.Threading.Tasks;
7+
using System.Web;
8+
using Microsoft.AspNet.Identity;
9+
using Microsoft.AspNet.Identity.EntityFramework;
10+
using Microsoft.AspNet.Identity.Owin;
11+
using Microsoft.Owin;
12+
using Microsoft.Owin.Security;
13+
using CloudBreadAdminWeb.Models;
14+
15+
namespace CloudBreadAdminWeb
16+
{
17+
public class EmailService : IIdentityMessageService
18+
{
19+
public Task SendAsync(IdentityMessage message)
20+
{
21+
// 전자 메일을 보낼 전자 메일 서비스를 여기에 플러그 인으로 추가합니다.
22+
return Task.FromResult(0);
23+
}
24+
}
25+
26+
public class SmsService : IIdentityMessageService
27+
{
28+
public Task SendAsync(IdentityMessage message)
29+
{
30+
// 텍스트 메시지를 보낼 SMS 서비스를 여기에 플러그 인으로 추가합니다.
31+
return Task.FromResult(0);
32+
}
33+
}
34+
35+
// 이 응용 프로그램에서 사용되는 응용 프로그램 사용자 관리자를 구성합니다. UserManager는 ASP.NET Identity에서 정의하며 응용 프로그램에서 사용됩니다.
36+
public class ApplicationUserManager : UserManager<ApplicationUser>
37+
{
38+
public ApplicationUserManager(IUserStore<ApplicationUser> store)
39+
: base(store)
40+
{
41+
}
42+
43+
public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context)
44+
{
45+
var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(context.Get<ApplicationDbContext>()));
46+
// 사용자 이름에 대한 유효성 검사 논리 구성
47+
manager.UserValidator = new UserValidator<ApplicationUser>(manager)
48+
{
49+
AllowOnlyAlphanumericUserNames = false,
50+
RequireUniqueEmail = true
51+
};
52+
53+
// 암호에 대한 유효성 검사 논리 구성
54+
manager.PasswordValidator = new PasswordValidator
55+
{
56+
RequiredLength = 6,
57+
RequireNonLetterOrDigit = true,
58+
RequireDigit = true,
59+
RequireLowercase = true,
60+
RequireUppercase = true,
61+
};
62+
63+
// 사용자 잠금 기본값 구성
64+
manager.UserLockoutEnabledByDefault = true;
65+
manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5);
66+
manager.MaxFailedAccessAttemptsBeforeLockout = 5;
67+
68+
// 2단계 인증 공급자를 등록합니다. 이 응용 프로그램은 사용자 확인 코드를 받는 단계에서 전화 및 전자 메일을 사용합니다.
69+
// 공급자 및 플러그 인을 여기에 쓸 수 있습니다.
70+
manager.RegisterTwoFactorProvider("전화 코드", new PhoneNumberTokenProvider<ApplicationUser>
71+
{
72+
MessageFormat = "보안 코드는 {0}입니다."
73+
});
74+
manager.RegisterTwoFactorProvider("전자 메일 코드", new EmailTokenProvider<ApplicationUser>
75+
{
76+
Subject = "보안 코드",
77+
BodyFormat = "보안 코드는 {0}입니다."
78+
});
79+
manager.EmailService = new EmailService();
80+
manager.SmsService = new SmsService();
81+
var dataProtectionProvider = options.DataProtectionProvider;
82+
if (dataProtectionProvider != null)
83+
{
84+
manager.UserTokenProvider =
85+
new DataProtectorTokenProvider<ApplicationUser>(dataProtectionProvider.Create("ASP.NET Identity"));
86+
}
87+
return manager;
88+
}
89+
}
90+
91+
// 이 응용 프로그램에서 사용되는 응용 프로그램 로그인 관리자를 구성합니다.
92+
public class ApplicationSignInManager : SignInManager<ApplicationUser, string>
93+
{
94+
public ApplicationSignInManager(ApplicationUserManager userManager, IAuthenticationManager authenticationManager)
95+
: base(userManager, authenticationManager)
96+
{
97+
}
98+
99+
public override Task<ClaimsIdentity> CreateUserIdentityAsync(ApplicationUser user)
100+
{
101+
return user.GenerateUserIdentityAsync((ApplicationUserManager)UserManager);
102+
}
103+
104+
public static ApplicationSignInManager Create(IdentityFactoryOptions<ApplicationSignInManager> options, IOwinContext context)
105+
{
106+
return new ApplicationSignInManager(context.GetUserManager<ApplicationUserManager>(), context.Authentication);
107+
}
108+
}
109+
}

App_Start/RouteConfig.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.Mvc;
6+
using System.Web.Routing;
7+
8+
namespace CloudBreadAdminWeb
9+
{
10+
public class RouteConfig
11+
{
12+
public static void RegisterRoutes(RouteCollection routes)
13+
{
14+
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
15+
16+
routes.MapRoute(
17+
name: "Default",
18+
url: "{controller}/{action}/{id}",
19+
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
20+
);
21+
}
22+
}
23+
}

App_Start/Startup.Auth.cs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
using System;
2+
using Microsoft.AspNet.Identity;
3+
using Microsoft.AspNet.Identity.Owin;
4+
using Microsoft.Owin;
5+
using Microsoft.Owin.Security.Cookies;
6+
using Microsoft.Owin.Security.Google;
7+
using Owin;
8+
using CloudBreadAdminWeb.Models;
9+
10+
namespace CloudBreadAdminWeb
11+
{
12+
public partial class Startup
13+
{
14+
// 인증 구성에 대한 자세한 내용은 http://go.microsoft.com/fwlink/?LinkId=301864를 참조하십시오.
15+
public void ConfigureAuth(IAppBuilder app)
16+
{
17+
// 요청당 단일 인스턴스를 사용하도록 db 컨텍스트, 사용자 관리자 및 로그인 관리자 구성
18+
app.CreatePerOwinContext(ApplicationDbContext.Create);
19+
app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
20+
app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
21+
22+
// 응용 프로그램이 쿠키를 사용하여 로그인한 사용자에 대한 정보를 저장하도록 설정합니다.
23+
// 또한 쿠키를 사용하여 타사 로그인 공급자를 통한 사용자 로그인 관련 정보를 일시적으로 저장하도록 설정합니다.
24+
// 쿠키에 서명을 구성합니다.
25+
app.UseCookieAuthentication(new CookieAuthenticationOptions
26+
{
27+
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
28+
LoginPath = new PathString("/Account/Login"),
29+
Provider = new CookieAuthenticationProvider
30+
{
31+
// 사용자가 로그인할 때 응용 프로그램이 보안 스탬프를 확인하도록 설정합니다.
32+
// 암호를 변경하거나 계정에 외부 로그인을 추가할 때 사용되는 보안 기능입니다.
33+
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
34+
validateInterval: TimeSpan.FromMinutes(30),
35+
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
36+
}
37+
});
38+
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
39+
40+
// 응용 프로그램에서 2단계 인증 프로세스의 두 번째 단계를 확인할 때 사용자 정보를 일시적으로 저장하도록 설정합니다.
41+
app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5));
42+
43+
// 응용 프로그램에서 전화나 전자 메일 같은 두 번째 로그인 확인 단계를 기억하도록 설정합니다.
44+
// 이 옵션을 선택하면 사용자가 로그인한 장치에서 로그인 프로세스의 두 번째 확인 단계를 기억합니다.
45+
// 로그인할 때의 [사용자 이름 및 암호 저장] 옵션과 유사합니다.
46+
app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie);
47+
48+
// 타사 로그인 공급자로 로그인할 수 있으려면 다음 줄의 주석 처리를 제거합니다.
49+
//app.UseMicrosoftAccountAuthentication(
50+
// clientId: "",
51+
// clientSecret: "");
52+
53+
//app.UseTwitterAuthentication(
54+
// consumerKey: "",
55+
// consumerSecret: "");
56+
57+
//app.UseFacebookAuthentication(
58+
// appId: "",
59+
// appSecret: "");
60+
61+
//app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
62+
//{
63+
// ClientId = "",
64+
// ClientSecret = ""
65+
//});
66+
}
67+
}
68+
}

0 commit comments

Comments
 (0)