Changeset 14366 for extensions/UserAdvManager/branches/2.40/include
- Timestamp:
- Apr 24, 2012, 9:18:13 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserAdvManager/branches/2.40/include/functions.inc.php
r13842 r14366 101 101 { 102 102 $passwd = (isset($_POST['password'])) ? $_POST['password'] : ''; 103 104 if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local')) 105 { 106 // This is to send an information email and set user to "waiting" group or status until admin validation 107 // ----------------------------------------------------------------------------------------------------- 108 SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false); 103 104 if (isset($conf_UAM[1]) and $conf_UAM[1] == 'local') 105 { 106 // This is to set user to "waiting" group or status and without ConfirMail until admin validation 107 // ---------------------------------------------------------------------------------------------- 109 108 SetPermission($register_user['id']);// Set to "waiting" group or status until admin validation 110 }111 elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'false') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))112 {113 // This is to set user to "waiting" group or status until admin validation114 // -----------------------------------------------------------------------115 SetPermission($register_user['id']);// Set to "waiting" group or status until admin validation116 }117 elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'false'))118 {119 // This is to send an information email without validation key120 // -----------------------------------------------------------121 SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);122 109 } 123 110 // Sending registration confirmation by email 124 111 // ------------------------------------------ 125 elseif ( (isset($conf_UAM[0]) and $conf_UAM[0] == 'true' or $conf_UAM[0] == 'false') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))112 elseif (isset($conf_UAM[1]) and $conf_UAM[1] == 'true') 126 113 { 127 114 if (is_admin() and isset($conf_UAM[19]) and $conf_UAM[19] == 'true') … … 298 285 } 299 286 300 $typemail = 3; 287 $typemail = 3; // Only information email send to user on user profile update if checked 301 288 302 289 if (!empty($_POST['use_new_pwd'])) 303 290 { 304 $typemail = 2; 291 $typemail = 2; // Confirmation email on user profile update - With information email if checked 305 292 306 293 // Password enforcement control … … 322 309 // Sending registration confirmation by email 323 310 // ------------------------------------------ 324 if ( (isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or(isset($conf_UAM[1]) and $conf_UAM[1] == 'true') or (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))311 if (/*(isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or */(isset($conf_UAM[1]) and $conf_UAM[1] == 'true') or (isset($conf_UAM[1]) and $conf_UAM[1] == 'local')) 325 312 { 326 313 $confirm_mail_need = false; … … 339 326 // ------------------------------------ 340 327 if ($_POST['mail_address'] != $current_email and (isset($conf_UAM[1]) and $conf_UAM[1] == 'true')) 341 328 { 329 SetPermission($user['id']);// Set to "waiting" group or status until user validation 342 330 $confirm_mail_need = true; 331 } 343 332 344 333 // This is to set the user to "waiting" group or status until admin validation 345 334 // --------------------------------------------------------------------------- 346 if ($_POST['mail_address'] != $current_email and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))347 335 elseif ($_POST['mail_address'] != $current_email and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local')) 336 { 348 337 SetPermission($user['id']);// Set to "waiting" group or status until admin validation 349 338 $confirm_mail_need = false; 339 } 350 340 } 351 341 352 if (( !empty($_POST['use_new_pwd']) and (isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or $confirm_mail_need))342 if (((!empty($_POST['use_new_pwd']) and (isset($conf_UAM[0]) and $conf_UAM[0] == 'true')) or $confirm_mail_need)) 353 343 { 354 344 $query = ' … … 925 915 switch($typemail) 926 916 { 927 case 1: 917 case 1: // Confirmation email on user registration - Without information email (already managed by Piwigo) 928 918 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('UAM_Add of %s', stripslashes($username))); 919 920 break; 921 922 case 2: // Confirmation email on user profile update - With information email if checked 923 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('UAM_Update of %s', stripslashes($username))); 929 924 $password = $password <> '' ? $password : l10n('UAM_empty_pwd'); 930 925 931 926 if (isset($conf_UAM[8]) and $conf_UAM[8] <> '') 932 927 { … … 946 941 else $infos1_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n"; 947 942 } 948 949 break; 950 951 case 2: 952 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('UAM_Update of %s', stripslashes($username))); 953 $password = $password <> '' ? $password : l10n('UAM_empty_pwd'); 943 944 if (isset($conf_UAM[0]) and $conf_UAM[0] == 'true') 945 { 946 if (isset($conf_UAM[34]) and $conf_UAM[34] == 'true') // Allow display of clear password in email 947 { 948 $infos1 = array( 949 get_l10n_args('UAM_infos_mail %s', stripslashes($username)), 950 get_l10n_args('UAM_User: %s', stripslashes($username)), 951 get_l10n_args('UAM_Password: %s', $password), 952 get_l10n_args('Email: %s', $email), 953 get_l10n_args('', ''), 954 ); 955 } 956 else // Do not allow display of clear password in email 957 { 958 $infos1 = array( 959 get_l10n_args('UAM_infos_mail %s', stripslashes($username)), 960 get_l10n_args('UAM_User: %s', stripslashes($username)), 961 get_l10n_args('Email: %s', $email), 962 get_l10n_args('', ''), 963 ); 964 } 965 } 954 966 955 967 break; 956 968 957 case 3: 969 case 3: // Only information email send to user if checked 958 970 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('UAM_Update of %s', stripslashes($username))); 959 971 $password = $password <> '' ? $password : l10n('UAM_no_update_pwd'); 960 972 973 if (isset($conf_UAM[8]) and $conf_UAM[8] <> '') 974 { 975 // Management of Extension flags ([username], [mygallery], [myurl]) 976 // ---------------------------------------------------------------- 977 $patterns[] = '#\[username\]#i'; 978 $replacements[] = $username; 979 $patterns[] = '#\[mygallery\]#i'; 980 $replacements[] = $conf['gallery_title']; 981 $patterns[] = '#\[myurl\]#i'; 982 $replacements[] = $conf['gallery_url']; 983 984 if (function_exists('get_user_language_desc')) 985 { 986 $infos1_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n"; 987 } 988 else $infos1_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n"; 989 } 990 991 if (isset($conf_UAM[0]) and $conf_UAM[0] == 'true') 992 { 993 if (isset($conf_UAM[34]) and $conf_UAM[34] == 'true') // Allow display of clear password in email 994 { 995 $infos1 = array( 996 get_l10n_args('UAM_infos_mail %s', stripslashes($username)), 997 get_l10n_args('UAM_User: %s', stripslashes($username)), 998 get_l10n_args('UAM_Password: %s', $password), 999 get_l10n_args('Email: %s', $email), 1000 get_l10n_args('', ''), 1001 ); 1002 } 1003 else // Do not allow display of clear password in email 1004 { 1005 $infos1 = array( 1006 get_l10n_args('UAM_infos_mail %s', stripslashes($username)), 1007 get_l10n_args('UAM_User: %s', stripslashes($username)), 1008 get_l10n_args('Email: %s', $email), 1009 get_l10n_args('', ''), 1010 ); 1011 } 1012 } 1013 961 1014 break; 962 }963 964 if (isset($conf_UAM[0]) and $conf_UAM[0] == 'true')965 {966 if (isset($conf_UAM[34]) and $conf_UAM[34] == 'true') // Allow display of clear password in email967 {968 $infos1 = array(969 get_l10n_args('UAM_infos_mail %s', stripslashes($username)),970 get_l10n_args('UAM_User: %s', stripslashes($username)),971 get_l10n_args('UAM_Password: %s', $password),972 get_l10n_args('Email: %s', $email),973 get_l10n_args('', ''),974 );975 }976 else // Do not allow display of clear password in email977 {978 $infos1 = array(979 get_l10n_args('UAM_infos_mail %s', stripslashes($username)),980 get_l10n_args('UAM_User: %s', stripslashes($username)),981 get_l10n_args('Email: %s', $email),982 get_l10n_args('', ''),983 );984 }985 1015 } 986 1016 … … 1018 1048 } 1019 1049 1020 // ********************************************************1021 // **** Pending code since to find how to make it work ****1022 // ********************************************************1023 // Testing if FCK Editor is used. Then decoding htmlchars to avoid problems with pwg_mail()1024 /*$areas = array();1025 array_push( $areas,'UAM_MailInfo_Text','UAM_ConfirmMail_Text');1026 1027 if (function_exists('set_fckeditor_instance'))1028 {1029 $fcke_config = unserialize($conf['FCKEditor']);1030 foreach($areas as $area)1031 {1032 if (isset($fcke_config['UAM_MailInfo_Text']) and $fcke_config['UAM_MailInfo_Text'] = true)1033 {1034 $infos1_perso = html_entity_decode($infos1_perso,ENT_QUOTES,UTF-8);1035 }1036 1037 if (isset($fcke_config['UAM_ConfirmMail_Text']) and $fcke_config['UAM_ConfirmMail_Text'] = true)1038 {1039 $infos2_perso = html_entity_decode($infos2_perso,ENT_QUOTES,UTF-8);1040 }1041 }1042 }*/1043 1044 1045 1050 // Sending the email with subject and contents 1046 1051 // ------------------------------------------- … … 1090 1095 switch($typemail) 1091 1096 { 1092 case 1: 1097 case 1: //Generating email content for remind with a new key 1093 1098 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('UAM_Reminder_with_key_of_%s', $username)); 1094 1099 … … 1134 1139 break; 1135 1140 1136 case 2: 1141 case 2: //Generating email content for remind without a new key 1137 1142 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('UAM_Reminder_without_key_of_%s',$username)); 1138 1143
Note: See TracChangeset
for help on using the changeset viewer.