// ------------------------------------------ // Template initialization for forms and data // ------------------------------------------ $template->assign(array('nb_para' => $nb_para, 'nb_para2' => $nb_para2, 'UAM_VERSION' => $version, 'UAM_PATH' => UAM_PATH, 'UAM_DUMP_DOWNLOAD' => $dump_download, 'UAM_THEME' => $UAM_theme, 'UAM_MAIL_INFO_TRUE' => $conf_UAM['MAIL_INFO'] == 'true' ? 'checked="checked"' : '', 'UAM_MAIL_INFO_FALSE' => $conf_UAM['MAIL_INFO'] == 'false' ? 'checked="checked"' : '', 'UAM_MAILINFO_TEXT' => $conf_UAM['MAILINFO_TEXT'], 'UAM_USERNAME_CHAR_TRUE' => $conf_UAM['USERNAME_CHAR'] == 'true' ? 'checked="checked"' : '', 'UAM_USERNAME_CHAR_FALSE' => $conf_UAM['USERNAME_CHAR'] == 'false' ? 'checked="checked"' : '', 'UAM_USERNAME_CHAR_LIST' => $conf_UAM['USERNAME_CHAR_LIST'], 'UAM_CONFIRM_MAIL_TRUE' => $conf_UAM['CONFIRM_MAIL'] == 'true' ? 'checked="checked"' : '', 'UAM_CONFIRM_MAIL_FALSE' => $conf_UAM['CONFIRM_MAIL'] == 'false' ? 'checked="checked"' : '', 'UAM_CONFIRM_MAIL_LOCAL' => $conf_UAM['CONFIRM_MAIL'] == 'local' ? 'checked="checked"' : '', 'UAM_CONFIRMMAIL_TEXT' => $conf_UAM['CONFIRMMAIL_TEXT'], 'UAM_No_Confirm_Group' => $conf_UAM['NO_CONFIRM_GROUP'], 'UAM_Validated_Group' => $conf_UAM['VALIDATED_GROUP'], 'UAM_No_Confirm_Status' => $conf_UAM['NO_CONFIRM_STATUS'], 'UAM_Validated_Status' => $conf_UAM['VALIDATED_STATUS'], 'UAM_MAILEXCLUSION_TRUE' => $conf_UAM['MAILEXCLUSION'] == 'true' ? 'checked="checked"' : '', 'UAM_MAILEXCLUSION_FALSE' => $conf_UAM['MAILEXCLUSION'] == 'false' ? 'checked="checked"' : '', 'UAM_MAILEXCLUSION_LIST' => $conf_UAM['MAILEXCLUSION_LIST'], 'UAM_GHOSTRACKER_TRUE' => $conf_UAM['GHOSTRACKER'] == 'true' ? 'checked="checked"' : '', 'UAM_GHOSTRACKER_FALSE' => $conf_UAM['GHOSTRACKER'] == 'false' ? 'checked="checked"' : '', 'UAM_GHOSTRACKER_DAYLIMIT' => $conf_UAM['GHOSTRACKER_DAYLIMIT'], 'UAM_GHOSTRACKER_REMINDERTEXT' => $conf_UAM['GHOSTRACKER_REMINDERTEXT'], 'UAM_ADDLASTVISIT_TRUE' => $conf_UAM['ADDLASTVISIT'] == 'true' ? 'checked="checked"' : '', 'UAM_ADDLASTVISIT_FALSE' => $conf_UAM['ADDLASTVISIT'] == 'false' ? 'checked="checked"' : '', 'UAM_ADMINCONFMAIL_TRUE' => $conf_UAM['ADMINCONFMAIL'] == 'true' ? 'checked="checked"' : '', 'UAM_ADMINCONFMAIL_FALSE' => $conf_UAM['ADMINCONFMAIL'] == 'false' ? 'checked="checked"' : '', 'UAM_REDIRTOPROFILE_TRUE' => $conf_UAM['REDIRTOPROFILE'] == 'true' ? 'checked="checked"' : '', 'UAM_REDIRTOPROFILE_FALSE' => $conf_UAM['REDIRTOPROFILE'] == 'false' ? 'checked="checked"' : '', 'UAM_GTAUTO_TRUE' => $conf_UAM['GTAUTO'] == 'true' ? 'checked="checked"' : '', 'UAM_GTAUTO_FALSE' => $conf_UAM['GTAUTO'] == 'false' ? 'checked="checked"' : '', 'UAM_GTAUTOMAIL_TRUE' => $conf_UAM['GTAUTOMAIL'] == 'true' ? 'checked="checked"' : '', 'UAM_GTAUTOMAIL_FALSE' => $conf_UAM['GTAUTOMAIL'] == 'false' ? 'checked="checked"' : '', 'UAM_GTAUTODEL_TEXT' => $conf_UAM['GTAUTODEL'], 'UAM_GTAUTOMAILTEXT' => $conf_UAM['GTAUTOMAILTEXT'], 'UAM_Downgrade_Group' => $conf_UAM['DOWNGRADE_GROUP'], 'UAM_Downgrade_Status' => $conf_UAM['DOWNGRADE_STATUS'], 'UAM_ADMINVALIDATIONMAIL_TEXT' => $conf_UAM['ADMINVALIDATIONMAIL'], 'UAM_CUSTOMPASSWRETR_TRUE' => $conf_UAM['CUSTOMPASSWRETR'] == 'true' ? 'checked="checked"' : '', 'UAM_CUSTOMPASSWRETR_FALSE' => $conf_UAM['CUSTOMPASSWRETR'] == 'false' ? 'checked="checked"' : '', 'UAM_CUSTOMPASSWRETR_TEXT' => $conf_UAM['CUSTOMPASSWRETR_TEXT'], 'UAM_USRAUTO_TRUE' => $conf_UAM['USRAUTO'] == 'true' ? 'checked="checked"' : '', 'UAM_USRAUTO_FALSE' => $conf_UAM['USRAUTO'] == 'false' ? 'checked="checked"' : '', 'UAM_USRAUTODEL_TEXT' => $conf_UAM['USRAUTODEL'], 'UAM_USRAUTOMAIL_TRUE' => $conf_UAM['USRAUTOMAIL'] == 'true' ? 'checked="checked"' : '', 'UAM_USRAUTOMAIL_FALSE' => $conf_UAM['USRAUTOMAIL'] == 'false' ? 'checked="checked"' : '', 'UAM_STUFFS_TRUE' => $conf_UAM['STUFFS'] == 'true' ? 'checked="checked"' : '', 'UAM_STUFFS_FALSE' => $conf_UAM['STUFFS'] == 'false' ? 'checked="checked"' : '', 'UAM_HIDEPASSW_TRUE' => $conf_UAM['HIDEPASSW'] == 'true' ? 'checked="checked"' : '', 'UAM_HIDEPASSW_FALSE' => $conf_UAM['HIDEPASSW'] == 'false' ? 'checked="checked"' : '', 'UAM_NO_VALID_LEVEL' => $conf_UAM['NO_VALID_LEVEL'], 'UAM_VALID_LEVEL' => $conf_UAM['VALID_LEVEL'], 'UAM_DOWNGRADE_LEVEL' => $conf_UAM['DOWNGRADE_LEVEL'], 'UAM_REJECTCONNECT_TRUE' => $conf_UAM['REJECTCONNECT'] == 'true' ? 'checked="checked"' : '', 'UAM_REJECTCONNECT_FALSE' => $conf_UAM['REJECTCONNECT'] == 'false' ? 'checked="checked"' : '', 'UAM_REJECTCONNECT_TEXT' => $conf_UAM['REJECTCONNECT_TEXT'], 'UAM_CONFIRMMAIL_SUBJECT' => $conf_UAM['CONFIRMMAIL_SUBJECT'], 'UAM_CONFIRMMAIL_REMAIL_SUBJECT' => $conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT'], 'UAM_INFOMAIL_SUBJECT' => $conf_UAM['INFOMAIL_SUBJECT'], 'UAM_GTAUTOMAIL_SUBJECT' => $conf_UAM['GTAUTOMAIL_SUBJECT'], 'UAM_GTREMINDER_SUBJECT' => $conf_UAM['GTREMINDER_SUBJECT'], 'UAM_ADMINVALIDATIONMAIL_SUBJECT' => $conf_UAM['ADMINVALIDATIONMAIL_SUBJECT'], 'UAM_ADDURL2MAIL_TRUE' => $conf_UAM['ADD_GALLERY_URL_TO_EMAILS'] == 'true' ? 'checked="checked"' : '', 'UAM_ADDURL2MAIL_FALSE' => $conf_UAM['ADD_GALLERY_URL_TO_EMAILS'] == 'false' ? 'checked="checked"' : '', 'UAM_ADMINS_COPY_TRUE' => $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true' ? 'checked="checked"' : '', 'UAM_ADMINS_COPY_FALSE' => $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'false' ? 'checked="checked"' : '', 'UAM_ERROR_REPORTS1' => $UAM_Exclusionlist_Error, 'UAM_ERROR_REPORTS2' => $UAM_Illegal_Flag_Error1, 'UAM_ERROR_REPORTS3' => $UAM_Illegal_Flag_Error2, 'UAM_ERROR_REPORTS4' => $UAM_Illegal_Flag_Error3, 'UAM_EMAIL_MANDATORY' => $UAM_Email_Mandatory_Check, 'UAM_CONFIRMMAIL_TIMEOUT_TRUE' => $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'true' ? 'checked="checked"' : '', 'UAM_CONFIRMMAIL_TIMEOUT_FALSE' => $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'false' ? 'checked="checked"' : '', 'UAM_CONFIRMMAIL_DELAY' => $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'], 'UAM_CONFIRMMAIL_REMAIL_TRUE' => $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL'] == 'true' ? 'checked="checked"' : '', 'UAM_CONFIRMMAIL_REMAIL_FALSE' => $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL'] == 'false' ? 'checked="checked"' : '', 'UAM_CONFIRMMAIL_REMAIL_TXT1' => $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1'], 'UAM_CONFIRMMAIL_REMAIL_TXT2' => $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2'], 'UAM_CONFIRMMAIL_CUSTOM_TXT1' => $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1'], 'UAM_CONFIRMMAIL_CUSTOM_TXT2' => $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2'])); if (isset($_POST['audit'])) { $msg_error1 = ''; // Username without forbidden keys // ------------------------------- if (isset($conf_UAM['USERNAME_CHAR']) and $conf_UAM['USERNAME_CHAR'] == 'true') { $query = ' SELECT ' . $conf['user_fields']['username'] . ', ' . $conf['user_fields']['email'] . ' FROM ' . USERS_TABLE . ' ;'; $result = pwg_query($query); while ($row = pwg_db_fetch_assoc($result)) { if (!ValidateUsername(stripslashes($row['username']))) { $msg_error1 .= ($msg_error1 != '' ? '<br>' : '') . l10n('UAM_Err_audit_username_char') . stripslashes($row['username']); } } } $msg_error2 = ''; // Email without forbidden domain // ------------------------------ if (isset($conf_UAM['MAILEXCLUSION']) and $conf_UAM['MAILEXCLUSION'] == 'true') { $query = ' SELECT ' . $conf['user_fields']['username'] . ', ' . $conf['user_fields']['email'] . ' FROM ' . USERS_TABLE . ' ;'; $result = pwg_query($query); while ($row = pwg_db_fetch_assoc($result)) { $conf_MailExclusion = preg_split("/[\\s,]+/", $conf_UAM['MAILEXCLUSION_LIST']);
/** * Triggered on register_user_check * * Additional controls on user registration check */ function UAM_RegistrationCheck($errors, $user) { global $conf; // Exclusion of Adult_Content users // -------------------------------- if ($user['username'] != "16" and $user['username'] != "18") { load_language('plugin.lang', UAM_PATH); $conf_UAM = unserialize($conf['UserAdvManager']); // Username without forbidden keys // ------------------------------- if (isset($conf_UAM['USERNAME_CHAR']) and $conf_UAM['USERNAME_CHAR'] == 'true' and !empty($user['username']) and ValidateUsername($user['username']) and !is_admin()) { $lang['reg_err_login1'] = l10n('UAM_reg_err_login2') . "'" . $conf_UAM['USERNAME_CHAR_LIST'] . "'"; array_push($errors, $lang['reg_err_login1']); } // Email without forbidden domains // ------------------------------- if (isset($conf_UAM['MAILEXCLUSION']) and $conf_UAM['MAILEXCLUSION'] == 'true' and !empty($user['email']) and ValidateEmailProvider($user['email']) and !is_admin()) { $lang['reg_err_login1'] = l10n('UAM_reg_err_login5') . "'" . $conf_UAM['MAILEXCLUSION_LIST'] . "'"; array_push($errors, $lang['reg_err_login1']); } return $errors; } }