- Timestamp:
- Oct 29, 2009, 2:25:30 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php
r4135 r4143 63 63 $_POST['UserAdvManager_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_MailInfo_Text'])); 64 64 $_POST['UserAdvManager_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_Text'])); 65 66 $newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'].';'.$_POST['UserAdvManager_Password_Enforced'].';'.$_POST['UserAdvManager_Password_Score'].';'.$_POST['UserAdvManager_AdminPassword_Enforced'].';'.$_POST['UserAdvManager_GhostUser_Tracker']; 65 66 $_POST['UserAdvManager_GhostTracker_ReminderText'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_GhostTracker_ReminderText'])); 67 68 $newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'].';'.$_POST['UserAdvManager_Password_Enforced'].';'.$_POST['UserAdvManager_Password_Score'].';'.$_POST['UserAdvManager_AdminPassword_Enforced'].';'.$_POST['UserAdvManager_GhostUser_Tracker'].';'.$_POST['UserAdvManager_GhostTracker_DayLimit'].';'.$_POST['UserAdvManager_GhostTracker_ReminderText']; 67 69 68 70 $conf['nbc_UserAdvManager'] = $newconf_nbc_UserAdvManager; … … 182 184 $template->assign( 183 185 array( 184 'UserAdvManager_MAIL_INFO_TRUE' => $conf_nbc_UserAdvManager[0]=='true' ? 'checked="checked"' : '' , 185 'UserAdvManager_MAIL_INFO_FALSE' => $conf_nbc_UserAdvManager[0]=='false' ? 'checked="checked"' : '' , 186 'UserAdvManager_MAILINFO_TEXT' => $conf_nbc_UserAdvManager[10], 187 'UserAdvManager_NO_CASSE_TRUE' => $conf_nbc_UserAdvManager[1]=='true' ? 'checked="checked"' : '' , 188 'UserAdvManager_NO_CASSE_FALSE' => $conf_nbc_UserAdvManager[1]=='false' ? 'checked="checked"' : '' , 189 'UserAdvManager_USERNAME_CHAR_TRUE' => $conf_nbc_UserAdvManager[7]=='true' ? 'checked="checked"' : '' , 190 'UserAdvManager_USERNAME_CHAR_FALSE' => $conf_nbc_UserAdvManager[7]=='false' ? 'checked="checked"' : '' , 191 'UserAdvManager_USERNAME_CHAR_LIST' => $conf_nbc_UserAdvManager[8], 192 'UserAdvManager_CONFIRM_MAIL_TRUE' => $conf_nbc_UserAdvManager[2]=='true' ? 'checked="checked"' : '' , 193 'UserAdvManager_CONFIRM_MAIL_FALSE' => $conf_nbc_UserAdvManager[2]=='false' ? 'checked="checked"' : '' , 194 'UserAdvManager_CONFIRMMAIL_TEXT' => $conf_nbc_UserAdvManager[11], 195 'UserAdvManager_No_Confirm_Group' => $conf_nbc_UserAdvManager[3], 196 'UserAdvManager_Validated_Group' => $conf_nbc_UserAdvManager[4], 197 'UserAdvManager_No_Confirm_Status' => $conf_nbc_UserAdvManager[9], 198 'UserAdvManager_Validated_Status' => $conf_nbc_UserAdvManager[5], 199 'UserAdvManager_NO_COMMENT_ANO_TRUE' => $conf_nbc_UserAdvManager[6]=='true' ? 'checked="checked"' : '' , 200 'UserAdvManager_NO_COMMENT_ANO_FALSE' => $conf_nbc_UserAdvManager[6]=='false' ? 'checked="checked"' : '' , 201 'UserAdvManager_MAILEXCLUSION_TRUE' => $conf_nbc_UserAdvManager[12]=='true' ? 'checked="checked"' : '' , 202 'UserAdvManager_MAILEXCLUSION_FALSE' => $conf_nbc_UserAdvManager[12]=='false' ? 'checked="checked"' : '' , 203 'UserAdvManager_MAILEXCLUSION_LIST' => $conf_nbc_UserAdvManager[13], 204 'UserAdvManager_PASSWORDENF_TRUE' => $conf_nbc_UserAdvManager[14]=='true' ? 'checked="checked"' : '' , 205 'UserAdvManager_PASSWORDENF_FALSE' => $conf_nbc_UserAdvManager[14]=='false' ? 'checked="checked"' : '' , 206 'UserAdvManager_PASSWORD_SCORE' => $conf_nbc_UserAdvManager[15], 207 'UserAdvManager_ADMINPASSWENF_TRUE' => $conf_nbc_UserAdvManager[16]=='true' ? 'checked="checked"' : '' , 208 'UserAdvManager_ADMINPASSWENF_FALSE' => $conf_nbc_UserAdvManager[16]=='false' ? 'checked="checked"' : '' , 209 'UserAdvManager_GHOSTRACKER_TRUE' => $conf_nbc_UserAdvManager[17]=='true' ? 'checked="checked"' : '' , 210 'UserAdvManager_GHOSTRACKER_FALSE' => $conf_nbc_UserAdvManager[17]=='false' ? 'checked="checked"' : '' , 211 'UserAdvManager_PASSWORD_TEST_SCORE' => $UserAdvManager_Password_Test_Score, 186 'UserAdvManager_MAIL_INFO_TRUE' => $conf_nbc_UserAdvManager[0]=='true' ? 'checked="checked"' : '' , 187 'UserAdvManager_MAIL_INFO_FALSE' => $conf_nbc_UserAdvManager[0]=='false' ? 'checked="checked"' : '' , 188 'UserAdvManager_MAILINFO_TEXT' => $conf_nbc_UserAdvManager[10], 189 'UserAdvManager_NO_CASSE_TRUE' => $conf_nbc_UserAdvManager[1]=='true' ? 'checked="checked"' : '' , 190 'UserAdvManager_NO_CASSE_FALSE' => $conf_nbc_UserAdvManager[1]=='false' ? 'checked="checked"' : '' , 191 'UserAdvManager_USERNAME_CHAR_TRUE' => $conf_nbc_UserAdvManager[7]=='true' ? 'checked="checked"' : '' , 192 'UserAdvManager_USERNAME_CHAR_FALSE' => $conf_nbc_UserAdvManager[7]=='false' ? 'checked="checked"' : '' , 193 'UserAdvManager_USERNAME_CHAR_LIST' => $conf_nbc_UserAdvManager[8], 194 'UserAdvManager_CONFIRM_MAIL_TRUE' => $conf_nbc_UserAdvManager[2]=='true' ? 'checked="checked"' : '' , 195 'UserAdvManager_CONFIRM_MAIL_FALSE' => $conf_nbc_UserAdvManager[2]=='false' ? 'checked="checked"' : '' , 196 'UserAdvManager_CONFIRMMAIL_TEXT' => $conf_nbc_UserAdvManager[11], 197 'UserAdvManager_No_Confirm_Group' => $conf_nbc_UserAdvManager[3], 198 'UserAdvManager_Validated_Group' => $conf_nbc_UserAdvManager[4], 199 'UserAdvManager_No_Confirm_Status' => $conf_nbc_UserAdvManager[9], 200 'UserAdvManager_Validated_Status' => $conf_nbc_UserAdvManager[5], 201 'UserAdvManager_NO_COMMENT_ANO_TRUE' => $conf_nbc_UserAdvManager[6]=='true' ? 'checked="checked"' : '' , 202 'UserAdvManager_NO_COMMENT_ANO_FALSE' => $conf_nbc_UserAdvManager[6]=='false' ? 'checked="checked"' : '' , 203 'UserAdvManager_MAILEXCLUSION_TRUE' => $conf_nbc_UserAdvManager[12]=='true' ? 'checked="checked"' : '' , 204 'UserAdvManager_MAILEXCLUSION_FALSE' => $conf_nbc_UserAdvManager[12]=='false' ? 'checked="checked"' : '' , 205 'UserAdvManager_MAILEXCLUSION_LIST' => $conf_nbc_UserAdvManager[13], 206 'UserAdvManager_PASSWORDENF_TRUE' => $conf_nbc_UserAdvManager[14]=='true' ? 'checked="checked"' : '' , 207 'UserAdvManager_PASSWORDENF_FALSE' => $conf_nbc_UserAdvManager[14]=='false' ? 'checked="checked"' : '' , 208 'UserAdvManager_PASSWORD_SCORE' => $conf_nbc_UserAdvManager[15], 209 'UserAdvManager_ADMINPASSWENF_TRUE' => $conf_nbc_UserAdvManager[16]=='true' ? 'checked="checked"' : '' , 210 'UserAdvManager_ADMINPASSWENF_FALSE' => $conf_nbc_UserAdvManager[16]=='false' ? 'checked="checked"' : '' , 211 'UserAdvManager_GHOSTRACKER_TRUE' => $conf_nbc_UserAdvManager[17]=='true' ? 'checked="checked"' : '' , 212 'UserAdvManager_GHOSTRACKER_FALSE' => $conf_nbc_UserAdvManager[17]=='false' ? 'checked="checked"' : '' , 213 'UserAdvManager_GHOSTRACKER_DAYLIMIT' => $conf_nbc_UserAdvManager[18], 214 'UserAdvManager_GHOSTRACKER_REMINDERTEXT' => $conf_nbc_UserAdvManager[19], 215 'UserAdvManager_PASSWORD_TEST_SCORE' => $UserAdvManager_Password_Test_Score, 212 216 ) 213 217 ); … … 958 962 // +-----------------------------------------------------------------------+ 959 963 960 $page['filtered_users'] = get_ unvalid_user_list();964 $page['filtered_users'] = get_ghost_user_list(); 961 965 962 966 // +-----------------------------------------------------------------------+ … … 1041 1045 1042 1046 // +-----------------------------------------------------------------------+ 1043 // | Resend new validation key to users|1047 // | Send ghost reminder | 1044 1048 // +-----------------------------------------------------------------------+ 1045 1049 // +-----------------------------------------------------------------------+ 1046 1050 // | selected users | 1047 1051 // +-----------------------------------------------------------------------+ 1048 if (isset($_POST[' Mail_With_Key']))1052 if (isset($_POST['Reminder_Email'])) 1049 1053 { 1050 1054 $collection = array(); … … 1076 1080 } 1077 1081 // +-----------------------------------------------------------------------+ 1078 // | Resend new validation key to users|1079 // +-----------------------------------------------------------------------+ 1080 if (isset($_POST[' Mail_With_Key']) and count($collection) > 0)1082 // | Send ghost reminder | 1083 // +-----------------------------------------------------------------------+ 1084 if (isset($_POST['Reminder_Email']) and count($collection) > 0) 1081 1085 { 1082 1086 if (in_array($conf['guest_id'], $collection)) 1083 1087 { 1084 array_push($page['errors'], l10n('No_ validation_for_Guest'));1088 array_push($page['errors'], l10n('No_reminder_for_Guest')); 1085 1089 } 1086 1090 if (($conf['guest_id'] != $conf['default_user_id']) and 1087 1091 in_array($conf['default_user_id'], $collection)) 1088 1092 { 1089 array_push($page['errors'], l10n('No_ validation_for_default_user'));1093 array_push($page['errors'], l10n('No_reminder_for_default_user')); 1090 1094 } 1091 1095 if (in_array($conf['webmaster_id'], $collection)) 1092 1096 { 1093 array_push($page['errors'], l10n('No_ validation_for_Webmaster'));1097 array_push($page['errors'], l10n('No_reminder_for_Webmaster')); 1094 1098 } 1095 1099 if (in_array($user['id'], $collection)) 1096 1100 { 1097 array_push($page['errors'], l10n('No_ validation_for_your_account'));1101 array_push($page['errors'], l10n('No_reminder_for_your_account')); 1098 1102 } 1099 1103 … … 1101 1105 { 1102 1106 foreach ($collection as $user_id) 1103 { 1104 $typemail = 1; 1105 $query = " 1106 SELECT id, username, mail_address 1107 FROM ".USERS_TABLE." 1108 WHERE id = '".$user_id."' 1109 ;"; 1110 $data = mysql_fetch_array(pwg_query($query)); 1111 1112 ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],true); 1113 } 1114 array_push( 1115 $page['infos'], 1116 l10n_dec( 1117 '%d_Mail_With_Key', '%d_Mails_With_Key', 1118 count($collection) 1119 ) 1120 ); 1121 1122 $page['filtered_users'] = get_unvalid_user_list(); 1123 } 1124 } 1125 1126 // +-----------------------------------------------------------------------+ 1127 // | Send reminder without new key to users | 1128 // +-----------------------------------------------------------------------+ 1129 // +-----------------------------------------------------------------------+ 1130 // | selected users | 1131 // +-----------------------------------------------------------------------+ 1132 if (isset($_POST['Mail_Without_Key'])) 1133 { 1134 $collection = array(); 1135 1136 switch ($_POST['target']) 1137 { 1138 case 'all' : 1139 { 1140 foreach($page['filtered_users'] as $local_user) 1141 { 1142 array_push($collection, $local_user['id']); 1143 } 1144 break; 1145 } 1146 case 'selection' : 1147 { 1148 if (isset($_POST['selection'])) 1149 { 1150 $collection = $_POST['selection']; 1151 } 1152 break; 1153 } 1154 } 1155 1156 if (count($collection) == 0) 1157 { 1158 array_push($page['errors'], l10n('Select at least one user')); 1159 } 1160 } 1161 // +-----------------------------------------------------------------------+ 1162 // | Send reminder without new key to users | 1163 // +-----------------------------------------------------------------------+ 1164 if (isset($_POST['Mail_Without_Key']) and count($collection) > 0) 1165 { 1166 if (in_array($conf['guest_id'], $collection)) 1167 { 1168 array_push($page['errors'], l10n('No_validation_for_Guest')); 1169 } 1170 if (($conf['guest_id'] != $conf['default_user_id']) and 1171 in_array($conf['default_user_id'], $collection)) 1172 { 1173 array_push($page['errors'], l10n('No_validation_for_default_user')); 1174 } 1175 if (in_array($conf['webmaster_id'], $collection)) 1176 { 1177 array_push($page['errors'], l10n('No_validation_for_Webmaster')); 1178 } 1179 if (in_array($user['id'], $collection)) 1180 { 1181 array_push($page['errors'], l10n('No_validation_for_your_account')); 1182 } 1183 1184 if (count($page['errors']) == 0) 1185 { 1186 foreach ($collection as $user_id) 1187 { 1188 $typemail = 2; 1107 { 1189 1108 $query = " 1190 1109 SELECT id, username, mail_address … … 1195 1114 $data = mysql_fetch_array(pwg_query($query)); 1196 1115 1197 ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],false);1116 ghostreminder($user_id,$data['username'],$data['mail_address']); 1198 1117 } 1199 1118 array_push( … … 1205 1124 ); 1206 1125 1207 $page['filtered_users'] = get_unvalid_user_list(); 1208 } 1209 } 1210 1211 // +-----------------------------------------------------------------------+ 1212 // | Force validation | 1213 // +-----------------------------------------------------------------------+ 1214 // +-----------------------------------------------------------------------+ 1215 // | selected users | 1216 // +-----------------------------------------------------------------------+ 1217 if (isset($_POST['Force_Validation'])) 1218 { 1219 $collection = array(); 1220 1221 switch ($_POST['target']) 1222 { 1223 case 'all' : 1224 { 1225 foreach($page['filtered_users'] as $local_user) 1226 { 1227 array_push($collection, $local_user['id']); 1228 } 1229 break; 1230 } 1231 case 'selection' : 1232 { 1233 if (isset($_POST['selection'])) 1234 { 1235 $collection = $_POST['selection']; 1236 } 1237 break; 1238 } 1239 } 1240 1241 if (count($collection) == 0) 1242 { 1243 array_push($page['errors'], l10n('Select at least one user')); 1244 } 1245 } 1246 // +-----------------------------------------------------------------------+ 1247 // | Force validation | 1248 // +-----------------------------------------------------------------------+ 1249 if (isset($_POST['Force_Validation']) and count($collection) > 0) 1250 { 1251 if (in_array($conf['guest_id'], $collection)) 1252 { 1253 array_push($page['errors'], l10n('No_validation_for_Guest')); 1254 } 1255 if (($conf['guest_id'] != $conf['default_user_id']) and 1256 in_array($conf['default_user_id'], $collection)) 1257 { 1258 array_push($page['errors'], l10n('No_validation_for_default_user')); 1259 } 1260 if (in_array($conf['webmaster_id'], $collection)) 1261 { 1262 array_push($page['errors'], l10n('No_validation_for_Webmaster')); 1263 } 1264 if (in_array($user['id'], $collection)) 1265 { 1266 array_push($page['errors'], l10n('No_validation_for_your_account')); 1267 } 1268 1269 if (count($page['errors']) == 0) 1270 { 1271 foreach ($collection as $user_id) 1272 { 1273 $query = " 1274 SELECT id, username, mail_address 1275 FROM ".USERS_TABLE." 1276 WHERE id = '".$user_id."' 1277 ;"; 1278 1279 $data = mysql_fetch_array(pwg_query($query)); 1280 1281 ForceValidation($data['id']); 1282 } 1283 array_push( 1284 $page['infos'], 1285 l10n_dec( 1286 '%d_Validated_User', '%d_Validated_Users', 1287 count($collection) 1288 ) 1289 ); 1290 1291 $page['filtered_users'] = get_unvalid_user_list(); 1292 } 1293 } 1294 1295 1296 // +-----------------------------------------------------------------------+ 1297 // | groups list | 1298 // +-----------------------------------------------------------------------+ 1299 1300 $groups[-1] = '------------'; 1301 1302 $query = ' 1303 SELECT id, name 1304 FROM '.GROUPS_TABLE.' 1305 ORDER BY name ASC 1306 ;'; 1307 1308 $result = pwg_query($query); 1309 1310 while ($row = mysql_fetch_array($result)) 1311 { 1312 $groups[$row['id']] = $row['name']; 1313 } 1126 $page['filtered_users'] = get_ghost_user_list(); 1127 } 1128 } 1314 1129 1315 1130 // +-----------------------------------------------------------------------+ … … 1341 1156 } 1342 1157 1158 1343 1159 // +-----------------------------------------------------------------------+ 1344 1160 // | user list | 1345 1161 // +-----------------------------------------------------------------------+ 1346 1347 $profile_url = get_root_url().'admin.php?page=profile&user_id=';1348 $perm_url = get_root_url().'admin.php?page=user_perm&user_id=';1349 1162 1350 1163 $visible_user_list = array(); … … 1363 1176 $visible_user_list[] = $local_user; 1364 1177 } 1365 1178 1179 $reminder = ''; 1180 if (isset($local_user['reminder']) and $local_user['reminder'] == 'true') 1181 { 1182 $reminder = l10n('Reminder_Sent_OK'); 1183 } 1184 else if (isset($local_user['reminder']) and $local_user['reminder'] == 'false') 1185 { 1186 $reminder = l10n('Reminder_Sent_NOK'); 1187 } 1188 1366 1189 foreach ($visible_user_list as $local_user) 1367 1190 { 1368 $groups_string = preg_replace(1369 '/(\d+)/e',1370 "\$groups['$1']",1371 implode(1372 ', ',1373 $local_user['groups']1374 )1375 );1376 1377 1191 if (isset($_POST['pref_submit']) 1378 1192 and isset($_POST['selection']) … … 1386 1200 } 1387 1201 1388 $properties = array();1389 if ( $local_user['level'] != 0 )1390 {1391 $properties[] = l10n( sprintf('Level %d', $local_user['level']) );1392 }1393 $properties[] =1394 (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true'))1395 ? l10n('is_high_enabled') : l10n('is_high_disabled');1396 1397 $expiration = expiration($local_user['id']);1398 1399 1202 $template->append( 1400 1203 'users', … … 1402 1205 'ID' => $local_user['id'], 1403 1206 'CHECKED' => $checked, 1404 'U_PROFILE' => $profile_url.$local_user['id'],1405 'U_PERM' => $perm_url.$local_user['id'],1406 1207 'USERNAME' => $local_user['username'] 1407 1208 .($local_user['id'] == $conf['guest_id'] … … 1409 1210 .($local_user['id'] == $conf['default_user_id'] 1410 1211 ? '<BR />['.l10n('is_the_default').']' : ''), 1411 'STATUS' => l10n('user_status_'.1412 $local_user['status']).(($local_user['adviser'] == 'true')1413 ? '<BR />['.l10n('adviser').']' : ''),1414 1212 'EMAIL' => get_email_address_as_display_text($local_user['email']), 1415 'GROUPS' => $groups_string, 1416 'REGISTRATION' => $local_user['registration_date'], 1417 'EXPIRATION' => $expiration, 1213 'LASTVISIT' => $local_user['lastvisit'], 1214 'REMINDER' => $reminder, 1418 1215 ) 1419 1216 ); … … 1436 1233 // +-----------------------------------------------------------------------+ 1437 1234 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/ghosttracker.tpl'); 1438 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 1439 1235 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 1236 } 1440 1237 else 1441 1238 { 1442 1239 array_push($page['infos'], l10n('Err_GhostTracker_Settings')); 1443 1240 } 1444 break; 1241 break; 1445 1242 } 1446 1243 ?>
Note: See TracChangeset
for help on using the changeset viewer.