Unable to upgrade to 2.0.11 due to conflict with PM Mod code

Makes it posble for admin to specify witch type of users may mass PM any usergroup
Also PM users can be a list of usernames, so PM can be sendt to any number of users

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Unable to upgrade to 2.0.11 due to conflict with PM Mod code

Postby The Grinch on Thu 09. Dec, 2004 05:21

Code: Select all
FIND - Line 1135

$to_username = $HTTP_POST_VARS['username'];


REPLACE WITH

$to_username = phpbb_clean_username($HTTP_POST_VARS['username']);


The problem is the PM mod changed that line pretty drastically. So I have no clue how to do the update. From what I understand the bugs are very serious, and I've already had someone hack me. So I really need to get this going asap. I'd prefer to not have to uninstall the PM mod.

Here's what the original change was:
Code: Select all
#-----[ FIND ]------------------------------------------------
#
$to_username = $HTTP_POST_VARS['username'];

#
#-----[ REPLACE WITH ]----------------------------------------
#

// Start replacement - Custom mass PM MOD
$to_username_array = explode (",", $HTTP_POST_VARS['username']);

foreach ($to_username_array as $name) $temp_array[] = trim($name);
$to_username_array=$temp_array;

sort ($to_username_array);

$n=0;
while ( !empty($to_username_array[$n]) )
{
   $to_username_array[$n] = trim ($to_username_array[$n]);
   $to_usernames .=  (($to_usernames) ? "," : "" ) . "'" . $to_username_array[$n++]."'";
}
// End replacement - Custom mass PM MOD


If someone could tell me how to incorporate the 2.0.11 changes to work, that would be extremely helpful.
The Grinch
Poster
Poster
 
Posts: 7
Joined: Sun 31. Aug, 2003 18:30

Postby MR on Thu 16. Dec, 2004 23:19

I have the same problem !

Help :cry:
MR
Poster
Poster
 
Posts: 2
Joined: Sun 12. Dec, 2004 18:38

Postby ITHAKB on Fri 17. Dec, 2004 05:50

Me three!
ITHAKB
Poster
Poster
 
Posts: 1
Joined: Fri 17. Dec, 2004 05:48

Postby Ex0dus on Fri 17. Dec, 2004 21:06

Please post up the part of the 2.0.11 changes that deal with this part of the code. I did it but i dont remember exactly how. Seeing all of the code in one spot again should refresh my memory.

-Ex0dus
Ex0dus
Poster
Poster
 
Posts: 2
Joined: Mon 06. Sep, 2004 07:56

Postby corny on Fri 17. Dec, 2004 22:01

Hi,

I've checked my code (I suppose it is privmsg.php what this is about ;) ) and this is what I have there:

Code: Select all
   if ( $submit )
   {
      if ( !empty($HTTP_POST_VARS['username']) )
      {

// Start replacement - Custom mass PM MOD
         $to_username_array = explode (";", $HTTP_POST_VARS['username']);
         usort($to_username_array, create_function('$a,$b','return strcasecmp($a,$b);'));
         foreach ($to_username_array as $name)
            $to_usernames .= "'".phpbb_clean_username(trim($name))."',";
         $to_usernames[strlen($to_usernames)-1]=" ";
// End replacement - Custom mass PM MOD

         $sql = "SELECT user_id, username, user_notify_pm, user_email, user_lang, user_active
            FROM " . USERS_TABLE . "
            WHERE username IN ($to_usernames)
               AND user_id <> " . ANONYMOUS . " ORDER BY username ASC";

// Start replacement - Custom mass PM MOD
         if( !($result2 = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not obtain users PM information', '', __LINE__, __FILE__, $sql);
         }
         $to_users = $db->sql_fetchrowset($result2);
         $n=0;
         while ($to_username_array[$n] && !$error)
         {
            if (strcasecmp($to_users[$n]['username'], str_replace("\'", "'",$to_username_array[$n])))
            {
               $error = TRUE;
               $error_msg .= $lang['No_such_user']." '".str_replace("\'", "'", $to_username_array[$n]);
            }
            $n++;
         }
      }
      else
      {
// End replacement - Custom mass PM MOD

         $error = TRUE;
         $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['No_to_user'];
      }

      $privmsg_subject = trim(strip_tags($HTTP_POST_VARS['subject']));
      if ( empty($privmsg_subject) )
      {
         $error = TRUE;
         $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_subject'];
      }

      if ( !empty($HTTP_POST_VARS['message']) )
      {
         if ( !$error )
         {
            if ( $bbcode_on )
            {
               $bbcode_uid = make_bbcode_uid();
            }

            $privmsg_message = prepare_message($HTTP_POST_VARS['message'], $html_on, $bbcode_on, $smilies_on, $bbcode_uid);

         }
      }
      else
      {
         $error = TRUE;
         $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_message'];
      }
   }


Maybe this helps for you. My board is running 2.0.11.
Last edited by corny on Tue 22. Feb, 2005 11:56, edited 1 time in total.
Regards,
Cornelis
corny
Poster
Poster
 
Posts: 20
Joined: Tue 29. Jun, 2004 14:53

Postby Anon Indie on Fri 07. Jan, 2005 18:01

Does anyone have a solution for this yet?

For that matter, since no one should be running old 2.0.6 due to security issues anyway, does the author plan to ever upgrade these mods to be more compatible with 2.0.11???
Anon Indie
Poster
Poster
 
Posts: 1
Joined: Tue 28. Dec, 2004 10:12

Postby MJ on Fri 11. Feb, 2005 04:43

Code: Select all
// Start replacement - Custom mass PM MOD
$to_username_array = explode (",", $HTTP_POST_VARS['username']);


CHANGE TO:
Code: Select all
// Start replacement - Custom mass PM MOD
$to_username_array = explode (",", phpbb_clean_username($HTTP_POST_VARS['username']));
;)
MJ
Poster
Poster
 
Posts: 90
Joined: Fri 19. Apr, 2002 13:46

Postby ChristianR on Fri 11. Feb, 2005 23:48

MJ wrote:
Code: Select all
// Start replacement - Custom mass PM MOD
$to_username_array = explode (",", $HTTP_POST_VARS['username']);


CHANGE TO:
Code: Select all
// Start replacement - Custom mass PM MOD
$to_username_array = explode (",", phpbb_clean_username($HTTP_POST_VARS['username']));
;)


if you do that, you will not be able to to the multi send.. i.e. send a pm to more than one user at a time.... e.g. "Webmaster;Joe;Matt"
ChristianR
Poster
Poster
 
Posts: 47
Joined: Sun 18. Jan, 2004 14:17

Next

Return to Custom mass PM [2.0.6/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron