Browse Source

[TASK] added create_user Function.

pull/126/head
Kanti 11 years ago
parent
commit
e8b517b7bd
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      system/admin/admin.php

+ 12
- 0
system/admin/admin.php View File

@ -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…
Cancel
Save