Advertisement
Corey

Untitled

Mar 10th, 2011
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2.     class GroupStrings_ControllerPublic_GroupStrings extends XFCP_GroupStrings_ControllerPublic_GroupStrings
  3.     {
  4.         $db = XenForo_Application::get('db');
  5.         $groups = $db->fetchAll("SELECT * FROM `xf_user_group` WHERE `strings`!=''");
  6.         $match = 0;
  7.         foreach ($groups as $group)
  8.         {
  9.             $strings = str_replace(" ", "", $group['strings']);
  10.             if (stristr(',', $strings))
  11.             {
  12.                 $strings = explode(",", $strings);
  13.                 foreach ($strings as $string)
  14.                 {
  15.                     if (strlen($data['email']) == (strlen($string) && strripos($data['email'], $string)))
  16.                     {
  17.                         $match = $group['user_group_id'];
  18.                     }
  19.                 }
  20.             }
  21.             if (stristr($data['email'], $strings))
  22.             {
  23.                 $match = $group['user_group_id'];
  24.             }
  25.         }
  26.         if ($match == 0)
  27.         {
  28.             $writer->set('user_group_id', XenForo_Model_User::$defaultRegisteredGroupId);
  29.         }
  30.         else
  31.         {
  32.             $writer->set('user_group_id', $match);
  33.         }
  34.     }
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement