php - CakePHP: How to login using only barcode? -


I started learning KPHHP about the month before, so I am quite new to this and I want to ask a question:

< p> How do I use barcode only?

My plan is to log in with regular barcode for regular users only and they will have their regular username and password for admin login. I have searched many pages but I have not found any solution for this.

for example QR-code:

The login function is used in the administrator:

  if ($ this-> request-> is ('get')) {$ user = $ this-> ; User- & gt; Search ('first', array ('conditions' => gt; array ('user.name' => = this- & gt; request- & gt; query ['username'], 'user password' = & Gt; $ this- & gt; Request- & gt; query ['password'] / do not forget the hash password if I ($ user! = Null) {$ this-> AUTH- & gt; Login ( $ User); $ this- & gt; redirect ('/ admin / index');}}    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -