users.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. if(!DEFINED('EGP'))
  3. exit(header('Refresh: 0; URL=http://'.$_SERVER['SERVER_NAME'].'/404'));
  4. class users
  5. {
  6. public static function ava($user)
  7. {
  8. global $cfg;
  9. $file = 'upload/avatars/'.$user.'.';
  10. $link = $cfg['http'].'upload/avatars/'.$user.'.';
  11. if(file_exists(ROOT.$file.'jpg'))
  12. return $link.'jpg';
  13. if(file_exists(ROOT.$file.'png'))
  14. return $link.'png';
  15. if(file_exists(ROOT.$file.'gif'))
  16. return $link.'gif';
  17. return $cfg['http'].'template/images/avatar.png';
  18. }
  19. public static function nav($active)
  20. {
  21. global $cfg, $html;
  22. $aUnit = array('index', 'settings', 'auth', 'logs', 'security');
  23. $html->get('gmenu', 'sections/user');
  24. $html->set('home', $cfg['http']);
  25. foreach($aUnit as $unit)
  26. if($unit == $active) $html->unit($unit, 1); else $html->unit($unit);
  27. $html->pack('main');
  28. $html->get('vmenu', 'sections/user');
  29. $html->set('home', $cfg['http']);
  30. foreach($aUnit as $unit)
  31. if($unit == $active) $html->unit($unit, 1); else $html->unit($unit);
  32. $html->pack('vmenu');
  33. return NULL;
  34. }
  35. }
  36. ?>