|
|
|
สอบถามเกี่ยว Register Account Password encode HMail |
|
|
|
|
|
|
|
Password พวกนี้น่าจะ One-way Password + Token ID ด้วยครับ แต่ไม่รู้ว่าใช้ตัวไหน
|
|
|
|
|
Date :
2015-08-14 16:07:10 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
อยากเลยที่นี้
มีท่านได สร้างฟอร์ม Hmail encode pass บ้างครับ
|
|
|
|
|
Date :
2015-08-14 16:34:20 |
By :
โต้ง |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
$hmail = new stdClass;
$hmail->authname = "Administrator";
$hmail->authpass = "YOUR-HMAIL-PASSWORD";
$hmail->COM = null;
$newPass = "password1";
$domain = "example.com";
$emailprefix = "user";
set_mail_password($newPass, $domain, $emailprefix);
function set_mail_password($password, $domain, $emailprefix) {
global $hmail;
$hmail->COM = new COM("hMailServer.Application") or die("Could not load mail");
$hmail->COM->Authenticate($hmail->authname, $hmail->authpass);
$tmpDomain = $hmail->COM->Domains->ItemByName($domain);
$add = $emailprefix . "@" . $domain;
$tmpAccount = $tmpDomain->Accounts->ItemByAddress($add);
$tmpAccount->Password = $password;
$tmpAccount->Save();
}
ไม่รู้ใช้ได้เหรอป่าวครับ
อยากให้พี่ ๆ ช่วยดูให้หน่อยครับ
|
|
|
|
|
Date :
2015-08-14 16:38:11 |
By :
โต้ง |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ส่วนที่ 1.. trim($accountpassword=null); // กำหนดค่าเริ่มต้นของ $accountpassword
Code (PHP)
$chars = "0123456789abcdef";
$i = 0;
$strSALT ="";
while ($i <= 5) {
$strSALT .= $chars{ mt_rand( 0, strlen( $chars ) ) };
$i++;
}
// Create a temp string containing salt+pass
$strTemp = $strSALT.$accountpassword;
// SHA256 the temp string
$strHash = hash( 'sha256', $strTemp );
unset($strTemp);
// The final string to be stored
$strHashedPass = $strSALT.$strHash;
//echo $strHashedPass;
กำหนดค่า ลง TEXTBOX แทนค่า $accountpassword rand password มา แต่ไม่ได้ครับ
ส่วนที่2.trim($accountpassword=123456); // กำหนดค่าเริ่มต้นของ $accountpassword
Code (PHP)
$chars = "0123456789abcdef";
$i = 0;
$strSALT ="";
while ($i <= 5) {
$strSALT .= $chars{ mt_rand( 0, strlen( $chars ) ) };
$i++;
}
// Create a temp string containing salt+pass
$strTemp = $strSALT.$accountpassword;
// SHA256 the temp string
$strHash = hash( 'sha256', $strTemp );
unset($strTemp);
// The final string to be stored
$strHashedPass = $strSALT.$strHash;
//echo $strHashedPass;
กำหนดค่า ลง TEXTBOX แทนค่า $accountpassword rand password มา ได้คับ
Login เข้าระบบปกติครับ
|
ประวัติการแก้ไข 2015-09-22 14:44:07
|
|
|
|
Date :
2015-09-22 14:42:21 |
By :
โต้ง |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|