Log message #4222975

# At Username Text
# Jan 20th 2020, 09:03 mr.kusmadi @conehead OK Thank you hehe
# Jan 20th 2020, 08:52 HumanG33k hello when i submit my json/curl request to add action the book code don t want to merge entity. some of you already as that issue ? (on v4)
# Jan 20th 2020, 06:58 slackebot https://github.com/cakephp/authentication/blob/master/src/Identifier/Resolver/OrmResolver.php Probably it is enough to loop through $this->_config['userModels'] and use the existing code and return the result only if any was found.
# Jan 20th 2020, 06:58 conehead @mr.kusmadi Where did you see that it works with multiple models at all? As @ricksaccous said you probably will need your own resolver. Not changing some variables, but writing a whole resolver yourself and use it like: ``` 'resolver' => [ 'className' => 'Authentication.YourOwnOrm', 'userModels' => ['Admin','Users','Students'], ],``` Have a look at
# Jan 20th 2020, 03:20 slackebot 'all', ];``` no userModels in there help me out thx
# Jan 20th 2020, 03:20 mr.kusmadi ``` //this code successfull 'resolver' => [ 'className' => 'Authentication.Orm', 'userModels' => ['Admin','Users','Students'], ],``` he will automatically recognize the users table as a model table app/vendor/cakephp/authentication/src/Identifier/Resolver/OrmResolver.php online 37 ``` protected $_defaultConfig = [ 'userModel' => 'Users', 'finder' =>
# Jan 20th 2020, 00:34 ricksaccous then your own resolver is probably the way to go
# Jan 20th 2020, 00:34 ricksaccous if you want to accept any of those tables though
# Jan 20th 2020, 00:34 ricksaccous if that's the case you might as well just not make resolvers and instead set the resolver based on the request
# Jan 20th 2020, 00:34 ricksaccous are you just trying to set one per login page though
# Jan 20th 2020, 00:34 ricksaccous @mr.kusmadi change 'userModel' to 'userModels' and have your resolver read that setting
# Jan 20th 2020, 00:33 mr.kusmadi @ricksaccous I already made a resolver. Was successful How to set multi tables ``` //this code successfull 'resolver' => [ 'className' => 'Authentication.Orm', 'userModel' => 'Admin', ],```
# Jan 19th 2020, 23:29 lpj145 @challgren thanks!
# Jan 19th 2020, 23:24 ricksaccous but i'm not sure if that will turn out well
# Jan 19th 2020, 23:24 ricksaccous you can even possibly load a single resolver with different params based on request
# Jan 19th 2020, 23:23 ricksaccous that supports multiple tables
# Jan 19th 2020, 23:23 ricksaccous @mr.kusmadi you'd have to write your own Resolver
# Jan 19th 2020, 23:19 slackebot fail) ]); return $authenticationService; }```
# Jan 19th 2020, 23:19 slackebot $authenticationService->loadAuthenticator('Authentication.Session'); // Configure form data check to pick email and password $authenticationService->loadAuthenticator('Authentication.Form', [ 'fields' => [ 'username' => 'username', 'password' => 'password', ], 'loginUrl' => ['/simsiswa/admin','/simsiswa/staff','/simsiswa/user'],//multi table (staff ok, admin and user
# Jan 19th 2020, 23:19 slackebot 'unauthenticatedRedirect' => '/simsiswa/pages/display', 'queryParam' => 'redirect', ]); // Load identifiers, ensure we check email and password fields $authenticationService->loadIdentifier('Authentication.Password', [ 'fields' => [ 'username' => 'username', 'password' => 'password', ] ]); // Load the authenticators, you want session first
# Jan 19th 2020, 23:19 mr.kusmadi Hi bro How do you create multiple table logins on cakephp version 4.x? I have followed the guidelines at https://book.cakephp.org/4/en/tutorials-and-examples/cms/authentication.html Only the users table is successful, while the Admin and Students table always fails ``` protected function configAuth(): \Authentication\AuthenticationService { $authenticationService = new \Authentication\AuthenticationService([
# Jan 19th 2020, 23:18 challgren @lpj145 https://github.com/dereuromark/cakephp-queue works great
# Jan 19th 2020, 23:00 lpj145 or parallel tasks ? what lib yours recommend me ?
# Jan 19th 2020, 22:59 lpj145 someone used any cakephp lib to jobs (scheduled jobs) ?
# Jan 19th 2020, 22:25 martin I can't simple change the order of label and field when I use `$this->Form->control('bla', ['label' => 'green']);` ? I don't see it in the widget templates. I I think the only way to do this is label false and put lable seperate ?
# Jan 19th 2020, 19:08 lpj145 but, if your's look something is interest, or to change better, feel free to talk with me.
# Jan 19th 2020, 19:07 lpj145 yes, know, this is much better for Br community.
# Jan 19th 2020, 19:07 lpj145 guy's, look some api boilerplate with 4x
# Jan 19th 2020, 19:06 lpj145 https://github.com/lpj145/cakephp_template
# Jan 19th 2020, 18:35 michael175 Ah. Must be something else then. :)
# Jan 19th 2020, 18:35 wizardfix Yeah, I mean I'm not usng it
# Jan 19th 2020, 18:34 michael175 Security-Enhanced Linux (*SELinux*) is a Linux kernel security module that provides a mechanism for supporting access control security policies, including mandatory access controls (MAC). It is software that acts like a firewall and can run on Ubuntu.
# Jan 19th 2020, 18:30 wizardfix Ah well I'm just on Ubuntu 18.04, not SELinux...
# Jan 19th 2020, 18:29 michael175 Hi, I don't know if it'll be any help but I've just spent an hgour tearing my hair out over a `file_put_contents()` error when thee folder and its parents all had write permission and were correctly owned and grouped. Turned out to be `SELinux` causing the trouble. Ran `setenforce = 0` and the permissions error disappeared. Now, jsut need to turn it back on and sort out the real issue with SELinux.
# Jan 19th 2020, 18:03 slackebot $this->response->withFile($path, ['download' => true]); $this->Flash->success(__('The file will be downloaded.')); return $response; }``` I'm not sure what I'm missing here, looking for a bit of guidance... :thinking_face:
# Jan 19th 2020, 18:03 slackebot [APP/Controller/ResultsController.php, line 132]# SOME DUMMY DATA WHICH SHOULD BE OVERWRITTEN. # -------------------------------------------- (src/files/test_results.csv)``` The file has 777 perms. `file_put_contents()` works fine in my psysh shell. This is my method: ```public function export() { $path = 'files/results_export.csv'; file_put_contents($path, 'THIS LINE WRITTEN BY EXPORT METHOD'); $response =
# Jan 19th 2020, 18:03 wizardfix *Problem Writing to File* I have a simple method to write a line to a file and let the user download it. What actually happens is the file does not seem to get overwritten at all, and the file downloaded contains error markup indicating a perms error followed by the original text contained in the file: ```Warning (2): file_put_contents(files/test_results_ex.csv): failed to open stream: Permission denied
# Jan 18th 2020, 21:29 jimbo2150 Yes, MySQL will rewrite that query to `ALTER TABLE \`results\` CHANGE \`status\` \`status\` TINYINT(1) UNSIGNED NULL;` and when you query for the column types is comes out as `TINYINT(1)` so there is no way for CakePHP (or any code) to even detect a `TINYINT(1)` vs `BOOLEAN`.
# Jan 18th 2020, 21:19 wizardfix So are the SQL statements generated by phpMyAdmin just syntactic sugar? ```ALTER TABLE `results` CHANGE `status` `status` BOOLEAN UNSIGNED NULL;```
# Jan 18th 2020, 21:16 jimbo2150 Once it is removed it will just be `TINYINT` (without parentheses) unless they implement `BOOLEAN` as a separate type. In the first case it will be up to the code to cast it as boolean either in the SELECT query or once it's returned the value as an integer (e.g. greater than 0 is true otherwise false).
# Jan 18th 2020, 21:15 ndm I'm not familiar with the future plans for MySQL, but I'd suspect that they will add a real boolean type then