• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    PHP
  • Created about 14 years ago
  • Updated about 13 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

User administration and auth for Kohana 3

TUTORIAL

NEW: Upgraded to support Kohana 3.1.x! Thank you gartz for this! If you need KO 3.0.x support, use the Feb 27th version.

Most recent, detailed tutorial - note, documentation still needs an update:

Earlier writing about Kohana auth:

SUPPORTED PROVIDERS

  • Regular Kohana user account registration
  • Facebook (OAuth v2.0)
  • Twitter (OAuth v1.0)
  • Google (OpenID)
  • Yahoo (OpenID)

MODULES USED

  • Core: Auth, ORM, Database
  • Core (but not included by default in KO 3.1): pagination
  • Other: kohana-email, kohana-oauth, fleepme-unittest.

CONTRIBUTORS

I would like to thank:

  • jnbdz for adding the reCaptcha support.
  • gartz for doing upgrading the module to support Kohana 3.1.x.

CHANGELOG

March 19th 2011:

  • Upgraded to support Kohana 3.1.x! Thanks gartz!
  • Testing various actions to ensure KO 3.1.2 compatibility (admin in particular), improved validation message handling.
  • Added support for media file routing to make it easier to get started with the module.

Feb 27th 2011:

  • New UI! The UI is loosely based on https://github.com/pilu/web-app-theme (a theme generator for Ruby) and is a lot better looking than the old one. See screenshots below.
  • Twitter login! Requires that you enable the kohana-oauth module from the core.
  • Google and Yahoo login! Uses LightOpenID which is bundled in the repo. I had a look at Janrain's popular library, but to me if you let your library generate errors on PHP 5.0.0 - 5.3.0 and have dozens of pending issues and pull requests - then you just don't care about supporting your library. So not using Janrain's lib.
  • Refactored 3rd party account provider code for better extensibility.
  • Changed from Facebook Javascript API (which had some reports of problems) to PHP/redirect based API. No popups during login, just a redirect!
  • Database changes to allow user to be associated with more service providers. See MIGRATION below if you used had the Facebook login enabled previously and want to migrate the accounts.
  • Included Datatable helper which helps when working with pagination links in tables.

Feb 21st 2011:

  • CRITICAL SECURITY BUG in Facebook login; it is strongly recommended that all users of Facebook login functionality upgrade (does not affect sites with Facebook login disabled). Thank you Euan McKay!
  • To support login via AJAX requests moved the processing of results from the Auth check to Controller_App->access_required and Controller_App->login_required. Override those in your app, using Request::$is_ajax to detect AJAX requests.
  • Workaround for email field for http://dev.kohanaframework.org/issues/3750 in messages/register.php

Jan 28th 2011:

  • Added reCaptcha support (captcha on registration)
  • Upgraded to Kohana v3.0.9

Jan 12th 2011: Pushed out new version with following improvements:

  • Facebook login! Yes, you can now have users register and log in using their Facebook account.
  • New tutorial! I tried to go through everything necessary to get started with the module, see this new post.
  • Transparent extending is now supported; you can start implementing your application by overriding Controller_User / Model_User with a class that extends Controller_Useradmin_User / Model_Useradmin_User.
  • Bug fixes (login using email, validation messages, saving empty password)

Nov 25th 2010: Pushed out new version with following improvements:

  • Now includes Kohana-Email module for sending password reset emails (users can request password request by entering an email, and they will be sent a one-time reset token via email).
  • Validation code in model has been improved based on feedback from biakaveron.
  • Validation code is prettier: it uses the approach from my validation-with-forms tutorial.
  • Framework has been updated to v3.0.8 and minor compatibility bugs fixed.

Sep 14th 2010:

  • Initial version.

SCREENSHOT

screenshot

MIGRATION from pre-Feb xxth 2011 to new schema

The schema had to be updated to allow for better support for multiple 3rd party providers.

Basically, the facebook_user_id field has been removed from the users table, and moved to the user_identies table. To migrate, you need to create a row for each user with a facebook_user_id in that table, something like:

INSERT INTO useradmin.user_identities (user_id, provider, identity) SELECT users.id, "facebook", users.facebook_user_id FROM useradmin.users;

