source: extensions/NBC_UserAdvManager/branches/2.16/ConfirmMail.php @ 9698

Last change on this file since 9698 was 8088, checked in by Eric, 14 years ago

merge from trunk to branch 2.16

  • Property svn:eol-style set to LF
File size: 3.0 KB
Line 
1<?php
2//----------------------------------------------------------- include
3define('PHPWG_ROOT_PATH','./../../');
4
5include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
6include_once( PHPWG_ROOT_PATH.'include/functions_mail.inc.php' );
7
8include_once (UAM_PATH.'include/constants.php');
9include_once (UAM_PATH.'include/functions.inc.php');
10
11$title= l10n('confirm_mail_page_title');
12$page['body_id'] = 'theAboutPage';
13include(PHPWG_ROOT_PATH.'include/page_header.php');
14
15@include(PHPWG_ROOT_PATH.'template/'.$user['template'].
16  '/theme/'.$user['theme'].'/themeconf.inc.php');
17
18
19if (isset($_GET['key']) and isset($_GET['userid']))
20{
21
22  global $user, $lang, $conf, $errors;
23 
24  $key = $_GET['key'];
25  $userid = $_GET['userid'];
26  $redirect = false;
27 
28  $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']);
29  $conf_UAM = unserialize($conf['UserAdvManager']);
30
31  if (VerifyConfirmMail($key))
32  {
33    $status = true;
34   
35    log_user($userid, false);
36
37/* We have to get the user's language in database */
38    $query = '
39SELECT '.USER_INFOS_TABLE.'.language
40FROM '.USER_INFOS_TABLE.','.USER_CONFIRM_MAIL_TABLE.'
41WHERE (('.USER_INFOS_TABLE.'.user_id ='.$userid.') AND ('.USER_INFOS_TABLE.'.user_id = '.USER_CONFIRM_MAIL_TABLE.'.user_id))
42;';
43    $data = pwg_db_fetch_assoc(pwg_query($query));
44
45/* Check if user is already registered (profile changing) - If not (new registration), language is set to current gallery language */
46    if (empty($data))
47    {
48/* And switch gallery to this language before using personalized and multilangual contents */
49      $language = pwg_get_session_var('lang_switch', $user['language']);
50      switch_lang_to($language);
51    }
52    else
53    {
54/* And switch gallery to this language before using personalized and multilangual contents */
55      switch_lang_to($data['language']);
56      load_language('plugin.lang', UAM_PATH);
57    }
58
59    if (function_exists('get_user_language_desc'))
60    {
61      $custom_text = get_user_language_desc($conf_UAM_ConfirmMail[5]);
62    }
63    else $custom_text = l10n($conf_UAM_ConfirmMail[5]);
64
65    $redirect = true;
66   
67    $template->assign(
68                        array(
69        'REDIRECT'             => $redirect,
70        'STATUS'               => $status,
71                                'CONFIRM_MAIL_MESSAGE' => $custom_text,
72                        )
73                );
74  } 
75  else
76  {
77    $status = false;
78    $redirect = false;
79    if (function_exists('get_user_language_desc'))
80    {
81      $custom_text = get_user_language_desc($conf_UAM_ConfirmMail[6]);
82    }
83    else $custom_text = l10n($conf_UAM_ConfirmMail[6]);
84   
85    $template->assign(
86                        array(
87        'REDIRECT'             => $redirect,
88        'GALLERY_URL'          => make_index_url(),
89        'STATUS'               => $status,
90                                'CONFIRM_MAIL_MESSAGE' => $custom_text,
91                        )
92                );
93  }
94}
95
96if (isset($lang['Theme: '.$user['theme']]))
97{
98  $template->assign(
99        'THEME_ABOUT',l10n('Theme: '.$user['theme'])
100  );
101}
102
103$template->set_filenames(
104  array(
105        'confirm_mail'=>dirname(__FILE__).'/template/ConfirmMail.tpl',
106        )
107);
108
109$template->pparse('confirm_mail');
110include(PHPWG_ROOT_PATH.'include/page_tail.php');
111?>
Note: See TracBrowser for help on using the repository browser.