mirror of
https://github.com/danpros/htmly.git
synced 2026-04-18 19:46:21 +05:30
[TASK] added create_user Function.
This commit is contained in:
parent
5eefbe93f8
commit
e8b517b7bd
1 changed files with 12 additions and 0 deletions
|
|
@ -13,6 +13,18 @@ function user($key, $user = null)
|
|||
}
|
||||
}
|
||||
|
||||
function create_user($userName, $password){
|
||||
$file = 'config/users/' . $userName . '.ini';
|
||||
if(file_exists($file)) {
|
||||
return false;
|
||||
} else {
|
||||
file_put_contents($file,"password = " . hash("sha512",$password) . "\n" .
|
||||
"encryption = sha512\n" .
|
||||
"role = user\n");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Create a session
|
||||
function session($user, $pass, $str = null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue