mirror of
				https://github.com/Mibew/i18n.git
				synced 2025-11-01 01:36:57 +03:00 
			
		
		
		
	Switch to a more secure method for generation of the token for request for a password restore
This commit is contained in:
		
							parent
							
								
									e61706955a
								
							
						
					
					
						commit
						2334a0ed0a
					
				| @ -38,7 +38,8 @@ if (isset($_POST['loginoremail'])) { | ||||
| 	} | ||||
| 
 | ||||
| 	if (count($errors) == 0) { | ||||
| 		$token = md5((time() + microtime()) . rand(0, 99999999)); | ||||
| 
 | ||||
| 		$token = sha1($torestore['vclogin'] . (function_exists('openssl_random_pseudo_bytes') ? openssl_random_pseudo_bytes(32) : (time() + microtime()) . mt_rand(0, 99999999))); | ||||
| 
 | ||||
| 		$link = connect(); | ||||
| 		$query = sprintf("update ${mysqlprefix}chatoperator set dtmrestore = CURRENT_TIMESTAMP, vcrestoretoken = '%s' where operatorid = %s", mysql_real_escape_string($token, $link), intval($torestore['operatorid'])); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user