Logs for #cakephp

Page 4 of 36,512, showing 100 records out of 3,651,104 total, starting on record 301, ending on 400

# At Username Text
# Feb 13th, 15:39 alexmax Cake 3.5 btw
# Feb 13th, 15:38 alexmax Without one, I get an error message saying it can't find a template for `checkboxContainer`. Should there be one?
# Feb 13th, 15:37 neon1024 @alexmax Are you giving a custom template string to the Form->setTemplate ?
# Feb 13th, 15:36 alexmax when you want "at least one of these checkboxes"
# Feb 13th, 15:35 alexmax Man I hope I don't have to resort to three separate fields again, validation and error rendering on those is a pain in the neck
# Feb 13th, 15:35 sebastian.krzewinski. i dont get.. do all with docs.. not work.. add 1 line and everything fine
# Feb 13th, 15:35 alexmax Hrm, even when I supply a basic template for `checkboxContainer` the resulting HTML is lacking - the checkboxes are missing labels.
# Feb 13th, 15:33 dereuromark true :) ignore deprecations
# Feb 13th, 15:32 spriz AuthComponent is also still working all good :v:
# Feb 13th, 15:31 dereuromark good old days where you used TinyAuth and 3 lines of config and all worked fine.
# Feb 13th, 15:30 sebastian.krzewinski. im done for today.. this docs not working (auth)
# Feb 13th, 15:27 spriz I like the first one better, and that was the one I have used the most but I've been confused since the 2nd was added :shrug:
# Feb 13th, 15:27 neon1024 Seriously @spriz No idea! :thinking_face: Probably the first option? It’s readable
# Feb 13th, 15:26 dereuromark darn, he was faster
# Feb 13th, 15:26 dereuromark actually, make it a separate class and inject it.
# Feb 13th, 15:26 neon1024 Injected via DI container
# Feb 13th, 15:26 neon1024 Wrap it in a private method too
# Feb 13th, 15:26 neon1024 So I pick option 2
# Feb 13th, 15:25 neon1024 More code means you’re working harder, so you get paid more :pokerface:
# Feb 13th, 15:25 spriz Which one do you use - why? :)
# Feb 13th, 15:24 spriz ``` $this->request = $this->request->withData('foo', 'bar');
# Feb 13th, 14:42 damiano ok
# Feb 13th, 14:40 noel The way I've done that in the past is in AppController... there I check the path in `$_SERVER['REQUEST_URI']` and set a viewVar if it is the home page.
# Feb 13th, 14:38 damiano so i need to find a way to understanrd if it is the home page or not, or maybe i just set('home', 1) inside the index() action and stop
# Feb 13th, 14:38 damiano i must load different classes
# Feb 13th, 14:38 damiano @noel it is a view problem, if it is the home page the header is different
# Feb 13th, 14:37 noel er.. sorry that posted while I was still thinking about it. pls ignore.
# Feb 13th, 14:36 noel @damiano I think you're approaching this in the wrong way. The way I would do that is in the AppController and use it to layout
# Feb 13th, 14:35 alexmax So I've got a question. I don't use `'type' => 'select', 'multiple' => 'checkbox'` with the formHelper terribly often, and I'm getting an error message saying that there is no `checkboxContainer` template. Is this expected? Does CakePHP simply not come with a built-in `checkboxContainer` template? Is that even the correct template for it to grab? Or is this likely something in my app breaking things?
# Feb 13th, 14:35 damiano so basically two different header so i woukld like to check automatically what class i should use looking at the current route/page
# Feb 13th, 14:34 damiano because in the header of my template i have different classes
# Feb 13th, 14:34 damiano then i need a way to understand if the page the user is seeing is the home page or not
# Feb 13th, 14:34 damiano @noel inside a view i need to check if the current route is a specified named route for example i add _name => 'home' inside my routes.php
# Feb 13th, 14:33 noel @damiano I'm not sure I understand your question. What is "Current Page"?
# Feb 13th, 14:30 damiano (inside a view)
# Feb 13th, 14:29 rightscoreanalysis but I think I need to lock down some fields
# Feb 13th, 14:29 rightscoreanalysis as mentioned I have some model methods which check a user is the owner of an entity and isAllowed
# Feb 13th, 14:29 damiano hi guys how can i check if the current page is == named route?
# Feb 13th, 14:28 rightscoreanalysis but the Cake validation class would cover this I believe
# Feb 13th, 14:28 noel You can validate in any way you choose. It's just code at the end of the day.
# Feb 13th, 14:27 rightscoreanalysis I believe you can allow a writ but deny update
# Feb 13th, 14:27 noel Of course.
# Feb 13th, 14:26 rightscoreanalysis ah ok so then the validators could be used i guess to prevent updates of certain fields iirc?
# Feb 13th, 14:26 noel E.g. Does this user have privilege to UPDATE or only INSERT? If it's the latter then it's not a valid request.
# Feb 13th, 14:26 noel Well of course if it's a valid request then you don't want to prevent it. The trick is determining what makes it an invalid request and coding that into your validators.
# Feb 13th, 14:25 rightscoreanalysis but if they mock a valid requst I don't see how it can be prevented
# Feb 13th, 14:23 noel @rightscoreanalysis You have to validate each request. That's down to your business rules.
# Feb 13th, 14:23 rightscoreanalysis I then post to Model to update the price paid
# Feb 13th, 14:22 rightscoreanalysis Or a simple example - I make a purchase for price X
# Feb 13th, 14:22 rightscoreanalysis I have checks to ensure the User is allowed to edit the model - for example they should be the owner....
# Feb 13th, 14:21 noel @rightscoreanalysis you can't. You have to limit their privileges based on their user type. But you can't stop them doing something they are authorised to do. What would be the point?
# Feb 13th, 14:21 challgren @rightscoreanalysis https://book.cakephp.org/4/en/controllers/components/security.html
# Feb 13th, 14:21 rightscoreanalysis @noel yes I see your point. So how can we prevent soemone who is authorised from posting to the backend?
# Feb 13th, 14:18 challgren No that really depends on your requirements what you have protected and what you dont
# Feb 13th, 14:18 sebastian.krzewinski. its something wrong?
# Feb 13th, 14:17 challgren If thats what you want.
# Feb 13th, 14:17 sebastian.krzewinski. but only for home and pages
# Feb 13th, 14:17 sebastian.krzewinski. i think about this: $this->Authentication->addUnauthenticatedActions(['index', 'view']);
# Feb 13th, 14:16 challgren @sebastian.krzewinski. see https://book.cakephp.org/4/en/tutorials-and-examples/cms/authentication.html near `In your UsersController, add the following code:`
# Feb 13th, 14:14 noel @rightscoreanalysis for that to happen, the authorised use would be the hacker and would be hacking his own session... which isn't what CSRF protection is designed to prevent.
# Feb 13th, 14:07 sebastian.krzewinski. how to create login to /admin not only form funcions like add edit
# Feb 13th, 13:50 sebastian.krzewinski. good to know
# Feb 13th, 13:50 challgren It will be more updated than a pdf you save
# Feb 13th, 13:50 challgren Use the website
# Feb 13th, 13:49 sebastian.krzewinski. copying from pdf doc is terrible
# Feb 13th, 13:49 sebastian.krzewinski. ok i see
# Feb 13th, 13:48 challgren @sebastian.krzewinski. need a space there
# Feb 13th, 13:47 sebastian.krzewinski. he?
# Feb 13th, 13:47 sebastian.krzewinski. https://i.imgur.com/6UMRZKi.png
# Feb 13th, 13:46 rightscoreanalysis I am using the CRUD plugin, the book recommends to protect against csfr for ajax requests by adding the token found in the hidden field of the form to the request header. But what is to stop someone uo to no good from viewing the ource of the form and copying the token and adding it to a request in something liek Postman - I don't see how the request is not open to anyone with the token? Also what about get requests which do not
# Feb 13th, 13:46 slackebot have a form?
# Feb 13th, 12:36 sebastian.krzewinski. now i figured how is work connection controller with actions and if i link a button with simply action like "add" there will be working everywhere
# Feb 13th, 12:31 sebastian.krzewinski. i know i know. its stupid for you but still learning this framework
# Feb 13th, 12:30 noel Any idea what's causing this: ```Aura\Intl\Exception: Package 'cake' with locale 'en_US' is not registered. in /vendor/aura/intl/src/Aura/Intl/PackageLocator.php```
# Feb 13th, 12:22 challgren Is it a remote? I have ones of those!
# Feb 13th, 12:18 slackebot Action: admad wonders what the "universal button" does, is it as powerful as Thanos' snap?
# Feb 13th, 11:52 pieceof thx sz
# Feb 13th, 11:52 sebastian.krzewinski. @dereuromark i solved it
# Feb 13th, 11:52 dereuromark I never use the magic methods, they kill all IDE support^^
# Feb 13th, 11:52 neon1024 @pieceof Just append `->select()`?
# Feb 13th, 11:52 dereuromark @sebastian.krzewinski. what is a universal button?
# Feb 13th, 11:51 pieceof is it posible to add fields[] to ```$users->findTrollsByUsername('bro');``` by design ?
# Feb 13th, 11:46 sebastian.krzewinski. I have a question, there is possible to do universal button from add funcion?
# Feb 13th, 11:36 damiano yeah i found them too (soyoustart)
# Feb 13th, 11:36 admad @damiano if you are in EU OVH has cheap VPS with free Plesk
# Feb 13th, 11:30 damiano thanks @javier.villanueva
# Feb 13th, 11:27 javier.villanueva I recommend you https://uberspace.de/en/
# Feb 13th, 11:17 damiano it is a website, it is not for dev purpose
# Feb 13th, 11:16 damiano @dereuromark yeah it must run 24/7
# Feb 13th, 11:16 damiano thanks @challgren i am looking at their website
# Feb 13th, 11:16 conehead Getting 500..not even receiving a `die("foo")` from the index.php file. When removing the last rewrite rule, I can see the die message
# Feb 13th, 11:15 conehead ```<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^(\.well-known/.*)$ $1 [L] RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule>```
# Feb 13th, 11:15 dereuromark heroku is free if you dont need 24/7 uptime
# Feb 13th, 11:14 challgren knownhost.com is who I use
# Feb 13th, 11:14 challgren @damiano I have my own VPS that runs cPanel
# Feb 13th, 11:14 damiano guys, i know i am off-topic but ...please...help me :) i am looking for dedicated (cheap) server to run a cakephp application. Where do you run your application?
# Feb 13th, 11:13 challgren mod_rewrite installed?
# Feb 13th, 11:13 conehead Hm...this kills my cake project on a new server in the htaccess file. Everything is working fine on a different server ``` RewriteRule (.*) webroot/$1 [L]```
# Feb 13th, 11:12 challgren Yep you can
# Feb 13th, 11:09 sebastian.krzewinski. i just need controllers from /controllers/admin