Changeset 6785 for extensions/NBC_UserAdvManager
- Timestamp:
- Aug 21, 2010, 10:44:33 PM (14 years ago)
- Location:
- extensions/NBC_UserAdvManager/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/trunk/ConfirmMail.php
r6354 r6785 8 8 include_once (UAM_PATH.'include/functions.inc.php'); 9 9 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 16 10 $title= l10n('confirm_mail_page_title'); 17 11 $page['body_id'] = 'theAboutPage'; … … 22 16 23 17 24 if (isset($_GET['key']) )18 if (isset($_GET['key']) and isset($_GET['userid'])) 25 19 { 26 20 27 global $conf; 21 global $user, $lang, $conf, $errors; 22 23 $key = $_GET['key']; 24 $userid = $_GET['userid']; 25 $redirect = false; 28 26 29 27 $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']); 28 $conf_UAM = unserialize($conf['UserAdvManager']); 30 29 31 if (VerifyConfirmMail($ _GET['key']))30 if (VerifyConfirmMail($key)) 32 31 { 33 32 $status = true; 34 33 34 log_user($userid, false); 35 36 /* We have to get the user's language in database */ 37 $query = ' 38 SELECT '.USER_INFOS_TABLE.'.language 39 FROM '.USER_INFOS_TABLE.','.USER_CONFIRM_MAIL_TABLE.' 40 WHERE (('.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 35 73 $template->assign( 36 74 array( 75 'REDIRECT' => $redirect, 37 76 'STATUS' => $status, 38 'CONFIRM_MAIL_MESSAGE' => $c onf_UAM_ConfirmMail[5],77 'CONFIRM_MAIL_MESSAGE' => $custom_text, 39 78 ) 40 79 ); … … 43 82 { 44 83 $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 45 90 $template->assign( 46 91 array( 92 'REDIRECT' => $redirect, 47 93 'STATUS' => $status, 48 'CONFIRM_MAIL_MESSAGE' => $c onf_UAM_ConfirmMail[6],94 'CONFIRM_MAIL_MESSAGE' => $custom_text, 49 95 ) 50 96 ); … … 60 106 61 107 if ( isset($conf['gallery_url']) ) 62 108 { 63 109 $template->assign( 64 110 array( -
extensions/NBC_UserAdvManager/trunk/changelog.txt.php
r6784 r6785 186 186 Bug 1795 fixed - Fixes rules using email information and/or email of validation 187 187 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. 189 190 Bug 1807 fixed - Textareas are resized according the screen resolution 190 191 Bug 1808 fixed - The Tracking users table is ordered by default on "LastVisit" field (last in at top) 191 192 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. 192 194 */ 193 195 ?> -
extensions/NBC_UserAdvManager/trunk/include/functions.inc.php
r6775 r6785 387 387 } 388 388 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; 390 390 } 391 391 } … … 458 458 pwg_query($query); 459 459 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; 461 461 } 462 462 } … … 505 505 $tab = array(); 506 506 507 $query = "507 $query = ' 508 508 SELECT value 509 FROM ".CONFIG_TABLE."510 WHERE param = 'UserAdvManager_Redir'511 ; ";509 FROM '.CONFIG_TABLE.' 510 WHERE param = "UserAdvManager_Redir" 511 ;'; 512 512 513 513 $tab = pwg_db_fetch_row(pwg_query($query)); … … 527 527 528 528 /* 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 */ 529 530 function VerifyConfirmMail($id) 530 531 { -
extensions/NBC_UserAdvManager/trunk/template/ConfirmMail.tpl
r5633 r6785 5 5 <ul class="categoryActions"> 6 6 <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} 7 12 {if isset($GALLERY_URL)} 8 13 <a href="{$GALLERY_URL}" title="{'return to homepage'|@translate}"> … … 14 19 </a> 15 20 {/if} 21 {/if} 16 22 </li> 17 23 </ul>
Note: See TracChangeset
for help on using the changeset viewer.