To jest tylko wersja do druku, aby zobaczyć pełną wersję tematu, kliknij TUTAJ
phpBB2 by Przemo
Support forów phpBB2 modified by Przemo

English version - [Modification] Mass PW BIG Problem

evilmc - 07-08-2015, 13:27
Temat postu: [Modification] Mass PW BIG Problem
I have big problem with this modification. Not works more. Always show this error. How to fix and work, again?

Kod:
https://serbian-fm.net/admin/admin_mass_pw.php?sid=xxxx


Error:
Kod:
damianmyst'; } function GenerateJump() { global $db, $lang; $sql = "SELECT group_id, group_name FROM ".GROUPS_TABLE . " WHERE group_single_user <> 1"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain list of groups', '', __LINE__, __FILE__, $sql); } $grupy = ''; return $grupy; } $no_page_header = TRUE; $phpbb_root_path = './../'; require($phpbb_root_path . 'extension.inc'); require('./pagestart.' . $phpEx); if (!isset($HTTP_POST_VARS['submit'])) { include('./page_header_admin.'.$phpEx); $template->set_filenames(array( 'body' => 'admin/user_pw_body.tpl') ); $template->assign_vars(array( 'L_GUZIK'=>$lang['senduj'], 'L_MSG'=>$lang['Message'], 'L_TOPIC'=>$lang['Subject'], 'L_MASS_PW' => $lang['mass_pw'], 'L_INFO' => Copyright(), 'L_SEND' => $lang['sent_to'], 'L_EMAIL' => $lang['send_mail'], 'L_TITLE' => $lang['mass_pw'], 'L_EXPLAIN' => $lang['mass_pw_ex'], 'S_SEND_TO' => GenerateJump(), 'S_ACTION' => append_sid('admin_mass_pw.'.$phpEx)) ); $template->pparse('body'); include('./page_footer_admin.'.$phpEx); } else { if ($HTTP_POST_VARS['grupy'] == 'all') { $email = (isset($HTTP_POST_VARS['email'])) ? ', username, user_email, user_notify_pm, user_lang, user_active' : ''; $sql = "SELECT user_id, user_unread_privmsg $email FROM ".USERS_TABLE." WHERE user_id <> -1"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select members', '', __LINE__, __FILE__, $sql); } while ( $row = $db->sql_fetchrow($result) ) { if (isset($HTTP_POST_VARS['email'])) { $UsersData['username'][ $row['user_id'] ] = $row['username']; $UsersData['email'][ $row['user_id'] ] = $row['user_email']; $UsersData['email_allow'][ $row['user_id'] ] = $row['user_notify_pm']; $UsersData['lang'][ $row['user_id'] ] = $row['user_lang']; $UsersData['active'][ $row['user_id'] ] = $row['user_active']; } $UsersData['user_id'][] = $row['user_id']; $UsersData['pw'][ $row['user_id'] ] = $row['user_unread_privmsg']; } $db->sql_freeresult($result); } else { $email = (isset($HTTP_POST_VARS['email'])) ? ', u.username, u.user_email, u.user_notify_pm, u.user_lang, u.user_active' : ''; $sql = "SELECT u.user_id, u.user_unread_privmsg $email FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug WHERE ug.group_id = '".$HTTP_POST_VARS['grupy']."' AND ug.user_pending <> '1' AND u.user_id = ug.user_id"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select group members', '', __LINE__, __FILE__, $sql); } $UsersData = array(); while ( $row = $db->sql_fetchrow($result) ) { if (isset($HTTP_POST_VARS['email'])) { $UsersData['username'][ $row['user_id'] ] = $row['username']; $UsersData['email'][ $row['user_id'] ] = $row['user_email']; $UsersData['email_allow'][ $row['user_id'] ] = $row['user_notify_pm']; $UsersData['lang'][ $row['user_id'] ] = $row['user_lang']; $UsersData['active'][ $row['user_id'] ] = $row['user_active']; } $UsersData['user_id'][] = $row['user_id']; $UsersData['pw'][ $row['user_id'] ] = $row['user_unread_privmsg']; } $db->sql_freeresult($result); } $sql = "SELECT max(privmsgs_id) AS pw FROM ".PRIVMSGS_TABLE; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select members', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $idx = ++$row['pw']; $sql = "SELECT user_id, username FROM " . USERS_TABLE . " WHERE username = 'Mass Pw Bot'"; if ( !( $result = $db -> sql_query( $sql ) ) ) { message_die(GENERAL_ERROR, 'Could not select mass pw bot data', '', '', __LINE__, __FILE__, $sql ); } if ( $db -> sql_numrows( $result ) == '0' ) { $sql = "SELECT max( user_id ) as MAX FROM " . USERS_TABLE; $result = $db -> sql_query( $sql ); $row = $db -> sql_fetchrow( $result ); $user_id = ++$row['MAX']; $bot_pass = md5(rand('0', '99999999')); $sql = "INSERT INTO " . USERS_TABLE ." ( user_id, username, user_password, user_level, user_regdate ) VALUES ( '$user_id', 'Mass Pw Bot', '$bot_pass', '2', '" . time() ."' );"; if ( !( $result = $db -> sql_query( $sql ) ) ) { message_die(GENERAL_ERROR, 'Could not insert mass pw bot data', '', '', __LINE__, __FILE__, $sql ); } $sql = "SELECT user_id, username FROM " . USERS_TABLE . " WHERE username = 'Mass Pw Bot'"; if ( !( $result = $db -> sql_query( $sql ) ) ) { message_die(GENERAL_ERROR, 'Could not select mass pw bot data', '', '', __LINE__, __FILE__, $sql ); } $bot_data = $db -> sql_fetchrow( $result ); $bot_id = $bot_data['user_id']; } else { $bot_data = $db -> sql_fetchrow( $result ); $bot_id = $bot_data['user_id']; } $temat = addslashes (stripslashes (htmlspecialchars ($HTTP_POST_VARS['subject']))); $tresc = addslashes (stripslashes (htmlspecialchars ($HTTP_POST_VARS['message']))); if($board_config['allow_bbcode']) { require($phpbb_root_path . 'includes/bbcode.' . $phpEx); require($phpbb_root_path . 'includes/functions_post.' . $phpEx); $pm_bbcode = make_bbcode_uid(); $tresc = prepare_message($tresc, 1, 1, 1, $pm_bbcode); } $data = time(); $db -> sql_query( "LOCK TABLES " . PRIVMSGS_TABLE . " WRITE" ); foreach ( $UsersData['user_id'] as $i => $UserId ) { $idx += $i; $PW = ++$UsersData['pw'][$UserId]; $sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_id, privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES ('$idx', '1', '$temat', '$bot_id', '$UserId', " . $data . ", '0', '1', '1', '0')";    if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select members', '', __LINE__, __FILE__, $sql); } $idx_buffor[] = $idx; } $db -> sql_query( "LOCK TABLES " . PRIVMSGS_TEXT_TABLE ." WRITE" ); foreach ( $UsersData['user_id'] as $i => $UserId ) { $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text) VALUES ('{$idx_buffor[ $i ]}', '$pm_bbcode', '$tresc')"; if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not insert private message sent text', '', __LINE__, __FILE__, $sql); } } $db -> sql_query( "UNLOCK TABLES" ); foreach ( $UsersData['user_id'] as $i => $UserId ) { $sql = "UPDATE " . USERS_TABLE . " SET user_new_privmsg = '1', user_unread_privmsg = '$PW' WHERE user_id = '$UserId'"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql); } } if (isset($HTTP_POST_VARS['email'])) { @set_time_limit('1200'); include_once($phpbb_root_path . 'includes/emailer.'.$phpEx); foreach ( $UsersData['email_allow'] as $UserId => $Value ) { if ( $UsersData['active'][$UserId] ) { $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path'])); $script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx; $server_name = trim($board_config['server_name']); $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/'; $emailer = new emailer($board_config['smtp_delivery']); if ( substr($board_config['version'], -1) <= 4) { $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\n"; $emailer->extra_headers($email_headers); } else { $emailer->from($board_config['board_email']); $emailer->replyto($board_config['board_email']); } $emailer->use_template('privmsg_notify', $UsersData['lang'][ $UserId ]); $emailer->email_address($UsersData['email'][ $UserId ]); $emailer->set_subject($lang['Notification_subject']); $emailer->assign_vars(array( 'USERNAME' => $UsersData['username'][ $UserId ], 'SITENAME' => $board_config['sitename'], 'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('
', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox') ); $emailer->send(); $emailer->reset(); } } } $message = $lang['good_Work_myst'] . "

