Skip to content

Commit

Permalink
Initial commit of user module
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDotPro committed Nov 2, 2011
0 parents commit bcc8bbc
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Module.php
@@ -0,0 +1,34 @@
<?php

namespace EdpUser;

use Zend\Module\Manager,
Zend\Config\Config,
Zend\Loader\AutoloaderFactory;

class Module
{
public function init(Manager $moduleManager)
{
$this->initAutoloader();
}

protected function initAutoloader()
{
AutoloaderFactory::factory(array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
));
}

public function getConfig($env = null)
{
return new Config(include __DIR__ . '/configs/module.config.php');
}
}
20 changes: 20 additions & 0 deletions README.md
@@ -0,0 +1,20 @@
EdpUser
=======
Version 0.0.1 Created by Evan Coury

Introduction
------------

EdpUser is a ZF2 module which utilizes Doctrine2. It provides the foundations
for adding user authentication and registration to your ZF2 site. It is built to
be very simple and easily to extend.

Features
--------

* Authenticate via username, email, or both (can opt out of the concept of
username and use strictly email)
* E-mail address verification (optional)
* Forgot Password
* User Registration
* Robust event system to allow for extending
2 changes: 2 additions & 0 deletions autoload_classmap.php
@@ -0,0 +1,2 @@
<?php
return array();
12 changes: 12 additions & 0 deletions autoload_function.php
@@ -0,0 +1,12 @@
<?php
return function ($class) {
static $map;
if (!$map) {
$map = include __DIR__ . '/autoload_classmap.php';
}

if (!isset($map[$class])) {
return false;
}
return include $map[$class];
};
2 changes: 2 additions & 0 deletions autoload_register.php
@@ -0,0 +1,2 @@
<?php
spl_autoload_register(include __DIR__ . '/autoload_function.php');
20 changes: 20 additions & 0 deletions configs/module.config.php
@@ -0,0 +1,20 @@
<?php
return array(
'di' => array(
'instance' => array(
'doctrine-container' => array(
'parameters' => array(
'em' => array(
'default' => array(
'driver' => array(
'paths' => array(
'EdpUser' => __DIR__ . '/../src/EdpUser/Entity',
),
),
),
),
),
),
),
),
);
63 changes: 63 additions & 0 deletions src/EdpUser/Entity/User.php
@@ -0,0 +1,63 @@
<?php

namespace EdpUser\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
*/
class User
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;

/**
* @ORM\Column(type="string", unique=true)
*/
private $username;

/**
* @ORM\Column(type="string", unique=true)
*/
private $email;

/**
* @ORM\Column(type="string", length=50)
*/
private $display_name;

/**
* @ORM\Column(type="string", length=128)
*/
private $password;

/**
* @ORM\Column(type="string", length=16)
*/
private $salt;

/**
* @ORM\Column(type="datetime")
*/
private $last_login;

/**
* @ORM\Column(type="integer")
*/
private $last_ip;

/**
* @ORM\Column(type="datetime")
*/
private $register_time;

/**
* @ORM\Column(type="integer")
*/
private $register_ip;
}

0 comments on commit bcc8bbc

Please sign in to comment.