# |
Mar 8th 2018, 12:45 |
jkpatel291289 |
how to create virtual property in table using associations? I have a loadingmemo tabel with many lorryreceipts . lorryreceipts have weight. i want to add virtual property in loading memo table wich return total weight of all lr. |
# |
Mar 8th 2018, 12:45 |
steinkel |
there is a basic cakephp recipe you can tweak a bit and get atomic deployments |
# |
Mar 8th 2018, 12:43 |
neon1024 |
Nice @steinkel I’ll have to check that one out, I haven’t heard of it |
# |
Mar 8th 2018, 12:34 |
steinkel |
for deployment, we've been using https://github.com/deployphp/deployer for some time and works good |
# |
Mar 8th 2018, 12:00 |
neon1024 |
Now we are moving over to Ansible though, so we should be able to weave that into the playbook somewhere I’d think |
# |
Mar 8th 2018, 11:59 |
neon1024 |
Good idea @dereuromark we still just shell in an run it all manually, and I often forget to run migrations! |
# |
Mar 8th 2018, 11:47 |
dereuromark |
see my old https://twitter.com/dereuromark/status/918155913038479360 |
# |
Mar 8th 2018, 11:46 |
ghoritrilochan |
ok try |
# |
Mar 8th 2018, 11:45 |
dereuromark |
also run a clean composer install here instead of using outdated lock file or even composer cache files |
# |
Mar 8th 2018, 11:45 |
dereuromark |
ghori: you dont "upload", you deploy your project. basic shell scripts would suffice. the important point is that you in those deploy scripts also clear your cache etc. |
# |
Mar 8th 2018, 11:42 |
ghoritrilochan |
plz give me suggestion how to fix this problem..:tired_face: |
# |
Mar 8th 2018, 11:34 |
dereuromark |
Beginners I would always recommend https://www.dereuromark.de/2011/08/25/working-with-passwords-in-cakephp/ and the Passwordable behavior. Dry, clean and safe approach without modification on project level really. Using your own approach can shoot you in the foot very easily. And not aliasing the field, thus introducing injection vectors on user forms / edit etc. |
# |
Mar 8th 2018, 11:31 |
ghoritrilochan |
only open home page not open other all page why? |
# |
Mar 8th 2018, 11:30 |
ghoritrilochan |
http://shreehariji.com |
# |
Mar 8th 2018, 11:30 |
ghoritrilochan |
i was upload my project on server. but than after project not work propar |
# |
Mar 8th 2018, 11:28 |
ghoritrilochan |
hi... |
# |
Mar 8th 2018, 10:29 |
neon1024 |
Neatly wrapped for you by the framework :slightly_smiling_face: https://github.com/cakephp/cakephp/blob/master/src/Auth/DefaultPasswordHasher.php#L47 |
# |
Mar 8th 2018, 10:28 |
digitalfotografen |
Add a setPassword and a checkPassword method to your User entity |
# |
Mar 8th 2018, 10:28 |
neon1024 |
http://php.net/manual/en/function.password-hash.php |
# |
Mar 8th 2018, 10:27 |
neon1024 |
PHP even has a password function now :slightly_smiling_face: |
# |
Mar 8th 2018, 10:26 |
digitalfotografen |
@portilloster Put the password encrypt in your model, then You can reuse it from controllers and shells. But MD5 is no longer best practice for password hashing. Read the docs linked by Joshua. |
# |
Mar 8th 2018, 10:21 |
joshualuckers |
@portilloster https://book.cakephp.org/3.0/en/tutorials-and-examples/cms/authentication.html#adding-password-hashing |
# |
Mar 8th 2018, 10:17 |
slackebot |
$this->Usuarios->patchEntity($usuario, $this->request->getData()); if ($this->Usuarios->save($usuario)) { $this->Flash->success(__('The usuario has been saved.')); return $this->redirect(['action' => 'index']); } $this->Flash->error(__('The usuario could not be saved. Please, try again.')); } $this->set(compact('usuario')); } |
# |
Mar 8th 2018, 10:17 |
slackebot |
method * * @param string|null $id Usuario id. * @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise. * @throws \Cake\Network\Exception\NotFoundException When record not found. */ public function edit($id = null) { $usuario = $this->Usuarios->get($id, [ 'contain' => [] ]); if ($this->request->is(['patch', 'post', 'put'])) { $usuario = |
# |
Mar 8th 2018, 10:17 |
slackebot |
$usuario = $this->Usuarios->patchEntity($usuario, $this->request->getData()); if ($this->Usuarios->save($usuario)) { $this->Flash->success(__('The usuario has been saved.')); return $this->redirect(['action' => 'index']); } $this->Flash->error(__('The usuario could not be saved. Please, try again.')); } $this->set(compact('usuario')); } /** * Edit |
# |
Mar 8th 2018, 10:17 |
portilloster |
Hi again guys! I managed to encrypt with md5 the password on the database and also on my function login(). But I also want to encrypt the password when creating a new user or editing it. How can I manage that? I believe is adding some line on the user controller in the add and edit method but I dont know: public function add() { $usuario = $this->Usuarios->newEntity(); if ($this->request->is('post')) { |
# |
Mar 8th 2018, 09:06 |
megan |
patsuckow quality over quantity :slightly_smiling_face: |
# |
Mar 8th 2018, 08:59 |
neon1024 |
Hey everyone |
# |
Mar 8th 2018, 08:55 |
patsuckow |
Once again, I am convinced that although the cackephp community is not very large as I would like, but responsive :) |
# |
Mar 8th 2018, 08:50 |
patsuckow |
Thanks savant. The solution code was written below your tip (can anyone be useful). |
# |
Mar 8th 2018, 08:11 |
birdy247 |
morning |
# |
Mar 8th 2018, 08:07 |
savant |
night! |
# |
Mar 8th 2018, 08:07 |
savant |
otherwise there isnt anything to fetch. |
# |
Mar 8th 2018, 08:07 |
savant |
headed to bed, but basically `->fetchAll()` can only be used when you are selecting things |
# |
Mar 8th 2018, 08:07 |
savant |
I responded on stackoverflow |
# |
Mar 8th 2018, 08:02 |
patsuckow |
Hello everybody. Can anyone help me? - https://stackoverflow.com/questions/49156063/it-is-not-possible-to-know-the-output-of-execute-cakephp3-x |
# |
Mar 8th 2018, 06:40 |
ashish_onmobile |
:+1: |
# |
Mar 8th 2018, 06:40 |
ashish_onmobile |
thanks for oyur help savant |
# |
Mar 8th 2018, 06:40 |
ashish_onmobile |
got the issue |
# |
Mar 8th 2018, 06:34 |
ashish_onmobile |
ok |
# |
Mar 8th 2018, 06:34 |
savant |
your database schema is different between the two |