Ignore:
Timestamp:
Aug 21, 2010, 6:31:47 PM (14 years ago)
Author:
Eric
Message:

Bug 1727 fixed - The redirection does not appli to admins, webmaster and generic users.
W3C HTML 4.0 strict compliance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/trunk/main.inc.php

    r6783 r6784  
    397397
    398398// RedirectToProfile - Thx to LucMorizur
    399 // redirects a visitor (not generic (forbidden) neither admin) to his
     399// redirects a visitor (except for admins, webmasters and generic statuses) to his
    400400// profile.php page
    401401//
     
    408408 
    409409  $conf_UAM = unserialize($conf['UserAdvManager']);
    410 
    411   if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true'))
    412   {
    413     $user_idsOK = array();
    414     if (!check_consult($user['id'], $user_idsOK))
    415       redirect(PHPWG_ROOT_PATH.'profile.php');
     410 
     411  $query ='
     412SELECT user_id, status
     413FROM '.USER_INFOS_TABLE.'
     414WHERE user_id = '.$user['id'].'
     415;';
     416  $data = pwg_db_fetch_assoc(pwg_query($query));
     417 
     418  if ($data['status'] <> "admin" and $data['status'] <> "webmaster" and $data['status'] <> "generic")
     419  {
     420    if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true'))
     421    {
     422      $user_idsOK = array();
     423      if (!check_consult($user['id'], $user_idsOK))
     424        redirect(PHPWG_ROOT_PATH.'profile.php');
     425    }
    416426  }
    417427}
Note: See TracChangeset for help on using the changeset viewer.