Changeset 6785


Ignore:
Timestamp:
Aug 21, 2010, 10:44:33 PM (14 years ago)
Author:
Eric
Message:
  • Bug 1693 fixed - Multi-languages are available for ConfirmMail customization (using Extended Description plugin)
  • Bug 1810 partially fixed - Auto login is not performed after visitors have validated their registration but the "home" button changes his link to redirect to identification page when the redirection option is set. Note: The redirection to profile.php doesn't work because I was unable to use the log_user() function on ConfirmMail page. This feature is still under investigation to perform the best way.
Location:
extensions/NBC_UserAdvManager/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/trunk/ConfirmMail.php

    r6354 r6785  
    88include_once (UAM_PATH.'include/functions.inc.php');
    99
    10 // +-----------------------------------------------------------------------+
    11 // | Check Access and exit when user status is not ok                      |
    12 // +-----------------------------------------------------------------------+
    13 //check_status(ACCESS_NONE);
    14 load_language('plugin.lang', UAM_PATH);
    15 
    1610$title= l10n('confirm_mail_page_title');
    1711$page['body_id'] = 'theAboutPage';
     
    2216
    2317
    24 if (isset($_GET['key']))
     18if (isset($_GET['key']) and isset($_GET['userid']))
    2519{
    2620
    27   global $conf;
     21  global $user, $lang, $conf, $errors;
     22 
     23  $key = $_GET['key'];
     24  $userid = $_GET['userid'];
     25  $redirect = false;
    2826 
    2927  $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']);
     28  $conf_UAM = unserialize($conf['UserAdvManager']);
    3029
    31   if (VerifyConfirmMail($_GET['key']))
     30  if (VerifyConfirmMail($key))
    3231  {
    3332    $status = true;
    3433   
     34    log_user($userid, false);
     35
     36/* We have to get the user's language in database */
     37    $query = '
     38SELECT '.USER_INFOS_TABLE.'.language
     39FROM '.USER_INFOS_TABLE.','.USER_CONFIRM_MAIL_TABLE.'
     40WHERE (('.USER_INFOS_TABLE.'.user_id ='.$userid.') AND ('.USER_INFOS_TABLE.'.user_id = '.USER_CONFIRM_MAIL_TABLE.'.user_id))
     41;';
     42    $data = pwg_db_fetch_assoc(pwg_query($query));
     43
     44/* Check if user is already registered (profile changing) - If not (new registration), language is set to current gallery language */
     45    if (empty($data))
     46    {
     47/* And switch gallery to this language before using personalized and multilangual contents */
     48      $language = pwg_get_session_var('lang_switch', $user['language']);
     49      switch_lang_to($language);
     50    }
     51    else
     52    {
     53/* And switch gallery to this language before using personalized and multilangual contents */
     54      switch_lang_to($data['language']);
     55      load_language('plugin.lang', UAM_PATH);
     56    }
     57
     58    if (function_exists('get_user_language_desc'))
     59    {
     60      $custom_text = get_user_language_desc($conf_UAM_ConfirmMail[5]);
     61    }
     62    else $custom_text = l10n($conf_UAM_ConfirmMail[5]);
     63
     64    if (isset($conf_UAM[21]) and $conf_UAM[21] == 'true')
     65    {
     66      $user_idsOK = array();
     67      if (!check_consult($userid, $user_idsOK))
     68      {
     69        $redirect = true;
     70      }
     71    }
     72   
    3573    $template->assign(
    3674                        array(
     75        'REDIRECT'             => $redirect,
    3776        'STATUS'               => $status,
    38                                 'CONFIRM_MAIL_MESSAGE' => $conf_UAM_ConfirmMail[5],
     77                                'CONFIRM_MAIL_MESSAGE' => $custom_text,
    3978                        )
    4079                );
     
    4382  {
    4483    $status = false;
     84    if (function_exists('get_user_language_desc'))
     85    {
     86      $custom_text = get_user_language_desc($conf_UAM_ConfirmMail[6]);
     87    }
     88    else $custom_text = l10n($conf_UAM_ConfirmMail[6]);
     89   
    4590    $template->assign(
    4691                        array(
     92        'REDIRECT'             => $redirect,
    4793        'STATUS'               => $status,
    48                                 'CONFIRM_MAIL_MESSAGE' => $conf_UAM_ConfirmMail[6],
     94                                'CONFIRM_MAIL_MESSAGE' => $custom_text,
    4995                        )
    5096                );
     
    60106
    61107if ( isset($conf['gallery_url']) )
    62         {
     108{
    63109        $template->assign(
    64110                array(
  • extensions/NBC_UserAdvManager/trunk/changelog.txt.php

    r6784 r6785  
    186186            Bug 1795 fixed - Fixes rules using email information and/or email of validation
    187187
    188 -- 2.15.5 : Bug 1727 fixed - The redirection does not appli to admins, webmaster and generic users.
     188-- 2.15.5 : Bug 1693 fixed - Multi-languages are available for ConfirmMail customization (using Extended Description plugin)
     189            Bug 1727 fixed - The redirection does not appli to admins, webmaster and generic users.
    189190            Bug 1807 fixed - Textareas are resized according the screen resolution
    190191            Bug 1808 fixed - The Tracking users table is ordered by default on "LastVisit" field (last in at top)
    191192            Bug 1809 fixed - Addition of a direct link to user's profile in all UAM tables. The link gives a new window
     193            Bug 1810 partially fixed - Auto login is not performed after visitors have validated their registration but the "home" button changes his link to redirect to identification page when the redirection option is set. Note: The redirection to profile.php doesn't work because I was unable to use the log_user() function on ConfirmMail page). This feature is still under investigation to perform the best way.
    192194*/
    193195?>
  • extensions/NBC_UserAdvManager/trunk/include/functions.inc.php

    r6775 r6785  
    387387    }
    388388   
    389     return get_absolute_root_url().UAM_PATH.'ConfirmMail.php?key='.$Confirm_Mail_ID;
     389    return get_absolute_root_url().UAM_PATH.'ConfirmMail.php?key='.$Confirm_Mail_ID.'&userid='.$user_id;
    390390  }
    391391}
     
    458458                pwg_query($query);
    459459   
    460     return get_absolute_root_url().UAM_PATH.'ConfirmMail.php?key='.$Confirm_Mail_ID;
     460    return get_absolute_root_url().UAM_PATH.'ConfirmMail.php?key='.$Confirm_Mail_ID.'&userid='.$user_id;
    461461  }
    462462}
     
    505505  $tab = array();
    506506
    507   $query = "
     507  $query = '
    508508SELECT value
    509 FROM ".CONFIG_TABLE."
    510 WHERE param = 'UserAdvManager_Redir'
    511 ;";
     509FROM '.CONFIG_TABLE.'
     510WHERE param = "UserAdvManager_Redir"
     511;';
    512512
    513513  $tab = pwg_db_fetch_row(pwg_query($query));
     
    527527
    528528/* Function called from ConfirmMail.php to verify validation key used by user according time limit */
     529/* Return true is key validation is OK else return false */
    529530function VerifyConfirmMail($id)
    530531{
  • extensions/NBC_UserAdvManager/trunk/template/ConfirmMail.tpl

    r5633 r6785  
    55    <ul class="categoryActions">
    66      <li>
     7    {if $REDIRECT}
     8        <a href="{$ROOT_URL}identification.php" title="{'return to homepage'|@translate}">
     9          <img src="{$ROOT_URL}{$themeconf.icon_dir}/home.png" class="button" alt="{'home'|@translate}">
     10        </a>
     11    {else}
    712      {if isset($GALLERY_URL)}
    813        <a href="{$GALLERY_URL}" title="{'return to homepage'|@translate}">
     
    1419        </a>
    1520      {/if}
     21    {/if}
    1622      </li>
    1723    </ul>
Note: See TracChangeset for help on using the changeset viewer.