From 81f78690dbcb0bb90304fb5e2b7343866d371615 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 12 Feb 2006 19:21:00 +0000 Subject: my turn to break things... harharhar - checking in permission settings and permission masks - permission presets and documentation not finished yet - added backtrace function to determine file/line for sql errors - fixed marlist for orphan attachments/groups/logs/users - able to change anonymous user settings/permissions now - re-arranged admin permissions a bit (added some and removed some) - setting forum permissions after creating/editing forum now selects every default group (copy permisson/dropdown to be added for adding forums) - finished user permissions in users acp note: the layout for permissions might change devs: please empty the user_permissions in phpbb_users. Also, first change your auth_options table, remove all cache files and then re-set admin permissions. After having set the admin permissions you can update your modules table (else you will not see the permission tabs) - or empty the auth setting within the modules table to be able to see the permission modules (they rely on newly added permission options) git-svn-id: file:///svn/phpbb/trunk@5553 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 72 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) (limited to 'phpBB/includes/functions.php') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index a5c96f5031..c139eb5a11 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2165,4 +2165,76 @@ function page_footer() exit; } +/** +* Return a nicely formatted backtrace (parts from the php manual by diz at ysagoon dot com) +*/ +function get_backtrace() +{ + global $phpbb_root_path; + + $output = '
'; + $backtrace = debug_backtrace(); + $path = realpath($phpbb_root_path); + + foreach ($backtrace as $number => $trace) + { + // We skip the first one, because it only shows this file/function + if ($number == 0) + { + continue; + } + + // Strip the current directory from path + $trace['file'] = str_replace(array($path, '\\'), array('', '/'), $trace['file']); + $trace['file'] = substr($trace['file'], 1); + + $args = array(); + foreach ($trace['args'] as $argument) + { + switch (gettype($argument)) + { + case 'integer': + case 'double': + $args[] = $argument; + break; + + case 'string': + $argument = htmlspecialchars(substr($argument, 0, 64)) . ((strlen($argument) > 64) ? '...' : ''); + $args[] = '"' . $argument . '"'; + break; + + case 'array': + $args[] = 'Array(' . sizeof($argument) . ')'; + break; + + case 'object': + $args[] = 'Object(' . get_class($argument) . ')'; + break; + + case 'resource': + $args[] = 'Resource(' . strstr($a, '#') . ')'; + break; + + case 'boolean': + $args[] = ($argument) ? 'true' : 'false'; + break; + + case 'NULL': + $args[] = 'NULL'; + break; + + default: + $args[] = 'Unknown'; + } + } + + $output .= '
'; + $output .= 'FILE: ' . htmlspecialchars($trace['file']) . '
'; + $output .= 'LINE: ' . $trace['line'] . '
'; + $output .= 'CALL: ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']) . '(' . ((sizeof($args)) ? implode(', ', $args) : '') . ')
'; + } + $output .= '
'; + return $output; +} + ?> \ No newline at end of file -- cgit v1.2.1