Git Product home page Git Product logo

codeigniter-authme's Introduction

CodeIgniter Authme

A lightweight, flexible and secure CodeIgniter authentication library. It uses PHPass for secure password hashing and aims to be a solid base on which to build an authentication system for your CodeIgniter project. It comes packaged with an example Auth class and related views so that you can get your CI project up and running in minutes.

Requirements

  • CodeIgniter 2.1+
  • PHP 5.2+
  • MySQL

Installation

  1. Download and unpack the contents of the application folder to your CodeIgniter project.
  2. That's it! Visit /auth to signup and login.
  3. If you want you can edit application/config/authme.php to change some settings, but the defaults are fine.

Usage

For an example on how to use Authme see the example Auth controller which provides a functioning example of login, sign up, logout and forget/reset password. The Authme library provides several API methods:

logged_in() - Returns true if the current user logged in, false otherwise.

login($email, $password) - Attempts to login a user with a given $email and $password. Returns true if successful and false otherwise.

logout([$redirect = false]) - Logs out the current user (by destorying the session). Accepts an optional $redirect parameter to redirect to a given URI after logout.

signup($email, $password) - Attempts to create a user with a given $email and $password. Returns true if successful and false otherwise.

reset_password($user_id, $new_password) - Resets the password of the user with the given $user_id.

The Authme helper includes the following helper functions:

logged_in() - Returns true if the current user logged in, false otherwise (shortcut to the Authme library logged_in() function).

user([$key = '']) - Returns the session data for the currently logged in user. If you specifiy a $key you can retrieve specific info, for exmaple user('id') returns the currently logged in user ID.

Credits

The CodeIgniter Authme library was created by Gilbert Pellegrom from Dev7studios. Released under the MIT license.

Please contribute by reporting bugs and submitting pull requests.

codeigniter-authme's People

Contributors

gilbitron 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.