after creating the new table. You can drop facebook_user_id after this.

LICENCE (Simplified BSD licence)

NOTE: This licence applies to the useradmin module only, as written by Mikito Takada (found under /modules/user/). Different licences may apply to the other modules in this repository and the Kohana 3 core.


Copyright 2010 Mikito Takada. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY MIKITO TAKADA ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MIKITO TAKADA OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Mikito Takada.


Not that I have any official policies.

DEPENDENCIES'S LICENCES (bundled in repository; don't have to find these)

I have attempted to ensure that none of the dependencies are GPL licenced, so that they can be used in commercial applications without worrying about copyleft.

Vendors folder:

  • Facebook's PHP SDK is under the Apache Licence, v.2.0 - needed for Facebook.
  • LightOpenID is under MIT licence - needed for OpenID (Google, Yahoo).
  • ReCaptchalib is under MIT licence - needed for ReCaptcha.

Kohana modules:

  • Kohana oAuth and Auth are part of the Kohana Core.
  • Kohana-email is a port of the same module which was in the Kohana v.2.x Core. It depends on Swiftmailer which is LGPL.

Icons:

Please consult a lawyer if you need legal advice.

More Repositories

1

distsysbook

The book Distributed systems: for fun and profit
HTML
2,538
star
2

markdown-styles

Markdown to static HTML generator and multiple CSS themes for Markdown
HTML
1,850
star
3

singlepageappbook

Content and site generator for Single page apps in depth (my book on single page applications)
HTML
1,712
star
4

nwm

Tiling window manager for X11 written in Node.js
JavaScript
786
star
5

npm_lazy

A lazy local cache for NPM to make your local deploys faster
JavaScript
753
star
6

gr

Multiple git repository management tool
JavaScript
675
star
7

electroshot

Capture website screenshots with optional device and network emulation as jpg, png or pdf (with web fonts!) using Electron / Chrome.
JavaScript
549
star
8

minilog

Lightweight client & server-side logging with Stream-API backends
JavaScript
378
star
9

cssbook

The book "Learn CSS layout the pedantic way"
CSS
225
star
10

ghost-render

Render static blog sites from Markdown using Ghost themes
JavaScript
224
star
11

gluejs

Build CommonJS modules for the browser via a chainable API
JavaScript
165
star
12

fastlint

Lint faster by only running linters and other tools on files that have recently changed or files that are different from `master` in git.
JavaScript
89
star
13

vectorclock

A simple implementation of vector clocks in Javascript.
JavaScript
78
star
14

token

Time-limited, HMAC-based authentication token generation
JavaScript
65
star
15

perfect

A perfect minimal hash function generator
JavaScript
63
star
16

siobench

Basic socket.io benchmarking
JavaScript
44
star
17

nplay

Console-based mp3 player with Winamp key bindings and jump-to-file
JavaScript
42
star
18

markdown-styles-lambda

Automatic static site generation on `git push` using AWS Lambda and markdown-styles using a Gulp-style API.
JavaScript
33
star
19

tmux-cpu

Display CPU usage in your tmux status bar or in the terminal.
JavaScript
32
star
20

archey.js

Archey.js is a system information tool written in JS (based on Archey)
JavaScript
29
star
21

nodebook

A book about using Node.js
HTML
29
star
22

vnodehash

Consistent hashing using virtual nodes.
JavaScript
29
star
23

datalog.js

A trivial Datalog with top-down and bottom up evaluation written in Javascript to learn how Datalog evaluation works.
JavaScript
28
star
24

pipe-iterators

Like underscore for Node streams. Functions for iterating over object mode streams: forEach, map, mapKey, reduce, filter, fromArray, toArray, fromAsync, devnull, pipe, head, tail, through, thru, writable, readable, duplex, pipeline.
JavaScript
27
star
25

file-dedupe

Fast duplicate file detection library
JavaScript
25
star
26

microee

A tiny EventEmitter-like client and server side library for routing events
JavaScript
21
star
27

amdetective

Like node-detective, but for AMD/r.js files
JavaScript
19
star
28

tmux-mem

Display memory usage in your tmux status bar or in the terminal
JavaScript
16
star
29

