/[drupal]/contributions/modules/troll/troll.module
ViewVC logotype

Diff of /contributions/modules/troll/troll.module

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

revision 1.26.2.11.2.8, Fri Jun 19 13:36:04 2009 UTC revision 1.26.2.11.2.9, Mon Sep 28 17:25:25 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: troll.module,v 1.26.2.11.2.7 2009/06/13 02:55:13 deekayen Exp $  // $Id: troll.module,v 1.26.2.11.2.8 2009/06/19 13:36:04 deekayen Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 120  function troll_admin_settings() { Line 120  function troll_admin_settings() {
120      '#description' => t("Page for relocating users banned based on their IP address or domain name.  If left blank, users will be redirected to blocked.html in the troll module's directory. Do not use a drupal path here! You will cause a loop since IP banning completely blocks all access to the site! Edit the blocked.html file, or redirect to http://localhost."),      '#description' => t("Page for relocating users banned based on their IP address or domain name.  If left blank, users will be redirected to blocked.html in the troll module's directory. Do not use a drupal path here! You will cause a loop since IP banning completely blocks all access to the site! Edit the blocked.html file, or redirect to http://localhost."),
121    );    );
122    
123    $roles = user_roles();    $roles = array(t(' -Select Role- ')) + user_roles();
   array_unshift($roles, t(' -Select Role- '));  
124    $form['role_settings'] = array(    $form['role_settings'] = array(
125      '#type' => 'fieldset',      '#type' => 'fieldset',
126      '#title' => t('User Blocking')      '#title' => t('User Blocking')
# Line 234  function troll_menu($may_cache) { Line 233  function troll_menu($may_cache) {
233        'path' => 'admin/user/troll/ip_blacklist/summary',        'path' => 'admin/user/troll/ip_blacklist/summary',
234        'title' => t('Summary'),        'title' => t('Summary'),
235        'callback' => 'troll_blacklist_summary',        'callback' => 'troll_blacklist_summary',
236        'access' => array('administer troll'),        'access' => user_access('administer troll'),
237        'type' => MENU_DEFAULT_LOCAL_TASK,        'type' => MENU_DEFAULT_LOCAL_TASK,
238        'weight' => 0        'weight' => 0
239      );      );
# Line 322  function troll_menu($may_cache) { Line 321  function troll_menu($may_cache) {
321  }  }
322    
323  /**  /**
324     * Menu callback: block a user and redirect to search page.
325     *
326     * @param $uid
327     */
328    function troll_confirm_block_user_form($uid) {
329      $account = user_load(array('uid' => $uid));
330      if (!$account) {
331        drupal_goto('admin/user/troll');
332      }
333      $form['uid'] = array(
334        '#type' => 'value',
335        '#value' => $uid,
336      );
337      $form['#redirect'] = 'admin/user/troll';
338      return confirm_form($form, t('Block user %username?', array('%username' => $account->name)), 'admin/user/troll', t('Are you sure you want to block this user?'));
339    }
340    
341    function troll_confirm_block_user_form_submit($form_id, $form_values /*$form, &$form_state*/) {
342      troll_block_user($form_values['uid']);
343    }
344    
345    /**
346   * Menu callback: user IP banning.   * Menu callback: user IP banning.
347   */   */
348  function troll_ip_ban() {  function troll_ip_ban() {
# Line 539  function troll_blacklist_import_list($li Line 560  function troll_blacklist_import_list($li
560   * @param array $edit   * @param array $edit
561   */   */
562  function troll_blacklist_import_url($edit) {  function troll_blacklist_import_url($edit) {
563    $url_parts = parse_url($edit['custom_list']);    $url_parts = parse_url($edit);
564    $file_parts = pathinfo($url_parts['path']);    $file_parts = pathinfo($url_parts['path']);
565    troll_blacklist_parse_save($edit['custom_list'], $file_parts['extension']);    troll_blacklist_parse_save($edit, $file_parts['extension']);
566  }  }
567    
568  /**  /**

Legend:
Removed from v.1.26.2.11.2.8  
changed lines
  Added in v.1.26.2.11.2.9

  ViewVC Help
Powered by ViewVC 1.1.2