1
我有一個正常的php登錄連接到數據庫認證用戶,現在我需要將其轉換爲使用yii框架的登錄,有人可以告訴我,以便這樣做..什麼是我應該做的第一件事情,我可以將其轉換爲yii登錄。下面是我打電話給正常的php登錄到YII登錄
function login($usr,$pwd) {
$query = "SELECT * FROM login WHERE us.username='$usr' AND us.password='$pwd'; ";
$dataReader=$command->query();
$row = mysql_fetch_array($dataReader);
$log = new stdClass();
if($row) {
$pro->accountID = (int)$row['accountID'];
$pro->accountname = $row['accountname'];
$pro->usertype = (int)$row['usertype'];
$string = rand() . 'SURVAYLAND' . rand() . $usr. $pwd;
$_SESSION['SURVEY_AUTHENTICATE_KEY'] = md5($string);
} else {
$pro = false;
}
}