" . sprintf($lang['PW'], "", "") . "

" . sprintf($lang['Click_return_admin_index'], "", ""); message_die(GENERAL_MESSAGE, $message);    } ?>




[ Added: 09-08-2015, 14:37 ]
Can anyone help me to solve the problem? Please! Thanx

Tommekk80 - 11-08-2015, 04:49

Show admin_mass_pw.php
evilmc - 13-08-2015, 14:57

This is default mass pw file. I don't edit line in this file.

[ Added: 14-08-2015, 16:59 ]
I download again Mass PW module and upload again files in server. And again not works!

I get same error:

Kod:
damianmyst'; } function GenerateJump() { global $db, $lang; $sql = "SELECT group_id, group_name FROM ".GROUPS_TABLE . " WHERE group_single_user <> 1"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain list of groups', '', __LINE__, __FILE__, $sql); } $grupy = ''; return $grupy; } $no_page_header = TRUE; $phpbb_root_path = './../'; require($phpbb_root_path . 'extension.inc'); require('./pagestart.' . $phpEx); if (!isset($HTTP_POST_VARS['submit'])) { include('./page_header_admin.'.$phpEx); $template->set_filenames(array( 'body' => 'admin/user_pw_body.tpl') ); $template->assign_vars(array( 'L_GUZIK'=>$lang['senduj'], 'L_MSG'=>$lang['Message'], 'L_TOPIC'=>$lang['Subject'], 'L_MASS_PW' => $lang['mass_pw'], 'L_INFO' => Copyright(), 'L_SEND' => $lang['sent_to'], 'L_EMAIL' => $lang['send_mail'], 'L_TITLE' => $lang['mass_pw'], 'L_EXPLAIN' => $lang['mass_pw_ex'], 'S_SEND_TO' => GenerateJump(), 'S_ACTION' => append_sid('admin_mass_pw.'.$phpEx)) ); $template->pparse('body'); include('./page_footer_admin.'.$phpEx); } else { if ($HTTP_POST_VARS['grupy'] == 'all') { $email = (isset($HTTP_POST_VARS['email'])) ? ', username, user_email, user_notify_pm, user_lang, user_active' : ''; $sql = "SELECT user_id, user_unread_privmsg $email FROM ".USERS_TABLE." WHERE user_id <> -1"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select members', '', __LINE__, __FILE__, $sql); } while ( $row = $db->sql_fetchrow($result) ) { if (isset($HTTP_POST_VARS['email'])) { $UsersData['username'][ $row['user_id'] ] = $row['username']; $UsersData['email'][ $row['user_id'] ] = $row['user_email']; $UsersData['email_allow'][ $row['user_id'] ] = $row['user_notify_pm']; $UsersData['lang'][ $row['user_id'] ] = $row['user_lang']; $UsersData['active'][ $row['user_id'] ] = $row['user_active']; } $UsersData['user_id'][] = $row['user_id']; $UsersData['pw'][ $row['user_id'] ] = $row['user_unread_privmsg']; } $db->sql_freeresult($result); } else { $email = (isset($HTTP_POST_VARS['email'])) ? ', u.username, u.user_email, u.user_notify_pm, u.user_lang, u.user_active' : ''; $sql = "SELECT u.user_id, u.user_unread_privmsg $email FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug WHERE ug.group_id = '".$HTTP_POST_VARS['grupy']."' AND ug.user_pending <> '1' AND u.user_id = ug.user_id"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select group members', '', __LINE__, __FILE__, $sql); } $UsersData = array(); while ( $row = $db->sql_fetchrow($result) ) { if (isset($HTTP_POST_VARS['email'])) { $UsersData['username'][ $row['user_id'] ] = $row['username']; $UsersData['email'][ $row['user_id'] ] = $row['user_email']; $UsersData['email_allow'][ $row['user_id'] ] = $row['user_notify_pm']; $UsersData['lang'][ $row['user_id'] ] = $row['user_lang']; $UsersData['active'][ $row['user_id'] ] = $row['user_active']; } $UsersData['user_id'][] = $row['user_id']; $UsersData['pw'][ $row['user_id'] ] = $row['user_unread_privmsg']; } $db->sql_freeresult($result); } $sql = "SELECT max(privmsgs_id) AS pw FROM ".PRIVMSGS_TABLE; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select members', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $idx = ++$row['pw']; $sql = "SELECT user_id, username FROM " . USERS_TABLE . " WHERE username = 'Mass Pw Bot'"; if ( !( $result = $db -> sql_query( $sql ) ) ) { message_die(GENERAL_ERROR, 'Could not select mass pw bot data', '', '', __LINE__, __FILE__, $sql ); } if ( $db -> sql_numrows( $result ) == '0' ) { $sql = "SELECT max( user_id ) as MAX FROM " . USERS_TABLE; $result = $db -> sql_query( $sql ); $row = $db -> sql_fetchrow( $result ); $user_id = ++$row['MAX']; $bot_pass = md5(rand('0', '99999999')); $sql = "INSERT INTO " . USERS_TABLE ." ( user_id, username, user_password, user_level, user_regdate ) VALUES ( '$user_id', 'Mass Pw Bot', '$bot_pass', '2', '" . time() ."' );"; if ( !( $result = $db -> sql_query( $sql ) ) ) { message_die(GENERAL_ERROR, 'Could not insert mass pw bot data', '', '', __LINE__, __FILE__, $sql ); } $sql = "SELECT user_id, username FROM " . USERS_TABLE . " WHERE username = 'Mass Pw Bot'"; if ( !( $result = $db -> sql_query( $sql ) ) ) { message_die(GENERAL_ERROR, 'Could not select mass pw bot data', '', '', __LINE__, __FILE__, $sql ); } $bot_data = $db -> sql_fetchrow( $result ); $bot_id = $bot_data['user_id']; } else { $bot_data = $db -> sql_fetchrow( $result ); $bot_id = $bot_data['user_id']; } $temat = addslashes (stripslashes (htmlspecialchars ($HTTP_POST_VARS['subject']))); $tresc = addslashes (stripslashes (htmlspecialchars ($HTTP_POST_VARS['message']))); $data = time(); $db -> sql_query( "LOCK TABLES " . PRIVMSGS_TABLE . " WRITE" ); foreach ( $UsersData['user_id'] as $i => $UserId ) { $idx += $i; $PW = ++$UsersData['pw'][$UserId]; $sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_id, privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES ('$idx', '1', '$temat', '$bot_id', '$UserId', " . $data . ", '0', '1', '1', '0')";    if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select members', '', __LINE__, __FILE__, $sql); } $idx_buffor[] = $idx; } $db -> sql_query( "LOCK TABLES " . PRIVMSGS_TEXT_TABLE ." WRITE" ); foreach ( $UsersData['user_id'] as $i => $UserId ) { $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_text) VALUES ('{$idx_buffor[ $i ]}', '$tresc')"; if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not insert private message sent text', '', __LINE__, __FILE__, $sql); } } $db -> sql_query( "UNLOCK TABLES" ); foreach ( $UsersData['user_id'] as $i => $UserId ) { $sql = "UPDATE " . USERS_TABLE . " SET user_new_privmsg = '1', user_unread_privmsg = '$PW' WHERE user_id = '$UserId'"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql); } } if (isset($HTTP_POST_VARS['email'])) { @set_time_limit('1200'); include_once($phpbb_root_path . 'includes/emailer.'.$phpEx); foreach ( $UsersData['email_allow'] as $UserId => $Value ) { if ( $UsersData['active'][$UserId] ) { $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path'])); $script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx; $server_name = trim($board_config['server_name']); $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/'; $emailer = new emailer($board_config['smtp_delivery']); if ( substr($board_config['version'], -1) <= 4) { $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\n"; $emailer->extra_headers($email_headers); } else { $emailer->from($board_config['board_email']); $emailer->replyto($board_config['board_email']); } $emailer->use_template('privmsg_notify', $UsersData['lang'][ $UserId ]); $emailer->email_address($UsersData['email'][ $UserId ]); $emailer->set_subject($lang['Notification_subject']); $emailer->assign_vars(array( 'USERNAME' => $UsersData['username'][ $UserId ], 'SITENAME' => $board_config['sitename'], 'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('
', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox') ); $emailer->send(); $emailer->reset(); } } } $message = $lang['good_Work_myst'] . "

