auth.php 475 B

1234567891011121314151617181920212223
  1. <?php
  2. function adm_check_user() {
  3. GLOBAL $username;
  4. $auth = FALSE;
  5. if ( file_exists( '../plugins/administrator/admins' ) ) {
  6. $auths = file( '../plugins/administrator/admins' );
  7. $auth = in_array( "$username\n", $auths );
  8. }else if ( $adm_id = fileowner('../config/config.php') ) {
  9. $adm = posix_getpwuid( $adm_id );
  10. if ( $username == $adm['name'] ) {
  11. $auth = TRUE;
  12. }
  13. }
  14. return( $auth );
  15. }
  16. ?>