# |
May 11th 2021, 14:19 |
ndm |
@dereuromark I mean... yeah, maybe. I can't think of how such a partial logout could look like right now, but I'm it's possible :upside_down_face: |
# |
May 11th 2021, 14:15 |
ndm |
@etibor You might be lacking a dedicated `else` branch, hard to say without seeing your complete code. |
# |
May 11th 2021, 14:14 |
paolo.bragagni |
but when I logout in some way it reauthenticate |
# |
May 11th 2021, 14:13 |
paolo.bragagni |
my authenticate function is for oauth2 |
# |
May 11th 2021, 14:12 |
paolo.bragagni |
but I cant get logout work |
# |
May 11th 2021, 14:12 |
paolo.bragagni |
I've build a (probably tremendous) Authenticator and it seems that work |
# |
May 11th 2021, 14:12 |
etibor |
@ndm thank you, its almost good, actually i have two: $this->set('thesises', $this->paginate($documents)) one is inside a post in case of form submit the other is outside of the post, in case of just arrive to the index.ctp now probybly its not properly placed, becuse after the submit, outside of the post $this->set('thesises', $this->paginate($documents)) will be showed |
# |
May 11th 2021, 14:11 |
paolo.bragagni |
hihi you are right |
# |
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' => |