Skip to content

Commit

Permalink
Merge remote branch 'origin/1.3' into 2.0
Browse files Browse the repository at this point in the history
Conflicts:
	cake/console/libs/shell.php
	cake/libs/controller/components/acl.php
	cake/libs/controller/components/auth.php
	cake/libs/controller/components/email.php
	cake/libs/controller/components/security.php
	cake/libs/controller/components/session.php
	cake/libs/view/helper.php
	cake/libs/view/helpers/form.php
	cake/libs/view/helpers/html.php
	cake/libs/view/helpers/number.php
	cake/libs/view/helpers/session.php
	cake/libs/view/helpers/text.php
	cake/libs/view/helpers/time.php
	cake/libs/view/helpers/xml.php
  • Loading branch information
predominant committed Apr 6, 2010
2 parents 51d71b4 + 518cab9 commit e4d292b
Show file tree
Hide file tree
Showing 27 changed files with 358 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cake/console/libs/shell.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ protected function _singularHumanName($name) {
* @return string Plural human name
*/
protected function _pluralHumanName($name) {
return Inflector::humanize(Inflector::underscore(Inflector::pluralize($name)));
return Inflector::humanize(Inflector::underscore($name));
}

/**
Expand Down
4 changes: 4 additions & 0 deletions cake/libs/controller/components/acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*
* @package cake
* @subpackage cake.cake.libs.controller.components
* @link http://book.cakephp.org/view/1242/Access-Control-Lists
*/
class AclComponent extends Object {

Expand Down Expand Up @@ -245,6 +246,7 @@ public function initialize(&$component) {
* @param string $aco ACO The controlled object identifier.
* @param string $action Action (defaults to *)
* @return boolean Success (true if ARO has access to action in ACO, false otherwise)
* @link http://book.cakephp.org/view/1249/Checking-Permissions-The-ACL-Component
*/
public function check($aro, $aco, $action = "*") {
if ($aro == null || $aco == null) {
Expand Down Expand Up @@ -335,6 +337,7 @@ public function check($aro, $aco, $action = "*") {
* @param string $actions Action (defaults to *)
* @param integer $value Value to indicate access type (1 to give access, -1 to deny, 0 to inherit)
* @return boolean Success
* @link http://book.cakephp.org/view/1248/Assigning-Permissions
*/
public function allow($aro, $aco, $actions = "*", $value = 1) {
$perms = $this->getAclLink($aro, $aco);
Expand Down Expand Up @@ -385,6 +388,7 @@ public function allow($aro, $aco, $actions = "*", $value = 1) {
* @param string $aco ACO The controlled object identifier.
* @param string $actions Action (defaults to *)
* @return boolean Success
* @link http://book.cakephp.org/view/1248/Assigning-Permissions
*/
public function deny($aro, $aco, $action = "*") {
return $this->allow($aro, $aco, $action, -1);
Expand Down
25 changes: 25 additions & 0 deletions cake/libs/controller/components/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*
* @package cake
* @subpackage cake.cake.libs.controller.components
* @link http://book.cakephp.org/view/1250/Authentication
*/
class AuthComponent extends Object {

Expand All @@ -53,6 +54,7 @@ class AuthComponent extends Object {
*
* @var object
* @access public
* @link http://book.cakephp.org/view/1278/authenticate
*/
public $authenticate = null;

Expand All @@ -66,6 +68,7 @@ class AuthComponent extends Object {
*
* @var mixed
* @access public
* @link http://book.cakephp.org/view/1275/authorize
*/
public $authorize = false;

Expand All @@ -75,6 +78,7 @@ class AuthComponent extends Object {
*
* @var string
* @access public
* @link http://book.cakephp.org/view/1277/ajaxLogin
*/
public $ajaxLogin = null;

Expand All @@ -91,6 +95,7 @@ class AuthComponent extends Object {
*
* @var string
* @access public
* @link http://book.cakephp.org/view/1266/userModel
*/
public $userModel = 'User';

Expand All @@ -100,6 +105,7 @@ class AuthComponent extends Object {
*
* @var array
* @access public
* @link http://book.cakephp.org/view/1268/userScope
*/
public $userScope = array();

Expand All @@ -109,6 +115,7 @@ class AuthComponent extends Object {
*
* @var array
* @access public
* @link http://book.cakephp.org/view/1267/fields
*/
public $fields = array('username' => 'username', 'password' => 'password');

Expand All @@ -118,6 +125,7 @@ class AuthComponent extends Object {
*
* @var string
* @access public
* @link http://book.cakephp.org/view/1276/sessionKey
*/
public $sessionKey = null;

Expand All @@ -129,6 +137,7 @@ class AuthComponent extends Object {
*
* @var string
* @access public
* @link http://book.cakephp.org/view/1279/actionPath
*/
public $actionPath = null;

Expand All @@ -138,6 +147,7 @@ class AuthComponent extends Object {
*
* @var mixed
* @access public
* @link http://book.cakephp.org/view/1269/loginAction
*/
public $loginAction = null;

Expand All @@ -149,6 +159,7 @@ class AuthComponent extends Object {
*
* @var mixed
* @access public
* @link http://book.cakephp.org/view/1270/loginRedirect
*/
public $loginRedirect = null;

Expand All @@ -161,6 +172,7 @@ class AuthComponent extends Object {
* @access public
* @see AuthComponent::$loginAction
* @see AuthComponent::logout()
* @link http://book.cakephp.org/view/1271/logoutRedirect
*/
public $logoutRedirect = null;

Expand All @@ -178,6 +190,7 @@ class AuthComponent extends Object {
*
* @var string
* @access public
* @link http://book.cakephp.org/view/1272/loginError
*/
public $loginError = null;

Expand All @@ -187,6 +200,7 @@ class AuthComponent extends Object {
*
* @var string
* @access public
* @link http://book.cakephp.org/view/1273/authError
*/
public $authError = null;

Expand All @@ -195,6 +209,7 @@ class AuthComponent extends Object {
*
* @var boolean
* @access public
* @link http://book.cakephp.org/view/1274/autoRedirect
*/
public $autoRedirect = true;

Expand All @@ -204,6 +219,7 @@ class AuthComponent extends Object {
* @var array
* @access public
* @see AuthComponent::allow()
* @link http://book.cakephp.org/view/1251/Setting-Auth-Component-Variables
*/
public $allowedActions = array();

Expand Down Expand Up @@ -586,6 +602,7 @@ function __authType($auth = null) {
* @param string $action Controller action name
* @param string ... etc.
* @return void
* @link http://book.cakephp.org/view/1257/allow
*/
public function allow() {
$args = func_get_args();
Expand All @@ -607,6 +624,7 @@ public function allow() {
* @param string ... etc.
* @return void
* @see AuthComponent::allow()
* @link http://book.cakephp.org/view/1258/deny
*/
public function deny() {
$args = func_get_args();
Expand All @@ -627,6 +645,7 @@ public function deny() {
*
* @param array $map Actions to map
* @return void
* @link http://book.cakephp.org/view/1260/mapActions
*/
public function mapActions($map = array()) {
$crud = array('create', 'read', 'update', 'delete');
Expand All @@ -651,6 +670,7 @@ public function mapActions($map = array()) {
*
* @param mixed $data User object
* @return boolean True on login success, false on failure
* @link http://book.cakephp.org/view/1261/login
*/
public function login($data = null) {
$this->__setDefaults();
Expand All @@ -673,6 +693,7 @@ public function login($data = null) {
* @param mixed $url Optional URL to redirect the user to after logout
* @return string AuthComponent::$loginAction
* @see AuthComponent::$loginAction
* @link http://book.cakephp.org/view/1262/logout
*/
public function logout() {
$this->__setDefaults();
Expand All @@ -687,6 +708,7 @@ public function logout() {
*
* @param string $key field to retrive. Leave null to get entire User record
* @return mixed User record. or null if no user is logged in.
* @link http://book.cakephp.org/view/1264/user
*/
public function user($key = null) {
$this->__setDefaults();
Expand Down Expand Up @@ -758,6 +780,7 @@ public function validate($object, $user = null, $action = null) {
* user against. The current request action is used if
* none is specified.
* @return boolean ACO node path
* @link http://book.cakephp.org/view/1256/action
*/
public function action($action = ':plugin/:controller/:action') {
$plugin = empty($this->params['plugin']) ? null : Inflector::camelize($this->params['plugin']) . '/';
Expand Down Expand Up @@ -877,6 +900,7 @@ public function identify($user = null, $conditions = null) {
*
* @param array $data Set of data to look for passwords
* @return array Data with passwords hashed
* @link http://book.cakephp.org/view/1259/hashPasswords
*/
public function hashPasswords($data) {
if (is_object($this->authenticate) && method_exists($this->authenticate, 'hashPasswords')) {
Expand All @@ -897,6 +921,7 @@ public function hashPasswords($data) {
*
* @param string $password Password to hash
* @return string Hashed password
* @link http://book.cakephp.org/view/1263/password
*/
public function password($password) {
return Security::hash($password, null, true);
Expand Down
1 change: 1 addition & 0 deletions cake/libs/controller/components/cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*
* @package cake
* @subpackage cake.cake.libs.controller.components
* @link http://book.cakephp.org/view/1280/Cookies
*
*/
class CookieComponent extends Object {
Expand Down
3 changes: 3 additions & 0 deletions cake/libs/controller/components/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*
* @package cake
* @subpackage cake.cake.libs.controller.components
* @link http://book.cakephp.org/view/1283/Email
*
*/
class EmailComponent extends Object{
Expand Down Expand Up @@ -225,6 +226,7 @@ class EmailComponent extends Object{
*
* @var array
* @access public
* @link http://book.cakephp.org/view/1290/Sending-A-Message-Using-SMTP
*/
public $smtpOptions = array(
'port'=> 25, 'host' => 'localhost', 'timeout' => 30
Expand Down Expand Up @@ -386,6 +388,7 @@ public function send($content = null, $template = null, $layout = null) {
/**
* Reset all EmailComponent internal variables to be able to send out a new email.
*
* @link http://book.cakephp.org/view/1285/Sending-Multiple-Emails-in-a-loop
*/
public function reset() {
$this->template = null;
Expand Down
1 change: 1 addition & 0 deletions cake/libs/controller/components/request_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*
* @package cake
* @subpackage cake.cake.libs.controller.components
* @link http://book.cakephp.org/view/1291/Request-Handling
*
*/
class RequestHandlerComponent extends Object {
Expand Down
10 changes: 10 additions & 0 deletions cake/libs/controller/components/security.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*
* @package cake
* @subpackage cake.cake.libs.controller.components
* @link http://book.cakephp.org/view/1296/Security-Component
*/
class SecurityComponent extends Object {

Expand Down Expand Up @@ -212,6 +213,7 @@ public function startup(&$controller) {
* Sets the actions that require a POST request, or empty for all actions
*
* @return void
* @link http://book.cakephp.org/view/1299/requirePost
*/
public function requirePost() {
$args = func_get_args();
Expand Down Expand Up @@ -252,6 +254,7 @@ public function requireDelete() {
* Sets the actions that require a request that is SSL-secured, or empty for all actions
*
* @return void
* @link http://book.cakephp.org/view/1300/requireSecure
*/
public function requireSecure() {
$args = func_get_args();
Expand All @@ -262,6 +265,7 @@ public function requireSecure() {
* Sets the actions that require an authenticated request, or empty for all actions
*
* @return void
* @link http://book.cakephp.org/view/1301/requireAuth
*/
public function requireAuth() {
$args = func_get_args();
Expand All @@ -272,6 +276,7 @@ public function requireAuth() {
* Sets the actions that require an HTTP-authenticated request, or empty for all actions
*
* @return void
* @link http://book.cakephp.org/view/1302/requireLogin
*/
public function requireLogin() {
$args = func_get_args();
Expand All @@ -296,6 +301,7 @@ public function requireLogin() {
*
* @param string $type Either 'basic', 'digest', or null. If null/empty, will try both.
* @return mixed If successful, returns an array with login name and password, otherwise null.
* @link http://book.cakephp.org/view/1303/loginCredentials-string-type
*/
public function loginCredentials($type = null) {
switch (strtolower($type)) {
Expand Down Expand Up @@ -334,6 +340,7 @@ public function loginCredentials($type = null) {
*
* @param array $options Set of options for header
* @return string HTTP-authentication request header
* @link http://book.cakephp.org/view/1304/loginRequest-array-options
*/
public function loginRequest($options = array()) {
$options = array_merge($this->loginOptions, $options);
Expand All @@ -355,6 +362,7 @@ public function loginRequest($options = array()) {
*
* @param string $digest Digest authentication response
* @return array Digest authentication parameters
* @link http://book.cakephp.org/view/1305/parseDigestAuthData-string-digest
*/
public function parseDigestAuthData($digest) {
if (substr($digest, 0, 7) == 'Digest ') {
Expand Down Expand Up @@ -383,6 +391,7 @@ public function parseDigestAuthData($digest) {
* @return string Digest authentication hash
* @access public
* @see SecurityComponent::parseDigestAuthData()
* @link http://book.cakephp.org/view/1306/generateDigestResponseHash-array-data
*/
function generateDigestResponseHash($data) {
return md5(
Expand All @@ -401,6 +410,7 @@ function generateDigestResponseHash($data) {
* @return mixed If specified, controller blackHoleCallback's response, or no return otherwise
* @access public
* @see SecurityComponent::$blackHoleCallback
* @link http://book.cakephp.org/view/1307/blackHole-object-controller-string-error
*/
function blackHole(&$controller, $error = '') {
if ($this->blackHoleCallback == null) {
Expand Down

0 comments on commit e4d292b

Please sign in to comment.