[3742] | 1 | <?php |
---|
| 2 | |
---|
| 3 | global $user, $lang, $conf, $errors; |
---|
| 4 | |
---|
| 5 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 6 | // +-----------------------------------------------------------------------+ |
---|
| 7 | // | Check Access and exit when user status is not ok | |
---|
| 8 | // +-----------------------------------------------------------------------+ |
---|
| 9 | check_status(ACCESS_ADMINISTRATOR); |
---|
| 10 | |
---|
| 11 | //ini_set('error_reporting', E_ALL); |
---|
| 12 | //ini_set('display_errors', true); |
---|
| 13 | |
---|
| 14 | include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
| 15 | include_once (PHPWG_ROOT_PATH.'/include/constants.php'); |
---|
| 16 | $my_base_url = get_admin_plugin_menu_link(__FILE__); |
---|
| 17 | |
---|
| 18 | load_language('plugin.lang', NBC_UserAdvManager_PATH); |
---|
| 19 | |
---|
| 20 | // +-----------------------------------------------------------------------+ |
---|
| 21 | // | Tabssheet | |
---|
| 22 | // +-----------------------------------------------------------------------+ |
---|
| 23 | if (!isset($_GET['tab'])) |
---|
[3841] | 24 | $page['tab'] = 'global'; |
---|
[3742] | 25 | else |
---|
| 26 | $page['tab'] = $_GET['tab']; |
---|
| 27 | |
---|
| 28 | $tabsheet = new tabsheet(); |
---|
| 29 | $tabsheet->add('global', |
---|
| 30 | l10n('Tab_Global'), |
---|
| 31 | $my_base_url.'&tab=global'); |
---|
| 32 | $tabsheet->add('confirmmail', |
---|
| 33 | l10n('Tab_ConfirmMail'), |
---|
| 34 | $my_base_url.'&tab=confirmmail'); |
---|
[3845] | 35 | $tabsheet->add('usermanager', |
---|
| 36 | l10n('Tab_UserManager'), |
---|
| 37 | $my_base_url.'&tab=usermanager'); |
---|
[3742] | 38 | $tabsheet->select($page['tab']); |
---|
| 39 | $tabsheet->assign(); |
---|
| 40 | |
---|
| 41 | $page['global'] = array(); |
---|
| 42 | $error = array(); |
---|
| 43 | |
---|
| 44 | // +-----------------------------------------------------------------------+ |
---|
| 45 | // | Tabssheet select | |
---|
| 46 | // +-----------------------------------------------------------------------+ |
---|
| 47 | |
---|
| 48 | switch ($page['tab']) |
---|
| 49 | { |
---|
[3858] | 50 | // ************************************************************************* |
---|
[3742] | 51 | // +-----------------------------------------------------------------------+ |
---|
| 52 | // | Global Config | |
---|
| 53 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 54 | // ************************************************************************* |
---|
[3742] | 55 | case 'global': |
---|
| 56 | |
---|
[3841] | 57 | if ( isset($_POST['submit']) and !is_adviser() and isset($_POST['UserAdvManager_Mail_Info']) and isset($_POST['UserAdvManager_No_Casse']) and isset($_POST['UserAdvManager_Username_Char']) and isset($_POST['UserAdvManager_Confirm_Mail']) and isset($_POST['UserAdvManager_No_Comment_Anonymous']) ) |
---|
[3742] | 58 | { |
---|
[3841] | 59 | $_POST['UserAdvManager_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_MailInfo_Text'])); |
---|
| 60 | $_POST['UserAdvManager_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_Text'])); |
---|
[3742] | 61 | |
---|
[3841] | 62 | $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']; |
---|
[3742] | 63 | |
---|
[3841] | 64 | $conf['nbc_UserAdvManager'] = $newconf_nbc_UserAdvManager; |
---|
[3742] | 65 | |
---|
[3841] | 66 | $query = ' |
---|
| 67 | UPDATE '.CONFIG_TABLE.' |
---|
| 68 | SET value="'.$newconf_nbc_UserAdvManager.'" |
---|
| 69 | WHERE param="nbc_UserAdvManager" |
---|
| 70 | LIMIT 1 |
---|
| 71 | ;'; |
---|
[3742] | 72 | |
---|
[3841] | 73 | pwg_query($query); |
---|
[3742] | 74 | |
---|
[3841] | 75 | array_push($page['infos'], l10n('UserAdvManager_save_config')); |
---|
[3742] | 76 | } |
---|
| 77 | |
---|
| 78 | $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array(); |
---|
| 79 | |
---|
| 80 | /* Group setting for unvalidated and validated users */ |
---|
| 81 | $groups[-1] = '---------'; |
---|
| 82 | $No_Valid = -1; |
---|
| 83 | $Valid = -1; |
---|
| 84 | |
---|
| 85 | /* Check groups list in database */ |
---|
| 86 | $query = ' |
---|
| 87 | SELECT id, name |
---|
[3841] | 88 | FROM '.GROUPS_TABLE.' |
---|
| 89 | ORDER BY name ASC |
---|
| 90 | ;'; |
---|
[3742] | 91 | |
---|
| 92 | $result = pwg_query($query); |
---|
| 93 | |
---|
| 94 | while ($row = mysql_fetch_array($result)) |
---|
| 95 | { |
---|
| 96 | $groups[$row['id']] = $row['name']; |
---|
| 97 | /* configuration value for unvalidated users */ |
---|
| 98 | if (isset($conf_nbc_UserAdvManager[3]) and $conf_nbc_UserAdvManager[3] == $row['id']) |
---|
| 99 | { |
---|
[3841] | 100 | $No_Valid = $row['id']; |
---|
| 101 | } |
---|
[3742] | 102 | /* configuration value for validated users */ |
---|
| 103 | if (isset($conf_nbc_UserAdvManager[4]) and $conf_nbc_UserAdvManager[4] == $row['id']) |
---|
[3841] | 104 | { |
---|
| 105 | $Valid = $row['id']; |
---|
| 106 | } |
---|
[3742] | 107 | } |
---|
| 108 | |
---|
| 109 | /* Template initialization for unvalidated users group */ |
---|
| 110 | $template->assign( |
---|
| 111 | 'No_Confirm_Group', |
---|
[3841] | 112 | array( |
---|
| 113 | 'group_options'=> $groups, |
---|
| 114 | 'group_selected' => $No_Valid |
---|
| 115 | ) |
---|
| 116 | ); |
---|
[3742] | 117 | /* Template initialization for validated users group */ |
---|
| 118 | $template->assign( |
---|
| 119 | 'Validated_Group', |
---|
[3841] | 120 | array( |
---|
[3742] | 121 | 'group_options'=> $groups, |
---|
| 122 | 'group_selected' => $Valid |
---|
[3841] | 123 | ) |
---|
| 124 | ); |
---|
[3742] | 125 | |
---|
| 126 | /* Status setting for unvalidated and validated users */ |
---|
| 127 | $status_options[-1] = '------------'; |
---|
| 128 | $No_Valid_Status = -1; |
---|
| 129 | $Valid_Status = -1; |
---|
| 130 | |
---|
| 131 | /* Get status values */ |
---|
| 132 | foreach (get_enums(USER_INFOS_TABLE, 'status') as $status) |
---|
[3841] | 133 | { |
---|
[3742] | 134 | $status_options[$status] = l10n('user_status_'.$status); |
---|
| 135 | if (isset($conf_nbc_UserAdvManager[9]) and $conf_nbc_UserAdvManager[9] == $status) |
---|
| 136 | { |
---|
| 137 | $No_Valid_Status = $status; |
---|
| 138 | } |
---|
[3858] | 139 | |
---|
[3742] | 140 | /* Template initialization for unvalidated users group */ |
---|
| 141 | $template->assign( |
---|
| 142 | 'No_Confirm_Status', |
---|
| 143 | array( |
---|
[3841] | 144 | 'Status_options' => $status_options, |
---|
| 145 | 'Status_selected' => $No_Valid_Status |
---|
| 146 | ) |
---|
| 147 | ); |
---|
| 148 | } |
---|
[3858] | 149 | |
---|
[3742] | 150 | /* Get status values */ |
---|
| 151 | foreach (get_enums(USER_INFOS_TABLE, 'status') as $status) |
---|
[3841] | 152 | { |
---|
[3742] | 153 | $status_options[$status] = l10n('user_status_'.$status); |
---|
| 154 | if (isset($conf_nbc_UserAdvManager[5]) and $conf_nbc_UserAdvManager[5] == $status) |
---|
[3841] | 155 | { |
---|
[3742] | 156 | $Valid_Status = $status; |
---|
| 157 | } |
---|
[3858] | 158 | |
---|
[3742] | 159 | /* Template initialization for unvalidated users group */ |
---|
| 160 | $template->assign( |
---|
| 161 | 'Confirm_Status', |
---|
| 162 | array( |
---|
[3841] | 163 | 'Status_options' => $status_options, |
---|
| 164 | 'Status_selected' => $Valid_Status |
---|
| 165 | ) |
---|
| 166 | ); |
---|
| 167 | } |
---|
[3742] | 168 | |
---|
| 169 | $template->assign( |
---|
| 170 | array( |
---|
| 171 | 'UserAdvManager_MAIL_INFO_TRUE' => $conf_nbc_UserAdvManager[0]=='true' ? 'checked="checked"' : '' , |
---|
| 172 | 'UserAdvManager_MAIL_INFO_FALSE' => $conf_nbc_UserAdvManager[0]=='false' ? 'checked="checked"' : '' , |
---|
| 173 | 'UserAdvManager_MAILINFO_TEXT' => $conf_nbc_UserAdvManager[10], |
---|
| 174 | 'UserAdvManager_NO_CASSE_TRUE' => $conf_nbc_UserAdvManager[1]=='true' ? 'checked="checked"' : '' , |
---|
| 175 | 'UserAdvManager_NO_CASSE_FALSE' => $conf_nbc_UserAdvManager[1]=='false' ? 'checked="checked"' : '' , |
---|
| 176 | 'UserAdvManager_USERNAME_CHAR_TRUE' => $conf_nbc_UserAdvManager[7]=='true' ? 'checked="checked"' : '' , |
---|
| 177 | 'UserAdvManager_USERNAME_CHAR_FALSE' => $conf_nbc_UserAdvManager[7]=='false' ? 'checked="checked"' : '' , |
---|
| 178 | 'UserAdvManager_USERNAME_CHAR_LIST' => $conf_nbc_UserAdvManager[8], |
---|
| 179 | 'UserAdvManager_CONFIRM_MAIL_TRUE' => $conf_nbc_UserAdvManager[2]=='true' ? 'checked="checked"' : '' , |
---|
| 180 | 'UserAdvManager_CONFIRM_MAIL_FALSE' => $conf_nbc_UserAdvManager[2]=='false' ? 'checked="checked"' : '' , |
---|
| 181 | 'UserAdvManager_CONFIRMMAIL_TEXT' => $conf_nbc_UserAdvManager[11], |
---|
| 182 | 'UserAdvManager_No_Confirm_Group' => $conf_nbc_UserAdvManager[3], |
---|
| 183 | 'UserAdvManager_Validated_Group' => $conf_nbc_UserAdvManager[4], |
---|
| 184 | 'UserAdvManager_No_Confirm_Status' => $conf_nbc_UserAdvManager[9], |
---|
| 185 | 'UserAdvManager_Validated_Status' => $conf_nbc_UserAdvManager[5], |
---|
| 186 | 'UserAdvManager_NO_COMMENT_ANO_TRUE' => $conf_nbc_UserAdvManager[6]=='true' ? 'checked="checked"' : '' , |
---|
| 187 | 'UserAdvManager_NO_COMMENT_ANO_FALSE' => $conf_nbc_UserAdvManager[6]=='false' ? 'checked="checked"' : '' , |
---|
| 188 | 'UserAdvManager_MAILEXCLUSION_TRUE' => $conf_nbc_UserAdvManager[12]=='true' ? 'checked="checked"' : '' , |
---|
| 189 | 'UserAdvManager_MAILEXCLUSION_FALSE' => $conf_nbc_UserAdvManager[12]=='false' ? 'checked="checked"' : '' , |
---|
| 190 | 'UserAdvManager_MAILEXCLUSION_LIST' => $conf_nbc_UserAdvManager[13], |
---|
| 191 | ) |
---|
| 192 | ); |
---|
| 193 | |
---|
| 194 | |
---|
| 195 | if ( isset($_POST['audit']) or isset($_POST['submit']) ) |
---|
[3858] | 196 | { |
---|
[3841] | 197 | $msg_error1 = ''; |
---|
[3742] | 198 | |
---|
| 199 | /* username insensible a la casse */ |
---|
[3841] | 200 | if (isset($conf_nbc_UserAdvManager[3]) and $conf_nbc_UserAdvManager[3] == 'true') |
---|
| 201 | { |
---|
| 202 | $query = " |
---|
| 203 | SELECT ".$conf['user_fields']['username']." |
---|
| 204 | FROM ".USERS_TABLE." p1 |
---|
| 205 | WHERE EXISTS( |
---|
| 206 | SELECT ".$conf['user_fields']['username']." |
---|
| 207 | FROM ".USERS_TABLE." p2 |
---|
| 208 | WHERE p1.".$conf['user_fields']['id']." <> p2.".$conf['user_fields']['id']." |
---|
| 209 | AND LOWER(p1.".$conf['user_fields']['username'].") = LOWER(p2.".$conf['user_fields']['username'].") |
---|
| 210 | ) |
---|
[3742] | 211 | ;"; |
---|
| 212 | |
---|
| 213 | $result = pwg_query($query); |
---|
| 214 | |
---|
| 215 | while($row = mysql_fetch_array($result)) |
---|
[3841] | 216 | { |
---|
| 217 | $msg_error1 .= (($msg_error1 <> '') ? '<br/>' : '') . l10n('Err_audit_no_casse').$row['username']; |
---|
[3742] | 218 | } |
---|
| 219 | } |
---|
| 220 | |
---|
[3841] | 221 | $msg_error2 = ''; |
---|
[3742] | 222 | |
---|
| 223 | /* Username without forbidden keys */ |
---|
[3858] | 224 | if ( isset($conf_nbc_UserAdvManager[7]) and $conf_nbc_UserAdvManager[7] == 'true' ) |
---|
| 225 | { |
---|
| 226 | $query = " |
---|
| 227 | SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']." |
---|
| 228 | FROM ".USERS_TABLE." |
---|
| 229 | ;"; |
---|
[3742] | 230 | |
---|
[3858] | 231 | $result = pwg_query($query); |
---|
[3742] | 232 | |
---|
[3858] | 233 | while($row = mysql_fetch_array($result)) |
---|
| 234 | { |
---|
| 235 | if (!ValidateUsername($row['username'])) |
---|
| 236 | $msg_error2 .= (($msg_error2 <> '') ? '<br/>' : '') . l10n('Err_audit_username_char').$row['username']; |
---|
[3742] | 237 | } |
---|
[3858] | 238 | } |
---|
[3742] | 239 | |
---|
[3841] | 240 | $msg_error3 = ''; |
---|
[3742] | 241 | |
---|
| 242 | /* Email without forbidden domain */ |
---|
[3858] | 243 | if ( isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' ) |
---|
| 244 | { |
---|
| 245 | $query = " |
---|
| 246 | SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']." |
---|
| 247 | FROM ".USERS_TABLE." |
---|
| 248 | ;"; |
---|
[3742] | 249 | |
---|
[3858] | 250 | $result = pwg_query($query); |
---|
[3742] | 251 | |
---|
[3858] | 252 | while($row = mysql_fetch_array($result)) |
---|
| 253 | { |
---|
| 254 | $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array(); |
---|
| 255 | $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]); |
---|
| 256 | for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++) |
---|
| 257 | { |
---|
| 258 | $pattern = '/'.$conf_nbc_MailExclusion[$i].'/'; |
---|
| 259 | if (preg_match($pattern, $row['mail_address'])) |
---|
| 260 | { |
---|
| 261 | $msg_error3 .= (($msg_error3 <> '') ? '<br/>' : '') . l10n('Err_audit_email_forbidden').$row['username'].' ('.$row['mail_address'].')'; |
---|
[3742] | 262 | } |
---|
| 263 | } |
---|
| 264 | } |
---|
[3858] | 265 | } |
---|
[3742] | 266 | |
---|
[3858] | 267 | if ($msg_error1 <> '') |
---|
| 268 | $errors[] = $msg_error1.'<br/><br/>'; |
---|
[3742] | 269 | |
---|
[3858] | 270 | if ($msg_error2 <> '') |
---|
| 271 | $errors[] = $msg_error2.'<br/><br/>'; |
---|
[3742] | 272 | |
---|
[3858] | 273 | if ($msg_error3 <> '') |
---|
| 274 | $errors[] = $msg_error3.'<br/><br/>'; |
---|
[3742] | 275 | |
---|
[3858] | 276 | if ($msg_error1 <> '' or $msg_error2 <> '' or $msg_error3 <> '') |
---|
| 277 | array_push($page['errors'], l10n('Err_audit_advise')); |
---|
| 278 | else |
---|
| 279 | array_push($page['infos'], l10n('UserAdvManager_audit_ok')); |
---|
[3841] | 280 | } |
---|
[3742] | 281 | |
---|
| 282 | |
---|
| 283 | // +-----------------------------------------------------------------------+ |
---|
| 284 | // | errors display | |
---|
| 285 | // +-----------------------------------------------------------------------+ |
---|
| 286 | if ( isset ($errors) and count($errors) != 0) |
---|
[3841] | 287 | { |
---|
[3742] | 288 | $template->assign('errors',array()); |
---|
| 289 | foreach ($errors as $error) |
---|
[3841] | 290 | { |
---|
[3742] | 291 | array_push($page['errors'], $error); |
---|
| 292 | } |
---|
| 293 | } |
---|
| 294 | |
---|
| 295 | // +-----------------------------------------------------------------------+ |
---|
| 296 | // | templates display | |
---|
| 297 | // +-----------------------------------------------------------------------+ |
---|
| 298 | $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/global.tpl'); |
---|
| 299 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 300 | |
---|
| 301 | break; |
---|
| 302 | |
---|
[3858] | 303 | // ************************************************************************* |
---|
[3742] | 304 | // +-----------------------------------------------------------------------+ |
---|
| 305 | // | ConfirmMail Config | |
---|
| 306 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 307 | // ************************************************************************* |
---|
[3742] | 308 | case 'confirmmail': |
---|
| 309 | |
---|
| 310 | $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array(); |
---|
| 311 | |
---|
[3845] | 312 | if (isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2]=='true') |
---|
[3841] | 313 | { |
---|
| 314 | if ( isset($_POST['submit']) and !is_adviser() and isset($_POST['UserAdvManager_ConfirmMail_TimeOut']) ) |
---|
| 315 | { |
---|
[3845] | 316 | $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'])); |
---|
| 317 | $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2'])); |
---|
[3841] | 318 | |
---|
[3845] | 319 | $newconf_nbc_UserAdvManager_ConfirmMail = $_POST['UserAdvManager_ConfirmMail_TimeOut'].';'.$_POST['UserAdvManager_ConfirmMail_Delay'].';'.$_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'].';'.$_POST['UserAdvManager_ConfirmMail_Remail'].';'.$_POST['UserAdvManager_ConfirmMail_ReMail_Txt2']; |
---|
[3841] | 320 | |
---|
| 321 | //NODO:Adding new option [Auto deletion : True | False] - No access to cron functionnalities |
---|
| 322 | |
---|
| 323 | $conf['nbc_UserAdvManager_ConfirmMail'] = $newconf_nbc_UserAdvManager_ConfirmMail; |
---|
[3742] | 324 | |
---|
[3841] | 325 | $query = ' |
---|
| 326 | UPDATE '.CONFIG_TABLE.' |
---|
| 327 | SET value="'.$newconf_nbc_UserAdvManager_ConfirmMail.'" |
---|
| 328 | WHERE param="nbc_UserAdvManager_ConfirmMail" |
---|
| 329 | LIMIT 1 |
---|
| 330 | ;'; |
---|
[3742] | 331 | |
---|
[3841] | 332 | pwg_query($query); |
---|
[3742] | 333 | |
---|
[3841] | 334 | array_push($page['infos'], l10n('UserAdvManager_save_config')); |
---|
[3742] | 335 | } |
---|
| 336 | |
---|
[3845] | 337 | $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array(); |
---|
[3742] | 338 | |
---|
[3845] | 339 | $template->assign( |
---|
| 340 | array( |
---|
| 341 | 'UserAdvManager_CONFIRMMAIL_TIMEOUT_TRUE' => $conf_nbc_UserAdvManager_ConfirmMail[0]=='true' ? 'checked="checked"' : '' , |
---|
| 342 | 'UserAdvManager_CONFIRMMAIL_TIMEOUT_FALSE' => $conf_nbc_UserAdvManager_ConfirmMail[0]=='false' ? 'checked="checked"' : '' , |
---|
| 343 | 'UserAdvManager_CONFIRMMAIL_DELAY' => $conf_nbc_UserAdvManager_ConfirmMail[1], |
---|
| 344 | 'UserAdvManager_CONFIRMMAIL_REMAIL_TXT1' => $conf_nbc_UserAdvManager_ConfirmMail[2], |
---|
| 345 | 'UserAdvManager_CONFIRMMAIL_REMAIL_TXT2' => $conf_nbc_UserAdvManager_ConfirmMail[4], |
---|
| 346 | 'UserAdvManager_CONFIRMMAIL_REMAIL_TRUE' => $conf_nbc_UserAdvManager_ConfirmMail[3]=='true' ? 'checked="checked"' : '', |
---|
| 347 | 'UserAdvManager_CONFIRMMAIL_REMAIL_FALSE' => $conf_nbc_UserAdvManager_ConfirmMail[3]=='false' ? 'checked="checked"' : '', |
---|
| 348 | ) |
---|
| 349 | ); |
---|
| 350 | |
---|
[3742] | 351 | // +-----------------------------------------------------------------------+ |
---|
[3845] | 352 | // | errors display | |
---|
| 353 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 354 | if ( isset ($errors) and count($errors) != 0) |
---|
| 355 | { |
---|
| 356 | $template->assign('errors',array()); |
---|
| 357 | foreach ($errors as $error) |
---|
| 358 | { |
---|
| 359 | array_push($page['errors'], $error); |
---|
| 360 | } |
---|
| 361 | } |
---|
[3845] | 362 | |
---|
| 363 | // +-----------------------------------------------------------------------+ |
---|
| 364 | // | templates display | |
---|
| 365 | // +-----------------------------------------------------------------------+ |
---|
| 366 | $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/confirmmail.tpl'); |
---|
| 367 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 368 | } |
---|
| 369 | else |
---|
| 370 | { |
---|
| 371 | array_push($page['infos'], l10n('Err_ConfirmMail_Settings')); |
---|
| 372 | } |
---|
| 373 | break; |
---|
| 374 | |
---|
| 375 | |
---|
[3858] | 376 | // ************************************************************************* |
---|
[3845] | 377 | // +-----------------------------------------------------------------------+ |
---|
| 378 | // | Users manager page | |
---|
| 379 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 380 | // ************************************************************************* |
---|
[3845] | 381 | case 'usermanager': |
---|
[3858] | 382 | |
---|
[3845] | 383 | $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array(); |
---|
| 384 | $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array(); |
---|
| 385 | |
---|
| 386 | if (isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2]=='true' and isset($conf_nbc_UserAdvManager_ConfirmMail[0]) and $conf_nbc_UserAdvManager_ConfirmMail[0]=='true' ) |
---|
| 387 | { |
---|
| 388 | // +-----------------------------------------------------------------------+ |
---|
[3742] | 389 | // | initialization | |
---|
| 390 | // +-----------------------------------------------------------------------+ |
---|
| 391 | |
---|
[3858] | 392 | if (!defined('PHPWG_ROOT_PATH')) |
---|
[3841] | 393 | { |
---|
| 394 | die('Hacking attempt!'); |
---|
| 395 | } |
---|
[3742] | 396 | |
---|
[3841] | 397 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
[3742] | 398 | |
---|
| 399 | // +-----------------------------------------------------------------------+ |
---|
| 400 | // | Check Access and exit when user status is not ok | |
---|
| 401 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 402 | check_status(ACCESS_ADMINISTRATOR); |
---|
[3742] | 403 | |
---|
[3841] | 404 | $page['order_by_items'] = array( |
---|
| 405 | 'id' => l10n('registration_date'), |
---|
| 406 | 'username' => l10n('Username'), |
---|
| 407 | 'level' => l10n('Privacy level'), |
---|
| 408 | 'language' => l10n('language'), |
---|
| 409 | ); |
---|
[3742] | 410 | |
---|
| 411 | // +-----------------------------------------------------------------------+ |
---|
| 412 | // | user list | |
---|
| 413 | // +-----------------------------------------------------------------------+ |
---|
| 414 | |
---|
[3858] | 415 | $page['filtered_users'] = get_unvalid_user_list(); |
---|
[3742] | 416 | |
---|
| 417 | // +-----------------------------------------------------------------------+ |
---|
| 418 | // | selected users | |
---|
| 419 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 420 | if (isset($_POST['Del_Selected'])) |
---|
| 421 | { |
---|
| 422 | $collection = array(); |
---|
[3742] | 423 | |
---|
[3858] | 424 | switch ($_POST['target']) |
---|
| 425 | { |
---|
| 426 | case 'all' : |
---|
| 427 | { |
---|
| 428 | foreach($page['filtered_users'] as $local_user) |
---|
| 429 | { |
---|
| 430 | array_push($collection, $local_user['id']); |
---|
| 431 | } |
---|
| 432 | break; |
---|
| 433 | } |
---|
| 434 | case 'selection' : |
---|
| 435 | { |
---|
| 436 | if (isset($_POST['selection'])) |
---|
| 437 | { |
---|
| 438 | $collection = $_POST['selection']; |
---|
| 439 | } |
---|
| 440 | break; |
---|
| 441 | } |
---|
[3841] | 442 | } |
---|
[3858] | 443 | |
---|
| 444 | if (count($collection) == 0) |
---|
| 445 | { |
---|
| 446 | array_push($page['errors'], l10n('Select at least one user')); |
---|
| 447 | } |
---|
[3841] | 448 | } |
---|
[3742] | 449 | |
---|
| 450 | // +-----------------------------------------------------------------------+ |
---|
| 451 | // | delete users | |
---|
| 452 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 453 | if (isset($_POST['Del_Selected']) and count($collection) > 0) |
---|
| 454 | { |
---|
| 455 | if (in_array($conf['guest_id'], $collection)) |
---|
| 456 | { |
---|
| 457 | array_push($page['errors'], l10n('Guest cannot be deleted')); |
---|
| 458 | } |
---|
| 459 | if (($conf['guest_id'] != $conf['default_user_id']) and |
---|
| 460 | in_array($conf['default_user_id'], $collection)) |
---|
| 461 | { |
---|
| 462 | array_push($page['errors'], l10n('Default user cannot be deleted')); |
---|
| 463 | } |
---|
| 464 | if (in_array($conf['webmaster_id'], $collection)) |
---|
| 465 | { |
---|
| 466 | array_push($page['errors'], l10n('Webmaster cannot be deleted')); |
---|
| 467 | } |
---|
| 468 | if (in_array($user['id'], $collection)) |
---|
| 469 | { |
---|
| 470 | array_push($page['errors'], l10n('You cannot delete your account')); |
---|
| 471 | } |
---|
[3845] | 472 | |
---|
[3858] | 473 | if (count($page['errors']) == 0) |
---|
| 474 | { |
---|
| 475 | foreach ($collection as $user_id) |
---|
| 476 | { |
---|
| 477 | delete_user($user_id); |
---|
| 478 | } |
---|
| 479 | array_push( |
---|
| 480 | $page['infos'], |
---|
| 481 | l10n_dec( |
---|
| 482 | '%d user deleted', '%d users deleted', |
---|
| 483 | count($collection) |
---|
| 484 | ) |
---|
| 485 | ); |
---|
[3742] | 486 | |
---|
[3858] | 487 | foreach ($page['filtered_users'] as $filter_key => $filter_user) |
---|
| 488 | { |
---|
| 489 | if (in_array($filter_user['id'], $collection)) |
---|
| 490 | { |
---|
| 491 | unset($page['filtered_users'][$filter_key]); |
---|
| 492 | } |
---|
| 493 | } |
---|
| 494 | } |
---|
[3845] | 495 | } |
---|
[3841] | 496 | |
---|
[3742] | 497 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 498 | // | Resend new validation key to users | |
---|
| 499 | // +-----------------------------------------------------------------------+ |
---|
| 500 | // +-----------------------------------------------------------------------+ |
---|
[3841] | 501 | // | selected users | |
---|
| 502 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 503 | if (isset($_POST['Mail_With_Key'])) |
---|
| 504 | { |
---|
| 505 | $collection = array(); |
---|
[3841] | 506 | |
---|
[3858] | 507 | switch ($_POST['target']) |
---|
| 508 | { |
---|
| 509 | case 'all' : |
---|
| 510 | { |
---|
| 511 | foreach($page['filtered_users'] as $local_user) |
---|
| 512 | { |
---|
| 513 | array_push($collection, $local_user['id']); |
---|
| 514 | } |
---|
| 515 | break; |
---|
| 516 | } |
---|
| 517 | case 'selection' : |
---|
| 518 | { |
---|
| 519 | if (isset($_POST['selection'])) |
---|
| 520 | { |
---|
| 521 | $collection = $_POST['selection']; |
---|
| 522 | } |
---|
| 523 | break; |
---|
| 524 | } |
---|
[3841] | 525 | } |
---|
[3858] | 526 | |
---|
| 527 | if (count($collection) == 0) |
---|
| 528 | { |
---|
| 529 | array_push($page['errors'], l10n('Select at least one user')); |
---|
| 530 | } |
---|
[3841] | 531 | } |
---|
| 532 | // +-----------------------------------------------------------------------+ |
---|
[3742] | 533 | // | Resend new validation key to users | |
---|
| 534 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 535 | if (isset($_POST['Mail_With_Key']) and count($collection) > 0) |
---|
| 536 | { |
---|
| 537 | if (in_array($conf['guest_id'], $collection)) |
---|
| 538 | { |
---|
| 539 | array_push($page['errors'], l10n('No_validation_for_Guest')); |
---|
| 540 | } |
---|
| 541 | if (($conf['guest_id'] != $conf['default_user_id']) and |
---|
| 542 | in_array($conf['default_user_id'], $collection)) |
---|
| 543 | { |
---|
| 544 | array_push($page['errors'], l10n('No_validation_for_default_user')); |
---|
| 545 | } |
---|
| 546 | if (in_array($conf['webmaster_id'], $collection)) |
---|
| 547 | { |
---|
| 548 | array_push($page['errors'], l10n('No_validation_for_Webmaster')); |
---|
| 549 | } |
---|
| 550 | if (in_array($user['id'], $collection)) |
---|
| 551 | { |
---|
| 552 | array_push($page['errors'], l10n('No_validation_for_your_account')); |
---|
| 553 | } |
---|
[3742] | 554 | |
---|
[3858] | 555 | if (count($page['errors']) == 0) |
---|
| 556 | { |
---|
| 557 | foreach ($collection as $user_id) |
---|
| 558 | { |
---|
| 559 | $typemail = 1; |
---|
| 560 | $query = " |
---|
| 561 | SELECT id, username, mail_address |
---|
| 562 | FROM ".USERS_TABLE." |
---|
| 563 | WHERE id = '".$user_id."' |
---|
[3841] | 564 | ;"; |
---|
[3858] | 565 | $data = mysql_fetch_array(pwg_query($query)); |
---|
[3841] | 566 | |
---|
[3858] | 567 | ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],true); |
---|
| 568 | } |
---|
| 569 | array_push( |
---|
| 570 | $page['infos'], |
---|
| 571 | l10n_dec( |
---|
| 572 | '%d_Mail_With_Key', '%d_Mails_With_Key', |
---|
| 573 | count($collection) |
---|
| 574 | ) |
---|
| 575 | ); |
---|
| 576 | |
---|
| 577 | $page['filtered_users'] = get_unvalid_user_list(); |
---|
[3841] | 578 | } |
---|
| 579 | } |
---|
| 580 | |
---|
[3742] | 581 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 582 | // | Send reminder without new key to users | |
---|
| 583 | // +-----------------------------------------------------------------------+ |
---|
| 584 | // +-----------------------------------------------------------------------+ |
---|
[3841] | 585 | // | selected users | |
---|
| 586 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 587 | if (isset($_POST['Mail_Without_Key'])) |
---|
| 588 | { |
---|
| 589 | $collection = array(); |
---|
[3841] | 590 | |
---|
[3858] | 591 | switch ($_POST['target']) |
---|
| 592 | { |
---|
| 593 | case 'all' : |
---|
| 594 | { |
---|
| 595 | foreach($page['filtered_users'] as $local_user) |
---|
| 596 | { |
---|
| 597 | array_push($collection, $local_user['id']); |
---|
| 598 | } |
---|
| 599 | break; |
---|
| 600 | } |
---|
| 601 | case 'selection' : |
---|
| 602 | { |
---|
| 603 | if (isset($_POST['selection'])) |
---|
| 604 | { |
---|
| 605 | $collection = $_POST['selection']; |
---|
| 606 | } |
---|
| 607 | break; |
---|
| 608 | } |
---|
[3841] | 609 | } |
---|
[3858] | 610 | |
---|
| 611 | if (count($collection) == 0) |
---|
| 612 | { |
---|
| 613 | array_push($page['errors'], l10n('Select at least one user')); |
---|
| 614 | } |
---|
[3841] | 615 | } |
---|
| 616 | // +-----------------------------------------------------------------------+ |
---|
| 617 | // | Send reminder without new key to users | |
---|
| 618 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 619 | if (isset($_POST['Mail_Without_Key']) and count($collection) > 0) |
---|
| 620 | { |
---|
| 621 | if (in_array($conf['guest_id'], $collection)) |
---|
| 622 | { |
---|
| 623 | array_push($page['errors'], l10n('No_validation_for_Guest')); |
---|
| 624 | } |
---|
| 625 | if (($conf['guest_id'] != $conf['default_user_id']) and |
---|
| 626 | in_array($conf['default_user_id'], $collection)) |
---|
| 627 | { |
---|
| 628 | array_push($page['errors'], l10n('No_validation_for_default_user')); |
---|
| 629 | } |
---|
| 630 | if (in_array($conf['webmaster_id'], $collection)) |
---|
| 631 | { |
---|
| 632 | array_push($page['errors'], l10n('No_validation_for_Webmaster')); |
---|
| 633 | } |
---|
| 634 | if (in_array($user['id'], $collection)) |
---|
| 635 | { |
---|
| 636 | array_push($page['errors'], l10n('No_validation_for_your_account')); |
---|
| 637 | } |
---|
[3841] | 638 | |
---|
[3858] | 639 | if (count($page['errors']) == 0) |
---|
| 640 | { |
---|
| 641 | foreach ($collection as $user_id) |
---|
| 642 | { |
---|
| 643 | $typemail = 2; |
---|
| 644 | $query = " |
---|
| 645 | SELECT id, username, mail_address |
---|
| 646 | FROM ".USERS_TABLE." |
---|
| 647 | WHERE id = '".$user_id."' |
---|
| 648 | ;"; |
---|
| 649 | |
---|
| 650 | $data = mysql_fetch_array(pwg_query($query)); |
---|
[3841] | 651 | |
---|
[3858] | 652 | ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],false); |
---|
| 653 | } |
---|
| 654 | array_push( |
---|
| 655 | $page['infos'], |
---|
| 656 | l10n_dec( |
---|
| 657 | '%d_Reminder_Sent', '%d_Reminders_Sent', |
---|
| 658 | count($collection) |
---|
| 659 | ) |
---|
| 660 | ); |
---|
| 661 | |
---|
| 662 | $page['filtered_users'] = get_unvalid_user_list(); |
---|
| 663 | } |
---|
| 664 | } |
---|
[3841] | 665 | |
---|
[3858] | 666 | // +-----------------------------------------------------------------------+ |
---|
| 667 | // | Force validation | |
---|
| 668 | // +-----------------------------------------------------------------------+ |
---|
| 669 | // +-----------------------------------------------------------------------+ |
---|
| 670 | // | selected users | |
---|
| 671 | // +-----------------------------------------------------------------------+ |
---|
| 672 | if (isset($_POST['Force_Validation'])) |
---|
| 673 | { |
---|
| 674 | $collection = array(); |
---|
| 675 | |
---|
| 676 | switch ($_POST['target']) |
---|
| 677 | { |
---|
| 678 | case 'all' : |
---|
| 679 | { |
---|
| 680 | foreach($page['filtered_users'] as $local_user) |
---|
| 681 | { |
---|
| 682 | array_push($collection, $local_user['id']); |
---|
| 683 | } |
---|
| 684 | break; |
---|
| 685 | } |
---|
| 686 | case 'selection' : |
---|
| 687 | { |
---|
| 688 | if (isset($_POST['selection'])) |
---|
| 689 | { |
---|
| 690 | $collection = $_POST['selection']; |
---|
| 691 | } |
---|
| 692 | break; |
---|
| 693 | } |
---|
[3841] | 694 | } |
---|
[3858] | 695 | |
---|
| 696 | if (count($collection) == 0) |
---|
| 697 | { |
---|
| 698 | array_push($page['errors'], l10n('Select at least one user')); |
---|
| 699 | } |
---|
[3841] | 700 | } |
---|
[3858] | 701 | // +-----------------------------------------------------------------------+ |
---|
| 702 | // | Force validation | |
---|
| 703 | // +-----------------------------------------------------------------------+ |
---|
| 704 | if (isset($_POST['Force_Validation']) and count($collection) > 0) |
---|
| 705 | { |
---|
| 706 | if (in_array($conf['guest_id'], $collection)) |
---|
| 707 | { |
---|
| 708 | array_push($page['errors'], l10n('No_validation_for_Guest')); |
---|
| 709 | } |
---|
| 710 | if (($conf['guest_id'] != $conf['default_user_id']) and |
---|
| 711 | in_array($conf['default_user_id'], $collection)) |
---|
| 712 | { |
---|
| 713 | array_push($page['errors'], l10n('No_validation_for_default_user')); |
---|
| 714 | } |
---|
| 715 | if (in_array($conf['webmaster_id'], $collection)) |
---|
| 716 | { |
---|
| 717 | array_push($page['errors'], l10n('No_validation_for_Webmaster')); |
---|
| 718 | } |
---|
| 719 | if (in_array($user['id'], $collection)) |
---|
| 720 | { |
---|
| 721 | array_push($page['errors'], l10n('No_validation_for_your_account')); |
---|
| 722 | } |
---|
[3841] | 723 | |
---|
[3858] | 724 | if (count($page['errors']) == 0) |
---|
| 725 | { |
---|
| 726 | foreach ($collection as $user_id) |
---|
| 727 | { |
---|
| 728 | $query = " |
---|
| 729 | SELECT id, username, mail_address |
---|
| 730 | FROM ".USERS_TABLE." |
---|
| 731 | WHERE id = '".$user_id."' |
---|
| 732 | ;"; |
---|
| 733 | |
---|
| 734 | $data = mysql_fetch_array(pwg_query($query)); |
---|
| 735 | |
---|
| 736 | ForceValidation($data['id']); |
---|
| 737 | } |
---|
| 738 | array_push( |
---|
| 739 | $page['infos'], |
---|
| 740 | l10n_dec( |
---|
| 741 | '%d_Validated_User', '%d_Validated_Users', |
---|
| 742 | count($collection) |
---|
| 743 | ) |
---|
| 744 | ); |
---|
| 745 | |
---|
| 746 | $page['filtered_users'] = get_unvalid_user_list(); |
---|
| 747 | } |
---|
| 748 | } |
---|
| 749 | |
---|
[3841] | 750 | // +-----------------------------------------------------------------------+ |
---|
[3742] | 751 | // | groups list | |
---|
| 752 | // +-----------------------------------------------------------------------+ |
---|
| 753 | |
---|
[3858] | 754 | $groups[-1] = '------------'; |
---|
[3742] | 755 | |
---|
[3841] | 756 | $query = ' |
---|
| 757 | SELECT id, name |
---|
| 758 | FROM '.GROUPS_TABLE.' |
---|
| 759 | ORDER BY name ASC |
---|
| 760 | ;'; |
---|
[3742] | 761 | |
---|
[3858] | 762 | $result = pwg_query($query); |
---|
[3742] | 763 | |
---|
[3841] | 764 | while ($row = mysql_fetch_array($result)) |
---|
| 765 | { |
---|
| 766 | $groups[$row['id']] = $row['name']; |
---|
| 767 | } |
---|
[3742] | 768 | |
---|
| 769 | // +-----------------------------------------------------------------------+ |
---|
| 770 | // | Template Init | |
---|
| 771 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 772 | $base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list'; |
---|
[3742] | 773 | |
---|
[3841] | 774 | if (isset($_GET['start']) and is_numeric($_GET['start'])) |
---|
| 775 | { |
---|
| 776 | $start = $_GET['start']; |
---|
| 777 | } |
---|
| 778 | else |
---|
| 779 | { |
---|
| 780 | $start = 0; |
---|
| 781 | } |
---|
[3742] | 782 | |
---|
[3841] | 783 | $template->assign( |
---|
| 784 | array( |
---|
| 785 | 'F_ADD_ACTION' => $base_url, |
---|
| 786 | 'F_USERNAME' => @htmlentities($_GET['username']), |
---|
| 787 | 'F_FILTER_ACTION' => get_root_url().'admin.php' |
---|
| 788 | ) |
---|
| 789 | ); |
---|
[3742] | 790 | |
---|
| 791 | /* Hide radio-button if not allow to assign adviser */ |
---|
[3858] | 792 | if ($conf['allow_adviser']) |
---|
| 793 | { |
---|
| 794 | $template->assign('adviser', true); |
---|
| 795 | } |
---|
[3742] | 796 | |
---|
| 797 | // +-----------------------------------------------------------------------+ |
---|
| 798 | // | user list | |
---|
| 799 | // +-----------------------------------------------------------------------+ |
---|
| 800 | |
---|
[3858] | 801 | $profile_url = get_root_url().'admin.php?page=profile&user_id='; |
---|
| 802 | $perm_url = get_root_url().'admin.php?page=user_perm&user_id='; |
---|
[3742] | 803 | |
---|
[3841] | 804 | $visible_user_list = array(); |
---|
| 805 | foreach ($page['filtered_users'] as $num => $local_user) |
---|
| 806 | { |
---|
[3742] | 807 | /* simulate LIMIT $start, $conf['users_page'] */ |
---|
[3858] | 808 | if ($num < $start) |
---|
[3841] | 809 | { |
---|
| 810 | continue; |
---|
| 811 | } |
---|
| 812 | if ($num >= $start + $conf['users_page']) |
---|
| 813 | { |
---|
| 814 | break; |
---|
| 815 | } |
---|
[3742] | 816 | |
---|
[3841] | 817 | $visible_user_list[] = $local_user; |
---|
[3858] | 818 | } |
---|
[3742] | 819 | |
---|
[3858] | 820 | foreach ($visible_user_list as $local_user) |
---|
[3841] | 821 | { |
---|
| 822 | $groups_string = preg_replace( |
---|
| 823 | '/(\d+)/e', |
---|
| 824 | "\$groups['$1']", |
---|
| 825 | implode( |
---|
| 826 | ', ', |
---|
| 827 | $local_user['groups'] |
---|
| 828 | ) |
---|
[3858] | 829 | ); |
---|
[3742] | 830 | |
---|
[3858] | 831 | if (isset($_POST['pref_submit']) |
---|
| 832 | and isset($_POST['selection']) |
---|
| 833 | and in_array($local_user['id'], $_POST['selection'])) |
---|
| 834 | { |
---|
| 835 | $checked = 'checked="checked"'; |
---|
| 836 | } |
---|
| 837 | else |
---|
| 838 | { |
---|
| 839 | $checked = ''; |
---|
| 840 | } |
---|
[3742] | 841 | |
---|
[3858] | 842 | $properties = array(); |
---|
| 843 | if ( $local_user['level'] != 0 ) |
---|
| 844 | { |
---|
| 845 | $properties[] = l10n( sprintf('Level %d', $local_user['level']) ); |
---|
| 846 | } |
---|
| 847 | $properties[] = |
---|
| 848 | (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true')) |
---|
| 849 | ? l10n('is_high_enabled') : l10n('is_high_disabled'); |
---|
[3742] | 850 | |
---|
[3858] | 851 | if (isset($conf_nbc_UserAdvManager_ConfirmMail[1]) and $conf_nbc_UserAdvManager_ConfirmMail[0]=='true' ) |
---|
| 852 | { |
---|
| 853 | $template->append( |
---|
| 854 | 'users', |
---|
| 855 | array( |
---|
| 856 | 'ID' => $local_user['id'], |
---|
| 857 | 'CHECKED' => $checked, |
---|
| 858 | 'U_PROFILE' => $profile_url.$local_user['id'], |
---|
| 859 | 'U_PERM' => $perm_url.$local_user['id'], |
---|
| 860 | 'USERNAME' => $local_user['username'] |
---|
| 861 | .($local_user['id'] == $conf['guest_id'] |
---|
| 862 | ? '<BR />['.l10n('is_the_guest').']' : '') |
---|
| 863 | .($local_user['id'] == $conf['default_user_id'] |
---|
| 864 | ? '<BR />['.l10n('is_the_default').']' : ''), |
---|
| 865 | 'STATUS' => l10n('user_status_'. |
---|
| 866 | $local_user['status']).(($local_user['adviser'] == 'true') |
---|
| 867 | ? '<BR />['.l10n('adviser').']' : ''), |
---|
| 868 | 'EMAIL' => get_email_address_as_display_text($local_user['email']), |
---|
| 869 | 'GROUPS' => $groups_string, |
---|
| 870 | 'REGISTRATION' => $local_user['registration_date'], |
---|
| 871 | ) |
---|
| 872 | ); |
---|
| 873 | } |
---|
| 874 | } |
---|
[3742] | 875 | |
---|
| 876 | // +-----------------------------------------------------------------------+ |
---|
| 877 | // | errors display | |
---|
| 878 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 879 | if ( isset ($errors) and count($errors) != 0) |
---|
| 880 | { |
---|
| 881 | $template->assign('errors',array()); |
---|
| 882 | foreach ($errors as $error) |
---|
| 883 | { |
---|
| 884 | array_push($page['errors'], $error); |
---|
| 885 | } |
---|
| 886 | } |
---|
[3742] | 887 | |
---|
| 888 | // +-----------------------------------------------------------------------+ |
---|
| 889 | // | templates display | |
---|
| 890 | // +-----------------------------------------------------------------------+ |
---|
[3858] | 891 | $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/usermanager.tpl'); |
---|
[3841] | 892 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
[3858] | 893 | } |
---|
[3742] | 894 | else |
---|
[3841] | 895 | { |
---|
[3858] | 896 | array_push($page['infos'], l10n('Err_UserManager_Settings')); |
---|
[3841] | 897 | } |
---|
[3845] | 898 | break; |
---|
[3742] | 899 | } |
---|
| 900 | ?> |
---|