Cake 3 Cookie - not persistent
Hello, I think I must be missing something simple. On just a simple view action in the controller: $this-loadComponent('Cookie'); $this-Cookie-config('path', '/'); $this-Cookie-config([ 'expires' = '+10 days', 'httpOnly' = true ]); $this-Cookie-write('name', 'Larry'); echo $this-Cookie-read('name'); This works and displays the value. However after commenting out the 7th line that writes the value and then a refresh, nothing is displayed. What am I missing?? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: CakePHP 2.6.6 and 3.0.6 Released (security fixes)
Earlier today, we announced the release of 2.6.6. This version contained a syntax error in PHP 5.4. This error has been corrected in 2.6.7. If you are running PHP 5.4.0 you should upgrade to 2.6.7 instead of 2.6.6. In doing the security release, I did not follow our normal process of ensuring that there is a passing build on all supported PHP versions before doing the release. This was a mistake and will not happen again. On Thursday, 28 May 2015 11:57:53 UTC-4, mark_story wrote: The CakePHP core team is ready to announce the immediate availability of CakePHP 2.6.6 and 3.0.6. These are maintenance releases that contain important security fixes. ## Security Fixes Earlier this week we were notified that RequestHandlerComponent had a vulnerability that would allow well crafted requests to create a denial of service attack. RequestHandlerComponent leverages `Xml::build()` which allows reading local files. We recommend that all applications using RequestHandlerComponent upgrade, or disable parsing XML payloads. To disable XML payload parsing you can do the following ```php // In a controller's beforeFilter $this-RequestHandler-addInputType('xml', function() { return []; }); ``` The above code will replace the built-in XML parsing with a no-op function. We'd like to thank Takeshi Terada for notifying us of this security issue using our [Security Issue Process] ( http://book.cakephp.org/3.0/en/contributing/tickets.html#reporting-security-issues ). ## Other Fixes in 2.6.6 * `FormHelper::radio()` now correctly generates ID attributes for radio buttons with multibyte values. * `Inflector::humanize()` and `Inflector::underscore()` work correctly with UTF8 characters now. ## Other Fixes in 3.0.6 * `FormHelper::radio()` now correctly generates ID attributes for radio buttons with multibyte values. * `Inflector::humanize()` and `Inflector::underscore()` work correctly with UTF8 characters now. * URLs in `FormHelper::postLink()` are no longer double encoded. * `PaginatorHelper::numbers()` now supports the `url` option. * Error.trace is now respected when logging exceptions. * The Entity accessors cache introduced in 3.0.3 has been removed. It caused a number of issues and didn't greatly improve performance. * `EntityTrait::getOriginal()` and `EntityTrait::extractOriginal()` now return values that were initially null. * Empty query expressions used in association query builders no longer cause invalid SQL to be generated. As always, a huge thanks to all the community members that helped make this release happen by reporting issues and sending pull requests. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
How to set Authorization wise view in the Form in CakePHP-3.0
Hi All, I want to set an authorization in the registration of a form using CakePHP 3.0. Before asking here, i tried below things but no luck in my favor. Suppose i have role field in the usersTable like 'superuser', 'admin', 'user'. I want to provide permission superuser to make all the things like create admin and user. and then admin can create admin and user, and user can make user only. The code i tried in the add function of UsersController. if($this-Auth-user['role'] === 'superuser'){ $roles = $this-Users-find('list'); } elseif ($this-Auth-user['role'] === 'admin') { $roles = $this-Users-find('list')-where(['Users.role !==' = 'superuser']); } else { $roles = $this-Users-find('list')-where(['Users.role' = 'user']); } after failing i tried below things in the add.ctp if(!empty($this-request-session()-check('Auth.User.role') === 'superadmin')){ echo $this-Form-input('role',['options' = ['admin' = 'Admin', 'user' = 'User']]); } elseif(!empty($this-request-session()-check('Auth.User.role') === 'admin')){ echo $this-Form-input('role',['options' = ['user' = 'User', 'icr' = 'ICR', 'routing' = 'Routing']]); } else { echo $this-Form-input('role', ['options' = ['user' = 'User']]); } Could you please suggest on this regard or are there any easiest ways to do so? http://stackoverflow.com/questions/30487160/how-to-set-authorization-wise-view-in-the-form-in-cakephp-3-0 Thanks Bayezid -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: How to set Authorization wise view in the Form in CakePHP-3.0
check() and comparison is really a bad idea the first returns bool, how should that ever === to a string? wrapping that with !empty() makes this completely wrong if(!empty($this-request-session()-check('Auth.User.role') === 'superadmin')){ Try if ($this-request-session()-read('Auth.User.role') === 'superadmin') {} instead Am Donnerstag, 28. Mai 2015 15:54:47 UTC+2 schrieb Bayezid Alam: Hi All, I want to set an authorization in the registration of a form using CakePHP 3.0. Before asking here, i tried below things but no luck in my favor. Suppose i have role field in the usersTable like 'superuser', 'admin', 'user'. I want to provide permission superuser to make all the things like create admin and user. and then admin can create admin and user, and user can make user only. The code i tried in the add function of UsersController. if($this-Auth-user['role'] === 'superuser'){ $roles = $this-Users-find('list'); } elseif ($this-Auth-user['role'] === 'admin') { $roles = $this-Users-find('list')-where(['Users.role !==' = 'superuser']); } else { $roles = $this-Users-find('list')-where(['Users.role' = 'user']); } after failing i tried below things in the add.ctp if(!empty($this-request-session()-check('Auth.User.role') === 'superadmin')){ echo $this-Form-input('role',['options' = ['admin' = 'Admin', 'user' = 'User']]); } elseif(!empty($this-request-session()-check('Auth.User.role') === 'admin')){ echo $this-Form-input('role',['options' = ['user' = 'User', 'icr' = 'ICR', 'routing' = 'Routing']]); } else { echo $this-Form-input('role', ['options' = ['user' = 'User']]); } Could you please suggest on this regard or are there any easiest ways to do so? http://stackoverflow.com/questions/30487160/how-to-set-authorization-wise-view-in-the-form-in-cakephp-3-0 Thanks Bayezid -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
CakePHP 2.6.6 and 3.0.6 Released (security fixes)
The CakePHP core team is ready to announce the immediate availability of CakePHP 2.6.6 and 3.0.6. These are maintenance releases that contain important security fixes. ## Security Fixes Earlier this week we were notified that RequestHandlerComponent had a vulnerability that would allow well crafted requests to create a denial of service attack. RequestHandlerComponent leverages `Xml::build()` which allows reading local files. We recommend that all applications using RequestHandlerComponent upgrade, or disable parsing XML payloads. To disable XML payload parsing you can do the following ```php // In a controller's beforeFilter $this-RequestHandler-addInputType('xml', function() { return []; }); ``` The above code will replace the built-in XML parsing with a no-op function. We'd like to thank Takeshi Terada for notifying us of this security issue using our [Security Issue Process] (http://book.cakephp.org/3.0/en/contributing/tickets.html#reporting-security-issues). ## Other Fixes in 2.6.6 * `FormHelper::radio()` now correctly generates ID attributes for radio buttons with multibyte values. * `Inflector::humanize()` and `Inflector::underscore()` work correctly with UTF8 characters now. ## Other Fixes in 3.0.6 * `FormHelper::radio()` now correctly generates ID attributes for radio buttons with multibyte values. * `Inflector::humanize()` and `Inflector::underscore()` work correctly with UTF8 characters now. * URLs in `FormHelper::postLink()` are no longer double encoded. * `PaginatorHelper::numbers()` now supports the `url` option. * Error.trace is now respected when logging exceptions. * The Entity accessors cache introduced in 3.0.3 has been removed. It caused a number of issues and didn't greatly improve performance. * `EntityTrait::getOriginal()` and `EntityTrait::extractOriginal()` now return values that were initially null. * Empty query expressions used in association query builders no longer cause invalid SQL to be generated. As always, a huge thanks to all the community members that helped make this release happen by reporting issues and sending pull requests. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: How to set Authorization wise view in the Form in CakePHP-3.0
Thanks a lot. its working now. Is there any other easiest way to do so? On Thu, May 28, 2015 at 8:50 PM, euromark dereurom...@gmail.com wrote: check() and comparison is really a bad idea the first returns bool, how should that ever === to a string? wrapping that with !empty() makes this completely wrong if(!empty($this-request-session()-check('Auth.User.role') === 'superadmin')){ Try if ($this-request-session()-read('Auth.User.role') === 'superadmin') {} instead Am Donnerstag, 28. Mai 2015 15:54:47 UTC+2 schrieb Bayezid Alam: Hi All, I want to set an authorization in the registration of a form using CakePHP 3.0. Before asking here, i tried below things but no luck in my favor. Suppose i have role field in the usersTable like 'superuser', 'admin', 'user'. I want to provide permission superuser to make all the things like create admin and user. and then admin can create admin and user, and user can make user only. The code i tried in the add function of UsersController. if($this-Auth-user['role'] === 'superuser'){ $roles = $this-Users-find('list'); } elseif ($this-Auth-user['role'] === 'admin') { $roles = $this-Users-find('list')-where(['Users.role !==' = 'superuser']); } else { $roles = $this-Users-find('list')-where(['Users.role' = 'user']); } after failing i tried below things in the add.ctp if(!empty($this-request-session()-check('Auth.User.role') === 'superadmin')){ echo $this-Form-input('role',['options' = ['admin' = 'Admin', 'user' = 'User']]); } elseif(!empty($this-request-session()-check('Auth.User.role') === 'admin')){ echo $this-Form-input('role',['options' = ['user' = 'User', 'icr' = 'ICR', 'routing' = 'Routing']]); } else { echo $this-Form-input('role', ['options' = ['user' = 'User']]); } Could you please suggest on this regard or are there any easiest ways to do so? http://stackoverflow.com/questions/30487160/how-to-set-authorization-wise-view-in-the-form-in-cakephp-3-0 Thanks Bayezid -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.