PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, January 14, 2022

[FIXED] CakePHP query record does not show password

 January 14, 2022     cakephp, cakephp-3.0     No comments   

Issue

I have a simple model (User) which contains of the attributes id, username and password.

If I query for records with $this->User->find()->all()->toArray(), the output shows the attributes id and username. Password is not displayed.

No matter if the password is a hash or not, somehow it must be possible to retrieve it only for processing reasons.

Anyone has experienced this issue before?


Solution

not sure if its a good thing to want to display a password(hashed of not)

but outputting a user should show it to you.

You can check if there are any hidden properties set with $entity->hiddenProperties()

You can pass Either an array of properties to hide or null to get the hidden properties.



Answered By - Alex Stallen
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing