X-Git-Url: https://git.llucax.com/z.facultad/75.43/tp1.git/blobdiff_plain/ccbc22b804a14b60f48383323105df5bd30b84bf..271d752bc3321b73e78343ed03935dd46b5fb551:/src/lib/file.admins.php?ds=sidebyside diff --git a/src/lib/file.admins.php b/src/lib/file.admins.php index 650d69d..74498c9 100644 --- a/src/lib/file.admins.php +++ b/src/lib/file.admins.php @@ -15,7 +15,7 @@ */ function file_admins_check() { - return count(@file('data/admins.txt', 'r')) > 1; + return count(@file('data/admins.txt')) > 1; } /** @@ -25,7 +25,7 @@ function file_admins_check() */ function file_admins_es_admin($user) { - if (!($admins = @file('data/admins.txt', 'r'))) return false; + if (!($admins = file('data/admins.txt'))) return false; foreach ($admins as $admin) if (trim($admin) == $user) return true; return false; } @@ -37,7 +37,7 @@ function file_admins_es_admin($user) */ function file_admins_get() { - if (!($admins = @file('data/admins.txt', 'r'))) return false; + if (!($admins = file('data/admins.txt'))) return false; if (array_walk($admins, '_file_admins_walk_trim')) return false; return $admins; } @@ -50,7 +50,7 @@ function file_admins_get() function file_admins_add($user) { if (file_admins_check()) return false; // Si ya hay 2, no se puede agregar - if (($f = fopen("data/admins.txt", 'a')) === false) return false; + if (($f = fopen('data/admins.txt', 'a')) === false) return false; fwrite($f, "$user\n"); fclose($f); return true; @@ -66,7 +66,7 @@ function file_admins_replace($viejo, $nuevo) if (($admins = file_admins_get()) === false) return false; // error if (array_walk($admins, '_file_admins_walk_replace', array($viejo, $nuevo))) return false; //error - if (($f = fopen("data/admins.txt", 'w')) === false) return false; //error + if (($f = fopen('data/admins.txt', 'w')) === false) return false; //error foreach ($admins as $admin) fwrite($f, "$admin\n"); fclose($f); return true;