Download the PHP package ipunkt/auth without Composer

On this page you can find all versions of the php package ipunkt/auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package auth

ipunkt/auth

Latest Stable Version Latest Unstable Version License Total Downloads

This package provides a user model and simple login, plus remind and register views. It integrates nicely with other ipunkt packages like ipunkt/roles and ipunkt/social-auth to provide a pull-in-and-use-it environment.

Installation

Add to your composer.json following lines

"require": {
    "ipunkt/auth": "1.*"
}

Configuration

Registration strategy

The registration strategy can be choosen in the config.php through the field registration_strategy

Single-opt-in

Currently only single-opt-in is provided by the package. This means the user will be logged in and activated once they send valid user data to register. Config Value: single_opt_in

Double-opt-in

In the future a native double-opt-in will be provided. This means the user will be created, but disabled after they send valid user data. An email will be sent to their email address with a confirmation link. Their user account will be enabled once the registration link has been visited Config Value: double_opt_in

Usage

Link your users to the route auth.register to allow them to register

Link your users to the route auth.login for logging a user in

Link your users to the route auth.logout for logging a user out

User index

If you wish to publish a list of all users you can use to the auth.user.login route. There are 3 ways to decide access to this:

The default behaviour is to deny access.

User edit

To let your users edit a profile link them to the auth.user.edit route, with the user id / $user->getKey() as Parameter

This will ask the User model for edit permission

The default behaviour is to allow editing permissions to the users own profile.

User delete

To let your users delete an account, link them to the auth.user.delete route, with the user id / $user->getKey() as Parameter. Also if a user has permission to delete an account while viewing the auth.user.edit view of said account, a deletion link will be shown.

This will ask the user model for delete permission

The default behaviour is to to deny deletion permission

Customization

Views

Misc Config Options

set_usermodel

Default value: true When left at true then the AuthServiceProvider will set auth.model to the Model provided by this package Set to false if you wish to use your own user model.

set_repository

Default value: true When left at true then the AuthServiceProvider will bind this packages UserRepository to Ipunkt\Auth\Repositories\RepositoryInterface. The default repository will instanciate the Model set in the config value auth.model. Set to false if you do not use Eloquent or want to bind your own Repository for the User creation for some reason. see Change out user model below

route_prefix

Default value: '' This prefix is prepended to all routes set by this package. This enables you to bundle your authentication users under a single path, like auth/ If you set this, then make sure to check your auth filter. The default Laravel4 implementation sends the user to /login upon failing

set_reminder

Default value: true When left at true then the AuthServiceProvider will use auth::reminder/email as the View for reminder emails Set to false if you wish to load a view from your app instead of customizing the package view

publish_user_index

Default value: false When set to true then $route_prefix/user/ will show a listing of all registered users if the $user->can('index', $dummyUser) See ipunkt/permissions for specifics about giving permissions

user_actions

Default value: ['edit'] This value configures the default PermissionChecker for the user model this package brings. Any action listed in this config variable is see as on a user by user base and will be allowed if the user attempts to do it to his own account.

routes

Default value: ['logout' => 'auth.login'] This decides where varios actions redirect after they have successfuly finished. Currently:

Extending Registration Strategies

To create your own registration strategy you will have to register an event listener to Ipunkt.Auth.*

Example:

class RegistrationServiceProvider extends ServiceProvider {
    public function boot() {
        if(Config::get('auth::registration_strategy') == 'test_opt_in')
        Event::listen('Ipunkt.Auth.*', 'Acme\Listeners\TestOptInListener');
    }

    public function register() {}
}

Events to listen for

Also see Ipunkt\Auth\Listeners\SingleOptInListener for reference

Change user model

To use your own model set the config value 'auth.model' to its classpath.

If your model does not inherit from eloquent you will also have to replace 'Ipunkt\Auth\Repositories\RepositoryInterface' in the Laravel IoC

If you simply want to extend the model brought by this package have your own model inherit from Eloquent and implement Ipunkt\Auth\User\UserInterface.

All prebuild functionality is capsulated in traits and can be used directly in your new model

  1. EloquentUserTrait combines
    • EloquentUserInterfaceTrait implements the laravel UserInterface for you (pre-4.2)
    • EloquentUserRemindableTrait implements the laravel RemindableInterface for you (pre-4.2)

All versions of auth with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/support Version 4.2.*
ipunkt/permissions Version 1.0rc1
laracasts/commander Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ipunkt/auth contains the following files

Loading the files please wait ....