Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
45
application/helpers/password_helper.php
Normal file
45
application/helpers/password_helper.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Password helper
|
||||
*
|
||||
* Copyright (c) CIBoard <www.ciboard.co.kr>
|
||||
*
|
||||
* @author CIBoard (develop@ciboard.co.kr)
|
||||
*/
|
||||
|
||||
if ( ! function_exists('password_hash')) {
|
||||
function password_hash($password = '', $key = '1')
|
||||
{
|
||||
if (empty($password)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
include_once(APPPATH . 'libraries/PasswordHash.php');
|
||||
|
||||
$hasher = new PasswordHash();
|
||||
$hash = $hasher->HashPassword($password);
|
||||
|
||||
return $hash;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( ! function_exists('password_verify')) {
|
||||
function password_verify($password = '', $hash = '')
|
||||
{
|
||||
if (empty($password)) {
|
||||
return false;
|
||||
}
|
||||
if (empty($hash)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
include_once(APPPATH . 'libraries/PasswordHash.php');
|
||||
|
||||
$hasher = new PasswordHash();
|
||||
|
||||
return $hasher->CheckPassword($password, $hash);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user