Ignore:
Timestamp:
Aug 18, 2010, 10:43:18 PM (14 years ago)
Author:
Eric
Message:
  • Bug 1727 partially fixed: New option to redirect users to profile page after their first login only.
  • Known problem:
  • The redirection doesn't work after registration and after confirmation page (if ConfirmMail is enabled)
  • The redirection applies to already registered users including admins, webmaster and generic status.
  • Language files updated
  • Upgrade of upgradedb.inc.php
  • Prepare to new version 2.15.4 encode
Location:
extensions/NBC_UserAdvManager/trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/trunk/include/functions.inc.php

    r6757 r6775  
    498498  pwg_query($query);
    499499}
     500
     501
     502/* Function called from main.inc.php - Triggered on user deletion */
     503function DeleteRedir($user_id)
     504{
     505  $tab = array();
     506
     507  $query = "
     508SELECT value
     509FROM ".CONFIG_TABLE."
     510WHERE param = 'UserAdvManager_Redir'
     511;";
     512
     513  $tab = pwg_db_fetch_row(pwg_query($query));
     514 
     515  $values = explode(',', $tab[0]);
     516
     517  unset($values[array_search($user_id, $values)]);
     518     
     519  $query = "
     520UPDATE ".CONFIG_TABLE."
     521SET value = \"".implode(',', $values)."\"
     522WHERE param = 'UserAdvManager_Redir';";
     523
     524  pwg_query($query);
     525}
     526
    500527
    501528/* Function called from ConfirmMail.php to verify validation key used by user according time limit */
     
    11851212  }
    11861213}
     1214
     1215
     1216// check_consult - Thx to LucMorizur
     1217// checks if a user id is registered as having already
     1218// visited his profile.php page.
     1219// @uid        : the user id
     1220// @user_idsOK : (returned) array of all users ids having already visited
     1221//               their profile.php pages
     1222//
     1223// @returns    : true or false whether the users has already visited his
     1224//               profile.php page or not
     1225function check_consult($uid, &$user_idsOK)
     1226{
     1227  $t = array();
     1228  $v = false;
     1229 
     1230  $query = "
     1231SELECT value
     1232FROM ".CONFIG_TABLE."
     1233WHERE param = 'UserAdvManager_Redir'
     1234;";
     1235 
     1236  if ($v = (($t = pwg_db_fetch_row(pwg_query($query))) !== false))
     1237  {
     1238    $user_idsOK = explode(',', $t[0]);
     1239    $v = (in_array($uid, $user_idsOK));
     1240  }
     1241  return $v;
     1242}
    11871243?>
  • extensions/NBC_UserAdvManager/trunk/include/upgradedb.inc.php

    r6354 r6775  
    247247  $Newconf_UAM[19] = $Newconf_UAM[20];
    248248  $Newconf_UAM[20] = $Newconf_UAM[21];
    249   unset($Newconf_UAM[21]);
     249  $Newconf_UAM[21] = 'false';
    250250 
    251251  $update_conf = serialize($Newconf_UAM);
     
    258258                ;';
    259259
    260                 pwg_query($query);
     260        pwg_query($query);
     261
     262  $query = '
     263INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
     264VALUES ("UserAdvManager_Redir","0","UAM Redirections")
     265  ;';
     266 
     267  pwg_query($query);
    261268}
    262269?>
Note: See TracChangeset for help on using the changeset viewer.