# |
May 11th 2021, 14:10 |
ndm |
Why would you allow non-authenticated users to log out? |
# |
May 11th 2021, 14:10 |
kevin.pfeifer |
in your controller |
# |
May 11th 2021, 14:09 |
kevin.pfeifer |
``` public function beforeFilter( \Cake\Event\EventInterface $event ) { parent::beforeFilter( $event ); // Configure the login action to not require authentication, preventing // the infinite redirect loop issue $this->Authentication->addUnauthenticatedActions( [ 'login', 'logout' ] ); }``` |
# |
May 11th 2021, 14:08 |
paolo.bragagni |
how can I bypass authenticator (for my logout?) |
# |
May 11th 2021, 14:06 |
ndm |
@etibor You catch that exception, and do whatever you want then, for example redirect to the first page like `return $this->redirect(['?' => ['page' => 1]]);`, see https://book.cakephp.org/4/en/controllers/components/pagination.html#out-of-range-page-requests |
# |
May 11th 2021, 14:00 |
etibor |
i created a form filter in an index.ctp page the issue is that i could not configure to jump to the first page after the submit now if i am at the 20th page(url show ?page=20), and the actual query does not have such as elements its arrive to an error page how can i define here: $this->set('thesises', $this->paginate($documents)) or some other places ? |
# |
May 11th 2021, 13:57 |
etibor |
hello evryone |
# |
May 11th 2021, 12:53 |
etibor |
how did you tried? |
# |
May 11th 2021, 12:07 |
paolo.bragagni |
Cant remove session in logout |
# |
May 11th 2021, 11:42 |
etibor |
from day-to-day there is less activity in the channel |
# |
May 11th 2021, 08:04 |
etibor |
this does not works : $this->request->getQuery('page',NULL); |
# |
May 11th 2021, 07:37 |
etibor |
okey maybe it is: ```$this->request->getQuery('does_not_exist', 'default val');``` |
# |
May 11th 2021, 07:34 |
etibor |
is there a way to set the request param when submit? i have a special case when the id in the url must not be used even it is in i tried somethin similar: $this->request->setParam('id',NULL); |
# |
May 11th 2021, 07:32 |
etibor |
hello evryone |
# |
May 11th 2021, 07:30 |
paolo.bragagni |
If the user is not in my user table, how can I take the uusername that I got in my Oauth2Authenticator and pass it to the register view? |
# |
May 11th 2021, 07:29 |
paolo.bragagni |
I've build my Oauth2Authenticator and it works. I mean if the username is registered in my user table ie authenticate ecc ecc.. |
# |
May 11th 2021, 06:06 |
kevin.pfeifer |
thanks, that was the solution :bow: |
# |
May 11th 2021, 04:08 |
admad |
@tyler.adam.lazenby I hope this is not a public app as you have provided a way to DDOS it by using for e.g. `?limit=99999999` |
# |
May 10th 2021, 23:04 |
tyler.adam.lazenby |
yeeeyahhh |
# |
May 10th 2021, 23:04 |
tyler.adam.lazenby |
```histories = $this->Histories->find() ->contain('HistoryTypes') ->where([ 'contact_id' => $refer_params['id'], 'HistoryTypes.name' => $this->request->getQuery('name'), ]) ->limit($this->request->getQuery('limit') ?? 5);``` |
# |
May 10th 2021, 23:04 |
tyler.adam.lazenby |
```$referer = $this->referer('/', true); $refer_params = Router::getRouteCollection()->parse($referer);``` |
# |
May 10th 2021, 23:04 |
tyler.adam.lazenby |
Aahhhh figured it out |
# |
May 10th 2021, 22:51 |
rightscoreanalysis |
ah typo :) |
# |
May 10th 2021, 22:49 |
rightscoreanalysis |
they both extend IntegrationsAppMode |
# |
May 10th 2021, 22:49 |
rightscoreanalysis |
I only have one IntegrationsAppModel.php, and User.php and Order.php model files |
# |
May 10th 2021, 22:48 |
rightscoreanalysis |
Cannot declare class IntergrationsAppModel, because the name is already in use |
# |
May 10th 2021, 22:48 |
rightscoreanalysis |
I am creating a plugin for a legacy cake2 project |
# |
May 10th 2021, 22:45 |
tyler.adam.lazenby |
quick question. I am trying to get a contact's ID via ajax from the referrers URI. I can run `dd($this->request->referer(false));` and it will give me something like ```"http://local.ezbusinessmanager.com/contacts/view/1545"``` But this isn't easily parsible. What is the right way to do this? |
# |
May 10th 2021, 22:43 |
admad |
@kevin.pfeifer you didn't specify the plugin name anywhere, Cake can't read your mind :). Use `[plugin => Foo]` as 2nd argument for `scope()`. |
# |
May 10th 2021, 20:50 |
rightscoreanalysis |
is this i related to the autoloader, I recall something |
# |
May 10th 2021, 20:49 |
rightscoreanalysis |
in an old Cake2 project I am getting missing plugin errors, but I can see the plugins in the Plugins folder, and I have run composer to update |
# |
May 10th 2021, 18:43 |
slackebot |
'GET', ], 'pie' => [ 'action' => 'pie', 'method' => 'GET', ] ] ] ); } );``` Now this generates the following parameters for the URL Generator (seen via debug kit) ```{ "controller": "EasybillDocuments", "action": "chart", "_method": "GET", "plugin": null }``` But actually in the `plugin` part there should be `AlfredEasybill` How can I do that? |
# |
May 10th 2021, 18:43 |
kevin.pfeifer |
Hello there community :) I have got a route question. In my Plugin I have defined the following scope and resources ``` $routes->scope( '/api', function( RouteBuilder $builder ) { $builder->setExtensions( [ 'json' ] ); $builder->resources( 'EasybillDocuments', [ 'only' => [ 'index', 'chart', 'pie' ], 'map' => [ 'chart' => [ 'action' => 'chart', 'method' => |
# |
May 10th 2021, 18:08 |
kevin.pfeifer |
mealtime :) |
# |
May 10th 2021, 18:07 |
tyler.adam.lazenby |
ok time for lunch |
# |
May 10th 2021, 18:07 |
tyler.adam.lazenby |
it really has been |
# |
May 10th 2021, 18:00 |
kevin.pfeifer |
thats definitely a good starting opportunity then |
# |
May 10th 2021, 18:00 |
kevin.pfeifer |
sure |
# |
May 10th 2021, 17:58 |
tyler.adam.lazenby |
Yeah, I am lucky that I get to decide the direction of projects. This one is very VERY near the end of the first dev cycle. At that point, I expect more devs to be thrown in to clean up, refactor, etc |
# |
May 10th 2021, 17:58 |
kevin.pfeifer |
but nice :) |
# |
May 10th 2021, 17:56 |
kevin.pfeifer |
i would love to learn quasar and make my own custom express backends but I haven't made the jump yet |