GithubHelp home page GithubHelp logo

anthrax3 / memberlite-ef6 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from princetegaton/memberlite-ef6

0.0 0.0 0.0 439 KB

Simple and flexible asp.net membership system with C#, Entity Framework 6 and FormsAuthentication

License: MIT License

HTML 3.66% C# 84.46% CSS 0.59% ASP 0.11% JavaScript 11.18%

memberlite-ef6's Introduction

MemberLite-EF6

Simple and flexible asp.net membership system with C#, Entity Framework 6 and FormsAuthentication

By default Microsoft ASP.NET FormsAuthentication provides you with Owin Authentication classes using Entity Framework, but sometimes it gets so clumsy and hard to customize for beginners and even pros. MemberLite-EF6 is a lightweight system that is easy to use and highly customizable with codes for all setups. It takes you behind the scene for effective control of the process. MemberLite provides the basics of FormsAuthentication and can easily be incorporated into existing apps and database. Some core features includes;

  • Signup
  • Signin
  • Send verification email with HTML template
  • Verify email
  • Change password
  • Retrieve password with HTML template
  • Update profile
  • Change status
  • Upload avatar
  • User login history
  • Web mailer

It contains several methods that are needed for a User Object and makes your job faster. With highly editable HTML templates you can set how you want your user emails to appear.

Database

The database contains 2 tables - Users and LoginHistory. Execute the database script MemberLite.sql from App_Data folder.

AppUtility Helper Class

I addition, a very rich AppUtility class is available. It contains several methods that developers use regularly in every application. Some methods include;

  • GetDeviceType()
  • GetUserIPAddress()
  • CleanUrlSlug(string Str, int MaxLength = 50)
  • IsNumeric(object Expression)
  • CleanDomain(string Domain)
  • GenerateAlphaNumeric(int Length)
  • GenerateNumeric(int Length)
  • ValidateEmail(string Email)
  • GetUrlQueryString(string Key)
  • DateTimeToWord(DateTime DateTimeString)
  • DigitStyle(dynamic Value)
  • ConvertSize(long Bytes, ConvertType ConvertTo)
  • SetCookie(string Cookie, string Value, int Expires = 7)
  • SetCookie(string Cookie, string Value, DateTime Expires, bool Secure = false, bool HTTPOnly = false)
  • GetCookie(string Cookie)
  • Country class
  • DelimitedStringListFromFile(string FilePath, string Delimiter)
  • ExternalFileExist(string Url)
  • StripHtml(string HtmlContent)
  • ReadXDocAttribute(XElement Document, XName Name, string defaultValue = "")
  • UploadToBase64(Stream file)
  • Base64ImageToFile(string Base64String, string SaveAs, System.Drawing.Imaging.ImageFormat Format)
  • DateDifference class

WebMailer Helper Class

WebMailer is a class that handles sending of emails from your app with HTML templates packed properly. All configurations are saved in the Web.config appSettings and called through the AppConfig.cs. This class is fully dynamic as allows switching of sending email account as seen in the sample.

Crypto

This is a simple class that provides cryptographic functions for hashing in MD5 and SHA256, also privides comparism.

  • MD5Hash(string PlainText, string Salt = "")
  • SHA256Hash(string PlainText, string Salt = "")
  • ByteArrayToString(byte[] ArrayData)
  • CompareMD5Hash(string Hash1, string Hash2, string Hash1Salt = "")
  • CompareSHA256Hash(string Hash1, string Hash2, string Hash1Salt = "")

CustomErrorLogger Helper Class

This is a simple error logging utility that logs errors to App_Data/ErrorLog.xml and provides methods to read and clear errors

  • Log(string Message, string Code = "", string Page = "")
  • List LoadLog()
  • Clear()

Email Templates

Email verification and password reset uses HTML email templates predefined in App_Data/MailTemplates and can be customized with your app logo and details. Parameters are replaced in C# calls before passing them to WebMailer to send.

StaticContents

These are text files used as dynamic source. NameRestriction.txt contains a list of restricted names that users cannot signup with such as admin, superuser etc so not to confuse or impersonate other users in the site.

Countries

App_Data/Countries.xml contains all countries with their Name, 2 letter code and ISO. It corresponds to AppUtility.Country to access them.

memberlite-ef6's People

Contributors

princetegaton avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.