$Form->hidden('user_ID', $edited_User->ID); if (isset($Blog)) { $Form->hidden('blog', $Blog->ID); } if ($new_user_creating) { $current_User->check_perm('users', 'edit', true); $edited_User->get_Group(); $Form->begin_fieldset(T_('New user') . get_manual_link('user-edit'), array('class' => 'fieldset clear')); $chosengroup = $edited_User->Group === NULL ? $Settings->get('newusers_grp_ID') : $edited_User->grp_ID; $GroupCache =& get_GroupCache(); $Form->select_object('edited_user_grp_ID', $chosengroup, $GroupCache, T_('User group')); $field_note = '[0 - 10]'; $Form->text_input('edited_user_level', $edited_User->get('level'), 2, T_('User level'), $field_note, array('required' => true)); $email_fieldnote = '<a href="mailto:' . $edited_User->get('email') . '">' . get_icon('email', 'imgtag', array('title' => T_('Send an email'))) . '</a>'; $Form->text_input('edited_user_email', $edited_User->email, 30, T_('Email'), $email_fieldnote, array('maxlength' => 255, 'required' => true)); $Form->select_input_array('edited_user_status', $edited_User->get('status'), get_user_statuses(), T_('Account status')); $Form->end_fieldset(); } /*************** Identity **************/ $Form->begin_fieldset(T_('Identity') . (is_admin_page() ? get_manual_link('user-profile-tab') : '')); if (($url = $edited_User->get('url')) != '') { if (!preg_match('#://#', $url)) { $url = 'http://' . $url; } $url_fieldnote = '<a href="' . $url . '" target="_blank">' . get_icon('play', 'imgtag', array('title' => T_('Visit the site'))) . '</a>'; } else { $url_fieldnote = ''; } if ($action != 'view') { // We can edit the values: if ($action != 'new') {
/** * Callback to add filters on top of the result set * * @param Form */ function callback_filter_userlist(&$Form) { global $Settings, $current_User; $Form->hidden('filter', 'new'); $Form->text('keywords', get_param('keywords'), 20, T_('Name'), '', 50); echo '<span class="nowrap">'; $Form->checkbox('gender_men', get_param('gender_men'), T_('Men')); $Form->checkbox('gender_women', get_param('gender_women'), T_('Women')); echo '</span>'; if (!is_admin_page()) { echo '<br />'; } if (is_admin_page()) { // show this filters only on admin interface if ($current_User->check_perm('users', 'edit')) { // Show "Reported users" filter only for users with edit user permission $Form->checkbox('reported', get_param('reported'), T_('Reported users')); $Form->checkbox('custom_sender_email', get_param('custom_sender_email'), T_('Users with custom sender address')); $Form->checkbox('custom_sender_name', get_param('custom_sender_name'), T_('Users with custom sender name')); } $Form->select_input_array('account_status', get_param('account_status'), get_user_statuses(T_('All')), T_('Account status')); $GroupCache = new DataObjectCache('Group', true, 'T_groups', 'grp_', 'grp_ID', 'grp_name'); $group_options_array = array('-1' => T_('All (Ungrouped)'), '0' => T_('All (Grouped)')) + $GroupCache->get_option_array(); $Form->select_input_array('group', get_param('group'), $group_options_array, T_('User group'), '', array('force_keys_as_values' => true)); echo '<br />'; } if (user_country_visible()) { // Filter by country load_class('regional/model/_country.class.php', 'Country'); load_funcs('regional/model/_regional.funcs.php'); $CountryCache =& get_CountryCache(T_('All')); $Form->select_country('country', get_param('country'), $CountryCache, T_('Country'), array('allow_none' => true)); } if (user_region_visible()) { // Filter by region echo '<span id="region_filter"' . (!regions_exist(get_param('country'), true) ? ' style="display:none"' : '') . '>'; $Form->select_input_options('region', get_regions_option_list(get_param('country'), get_param('region')), T_('Region')); echo '</span>'; } if (user_subregion_visible()) { // Filter by subregion echo '<span id="subregion_filter"' . (!subregions_exist(get_param('region'), true) ? ' style="display:none"' : '') . '>'; $Form->select_input_options('subregion', get_subregions_option_list(get_param('region'), get_param('subregion')), T_('Sub-region')); echo '</span>'; } if (user_city_visible()) { // Filter by city echo '<span id="city_filter"' . (!cities_exist(get_param('country'), get_param('region'), get_param('subregion'), true) ? ' style="display:none"' : '') . '>'; $Form->select_input_options('city', get_cities_option_list(get_param('country'), get_param('region'), get_param('subregion'), get_param('city')), T_('City')); echo '</span>'; } echo '<br />'; $Form->interval('age_min', get_param('age_min'), 'age_max', get_param('age_max'), 3, T_('Age group')); echo '<br />'; $criteria_types = param('criteria_type', 'array/integer'); $criteria_values = param('criteria_value', 'array/string'); if (count($criteria_types) == 0) { // Init one criteria fieldset for first time $criteria_types[] = ''; $criteria_values[] = ''; } foreach ($criteria_types as $c => $type) { $value = trim(strip_tags($criteria_values[$c])); if ($value == '' && count($criteria_types) > 1 && $c > 0) { // Don't display empty field again after filter request continue; } if ($c > 0) { // Separator between criterias echo '<br />'; } $Form->output = false; $criteria_input = $Form->text('criteria_value[]', $value, 17, '', '', 50); $criteria_input .= get_icon('add', 'imgtag', array('rel' => 'add_criteria')); $Form->output = true; global $user_fields_empty_name; $user_fields_empty_name = T_('Select...'); $Form->select('criteria_type[]', $type, 'callback_options_user_new_fields', T_('Specific criteria'), $criteria_input); } if (user_region_visible()) { // JS functions for AJAX loading of regions, subregions & cities ?> <script type="text/javascript"> jQuery( '#country' ).change( function() { var this_obj = jQuery( this ); jQuery.ajax( { type: 'POST', url: '<?php echo get_samedomain_htsrv_url(); ?> anon_async.php', data: 'action=get_regions_option_list&ctry_id=' + jQuery( this ).val(), success: function( result ) { jQuery( '#region' ).html( ajax_debug_clear( result ) ); if( jQuery( '#region option' ).length > 1 ) { jQuery( '#region_filter' ).show(); } else { jQuery( '#region_filter' ).hide(); } load_subregions( 0 ); // Reset sub-regions } } ); } ); jQuery( '#region' ).change( function () { // Change option list with sub-regions load_subregions( jQuery( this ).val() ); } ); jQuery( '#subregion' ).change( function () { // Change option list with cities load_cities( jQuery( '#country' ).val(), jQuery( '#region' ).val(), jQuery( this ).val() ); } ); function load_subregions( region_ID ) { // Load option list with sub-regions for seleted region jQuery.ajax( { type: 'POST', url: '<?php echo get_samedomain_htsrv_url(); ?> anon_async.php', data: 'action=get_subregions_option_list&rgn_id=' + region_ID, success: function( result ) { jQuery( '#subregion' ).html( ajax_debug_clear( result ) ); if( jQuery( '#subregion option' ).length > 1 ) { jQuery( '#subregion_filter' ).show(); } else { jQuery( '#subregion_filter' ).hide(); } load_cities( jQuery( '#country' ).val(), region_ID, 0 ); } } ); } function load_cities( country_ID, region_ID, subregion_ID ) { // Load option list with cities for seleted region or sub-region jQuery.ajax( { type: 'POST', url: '<?php echo get_samedomain_htsrv_url(); ?> anon_async.php', data: 'action=get_cities_option_list&ctry_id=' + country_ID + '&rgn_id=' + region_ID + '&subrg_id=' + subregion_ID, success: function( result ) { jQuery( '#city' ).html( ajax_debug_clear( result ) ); if( jQuery( '#city option' ).length > 1 ) { jQuery( '#city_filter' ).show(); } else { jQuery( '#city_filter' ).hide(); } } } ); } </script> <?php } }
$Form->hidden('admin_form', '1'); $Form->hidden('user_ID', $edited_User->ID); $Form->hidden('edited_user_login', $edited_User->login); /*************** User permissions **************/ $Form->begin_fieldset(T_('User permissions') . get_manual_link('user-admin-permissions'), array('class' => 'fieldset clear')); $edited_User->get_Group(); $level_fieldnote = '[0 - 10]'; if ($edited_User->ID == 1) { // This is Admin user echo '<input type="hidden" name="edited_user_grp_ID" value="' . $edited_User->grp_ID . '" />'; $Form->info(T_('Account status'), T_('Autoactivated')); $Form->info(T_('User group'), $edited_User->Group->dget('name')); $Form->info_field(T_('User level'), $edited_User->get('level'), array('note' => $level_fieldnote)); } else { $status_icon = '<div id="user_status_icon">' . $user_status_icons[$edited_User->get('status')] . '</div>'; $Form->select_input_array('edited_user_status', $edited_User->get('status'), get_user_statuses(), T_('Account status'), '', array('field_suffix' => $status_icon)); $GroupCache =& get_GroupCache(); $Form->select_object('edited_user_grp_ID', $edited_User->grp_ID, $GroupCache, T_('User group')); $Form->text_input('edited_user_level', $edited_User->get('level'), 2, T_('User level'), $level_fieldnote, array('required' => true)); } $Form->end_fieldset(); // user permissions $Form->begin_fieldset(T_('Email') . get_manual_link('user-admin-email')); $email_fieldnote = '<a href="mailto:' . $edited_User->get('email') . '" class="roundbutton">' . get_icon('email', 'imgtag', array('title' => T_('Send an email'))) . '</a>'; $Form->text_input('edited_user_email', $edited_User->get('email'), 30, T_('Email'), $email_fieldnote, array('maxlength' => 100, 'required' => true)); // Get status of email from T_email_blocked table load_class('tools/model/_emailblocked.class.php', 'EmailBlocked'); $EmailBlockedCache =& get_EmailBlockedCache(); if ($EmailBlocked =& $EmailBlockedCache->get_by_name($edited_User->get('email'), false, false)) { // The email of this user is located in the T_email_blocked table $email_status = $EmailBlocked->get('status');