Merge lp:~edb/quam-plures/debug_logged-in_only into lp:quam-plures

Proposed by EdB
Status: Merged
Merged at revision: 7637
Proposed branch: lp:~edb/quam-plures/debug_logged-in_only
Merge into: lp:quam-plures
Diff against target: 125 lines (+41/-12)
4 files modified
qp_config/_advanced.php (+10/-0)
qp_inc/_core/_misc.funcs.php (+23/-7)
qp_inc/plugins/_plugin.class.php (+3/-2)
qp_inc/widgets/model/_widget.class.php (+5/-3)
To merge this branch: bzr merge lp:~edb/quam-plures/debug_logged-in_only
Reviewer Review Type Date Requested Status
Tilman Blumenbach (community) Approve
Review via email: mp+74047@code.launchpad.net

Description of the change

http://forums.quamplures.net/viewtopic.php?f=6&t=920

Adds $debug_visitors so you can turn on debug for logged in only with normal $debug or for everyone with both $debug and $debug_visitors

To post a comment you must log in.
Revision history for this message
Tilman Blumenbach (tblue) wrote :

Works! ;)

review: Approve
Revision history for this message
Tilman Blumenbach (tblue) wrote :

Does somebody else want to review this one? I usually merge branches after they have been approved by at least two reviewers.

7628. By EdB

matches core 7632

7629. By EdB

core updates

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qp_config/_advanced.php'
--- qp_config/_advanced.php 2010-09-15 01:18:55 +0000
+++ qp_config/_advanced.php 2011-10-05 17:42:08 +0000
@@ -30,6 +30,16 @@
30 */30 */
31$debug = 0;31$debug = 0;
3232
33/**
34 * Display debugging informations to visitors?
35 *
36 * $debug always applies to anyone logged in. Set this to 1 if you want to see
37 * debug info when not logged in (for troubleshooting what a visitor sees).
38 *
39 * @global integer
40 */
41$debug_visitors = 0;
42
33// Most of the time you'll want to see all errors, including notices:43// Most of the time you'll want to see all errors, including notices:
34// QP should run notice free! (plugins too!)44// QP should run notice free! (plugins too!)
35if( ! defined( 'E_DEPRECATED' ) )45if( ! defined( 'E_DEPRECATED' ) )
3646
=== modified file 'qp_inc/_core/_misc.funcs.php'
--- qp_inc/_core/_misc.funcs.php 2011-09-02 19:22:04 +0000
+++ qp_inc/_core/_misc.funcs.php 2011-10-05 17:42:08 +0000
@@ -1866,28 +1866,44 @@
1866 */1866 */
1867function debug_info( $force = false, $force_clean = false )1867function debug_info( $force = false, $force_clean = false )
1868{1868{
1869 global $debug, $debug_done, $Debuglog, $DB, $obhandler_debug, $Timer, $ReqHost, $ReqPath, $is_cli;1869 global $app_db_config;
1870 global $cache_imgsize, $cache_File;1870 global $app_db_tableprefix;
1871 global $Session;1871 global $cache_File;
1872 global $app_db_config, $app_db_tableprefix;1872 global $cache_imgsize;
1873 global $DB;
1874 global $debug;
1875 global $debug_done;
1876 global $debug_visitors;
1877 global $Debuglog;
1873 /**1878 /**
1874 * @var Hit1879 * @var Hit
1875 */1880 */
1876 global $Hit;1881 global $Hit;
1882 global $is_cli;
1883 global $obhandler_debug;
1884 global $ReqHost;
1885 global $ReqPath;
1886 global $Session;
1887 global $Timer;
1888
1889 if( ! is_logged_in() && ! $debug_visitors )
1890 { // No debug for visitors
1891 return;
1892 }
18771893
1878 if( !$force )1894 if( !$force )
1879 {1895 {
1880 if( !empty($debug_done))1896 if( !empty( $debug_done ) )
1881 { // Already displayed!1897 { // Already displayed!
1882 return;1898 return;
1883 }1899 }
18841900
1885 if( empty($debug) )1901 if( empty( $debug ) )
1886 { // No debug output desired:1902 { // No debug output desired:
1887 return;1903 return;
1888 }1904 }
18891905
1890 if( $debug < 2 && ( empty($Hit) || $Hit->get_agent_type() != 'browser' ) )1906 if( $debug < 2 && ( empty( $Hit ) || $Hit->get_agent_type() != 'browser' ) )
1891 { // Don't display if it's not a browser (very needed for proper RSS display btw)1907 { // Don't display if it's not a browser (very needed for proper RSS display btw)
1892 // ($Hit is empty e.g. during install)1908 // ($Hit is empty e.g. during install)
1893 return;1909 return;
18941910
=== modified file 'qp_inc/plugins/_plugin.class.php'
--- qp_inc/plugins/_plugin.class.php 2011-09-04 22:27:27 +0000
+++ qp_inc/plugins/_plugin.class.php 2011-10-05 17:42:08 +0000
@@ -2500,7 +2500,8 @@
2500 {2500 {
2501 global $plugins_path;2501 global $plugins_path;
25022502
2503 $globalfile_path = $plugins_path.$this->classname.'/po/php/_global.php';2503 $globalfile = $this->classname.'/po/php/_global.php';
2504 $globalfile_path = $plugins_path.$globalfile;
2504 $trans = & $this->_trans;2505 $trans = & $this->_trans;
25052506
2506 // Load the global messages file, if existing:2507 // Load the global messages file, if existing:
@@ -2514,7 +2515,7 @@
2514 }2515 }
2515 else2516 else
2516 {2517 {
2517 $this->debug_log( 'Global messages file '.$globalfile_path.' does not exist or is not readable!', 'locale' );2518 $this->debug_log( 'Translation file '.$globalfile.' does not exist or is not readable!', 'locale' );
2518 }2519 }
2519 }2520 }
25202521
25212522
=== modified file 'qp_inc/widgets/model/_widget.class.php'
--- qp_inc/widgets/model/_widget.class.php 2011-09-01 02:17:16 +0000
+++ qp_inc/widgets/model/_widget.class.php 2011-10-05 17:42:08 +0000
@@ -614,9 +614,11 @@
614 return $this->Plugin->T_( $string, $req_locale );614 return $this->Plugin->T_( $string, $req_locale );
615 }615 }
616616
617 global $plugins_path,$Debuglog;617 global $plugins_path;
618 global $Debuglog;
618619
619 $globalfile_path = $plugins_path.$this->code.'_widget/po/php/_global.php';620 $globalfile = $this->code.'_widget/po/php/_global.php';
621 $globalfile_path = $plugins_path.$globalfile;
620 $trans = & $this->_trans;622 $trans = & $this->_trans;
621623
622 // Load the global messages file, if existing:624 // Load the global messages file, if existing:
@@ -630,7 +632,7 @@
630 }632 }
631 else633 else
632 {634 {
633 $Debuglog->add( 'Global messages file '.$globalfile_path.' does not exist or is not readable!', 'locale' );635 $Debuglog->add( 'Translation file '.$globalfile.' does not exist or is not readable!', 'locale' );
634 }636 }
635 }637 }
636638

Subscribers

People subscribed via source and target branches