Line 50 | Line 50 |
---|
function settings($id, $mode) {
|
function settings($id, $mode) {
|
global $db, $user, $auth, $template, $cache;
| global $db, $user, $auth, $template, $cache, $request;
|
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$submit = (isset($_POST['submit'])) ? true : false;
|
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$submit = (isset($_POST['submit'])) ? true : false;
|
| if ($submit && !check_link_hash($request->variable('hash', ''), 'acp_search')) { trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); }
|
$search_types = $this->get_search_types();
| $search_types = $this->get_search_types();
|
Line 226 | Line 231 |
---|
'S_YES_SEARCH' => (bool) $config['load_search'], 'S_SETTINGS' => true,
|
'S_YES_SEARCH' => (bool) $config['load_search'], 'S_SETTINGS' => true,
|
'U_ACTION' => $this->u_action)
| 'U_ACTION' => $this->u_action . '&hash=' . generate_link_hash('acp_search'))
|
); }
function index($id, $mode) {
|
); }
function index($id, $mode) {
|
global $db, $user, $auth, $template, $cache;
| global $db, $user, $auth, $template, $cache, $request;
|
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$action = request_var('action', '');
| global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$action = request_var('action', '');
|
Line 243 | Line 248 |
---|
$action = ''; $this->state = array(); $this->save_state();
|
$action = ''; $this->state = array(); $this->save_state();
|
| } $submit = $request->is_set_post('submit', false);
if (!check_link_hash($request->variable('hash', ''), 'acp_search') && in_array($action, array('create', 'delete'))) { trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
}
if ($action)
| }
if ($action)
|
Line 294 | Line 305 |
---|
if (method_exists($this->search, 'delete_index')) { // pass a reference to myself so the $search object can make use of save_state() and attributes
|
if (method_exists($this->search, 'delete_index')) { // pass a reference to myself so the $search object can make use of save_state() and attributes
|
if ($error = $this->search->delete_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=delete", false)))
| if ($error = $this->search->delete_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=delete&hash=" . generate_link_hash('acp_search'), false)))
|
{ $this->state = array(''); $this->save_state();
| { $this->state = array(''); $this->save_state();
|
Line 339 | Line 350 |
---|
$mtime = explode(' ', microtime()); $totaltime = $mtime[0] + $mtime[1] - $starttime; $rows_per_second = $row_count / $totaltime;
|
$mtime = explode(' ', microtime()); $totaltime = $mtime[0] + $mtime[1] - $starttime; $rows_per_second = $row_count / $totaltime;
|
meta_refresh(1, append_sid($this->u_action . '&action=delete&skip_rows=' . $post_counter));
| meta_refresh(1, append_sid($this->u_action . '&action=delete&skip_rows=' . $post_counter . '&hash=' . generate_link_hash('acp_search')));
|
trigger_error($user->lang('SEARCH_INDEX_DELETE_REDIRECT', (int) $row_count, $post_counter, $rows_per_second)); } }
| trigger_error($user->lang('SEARCH_INDEX_DELETE_REDIRECT', (int) $row_count, $post_counter, $rows_per_second)); } }
|
Line 429 | Line 440 |
---|
$mtime = explode(' ', microtime()); $totaltime = $mtime[0] + $mtime[1] - $starttime; $rows_per_second = $row_count / $totaltime;
|
$mtime = explode(' ', microtime()); $totaltime = $mtime[0] + $mtime[1] - $starttime; $rows_per_second = $row_count / $totaltime;
|
meta_refresh(1, append_sid($this->u_action . '&action=create&skip_rows=' . $post_counter));
| meta_refresh(1, append_sid($this->u_action . '&action=create&skip_rows=' . $post_counter . '&hash=' . generate_link_hash('acp_search')));
|
trigger_error($user->lang('SEARCH_INDEX_CREATE_REDIRECT', (int) $row_count, $post_counter) . $user->lang('SEARCH_INDEX_CREATE_REDIRECT_RATE', $rows_per_second)); } }
| trigger_error($user->lang('SEARCH_INDEX_CREATE_REDIRECT', (int) $row_count, $post_counter) . $user->lang('SEARCH_INDEX_CREATE_REDIRECT_RATE', $rows_per_second)); } }
|
Line 449 | Line 460 |
---|
$search = null; $error = false;
|
$search = null; $error = false;
|
$search_options = '';
| |
foreach ($search_types as $type) { if ($this->init_search($type, $search, $error) || !method_exists($search, 'index_created'))
| foreach ($search_types as $type) { if ($this->init_search($type, $search, $error) || !method_exists($search, 'index_created'))
|
Line 509 | Line 519 |
---|
$template->assign_vars(array( 'S_INDEX' => true,
|
$template->assign_vars(array( 'S_INDEX' => true,
|
'U_ACTION' => $this->u_action,
| 'U_ACTION' => $this->u_action . '&hash=' . generate_link_hash('acp_search'),
|
'U_PROGRESS_BAR' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=progress_bar"), 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=progress_bar")), ));
| 'U_PROGRESS_BAR' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=progress_bar"), 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=progress_bar")), ));
|
Line 518 | Line 528 |
---|
{ $template->assign_vars(array( 'S_CONTINUE_INDEXING' => $this->state[1],
|
{ $template->assign_vars(array( 'S_CONTINUE_INDEXING' => $this->state[1],
|
'U_CONTINUE_INDEXING' => $this->u_action . '&action=' . $this->state[1],
| 'U_CONTINUE_INDEXING' => $this->u_action . '&action=' . $this->state[1] . '&hash=' . generate_link_hash('acp_search'),
|
'L_CONTINUE' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING'] : $user->lang['CONTINUE_DELETING_INDEX'], 'L_CONTINUE_EXPLAIN' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING_EXPLAIN'] : $user->lang['CONTINUE_DELETING_INDEX_EXPLAIN']) );
| 'L_CONTINUE' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING'] : $user->lang['CONTINUE_DELETING_INDEX'], 'L_CONTINUE_EXPLAIN' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING_EXPLAIN'] : $user->lang['CONTINUE_DELETING_INDEX_EXPLAIN']) );
|
Line 599 | Line 609 |
---|
*/ function init_search($type, &$search, &$error) {
|
*/ function init_search($type, &$search, &$error) {
|
global $phpbb_root_path, $phpEx, $user, $auth, $config, $db;
| global $phpbb_root_path, $phpEx, $user, $auth, $config, $db, $phpbb_dispatcher;
|
if (!class_exists($type) || !method_exists($type, 'keyword_search')) {
| if (!class_exists($type) || !method_exists($type, 'keyword_search')) {
|
Line 608 | Line 618 |
---|
}
$error = false;
|
}
$error = false;
|
$search = new $type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
| $search = new $type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
|
return $error; }
| return $error; }
|