Commit: 32878f4a53bba34d5b48edd55c0a5d645914e2c6

Author: Nate Abele | Date: 2010-08-30 19:42:20 -0400
Cleaning up app bootstrap files, adding documentation about `Auth` to default session file, commenting out `Auth` configuration by default.
diff --git a/app/config/bootstrap/g11n.php b/app/config/bootstrap/g11n.php index b1a28ec..ab9581f 100644 --- a/app/config/bootstrap/g11n.php +++ b/app/config/bootstrap/g11n.php @@ -8,15 +8,15 @@ namespace lithium; -use \lithium\core\Environment; -use \lithium\g11n\Locale; -use \lithium\g11n\Catalog; -use \lithium\g11n\Message; -use \lithium\util\Inflector; -use \lithium\util\Validator; -use \lithium\net\http\Media; -use \lithium\action\Dispatcher as ActionDispatcher; -use \lithium\console\Dispatcher as ConsoleDispatcher; +use lithium\core\Environment; +use lithium\g11n\Locale; +use lithium\g11n\Catalog; +use lithium\g11n\Message; +use lithium\util\Inflector; +use lithium\util\Validator; +use lithium\net\http\Media; +use lithium\action\Dispatcher as ActionDispatcher; +use lithium\console\Dispatcher as ConsoleDispatcher; /** * Sets the default timezone used by all date/time functions. diff --git a/app/config/bootstrap/media.php b/app/config/bootstrap/media.php index a3b6315..bf74cfa 100644 --- a/app/config/bootstrap/media.php +++ b/app/config/bootstrap/media.php @@ -21,7 +21,7 @@ * return $posts->to('json'); * }}} */ -use \lithium\util\Collection; +use lithium\util\Collection; Collection::formats('\lithium\net\http\Media'); @@ -34,9 +34,9 @@ Collection::formats('\lithium\net\http\Media'); * plugin's `webroot` directory into your main application's `webroot` directory, or adding routing * rules in your web server's configuration. */ -use \lithium\action\Dispatcher; -use \lithium\core\Libraries; -use \lithium\net\http\Media; +use lithium\action\Dispatcher; +use lithium\core\Libraries; +use lithium\net\http\Media; Dispatcher::applyFilter('_callable', function($self, $params, $chain) { list($plugin, $asset) = explode('/', $params['request']->url, 2) + array("", ""); diff --git a/app/config/bootstrap/session.php b/app/config/bootstrap/session.php index ffb754a..b57d0b4 100644 --- a/app/config/bootstrap/session.php +++ b/app/config/bootstrap/session.php @@ -20,18 +20,28 @@ Session::config(array( /** * Uncomment this to enable forms-based authentication. The configuration below will attempt to * authenticate users against a `User` model. In a controller, run - * `Auth::check('default', $this->request)` to authenticate a user. This will check + * `Auth::check('default', $this->request)` to authenticate a user. This will check the POST data of + * the request (`lithium\action\Request::$data`) to see if the fields match the `'fields'` key of + * the configuration below. If successful, it will write the data returned from `User::first()` to + * the session using the default session configuration. Once the session data is written, you can + * call `Auth::check('default')` to check authentication status or retrieve the user's data from the + * session. Call `Auth::clear('default')` to remove the user's authentication details from the + * session. This effectively logs a user out of the system. To modify the form input that the + * adapter accepts, or how the configured model is queried, or how the data is stored in the + * session, see the `Form` adapter API or the `Auth` API, respectively. * * @see lithium\security\auth\adapter\Form + * @see lithium\action\Request::$data + * @see lithium\security\Auth */ -use lithium\security\Auth; +// use lithium\security\Auth; -Auth::config(array( - 'default' => array( - 'adapter' => 'Form', - 'model' => 'User', - 'fields' => array('username', 'password') - ) -)); +// Auth::config(array( +// 'default' => array( +// 'adapter' => 'Form', +// 'model' => 'User', +// 'fields' => array('username', 'password') +// ) +// )); ?> \ No newline at end of file