Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #83 from ajira86/develop
Browse files Browse the repository at this point in the history
Update for Laravel 3.2.12
  • Loading branch information
mikelbring committed Nov 29, 2012
2 parents 9537ec4 + 7c2b197 commit d836c85
Show file tree
Hide file tree
Showing 324 changed files with 33,709 additions and 1,534 deletions.
30 changes: 29 additions & 1 deletion app/application/config/application.php
Expand Up @@ -30,6 +30,19 @@

'url' => '',

/*
|--------------------------------------------------------------------------
| Asset URL
|--------------------------------------------------------------------------
|
| The base URL used for your application's asset files. This is useful if
| you are serving your assets through a different server or a CDN. If it
| is not set, we'll default to the application URL above.
|
*/

'asset_url' => '',

/*
|--------------------------------------------------------------------------
| Application Index
Expand Down Expand Up @@ -61,6 +74,20 @@

'key' => 'YourSecretKeyGoesHere!',

/*
|--------------------------------------------------------------------------
| Profiler Toolbar
|--------------------------------------------------------------------------
|
| Laravel includes a beautiful profiler toolbar that gives you a heads
| up display of the queries and logs performed by your application.
| This is wonderful for development, but, of course, you should
| disable the toolbar for production applications..
|
*/

'profiler' => false,

/*
|--------------------------------------------------------------------------
| Application Character Encoding
Expand Down Expand Up @@ -154,6 +181,7 @@
'Log' => 'Laravel\\Log',
'Memcached' => 'Laravel\\Memcached',
'Paginator' => 'Laravel\\Paginator',
'Profiler' => 'Laravel\\Profiling\\Profiler',
'URL' => 'Laravel\\URL',
'Redirect' => 'Laravel\\Redirect',
'Redis' => 'Laravel\\Redis',
Expand All @@ -171,4 +199,4 @@
'View' => 'Laravel\\View',
),

);
);
65 changes: 22 additions & 43 deletions app/application/config/auth.php
Expand Up @@ -4,78 +4,57 @@

/*
|--------------------------------------------------------------------------
| Retrieve The Current User
| Default Authentication Driver
|--------------------------------------------------------------------------
|
| This closure is called by the Auth class' "user" method when trying to
| retrieve a user by the ID that is stored in their session. If you find
| the user, just return the user object, but make sure it has an "id"
| property. If you can't find the user, just return null.
| Laravel uses a flexible driver-based system to handle authentication.
| You are free to register your own drivers using the Auth::extend
| method. Of course, a few great drivers are provided out of
| box to handle basic authentication simply and easily.
|
| Of course, a simple and elegant authentication solution has already
| been provided for you using the query builder and hashing engine.
| We love making your life as easy as possible.
| Drivers: 'fluent', 'eloquent'.
|
*/

'user' => function($id)
{
if (filter_var($id, FILTER_VALIDATE_INT) !== false)
{
return User::find($id);
}
},
'driver' => 'eloquent',

/*
|--------------------------------------------------------------------------
| Authenticate User Credentials
| Authentication Username
|--------------------------------------------------------------------------
|
| This closure is called by the Auth::attempt() method when attempting to
| authenticate a user that is logging into your application. It's like a
| super buff bouncer to your application.
|
| If the provided credentials are correct, simply return an object that
| represents the user being authenticated. As long as it has a property
| for the "id", any object will work. If the credentials are not valid,
| you don't meed to return anything.
| Here you may specify the database column that should be considered the
| "username" for your users. Typically, this will either be "username"
| or "email". Of course, you're free to change the value to anything.
|
*/

'attempt' => function($username, $password)
{
$user = User::where_email($username)->first();

if ( ! is_null($user) and Hash::check($password, $user->password))
{
return $user;
}
},
'username' => 'email',

/*
|--------------------------------------------------------------------------
| Logout The Current User
| Authentication Model
|--------------------------------------------------------------------------
|
| Here you may do anything that needs to be done when a user logs out of
| your application, such as call the logout method on a third-party API
| you are using for authentication or anything else you desire.
| When using the "eloquent" authentication driver, you may specify the
| model that should be considered the "User" model. This model will
| be used to authenticate and load the users of your application.
|
*/

'logout' => function($user) {},
'model' => 'User',

/*
|--------------------------------------------------------------------------
| "Remember Me" Cookie Name
| Authentication Table
|--------------------------------------------------------------------------
|
| Here you may specify the cookie name that will be used for the cookie
| that serves as the "remember me" token. Of course, a sensible default
| has been set for you, so you probably don't need to change it.
| When using the "fluent" authentication driver, the database table used
| to load users may be specified here. This table will be used in by
| the fluent query builder to authenticate and load your users.
|
*/

'cookie' => 'tinyissue_remember',
'table' => 'users',

);
10 changes: 8 additions & 2 deletions app/application/controllers/login.php
Expand Up @@ -11,7 +11,13 @@ public function get_index()

public function post_index()
{
if(Auth::attempt(Input::get('email'), Input::get('password'), (bool) Input::get('remember')))
$userdata = array(
'username' => Input::get('email'),
'password' => Input::get('password'),
'remember' => (bool) Input::get('remember')
) ;

if(Auth::attempt($userdata))
{
return Redirect::to(Input::get('return', '/'));
}
Expand All @@ -20,4 +26,4 @@ public function post_index()
->with('error', __('tinyissue.password_incorrect'));
}

}
}
18 changes: 17 additions & 1 deletion app/application/start.php
Expand Up @@ -144,6 +144,22 @@
return Lang::file($bundle, $language, $file);
});

/*
|--------------------------------------------------------------------------
| Attach The Laravel Profiler
|--------------------------------------------------------------------------
|
| If the profiler is enabled, we will attach it to the Laravel events
| for both queries and logs. This allows the profiler to intercept
| any of the queries or logs performed by the application.
|
*/

if (Config::get('application.profiler'))
{
Profiler::attach();
}

/*
|--------------------------------------------------------------------------
| Enable The Blade View Engine
Expand Down Expand Up @@ -186,4 +202,4 @@
if ( ! Request::cli() and Config::get('session.driver') !== '')
{
Session::load();
}
}
4 changes: 2 additions & 2 deletions app/laravel/asset.php
@@ -1,4 +1,4 @@
<?php namespace Laravel; defined('DS') or die('No direct script access.');
<?php namespace Laravel;

class Asset {

Expand Down Expand Up @@ -107,7 +107,7 @@ public function __construct($name)
* @param string $source
* @param array $dependencies
* @param array $attributes
* @return void
* @return Asset_Container
*/
public function add($name, $source, $dependencies = array(), $attributes = array())
{
Expand Down

0 comments on commit d836c85

Please sign in to comment.