/[drupal]/drupal/modules/user/user.admin.inc
ViewVC logotype

Diff of /drupal/modules/user/user.admin.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.33 by dries, Sun Nov 16 15:10:49 2008 UTC revision 1.34 by webchick, Thu Jan 8 08:42:13 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: user.admin.inc,v 1.32 2008/11/11 22:39:59 dries Exp $  // $Id: user.admin.inc,v 1.33 2008/11/16 15:10:49 dries Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 15  function user_admin($callback_arg = '') Line 15  function user_admin($callback_arg = '')
15        $output = drupal_get_form('user_register');        $output = drupal_get_form('user_register');
16        break;        break;
17      default:      default:
18        if (!empty($_POST['accounts']) && isset($_POST['operation']) && ($_POST['operation'] == 'delete')) {        if (!empty($_POST['accounts']) && isset($_POST['operation']) && ($_POST['operation'] == 'cancel')) {
19          $output = drupal_get_form('user_multiple_delete_confirm');          $output = drupal_get_form('user_multiple_cancel_confirm');
20        }        }
21        else {        else {
22          $output = drupal_get_form('user_filter_form');          $output = drupal_get_form('user_filter_form');
# Line 235  function user_admin_settings() { Line 235  function user_admin_settings() {
235    $form['registration']['user_email_verification'] = array('#type' => 'checkbox', '#title' => t('Require e-mail verification when a visitor creates an account'), '#default_value' => variable_get('user_email_verification', TRUE), '#description' => t('If this box is checked, new users will be required to validate their e-mail address prior to logging into the site, and will be assigned a system-generated password. With it unchecked, users will be logged in immediately upon registering, and may select their own passwords during registration.'));    $form['registration']['user_email_verification'] = array('#type' => 'checkbox', '#title' => t('Require e-mail verification when a visitor creates an account'), '#default_value' => variable_get('user_email_verification', TRUE), '#description' => t('If this box is checked, new users will be required to validate their e-mail address prior to logging into the site, and will be assigned a system-generated password. With it unchecked, users will be logged in immediately upon registering, and may select their own passwords during registration.'));
236    $form['registration']['user_registration_help'] = array('#type' => 'textarea', '#title' => t('User registration guidelines'), '#default_value' => variable_get('user_registration_help', ''), '#description' => t('This text is displayed at the top of the user registration form and is useful for helping or instructing your users.'));    $form['registration']['user_registration_help'] = array('#type' => 'textarea', '#title' => t('User registration guidelines'), '#default_value' => variable_get('user_registration_help', ''), '#description' => t('This text is displayed at the top of the user registration form and is useful for helping or instructing your users.'));
237    
238      // Account cancellation settings.
239      module_load_include('inc', 'user', 'user.pages');
240      $form['cancel'] = array(
241        '#type' => 'fieldset',
242        '#title' => t('Account cancellation settings'),
243      );
244      $form['cancel']['user_cancel_method'] = array(
245        '#type' => 'item',
246        '#title' => t('When cancelling a user account'),
247        '#description' => t('This default applies to all users who want to cancel their accounts. Users with the %select-cancel-method or %administer-users <a href="@permissions-url">permissions</a> can override this default method.', array('%select-cancel-method' => t('Select method for cancelling account'), '%administer-users' => t('Administer users'), '@permissions-url' => url('admin/user/permissions'))),
248      );
249      $form['cancel']['user_cancel_method'] += user_cancel_methods();
250      foreach (element_children($form['cancel']['user_cancel_method']) as $element) {
251        // Remove all account cancellation methods that have #access defined, as
252        // those cannot be configured as default method.
253        if (isset($form['cancel']['user_cancel_method'][$element]['#access'])) {
254          $form['cancel']['user_cancel_method'][$element]['#access'] = FALSE;
255        }
256        // Remove the description (only displayed on the confirmation form).
257        else {
258          unset($form['cancel']['user_cancel_method'][$element]['#description']);
259        }
260      }
261    
262    // User e-mail settings.    // User e-mail settings.
263    $form['email'] = array(    $form['email'] = array(
264      '#type' => 'fieldset',      '#type' => 'fieldset',
# Line 243  function user_admin_settings() { Line 267  function user_admin_settings() {
267    );    );
268    // These email tokens are shared for all settings, so just define    // These email tokens are shared for all settings, so just define
269    // the list once to help ensure they stay in sync.    // the list once to help ensure they stay in sync.
270    $email_token_help = t('Available variables are:') . ' !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.';    $email_token_help = t('Available variables are:') . ' !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url, !cancel_url.';
271    
272    $form['email']['admin_created'] = array(    $form['email']['admin_created'] = array(
273      '#type' => 'fieldset',      '#type' => 'fieldset',
# Line 375  function user_admin_settings() { Line 399  function user_admin_settings() {
399      '#rows' => 3,      '#rows' => 3,
400    );    );
401    
402    $form['email']['deleted'] = array(    $form['email']['cancel_confirm'] = array(
403        '#type' => 'fieldset',
404        '#title' => t('Account cancellation confirmation email'),
405        '#collapsible' => TRUE,
406        '#collapsed' => TRUE,
407        '#description' => t('Customize e-mail messages sent to users when they attempt to cancel their accounts.') . ' ' . $email_token_help,
408      );
409      $form['email']['cancel_confirm']['user_mail_cancel_confirm_subject'] = array(
410        '#type' => 'textfield',
411        '#title' => t('Subject'),
412        '#default_value' => _user_mail_text('cancel_confirm_subject'),
413        '#maxlength' => 180,
414      );
415      $form['email']['cancel_confirm']['user_mail_cancel_confirm_body'] = array(
416        '#type' => 'textarea',
417        '#title' => t('Body'),
418        '#default_value' => _user_mail_text('cancel_confirm_body'),
419        '#rows' => 3,
420      );
421    
422      $form['email']['canceled'] = array(
423      '#type' => 'fieldset',      '#type' => 'fieldset',
424      '#title' => t('Account deleted email'),      '#title' => t('Account canceled email'),
425      '#collapsible' => TRUE,      '#collapsible' => TRUE,
426      '#collapsed' => TRUE,      '#collapsed' => TRUE,
427      '#description' => t('Enable and customize e-mail messages sent to users when their accounts are deleted.') . ' ' . $email_token_help,      '#description' => t('Enable and customize e-mail messages sent to users when their accounts are canceled.') . ' ' . $email_token_help,
428    );    );
429    $form['email']['deleted']['user_mail_status_deleted_notify'] = array(    $form['email']['canceled']['user_mail_status_canceled_notify'] = array(
430      '#type' => 'checkbox',      '#type' => 'checkbox',
431      '#title' => t('Notify user when account is deleted.'),      '#title' => t('Notify user when account is canceled.'),
432      '#default_value' => variable_get('user_mail_status_deleted_notify', FALSE),      '#default_value' => variable_get('user_mail_status_canceled_notify', FALSE),
433    );    );
434    $form['email']['deleted']['user_mail_status_deleted_subject'] = array(    $form['email']['canceled']['user_mail_status_canceled_subject'] = array(
435      '#type' => 'textfield',      '#type' => 'textfield',
436      '#title' => t('Subject'),      '#title' => t('Subject'),
437      '#default_value' => _user_mail_text('status_deleted_subject'),      '#default_value' => _user_mail_text('status_canceled_subject'),
438      '#maxlength' => 180,      '#maxlength' => 180,
439    );    );
440    $form['email']['deleted']['user_mail_status_deleted_body'] = array(    $form['email']['canceled']['user_mail_status_canceled_body'] = array(
441      '#type' => 'textarea',      '#type' => 'textarea',
442      '#title' => t('Body'),      '#title' => t('Body'),
443      '#default_value' => _user_mail_text('status_deleted_body'),      '#default_value' => _user_mail_text('status_canceled_body'),
444      '#rows' => 3,      '#rows' => 3,
445    );    );
446    

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

  ViewVC Help
Powered by ViewVC 1.1.3