การ Generate Password แบบ Joomla 2.5

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: การ Generate Password แบบ Joomla 2.5

การ Generate Password แบบ Joomla 2.5

โดย tsukasaz » 21/09/2012 1:22 pm

การ Generate Password แบบ Joomla 2.5 ที่สามารถนำไปใช้งานได้กับระบบ Login ของ Joomla

ต้อง Import ตัว JUserHelper เข้ามาก่อน

โค้ด: เลือกทั้งหมด

jimport( 'joomla.user.helper' ); 
ตัวอย่างการใช้งาน

โค้ด: เลือกทั้งหมด

$password = 'Your Password';
$salt = JUserHelper::genRandomPassword(32);
$crypt = JUserHelper::getCryptedPassword($password, $salt);
$encrypted = $crypt . ':' . $salt;
echo $encrypted;
 

ข้างบน