# |
Jul 7th 2021, 12:07 |
alamnaryab |
Hi How can I get logged-in user id inside Behavior I used Authentication Plugin following cake4 cms tutorial |
# |
Jul 7th 2021, 11:52 |
paolo.bragagni |
usingfoc bootstrap-ui but my require fields are not styled |
# |
Jul 7th 2021, 08:37 |
dereuromark |
But are u also using it as in docs? :) |
# |
Jul 7th 2021, 08:24 |
rudy1976s |
I am using @dereuromark Tags plugin, I configured it as described in the docs, but I cannot save: I always get the following error: `Cannot convert value of type array to string.` The stack is not helping: anyone got same issue ? |
# |
Jul 7th 2021, 08:22 |
rudy1976s |
good morning !!! |
# |
Jul 6th 2021, 22:17 |
itmpls |
makes sense, yeah |
# |
Jul 6th 2021, 22:06 |
dereuromark |
blacklisting instead of whitelisting is usually considered a security risk. add any new method/controller without thinking about it and you exposed too much by accident. |
# |
Jul 6th 2021, 21:14 |
itmpls |
Apparently my version doesn't support bypassAuth - by AppController logic did you mean just specifying a beforeFilter and conditioning off $this->name to specify $this->Auth->allow? That's what I just discovered |
# |
Jul 6th 2021, 19:57 |
slackebot2 |
] ); }``` It Returns `Roles` insde `UserRoles` object. while I want it as plain array of roles as property of `User` object so that I can make check easily for roles as below ```if(in_array('admin',$this->Authentication->getIdentityData('roles') ){ //show admin dashboard }else if(array_intersect( ['sa','owner'],$this->Authentication->getIdentityData('roles') ){ //show owner dashboard } ``` |
# |
Jul 6th 2021, 19:57 |
alamnaryab |
Respected @ndm I tried this, but there is still an issue I have 4 tables `Users` `Students` `Roles` and `UserRoles` I am expecting ```$this->Authentication->getIdentityData('roles') = array('sa','admin',....);``` ```public function findForAuthentication(\Cake\ORM\Query $query, array $options): \Cake\ORM\Query { return $query->contain( [ 'Students', 'UserRoles.Roles' |
# |
Jul 6th 2021, 18:53 |
steinkel |
you can add some logic to AppController too |
# |
Jul 6th 2021, 18:53 |
steinkel |
bypassAuth OR use `$this->Auth->allow(...)` to set the action as public in your controller |
# |
Jul 6th 2021, 18:52 |
itmpls |
with 8.x. and I saw 'bypassAuth' was a thing but I don't think it's in that version? |
# |
Jul 6th 2021, 18:51 |
itmpls |
you know how you do $this->Auth->allow([ ]); within each controller to bypass user permissions? is there a way to specify say, allow unregistered users to access all EXCEPT these in config/permissions? |
# |
Jul 6th 2021, 18:47 |
steinkel |
@itmpls I don't get your use-case could you provide an example? |
# |
Jul 6th 2021, 18:09 |
itmpls |
Is there a reverse to cakedc/users where I can allow all routes through permissions except some if the reverse is the default? |
# |
Jul 6th 2021, 15:52 |
kiwi_13 |
cakephp-orm-json is exactly what I was looking for :) Thanks! |
# |
Jul 6th 2021, 15:51 |
kiwi_13 |
Thanks a lot. |
# |
Jul 6th 2021, 15:50 |
ewbarnard |
I see Authentication+Authorization training is offered this Thursday July 8. Are any "getting started with CakePHP 4" courses currently scheduled? I don't see anything on the web site. We have a new employee! |
# |
Jul 6th 2021, 15:47 |
kevin.pfeifer |
I would guess you can start at https://github.com/liqueurdetoile/cakephp-orm-json |
# |
Jul 6th 2021, 15:47 |
ndm |
Depends on what work you need to do. CakePHP ships JSON column support out of the box as far as type conversion is concerned (DB to PHP and vice versa), but that's about it. |
# |
Jul 6th 2021, 15:37 |
kiwi_13 |
Hi, what is the best way to work with json-columns (mariadb) in cakephp orm? Couldn't find any documentation on the cake book |
# |
Jul 6th 2021, 15:28 |
charolastra |
or look in /etc/apache/modules-enabled |
# |
Jul 6th 2021, 15:28 |
charolastra |
no idea about centos but usually you can use a2enmod |
# |
Jul 6th 2021, 15:27 |
nayakvradhit |
@charolastra how to enable php 7 module in centos 7 in apache |
# |
Jul 6th 2021, 14:13 |
charolastra |
also maby you need to enable the module itself |
# |
Jul 6th 2021, 14:01 |
kevin.pfeifer |
google is usually your friend here |
# |
Jul 6th 2021, 14:00 |
kevin.pfeifer |
but as charolastra said you could also use PHP in apache via CGI or FPM |
# |
Jul 6th 2021, 14:00 |
kevin.pfeifer |
if its using the apache built in PHP module then it should suffice to ```LoadModule php7_module modules/libphp7.so <FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch>``` |
# |
Jul 6th 2021, 13:56 |
nayakvradhit |
I am using apache webserver |
# |
Jul 6th 2021, 12:34 |
charolastra |
and how it interfaces to PHP. there's CGI, FPM, .. |
# |
Jul 6th 2021, 11:40 |
kevin.pfeifer |
depends on your used webserver |
# |
Jul 6th 2021, 11:33 |
nayakvradhit |
Ok then how can I interpret php |
# |
Jul 6th 2021, 11:17 |
charolastra |
sounds like your webserver doesn't interpret it as PHP at all |
# |
Jul 6th 2021, 10:50 |
nayakvradhit |
Hi can anyone please tell me when I run the file test.php contains phpinfo, Output I am not getting php information instead it outputs the php code? Any idea why |
# |
Jul 6th 2021, 10:05 |
paolo.bragagni |
ok thanks |
# |
Jul 6th 2021, 10:04 |
paolo.bragagni |
$linguaarray = $lingua->toArray(); |
# |
Jul 6th 2021, 10:04 |
info315 |
@paolo.bragagni My controllers are doing it like so: https://github.com/it-novum/openITCOCKPIT/blob/development/src/Controller/CommandsController.php#L112-L147 My App is 100% API driven. Basically it's: receive data from post call patch entity return the entity via CakePHP auto json serialize method: https://book.cakephp.org/4/en/views/json-and-xml-views.html |
# |
Jul 6th 2021, 09:55 |
charolastra |
if Datasource->timezone is UTC but App->defaultTimezone is something different, should the dates be automaticly converted? |
# |
Jul 6th 2021, 09:52 |
paolo.bragagni |
how to send back the data saved (with the primaryKey and the other data? |
# |
Jul 6th 2021, 09:51 |
paolo.bragagni |
when I save in this way $this->Lingue->save($lingua) |