# |
Mar 13th 2019, 15:58 |
steinkel |
and https://github.com/CakeDC/auth/releases/tag/4.0.0 |
# |
Mar 13th 2019, 15:58 |
ricksaccous |
np |
# |
Mar 13th 2019, 15:58 |
kaliel |
thx :slightly_smiling_face: |
# |
Mar 13th 2019, 15:58 |
kaliel |
oh yes sure |
# |
Mar 13th 2019, 15:58 |
ricksaccous |
can be a field that doesn't exist in db if it doesn't need to be saved |
# |
Mar 13th 2019, 15:58 |
kaliel |
i tought about it but i will have a duplicate field :S |
# |
Mar 13th 2019, 15:57 |
ricksaccous |
@kaliel create another field that you populate yourself with Time::now(); |
# |
Mar 13th 2019, 15:53 |
kaliel |
I'd like to create a custom validation rule based on previous persisted entity by checking the filed 'created' populated by TimestampBehavior. Seems that TimestampBehavior adds 'created' in beforeSave so i can't validate, any idea on how to manage this please ? |
# |
Mar 13th 2019, 15:44 |
dereuromark |
https://github.com/dereuromark/cakephp-tinyauth/pull/97/files if anyone can help maybe? |
# |
Mar 13th 2019, 15:43 |
neon1024 |
Seems I can use `ini_set('user_agent', 'Daves great new user agent string')` :slightly_smiling_face: |
# |
Mar 13th 2019, 15:42 |
dereuromark |
yeah that one. I wanted to try to upgrade it fully to support them. |
# |
Mar 13th 2019, 15:41 |
neon1024 |
@dereuromark The middleware one? I haven’t tried it in a long time |
# |
Mar 13th 2019, 15:40 |
neon1024 |
How can I change the user-agent string from ‘CAKEPHP’ to something else for a post request using the HttpClient? |
# |
Mar 13th 2019, 15:40 |
dereuromark |
anyone working with authentication or more importantly authorization plugin yet? "The request to `/cars/add` did not apply any authorization checks." must be missing sth for tinyauth to work with new new plugins. |
# |
Mar 13th 2019, 15:05 |
ricksaccous |
thanks @neon1024;) |
# |
Mar 13th 2019, 15:04 |
neon1024 |
Thanks @dereuromark setting my default logging to false scope worked :thumbsup: |
# |
Mar 13th 2019, 15:03 |
neon1024 |
I don’t even think you *have* to pass an array, I think `where()` might take string, so you could lose the `[]` also :thinking_face: |
# |
Mar 13th 2019, 15:02 |
ricksaccous |
yeah i'll prob just do it that way |
# |
Mar 13th 2019, 15:02 |
ricksaccous |
yeah it's mysql |
# |
Mar 13th 2019, 15:02 |
neon1024 |
Assuming MySQL :point_up: |
# |
Mar 13th 2019, 15:02 |
ricksaccous |
oh wew |
# |
Mar 13th 2019, 15:02 |
neon1024 |
Well, if you’re doing that, why not `->where(['login_lockdown < NOW()'])` |
# |
Mar 13th 2019, 15:02 |
ricksaccous |
or is that evil |
# |
Mar 13th 2019, 15:02 |
ricksaccous |
\DateTime(); |
# |
Mar 13th 2019, 15:01 |
ricksaccous |
for a quick dirty one can i just do 'login_lockdown < ' => new |
# |
Mar 13th 2019, 15:01 |
neon1024 |
There is also the `->lt()` method |
# |
Mar 13th 2019, 15:01 |
neon1024 |
`->where(['login_lockdown <' => $datetimeInstance])` is the approach I use |
# |
Mar 13th 2019, 15:01 |
ricksaccous |
but i'm never sure what's the best way |
# |
Mar 13th 2019, 15:01 |
ricksaccous |
i've done this different ways |
# |
Mar 13th 2019, 15:00 |
ricksaccous |
'login_lockdown <' => todays date in cakephp3 terms |
# |
Mar 13th 2019, 15:00 |
ricksaccous |
let's say i'm querying |
# |
Mar 13th 2019, 15:00 |
neon1024 |
`$datetime->isToday()` |
# |
Mar 13th 2019, 15:00 |
ricksaccous |
datetime i should say |
# |
Mar 13th 2019, 15:00 |
ricksaccous |
in cake 3 what's the best way to compare a field to today's date |
# |
Mar 13th 2019, 15:00 |
neon1024 |
It just feels very counterintuitive to my brain |
# |
Mar 13th 2019, 14:58 |
dereuromark |
but nowadays you need to always enable listeners on app side for everything. no more good old "just lock to file x" |
# |
Mar 13th 2019, 14:58 |
dereuromark |
I had similar feelings once upgrading stuff from 2.x :slightly_smiling_face: https://sandbox.dereuromark.de/pages/best-practices#logging still is useful as default for all apps. |
# |
Mar 13th 2019, 14:57 |
neon1024 |
Not without writing it to a variety of handlers |
# |
Mar 13th 2019, 14:57 |
neon1024 |
I just want to log a message to a text file and it feels like the Log class can’t do this |
# |
Mar 13th 2019, 14:57 |
dereuromark |
known issue from back in 3.0, yeah. scopes need to default to false as per new app templates |
# |
Mar 13th 2019, 14:57 |
Martin` |
hmm never used scopes for debug |