X-Git-Url: https://git.llucax.com/z.facultad/75.43/tp1.git/blobdiff_plain/a148fa868c1bbf6e3f16130f019cd2e49e18cc8f..acccc4f0814d1d5eb98c2fb184b97ffc6664421f:/src/lib/file.users.php?ds=sidebyside diff --git a/src/lib/file.users.php b/src/lib/file.users.php index d874638..3e1c835 100644 --- a/src/lib/file.users.php +++ b/src/lib/file.users.php @@ -17,7 +17,7 @@ require_once 'lib/file.php'; */ function file_users_get_all() { - if (($f = fopen("data/admins.txt", 'r')) === false) return false; + if (($f = fopen("data/users.txt", 'r')) === false) return false; $users = array(); while (!feof($f)) $users[] = fgetcsv($f, 4096); fclose($f); @@ -31,7 +31,7 @@ function file_users_get_all() */ function file_users_get($user) { - if (($f = fopen("data/admins.txt", 'r')) === false) return false; + if (($f = fopen("data/users.txt", 'r')) === false) return false; while (!feof($f)) { $u = fgetcsv($f, 4096); @@ -52,8 +52,7 @@ function file_users_get($user) */ function file_users_add($user, $pass, $email) { - if (file_users_get($user)) return false; // Ya existe - if (($f = fopen("data/admins.txt", 'a')) === false) return false; // error + if (($f = fopen("data/users.txt", 'a')) === false) return false; // error fputcsv($f, array($user, $pass, $email)); fclose($f); return true;