phpBB

Code Changes

File: includes/acp/acp_reasons.php

  Unmodified   Added   Modified   Removed
Line 25Line 25

function main($id, $mode)
{


function main($id, $mode)
{

		global $db, $user, $auth, $template, $cache;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
global $request;

		global $db, $user, $template;
global $request, $phpbb_log;



$user->add_lang(array('mcp', 'acp/posting'));

// Set up general vars


$user->add_lang(array('mcp', 'acp/posting'));

// Set up general vars

		$action = request_var('action', '');

		$action = $request->variable('action', '');

		$submit = (isset($_POST['submit'])) ? true : false;

		$submit = (isset($_POST['submit'])) ? true : false;

		$reason_id = request_var('id', 0);

		$reason_id = $request->variable('id', 0);


$this->tpl_name = 'acp_reasons';
$this->page_title = 'ACP_REASONS';


$this->tpl_name = 'acp_reasons';
$this->page_title = 'ACP_REASONS';

Line 50Line 49
			case 'edit':

$reason_row = array(

			case 'edit':

$reason_row = array(

					'reason_title'			=> utf8_normalize_nfc(request_var('reason_title', '', true)),
'reason_description' => utf8_normalize_nfc(request_var('reason_description', '', true)),

					'reason_title'			=> $request->variable('reason_title', '', true),
'reason_description' => $request->variable('reason_description', '', true),

				);

if ($submit)

				);

if ($submit)

Line 139Line 138
							$log = 'UPDATED';
}


							$log = 'UPDATED';
}


						add_log('admin', 'LOG_REASON_' . $log, $reason_row['reason_title']);

						$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_REASON_' . $log, false, array($reason_row['reason_title']));

						trigger_error($user->lang['REASON_' . $log] . adm_back_link($this->u_action));
}
}

						trigger_error($user->lang['REASON_' . $log] . adm_back_link($this->u_action));
}
}

Line 232Line 231
						break;

// Standard? What's that?

						break;

// Standard? What's that?

						case 'mssql':

 
						case 'mssql_odbc':
case 'mssqlnative':
// Change the reports using this reason to 'other'

						case 'mssql_odbc':
case 'mssqlnative':
// Change the reports using this reason to 'other'

Line 252Line 250
						// Teh standard
case 'postgres':
case 'oracle':

						// Teh standard
case 'postgres':
case 'oracle':

						case 'sqlite':

 
						case 'sqlite3':
// Change the reports using this reason to 'other'
$sql = 'UPDATE ' . REPORTS_TABLE . '

						case 'sqlite3':
// Change the reports using this reason to 'other'
$sql = 'UPDATE ' . REPORTS_TABLE . '

Line 264Line 261

$db->sql_query('DELETE FROM ' . REPORTS_REASONS_TABLE . ' WHERE reason_id = ' . $reason_id);



$db->sql_query('DELETE FROM ' . REPORTS_REASONS_TABLE . ' WHERE reason_id = ' . $reason_id);


					add_log('admin', 'LOG_REASON_REMOVED', $reason_row['reason_title']);

					$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_REASON_REMOVED', false, array($reason_row['reason_title']));

					trigger_error($user->lang['REASON_REMOVED'] . adm_back_link($this->u_action));
}
else

					trigger_error($user->lang['REASON_REMOVED'] . adm_back_link($this->u_action));
}
else

Line 281Line 278

case 'move_up':
case 'move_down':


case 'move_up':
case 'move_down':

 

if (!check_link_hash($request->variable('hash', ''), 'acp_reasons'))
{
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}


$sql = 'SELECT reason_order
FROM ' . REPORTS_REASONS_TABLE . "


$sql = 'SELECT reason_order
FROM ' . REPORTS_REASONS_TABLE . "

Line 383Line 385

'U_EDIT' => $this->u_action . '&action=edit&id=' . $row['reason_id'],
'U_DELETE' => (!$other_reason) ? $this->u_action . '&action=delete&id=' . $row['reason_id'] : '',


'U_EDIT' => $this->u_action . '&action=edit&id=' . $row['reason_id'],
'U_DELETE' => (!$other_reason) ? $this->u_action . '&action=delete&id=' . $row['reason_id'] : '',

				'U_MOVE_UP'		=> $this->u_action . '&action=move_up&id=' . $row['reason_id'],
'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row['reason_id'])

				'U_MOVE_UP'		=> $this->u_action . '&action=move_up&id=' . $row['reason_id'] . '&hash=' . generate_link_hash('acp_reasons'),
'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row['reason_id'] . '&hash=' . generate_link_hash('acp_reasons'))

			);
}
$db->sql_freeresult($result);

			);
}
$db->sql_freeresult($result);