- Timestamp:
- Nov 30, 2009, 10:14:50 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php
r4384 r4399 14 14 $infos1_perso = ""; 15 15 $infos2_perso = ""; 16 17 /* We have to get the user's language in database */ 18 $query =' 19 SELECT user_id, language 20 FROM '.USER_INFOS_TABLE.' 21 WHERE user_id = '.$id.' 22 ;'; 23 $data = mysql_fetch_assoc(pwg_query($query)); 24 $language = $data['language']; 25 /* And switch gallery to this language before using personalized and multilangual contents */ 26 switch_lang_to($data['language']); 16 27 17 28 switch($typemail) … … 75 86 } 76 87 88 /* Sending the email with subject and contents */ 77 89 pwg_mail($email, array( 78 90 'subject' => $subject, … … 80 92 )); 81 93 94 /* Switching back to default language */ 95 switch_lang_back(); 96 97 /* ********************** */ 98 /* Email sending debugger */ 99 /* This is only to trace */ 100 /* the send of emails for */ 101 /* debugging */ 102 /* ********************** */ 103 // MailLog($email,$subject, $content); 104 /* ********************** */ 105 } 106 107 108 /* Email sending debugger function */ 109 //function MailLog ($to, $subject, $content) 110 //{ 111 // $fo=fopen (NBC_UserAdvManager_PATH.'admin/maillog.txt','a') ; 112 // fwrite($fo,"======================\n") ; 113 // fwrite($fo,'le ' . date('D, d M Y H:i:s') . "\r\n"); 114 // fwrite($fo,$to . "\n" . $subject . "\r\n") ; 115 // fwrite($fo, "\n" . $content . "\r\n") ; 116 //fwrite($fo, 'Langue : '."\n" . $language . "\r\n") ; 117 // fclose($fo) ; 118 //return mail ($to,$subject) ; 119 //} 120 121 122 /* Function called from UserAdvManager_admin.php to resend validation email with or without new validation key */ 123 function ResendMail2User($typemail, $user_id, $username, $email, $confirm) 124 { 125 global $conf; 126 $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array(); 127 $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array(); 128 129 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 130 131 $infos1_perso = ""; 132 $infos2_perso = ""; 133 134 /* We have to get the user's language in database */ 135 $query =' 136 SELECT user_id, language 137 FROM '.USER_INFOS_TABLE.' 138 WHERE user_id = '.$id.' 139 ;'; 140 $data = mysql_fetch_assoc(pwg_query($query)); 141 $language = $data['language']; 142 /* And switch gallery to this language before using personalized and multilangual contents */ 143 switch_lang_to($data['language']); 144 145 switch($typemail) 146 { 147 case 1: 148 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_with_key_of_%s', $username)); 149 150 if (isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and $confirm) 151 { 152 if (function_exists('get_user_language_desc')) 153 { 154 $infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 155 } 156 else $infos1 = l10n($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 157 158 $infos2 = array 159 ( 160 get_l10n_args('Link: %s', ResetConfirmMail($user_id)), 161 get_l10n_args('', ''), 162 ); 163 } 164 165 /* Set reminder true */ 166 $query = " 167 UPDATE ".USER_CONFIRM_MAIL_TABLE." 168 SET reminder = 'true' 169 WHERE user_id = '".$user_id."' 170 ;"; 171 pwg_query($query); 172 173 break; 174 175 case 2: 176 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_without_key_of_%s',$username)); 177 178 if (isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and !$confirm) 179 { 180 if (function_exists('get_user_language_desc')) 181 { 182 $infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 183 } 184 else $infos1 = l10n($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 185 } 186 187 /* Set reminder true */ 188 $query = " 189 UPDATE ".USER_CONFIRM_MAIL_TABLE." 190 SET reminder = 'true' 191 WHERE user_id = '".$user_id."' 192 ;"; 193 pwg_query($query); 194 195 break; 196 } 197 198 pwg_mail($email, array( 199 'subject' => $subject, 200 'content' => ($infos1."\n\n").(isset($infos2) ? l10n_args($infos2)."\n\n" : "").get_absolute_root_url(), 201 )); 202 203 /* Switching back to default language */ 204 switch_lang_back(); 82 205 /* ********************** */ 83 206 /* Email sending debugger */ … … 91 214 92 215 93 /* Email sending debugger function */ 94 //function MailLog ($to, $subject) 95 //{ 96 // $fo=fopen (NBC_UserAdvManager_PATH.'admin/maillog.txt','a') ; 97 // fwrite($fo,"======================\n") ; 98 // fwrite($fo,'le ' . date('D, d M Y H:i:s') . "\r\n"); 99 // fwrite($fo,$to . "\n" . $subject . "\r\n") ; 100 // fclose($fo) ; 101 //return mail ($to,$subject) ; 102 //} 103 104 105 /* Function called from UserAdvManager_admin.php to resend validation email with or without new validation key */ 106 function ResendMail2User($typemail, $user_id, $username, $email, $confirm) 216 /* Function called from UserAdvManager_admin.php to send a reminder mail for ghost users */ 217 function ghostreminder($user_id, $username, $email) 107 218 { 108 219 global $conf; 109 220 $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array(); 110 $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();111 221 112 222 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 113 223 114 224 $infos1_perso = ""; 115 $infos2_perso = ""; 116 117 switch($typemail) 118 { 119 case 1: 120 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_with_key_of_%s', $username)); 121 122 if (isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and $confirm) 123 { 124 if (function_exists('get_user_language_desc')) 125 { 126 $infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 127 } 128 else $infos1 = l10n($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 129 130 $infos2 = array 131 ( 132 get_l10n_args('Link: %s', ResetConfirmMail($user_id)), 133 get_l10n_args('', ''), 134 ); 135 } 136 137 /* Set reminder true */ 138 $query = " 139 UPDATE ".USER_CONFIRM_MAIL_TABLE." 140 SET reminder = 'true' 141 WHERE user_id = '".$user_id."' 142 ;"; 143 pwg_query($query); 144 145 break; 146 147 case 2: 148 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_without_key_of_%s',$username)); 149 150 if (isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and !$confirm) 151 { 152 if (function_exists('get_user_language_desc')) 153 { 154 $infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 155 } 156 else $infos1 = l10n($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 157 } 158 159 /* Set reminder true */ 160 $query = " 161 UPDATE ".USER_CONFIRM_MAIL_TABLE." 162 SET reminder = 'true' 163 WHERE user_id = '".$user_id."' 164 ;"; 165 pwg_query($query); 166 167 break; 168 } 169 170 pwg_mail($email, array( 171 'subject' => $subject, 172 'content' => ($infos1."\n\n").(isset($infos2) ? l10n_args($infos2)."\n\n" : "").get_absolute_root_url(), 173 )); 174 175 /* ********************** */ 176 /* Email sending debugger */ 177 /* This is only to trace */ 178 /* the send of emails for */ 179 /* debugging */ 180 /* ********************** */ 181 // MailLog($email,$subject); 182 /* ********************** */ 183 } 184 185 186 /* Function called from UserAdvManager_admin.php to send a reminder mail for ghost users */ 187 function ghostreminder($user_id, $username, $email) 188 { 189 global $conf; 190 $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array(); 191 192 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 193 194 $infos1_perso = ""; 225 226 /* We have to get the user's language in database */ 227 $query =' 228 SELECT user_id, language 229 FROM '.USER_INFOS_TABLE.' 230 WHERE user_id = '.$id.' 231 ;'; 232 $data = mysql_fetch_assoc(pwg_query($query)); 233 $language = $data['language']; 234 /* And switch gallery to this language before using personalized and multilangual contents */ 235 switch_lang_to($data['language']); 195 236 196 237 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Ghost_remainder_of_%s', $username)); … … 212 253 )); 213 254 255 /* Switching back to default language */ 256 switch_lang_back(); 214 257 /* ********************** */ 215 258 /* Email sending debugger */
Note: See TracChangeset
for help on using the changeset viewer.