snapshot

Serialize circular references, custom objects and other types not supported by JSON
JavaScript
16
star
30

pixiedust

RESTful lazy chainable API generator
JavaScript
14
star
31

htmlparser-to-html

Converts the JSON that the htmlparser/htmlparser2 package produces back to HTML
JavaScript
13
star
32

sioconfig

Socket.io HAProxy and Stunnel configs, and a test tool
JavaScript
12
star
33

nwm-user

Custom nwm configuration
JavaScript
11
star
34

hmvc-cfs

Cascading file system
JavaScript
11
star
35

wildglob

JavaScript
9
star
36

minimal

A router and http client - without unnecessary additions, modifications, or complications
JavaScript
8
star
37

node-winamp

Node.js remote control app for Winamp over LAN + client bindings
JavaScript
7
star
38

nodeko

Node.js window manager for X11 (written at NodeKO 2011)
C++
6
star
39

mg

JavaScript
6
star
40

heartbeat

Combine multiple recurring timers to a single interval
JavaScript
6
star
41

miniee

An EventEmitter-like Client and server side library for routing events w/regexps
JavaScript
6
star
42

7z-encrypted-backup

JavaScript
5
star
43

npm_push

Deprecated, see npm_lazy instead
JavaScript
5
star
44

tmux-colors

Write tmux-compatible color strings and have them work both in the terminal and in tmux.
JavaScript
5
star
45

glob-parse

Returns a parsed representation of a glob string; does not require Minimatch.
JavaScript
5
star
46

minitask

A standard/convention for running tasks over a list of files based around Node core streams2
JavaScript
4
star
47

changes

Check that your own npm packages are up to date
JavaScript
4
star
48

espresso

Syntax highlighting theme for Sublime Text 2 and Guake
Shell
4
star
49

markdown-stream-utils

Utility functions for processing markdown files using object mode streams. Used by markdown-styles and by ghost-render.
JavaScript
4
star
50

requireincontext

Wrapper to require() js files in a custom context
JavaScript
3
star
51

nbar

Status bar for nwm
C
3
star
52

glob-github

Run glob expressions against the Github Repo Contents API and return the matching files and metadata; with caching and handling of concurrent requests
JavaScript
3
star
53

fake.io

Fake Engine IO server and client for running tests without starting a server
JavaScript
3
star
54

apache_ai

Summarizes Apache error logs by removing unnecessary uniquely identifying information
JavaScript
3
star
55

unbundle-model

A model layer, implements a model and a collection.
JavaScript
3
star
56

controlflow

Node control flow patterns from my book
JavaScript
2
star
57

package-json-resolver

Library for reading package.json files for the gluejs build system
JavaScript
2
star
58

github.js

Github API v3 JS client
JavaScript
2
star
59

mds-csv

csv highlighting support for markdown-styles / generate-md
JavaScript
2
star
60

fail

Generic failure detector for connections
JavaScript
2
star
61

lost

A system for locating things by their name (and for binding things to names)
JavaScript
2
star
62

dom-to-htmlparser

Converts the DOM into htmlparser-compatible JSON
JavaScript
1
star
63

nodeunit-runner

A simple nodeunit test runner for invoking tests via node
JavaScript
1
star
64

tcp-loadbalancer

TCP load balancer for running load balanced scenario tests
JavaScript
1
star
65

sloppy

Sloppy quorum implementation
JavaScript
1
star
66

chromium-emulated-networks

The list of emulated network conditions from Chromium's devtools as JSON. Useful for configuring a specific latency and bandwidth profile.
1
star
67

fffuuu

A TCP socket client with transparent reconnection support and message buffering while disconnected.
JavaScript
1
star
68

chromium-emulated-devices

The list of emulated devices from Chromium's devtools as JSON. Useful for plucking out device resolutions, pixel ratios and user agent strings.
1
star
69

video-tools

Shell
1
star
70

identify-github-event

Map Github webhook events to their names
JavaScript
1
star
71

npmjs-github-crawler

Gets github metadata for the repos in the npm database
JavaScript
1
star
72

zendesk.js

Zendesk Javascript client (work in progress)
JavaScript
1
star