Logs for #cakephp

Page 2 of 36,196, showing 100 records out of 3,619,517 total, starting on record 101, ending on 200

# At Username Text
# Yesterday, 11:37 neon1024 @davorminchorov Just for balance I’m the total opposite of @acosonic and would never setup my own mail server for sending email, and would instead use a service like Sendgrid
# Yesterday, 11:36 acosonic @davorminchorov anything that you have full control and responsibility of... If it's mail server, then it means making your own stmp, and ensuring it gets 10/10 on mail-tester.com ...
# Yesterday, 11:35 neon1024 When unit testing, do I have to declare a schema for a table? It seems to be missing, but I am not mocking the table class, and I’m using a fixture
# Yesterday, 11:35 acosonic I guess that you would need some kind of log analyser to ensure google did it's part
# Yesterday, 11:35 davorminchorov what would you suggest for enterprise?
# Yesterday, 11:34 acosonic for enterprise use...
# Yesterday, 11:34 acosonic including gmail...
# Yesterday, 11:34 acosonic @davorminchorov I'm avoiding cloud anything, at all costs :)
# Yesterday, 11:33 acosonic @conehead first solution worked
# Yesterday, 11:33 davorminchorov Anyone ever had issues sending emails via Gmail from their apps where there were connection timeouts from time to time in some cases? Is this possible to fix somehow?
# Yesterday, 11:21 conehead Or you could make that default array static. Then you could access it via EmailConfig::default
# Yesterday, 11:20 acosonic I'll test with var-dumping...
# Yesterday, 11:20 conehead You need to instantiate that class if you want to get the data. (new EmailConfig())->default;
# Yesterday, 11:19 neon1024 Would be my first guess
# Yesterday, 11:19 neon1024 `$Email->getConfig()`
# Yesterday, 11:08 acosonic Hi everyone, how can I read data from class EmailConfig { public $default = array( Should I somehow include that class? I want to get values from within default array...
# Yesterday, 10:58 neon1024 If you need to assign to a protected property
# Yesterday, 10:58 neon1024 I think you can also modify the property as part of either save() or patchEntity(), I don’t recall which one
# Yesterday, 10:57 neon1024 You could just add the property to your extending entity
# Yesterday, 10:37 mikemack protected function _setRole($value) { $this->set($value, ['role' => false]); }
# Yesterday, 10:35 mikemack Work with cakedc user plugin. I modify the user table, and follow https://github.com/CakeDC/users/blob/master/Docs/Documentation/Extending-the-Plugin.md#extending-the-model-tableentity And on the MyUser Entity, how to disable the
# Yesterday, 10:27 dereuromark not sure, arent there still cases where you - without fields list - would be allowed to mass assign then too much? I just use explicit fields always here.
# Yesterday, 10:23 conehead Yes sure. Was just thinking about how to do it without editing the whitelist every time I add a property. Depending @felix.robaglia problem It should be possible to set the `$_accessible` `role => false` and before patching the entity in the controller you check if the current user has the rights to change the role. If yes, you could make that field accessible. ``` $data = $this->getRequest()->getData(); // allow to update role if current
# Yesterday, 10:23 slackebot user is admin if ($user->isAdmin()) { $userToUpdate->accessible('role, true); } // proceed as usual $this->Users->patchEntity($userToUpdate, $data) ``` You think this would be a suitable solution?
# Yesterday, 10:09 dereuromark in general a whitelist is usually always safer than blacklists.
# Yesterday, 10:08 dereuromark no, that is all cachd.
# Yesterday, 10:07 conehead Hm schema by accessing the database? This could allow values that are restricted via `accessible`
# Yesterday, 09:23 dereuromark i might have made a convienience method for this in tools or shim plugin maybe
# Yesterday, 09:23 dereuromark you could using schema
# Yesterday, 09:21 conehead @dereuromark is there a way to set "fields" to "allFieldsExcept"? Or do I always need to list all the properties by hand? Documentation looks like I can only set fields that should be patches.
# Yesterday, 08:57 felix.robaglia Sure, will do !
# Yesterday, 08:54 aivaras.godliauskas @felix.robaglia shere your progress. Im interesed in this topic as well:)
# Yesterday, 08:53 felix.robaglia Thanks for the help i'll see what i can do
# Yesterday, 08:52 dereuromark Also check TinyAuth maybe in terms of DRY and secure ways to easily handle all of this. Make sure you use "fields" key always where you allow users to edit any user data and that role is never part of it for "crud editing" here.
# Yesterday, 08:51 dereuromark this is usually persisted into the session Auth.User data when writing login data
# Yesterday, 08:51 felix.robaglia I see :slightly_smiling_face: I already do that kind of redirects also
# Yesterday, 08:50 dereuromark if you do your login and user update actions (edit) correctly, all is save here
# Yesterday, 08:49 aivaras.godliauskas in my case, im checking if user can access current scope, before letting him there. For example if user has access to *users/edit* otherwise redirect him somewhere he belongs.
# Yesterday, 08:47 aivaras.godliauskas or maybe define('role', 'admin') somwhere in app controller? so u can access status globaly?
# Yesterday, 08:46 aivaras.godliauskas hmm not sure about best strategy, but you can have a variable, lets say ```$is_admin``` in entity. and pass it before update. $entity->setIsAdmin(true/false)
# Yesterday, 08:44 felix.robaglia ``` protected function _setRole() { if (!($this->Auth->user('role') === 'admin')) { return $this->Auth->user('role'); } } ```
# Yesterday, 08:44 felix.robaglia I thought I could do something like this, but I don't have access to Auth in Entity/User.php. Any ideas how I could accomplish this ?
# Yesterday, 08:26 felix.robaglia I meant User entity.
# Yesterday, 08:26 felix.robaglia I think I found a way using _setRole in UsersTable. Thanks :slightly_smiling_face:
# Yesterday, 08:14 challgren if ($user->isAdmin) { $role = “html for input type”; }
# Yesterday, 08:13 felix.robaglia Cause even though they shouldn't be able to, i'm always scared they add a input manually to the dom connected to role and change it to become admin
# Yesterday, 08:13 felix.robaglia Hello, what is the easiest way to tell Cake : 'Users that aren't 'admin' can't modify the 'role' column" ?
# Yesterday, 08:12 dereuromark The delete ajax thingie worked quite well for now to roll out on all paginated tables.
# Yesterday, 08:12 dereuromark I think in 3.x/4.x it should be rather easy to generate some more generic tooling that easily injects itself here, or provides some skeleton around these tasks. too much manual is not DRY IMO^^
# Yesterday, 08:09 challgren As for AJAX, autocomplete, edit in place I kind of do that manually and dont depend on a plugin
# Yesterday, 08:09 challgren @dereuromark DataTables is the only one that comes to mind
# Yesterday, 08:08 dereuromark Do people have easy to use plugins/code around AJAX and auto-complete, edit-in-place etc?
# Yesterday, 08:06 challgren Yep https://book.cakephp.org/3.0/en/orm/query-builder.html#passing-conditions-to-contain
# Yesterday, 08:06 scuadra Is this possible in Cake3?
# Yesterday, 08:05 scuadra Hello. As long as I remember in Cake 2 find it was possible to do something like 'contain' => ['Images' => ['limit' => 1]]
# Yesterday, 08:01 neon1024 Morning all
# Yesterday, 07:58 val Hi, is there a way to disable one specific cache configuration in 3.x?
# Yesterday, 07:03 welo.lamacchia but this code: $this->request->getCookie($cookieName) return null
# Yesterday, 07:03 welo.lamacchia i think it's work, chrome network panel showing the cookie just created
# Yesterday, 07:00 welo.lamacchia i have also to return the response?
# Yesterday, 06:59 admad you need to assign back the instance `$this->response = $this->response->withCookie($cookie);`
# Yesterday, 06:57 welo.lamacchia Cake does not save cookie, what is wrong?
# Yesterday, 06:47 ajibarra If you want to override the view you need to create src/Template/Plugin/CakeDC/Users/Users/profile.ctp
# Yesterday, 06:46 ajibarra because the user is sent to view layer including any contain in configuration..and if you need something more specific you can always override get method in your users table (in case you have one)
# Yesterday, 06:45 ajibarra You can just override the view
# Yesterday, 05:40 joey.mukherjee I am using the CakeDC/Users plugin and I want to override the cakedc/users/src/Controller/Traits/ProfileTrait.php file and add in some more fields to send to profile. How would I do that?
# Yesterday, 01:09 niel45 Then I have no suggestions. I don't do Windows any more
# Yesterday, 01:09 FueripoDesu I'm using an IIS on Windows Server, and the folder is in a shared folder of the network... but it's open for the internal network.
# Yesterday, 01:07 niel45 so on Debian or deriviatives the location would need either user or group to be accessible for www-data
# Yesterday, 01:07 niel45 check the location you are trying to put to has permissions for the www server
# Yesterday, 01:05 FueripoDesu Hello, can anybody help me, I'm having a "failed to open stream: Permission denied" in a controller that I'm trying to "file_put_contents"... where do I have to set permission for this?
# Jul 17th, 22:22 dereuromark Yeah, AJAX delete is now working without the need to modify baked controller delete actions: https://sandbox.dereuromark.de/sandbox/ajax-examples/table (live demo)
# Jul 17th, 22:21 maxxstyle06 Guys how to generate an access token for guest users that do not require logining in. What should I rely on. It’s for my api.
# Jul 17th, 20:50 dereuromark is phpstan still working for core? "Fatal error: Interface 'PHPStan\Reflection\BrokerAwareClassReflectionExtension' not found in /.../vendor/cakephp/cakephp/tests/PHPStan/AssociationTableMixinClassReflectionExtension.php"
# Jul 17th, 20:15 ckjksl I know I can `link()` them afterwards if i have the tag entities
# Jul 17th, 20:14 ckjksl So from what I understand, it makes a new Entity for $articles using the data passed from the form. But how do I let cake know which Tags to associate with this article?
# Jul 17th, 20:12 ckjksl `$entity = $articles->newEntity($this->request->getData(), ['associated' => ['Tags']]);
# Jul 17th, 20:10 ckjksl Hi everyone. I'm trying to edit an entity using patchEntity() and add the associated tags with it, but I'm having a little trouble understanding the examples in the documentation
# Jul 17th, 18:07 tmig I'll look at it, htank you
# Jul 17th, 18:02 graziel https://book.cakephp.org/3.0/en/orm/query-builder.html#custom-functions
# Jul 17th, 18:00 tmig I'm keeping reading the docs, but cannot figure out how to INSTR or TIMESTAMPDIFF
# Jul 17th, 17:59 tmig I'm looking for the way to make a INSTR in the cake ORM, can anybody help me do that ?
# Jul 17th, 17:58 tmig Hi all
# Jul 17th, 17:41 dereuromark throttling probably. see awesome list for this
# Jul 17th, 17:40 graziel what do you mean by 'secure'?
# Jul 17th, 17:35 maxxstyle06 Guys what is best way to secure an api that is public and that do not requires authentication ??
# Jul 17th, 15:44 neon1024 Ah, it’s me being a spanner. Declare the connection config in the constructor, not in initialize :face_palm: :rubberduck:
# Jul 17th, 15:42 neon1024 :S
# Jul 17th, 15:42 neon1024 `var_dump(ConnectionManager::configured())` shows an array of two sources called `default` and `test`, but dumping the instances `var_dump($this->Calls->getConnection())` shows `NULL`
# Jul 17th, 15:41 neon1024 My datasource app config has a correctly configured `test` source
# Jul 17th, 15:40 neon1024 `$this->Calls->initialize(['connection' => ConnectionManager::get('test')]);`
# Jul 17th, 15:40 neon1024 Which leads to `$this->getConnection()` returning `null` in `Table.php`, however I’ve added a connection instance to the config when running `initialize`
# Jul 17th, 15:39 neon1024 However I encounter `Error: Call to a member function getSchemaCollection() on null`
# Jul 17th, 15:39 neon1024 I’d like to unit test that my table class has the correct data type set to the schema
# Jul 17th, 14:59 neon1024 Have a great day @scuadra
# Jul 17th, 14:59 itmpls Did you figure it out?
# Jul 17th, 14:58 scuadra I really appreciate everyone's help. Have a nice day
# Jul 17th, 13:58 scuadra I posted the wrong snippet
# Jul 17th, 13:58 scuadra but they are protected
# Jul 17th, 13:58 scuadra my mistake