" . sprintf($lang['PW'], "", "") . "

" . sprintf($lang['Click_return_admin_index'], "", ""); message_die(GENERAL_MESSAGE, $message);    } ?>


[ Added: 25-08-2015, 14:55 ]
Any help for this problem?

Thanx

Woytec - 27-08-2015, 18:11

Download from server and attach here.
evilmc - 29-08-2015, 02:38

I replace all files for mass pw mod, and don't have old files...always show same error with old or new files...

I found same error in this forum, but don't how to fix...
http://przemo.webd.pl/php...p=516256#516256


Thanx

kooza - 29-08-2015, 19:37

look + missing file main_admin.php
evilmc - 29-08-2015, 20:26

kooza napisał/a:
missing file main_admin.php

I can't find this file...Where's he supposed to be?

Woytec - 30-08-2015, 09:22

evilmc napisał/a:
kooza napisał/a:
missing file main_admin.php

I can't find this file...Where's he supposed to be?
You don't need to have this file.
evilmc - 01-09-2015, 00:57

Okey, but where is the problem with this modification? :/

[ Added: 16-09-2015, 19:10 ]
Any idea for this problem? :idea:

Woytec - 18-09-2015, 12:59

While sending admin_mass_pw make sure you selected binary mode during sending.
evilmc - 19-09-2015, 16:29

How to selected binary mode?


Woytec - 27-09-2015, 19:58

It depends on your FTP client.
evilmc - 28-09-2015, 00:29

Does anyone can tell me solve the problem and I will pay?


Powered by phpBB modified by Przemo © 2003 phpBB Group