diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-03-25 14:21:56 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-03-25 14:21:56 +0000 |
commit | c9670f992443924e613e972b363e01d9e408481b (patch) | |
tree | 2646a27dad8f228403bf9f6282c2cbaaf0748a8c /phpBB/adm/index.php | |
parent | 723a6e9d5b55c4686f6394f8386d993ff4ae332e (diff) | |
download | forums-c9670f992443924e613e972b363e01d9e408481b.tar forums-c9670f992443924e613e972b363e01d9e408481b.tar.gz forums-c9670f992443924e613e972b363e01d9e408481b.tar.bz2 forums-c9670f992443924e613e972b363e01d9e408481b.tar.xz forums-c9670f992443924e613e972b363e01d9e408481b.zip |
Enable reminder email sending
git-svn-id: file:///svn/phpbb/trunk@3720 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/adm/index.php')
-rw-r--r-- | phpBB/adm/index.php | 75 |
1 files changed, 68 insertions, 7 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index ef478deffb..55e024c61f 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -158,16 +158,13 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') $sql = (isset($_POST['activate'])) ? "UPDATE " . USERS_TABLE . " SET user_active = 1 WHERE user_id IN ($in_sql)" : "DELETE FROM " . USERS_TABLE . " WHERE user_id IN ($in_sql)"; $db->sql_query($sql); - if (isset($_POST['delete'])) + if (!isset($_POST['delete'])) { - $sql = "UPDATE " . CONFIG_TABLE . " - SET config_value = config_value - " . sizeof($_POST['mark']) . " - WHERE config_name = 'num_users'"; - $db->sql_query($sql); + set_config('num_users', $config['num_users'] + sizeof($mark)); } $log_action = (isset($_POST['activate'])) ? 'log_index_activate' : 'log_index_delete'; - add_admin_log($log_action, sizeof($_POST['mark'])); + add_log('admin', $log_action, sizeof($_POST['mark'])); } } } @@ -177,6 +174,61 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') { trigger_error($user->lang['NO_ADMIN']); } + + if (empty($config['email_enable'])) + { + trigger_error($user->lang['EMAIL_DISABLED']); + } + + if (is_array($_POST['mark'])) + { + $in_sql = ''; + foreach ($_POST['mark'] as $user_id) + { + $in_sql .= (($in_sql != '') ? ', ' : '') . intval($user_id); + } + + if ($in_sql != '') + { + $sql = "SELECT user_id, username, user_email, user_lang, user_regdate, user_actkey + FROM " . USERS_TABLE . " + WHERE user_id IN ($in_sql)"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + include($phpbb_root_path . 'includes/emailer.'.$phpEx); + $emailer = new emailer(); + + $board_url = generate_board_url() . '/ucp.' . $phpEx; + $usernames = ''; + + do + { + $emailer->use_template('user_remind_inactive', $row['user_lang']); + $emailer->email_address($row['user_email']); + + $emailer->assign_vars(array( + 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), + 'USERNAME' => $row['username'], + 'SITENAME' => $config['sitename'], + 'REGISTER_DATE' => $user->format_date($row['user_regdate']), + + 'U_ACTIVATE' => $board_url . '&mode=activate&u=' . $row['user_id'] . '&k=' . $row['user_actkey']) + ); + + $emailer->send(); + $emailer->reset(); + + $usernames .= (($usernames != '') ? ', ' : '') . $row['username']; + } + while ($row = $db->sql_fetchrow($result)); + + add_log('admin', 'LOG_INDEX_REMIND', $usernames); + } + $db->sql_freeresult($result); + } + } } else if (isset($_POST['online'])) { @@ -504,7 +556,16 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') ?> <tr> - <td class="cat" colspan="3" height="28" align="right"><input class="liteoption" type="submit" name="activate" value="<?php echo $user->lang['ACTIVATE']; ?>" /> <input class="liteoption" type="submit" name="remind" value="<?php echo $user->lang['REMIND']; ?>" /> <input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE']; ?>" /> </td> + <td class="cat" colspan="3" height="28" align="right"><input class="liteoption" type="submit" name="activate" value="<?php echo $user->lang['ACTIVATE']; ?>" /> <?php + + if (!empty($config['email_enable'])) + { + +?><input class="liteoption" type="submit" name="remind" value="<?php echo $user->lang['REMIND']; ?>" /> <?php + + } + +?><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE']; ?>" /> </td> </tr> <?php |