cvs: bugtracker /includes template.php /template/generic header.html /template/generic/bug index.php /template/generic/report index.php

From: Date: Tue, 05 Aug 2008 15:05:59 +0000
Subject: cvs: bugtracker /includes template.php /template/generic header.html /template/generic/bug index.php /template/generic/report index.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-2311@lists.php.net to get a copy of this message
bcarlyon Tue Aug 5 15:05:59 2008 UTC Modified files: /bugtracker/includes template.php /bugtracker/template/generic header.html /bugtracker/template/generic/bug index.php /bugtracker/template/generic/report index.php Log: Added some regex to the fun bus template engine As well as some loging logout varibles

http://cvs.php.net/viewvc.cgi/bugtracker/includes/template.php?r1=1.4&r2=1.5&diff_format=u Index: bugtracker/includes/template.php diff -u bugtracker/includes/template.php:1.4 bugtracker/includes/template.php:1.5 --- bugtracker/includes/template.php:1.4 Tue Aug 5 11:50:54 2008 +++ bugtracker/includes/template.php Tue Aug 5 15:05:59 2008 @@ -138,6 +138,11 @@ $this->html .= $this->prehtml; $this->generate_footer(); + $this->logged_in(); + //need to strip any existing {} + $this->html = preg_replace("[\{..*\}]", '', $this->html); + $this->html = preg_replace("[@]", '[cookies]', $this->html); + echo $this->html; return; } @@ -289,4 +294,35 @@ return; } + + function logged_in() + { + global $user; + //stripper + while (strpos($this->html, '{IF LOGGED_IN}')) + { + $if = strpos($this->html, '{IF LOGGED_IN}'); + $else = strpos($this->html, '{ELSE LOGGED_IN}'); + $end = strpos($this->html, '{ENDIF LOGGED_IN}'); + + $true = substr($this->html, $if + 14, $else - $if - 16); + $false = substr($this->html, $else + 16, $end - $else - 17); + + $new_html = substr($this->html, 0, $if); + + if ($user->logged_in) + { + $new_html .= $true; + } else { + $new_html .= $false; + } + + $new_html .= substr($this->html, $end + 17); + + $this->html = $new_html; + } + + return; + } } + http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/header.html?r1=1.6&r2=1.7&diff_format=u Index: bugtracker/template/generic/header.html diff -u bugtracker/template/generic/header.html:1.6 bugtracker/template/generic/header.html:1.7 --- bugtracker/template/generic/header.html:1.6 Fri Aug 1 10:51:11 2008 +++ bugtracker/template/generic/header.html Tue Aug 5 15:05:59 2008 @@ -36,7 +36,6 @@ <a href="#search" title="Skip To Search" style="display: none;" accesskey="2">Skip to Search</a> <a href="#header" title="Skip to Links" style="display: none;" accesskey="3">Skip to Links</a> <h1 style="display: none;">{PAGE_TITLE}</h1> - <div id="header"> <a href="/" id="logo">Home</a> <ul id="login"> http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/index.php?r1=1.19&r2=1.20&diff_format=u Index: bugtracker/template/generic/bug/index.php diff -u bugtracker/template/generic/bug/index.php:1.19 bugtracker/template/generic/bug/index.php:1.20 --- bugtracker/template/generic/bug/index.php:1.19 Tue Aug 5 11:50:54 2008 +++ bugtracker/template/generic/bug/index.php Tue Aug 5 15:05:59 2008 @@ -57,7 +57,7 @@ <a href="/bug/" title="Back to Bug Listing" style="display: block; text-align: right;">Back to Bug Listing</a> <table> <tr> <td style="width: 100px;">&nbsp;</td> <td style="width: 120px;">&nbsp;</td> <td style="width: 240px;">&nbsp;</td> <td style="width: 150px;">&nbsp;</td> </tr> -<tr> <td>Bug: #{DSP_BUG_ID}</td> <td colspan="3" style="width: 220px;">{DSP_SUMMARY}</td> </tr> +<tr> <td><h4>Bug: #{DSP_BUG_ID}</h4></td> <td colspan="3" style="width: 220px;">{DSP_SUMMARY}</td> </tr> <tr> <td><h4>{DSP_STATUS}</h4></td> <td>Opened:</td> <td>{DSP_REPORTED_ON}</td> <td>{DSP_REPORTED_BY}</td> </tr> {DSP_SHOW_ASSIGNED} <tr> <td>&nbsp;</td> <td>Assigned:</td> <td>{DSP_ASSIGNED_ON}</td> <td>{DSP_ASSIGNED_TO}</td> </tr> http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/report/index.php?r1=1.8&r2=1.9&diff_format=u Index: bugtracker/template/generic/report/index.php diff -u bugtracker/template/generic/report/index.php:1.8 bugtracker/template/generic/report/index.php:1.9 --- bugtracker/template/generic/report/index.php:1.8 Thu Jul 31 13:27:30 2008 +++ bugtracker/template/generic/report/index.php Tue Aug 5 15:05:59 2008 @@ -2,53 +2,12 @@ require_once($_SERVER['DOCUMENT_ROOT'] . '../includes/recaptchalib.php'); -$template_data['page_title'] .= ' - Reporting a bug'; -$template_data['content_title'] = 'Reporting a bug'; +$this->page_title .= 'Reporting a bug'; +$this->content_title = 'Reporting a bug'; -$form_data['email'] = isset($form_data['email']) ? $form_data['email'] : ''; -$form_data['php_version'] = isset($form_data['php_version']) ? $form_data['php_version'] : ''; -$form_data['bug_type'] = isset($form_data['bug_type']) ? $form_data['bug_type'] : ''; -$form_data['os_version'] = isset($form_data['os_version']) ? $form_data['os_version'] : ''; -$form_data['summary'] = isset($form_data['summary']) ? $form_data['summary'] : ''; -$form_data['password'] = ''; -$form_data['description'] = isset($form_data['description']) ? $form_data['description'] : ''; -$form_data['reproduce'] = isset($form_data['reproduce']) ? $form_data['reproduce'] : ''; -$form_data['expected'] = isset($form_data['expected']) ? $form_data['expected'] : ''; -$form_data['actual'] = isset($form_data['actual']) ? $form_data['actual'] : ''; -$form_data['recap_error'] = isset($form_data['recap_error']) ? $form_data['recap_error'] : ''; -$form_data['captcha'] = '';//to blank the template varible :-) $form_data['form_error'] = isset($form_data['form_error']) ? $form_data['form_error'] : ''; -foreach($form_data as $ref => $data) -{ - if (!is_array($data)) - { - $form_data['error'][$ref] = isset($form_data['error'][$ref]) && $form_data['error'][$ref] ? '* Required Field' : ''; - } - else if ($ref == 'invalid') - { - foreach($form_data[$ref] as $iref => $idata) - { - if ($iref == 'email') - { - $form_data['error'][$iref] = isset($form_data['invalid'][$iref]) && $form_data['invalid'][$iref] ? '* Invalid Format/MX Record' : ''; - } - else - { - $form_data['error'][$iref] = isset($form_data['invalid'][$iref]) && $form_data['invalid'][$iref] ? '* Invalid Format' : ''; - } - } - } -} - -$form_data['php_versions'] = $cache->convert('php_version', 'select', $form_data['php_version'], '1'); -$form_data['bug_types'] = $cache->convert('bug_type', 'select', $form_data['bug_type']); -$form_data['os_versions'] = $cache->convert('os_version', 'select', $form_data['os_version']); - -$form_data['php_versions'] .= '<option value="na">Irrelevant</option><option value="early">Earlier? Upgrade First</option>'; - -$content = ' -<p> +$this->prehtml = '<p> Before you report a bug, make sure to search for similar bugs using the form at the top of the page or our <a href="/search.php">advanced search page</a>. <br /><br /> Also, read the instructions for <a href="/how-to-report.php">how to report a bug that someone will want to help fix</a>. @@ -57,83 +16,34 @@ <br /><br /> <span class="red">Always disable any Zend or other 3rd party extensions (Turck MMCache, ionCube loader, Xdebug, APC) before submitting a *PHP* bug.</span> <br /><br /> -Do not report compile errors in HEAD versions (currently {CVS_VERSION}). If a compile error persists, please drop a mail to our <a href="http://www.php.net/mailing-lists.php">internals mailing list</a>. +Do not report compile errors in HEAD versions (currently ' . substr( $cache->obtain('php_version',-1), 0, 4 ) . '). If a compile error persists, please drop a mail to our <a href="http://www.php.net/mailing-lists.php">internals mailing list</a>. <br /><br /> <strong>Failure to follow these instructions may result in your bug simply being marked as "bogus".</strong> <br /><br /> <strong>If you feel this bug concerns a security issue, eg a buffer overflow, weak encryption, etc, then email <script type="text/javascript" src="/elements/email.php?e=security"></script> who will assess the situation.</strong> <br /><br /> </p> - -{FORM_ERROR} '; -//commence form -$content .= ' -<form action="/report/report/" method="post" class="form"> - <div class="slim"> - {IF LOGGED_IN} - You are Logged In - {ELSE LOGGED_IN} - <label for="email">Email Address: {ERROR_EMAIL} </label> <input type="text" name="email" id="email" value="{EMAIL}" /> - <br /><br /> - {ENDIF LOGGED_IN} - <label for="php_version">PHP version: {ERROR_PHP_VERSION}</label> <select name="php_version" id="php_version"><option value="">--Please Select--</option>{PHP_VERSIONS}</select> - <br /><br /> - <label for="bug_type">Type of Bug: {ERROR_BUG_TYPE}</label> <select name="bug_type" id="bug_type"><option value="">--Please Select--</option>{BUG_TYPES}</select> - <br /><br /> - <label for="os_version">Operating System: {ERROR_OS_VERSION}</label> <select name="os_version" id="os_version"><option value="">--Please Select--</option>{OS_VERSIONS}</select> - <br /><br /> - <label for="summary">Summary: AKA title{ERROR_SUMMARY}</label> -<input type="text" name="summary" id="summary" value="{SUMMARY}" maxlength="30" onkeypress="update(this);" onkeyup="update(this)" onblur="endupdate(this)" onfocus="update(this)" /><div id="summary_left" style="float: right; margin-right: 5px; display: none;" >30 Characters Left</div> - <br /><br /> - {IF LOGGED_IN} - You are Logged In - {ELSE LOGGED_IN} - <!-- Not logged in --> - <label for="password">Password: {ERROR_PASSWORD}</label> <input type="password" name="password" id="password" /> - <br /><br /> - <!-- Here be captcha --> -'; -$content .= '<label for="captcha">Captcha: {ERROR_CAPTCHA}</label><div id="captcha">' . recaptcha_get_html($recaptcha_key,$form_data['recap_error']) . '</div><hr />'; -$content .= ' - <!-- Here end captcha --> +$form_data['php_versions'] = $cache->convert('php_version', 'select', '', '1'); +$form_data['bug_types'] = $cache->convert('bug_type', 'select', ''); +$form_data['os_versions'] = $cache->convert('os_version', 'select', ''); + +$form_data['php_versions'] .= '<option value="na">Irrelevant</option><option value="early">Earlier? Upgrade First</option>'; + +//time to process + +$content = '{DSP_FORM_ERROR}'; +$content = $this->swap('dsp_form_error', $form_data['form_error'], $content); + +$content .= '<form action="/report/report/" method="post" class="form"> + {IF LOGGED_IN} + You are Logged In + {ELSE LOGGED_IN} +Not logged in {ENDIF LOGGED_IN} - <p> - Please suppy any information that may be helpful in fixing the bug: - </p> - </div> - <ul> - <li>A short script that reproduces the problem</li> - <li>The list of modules you compiled PHP with (your configure line)</li> - <li>Any other information unique or specific to your setup</li> - <li>Any changes made in your php.ini compared to php.ini-dist (<strong>not</strong> your whole php.ini!)</li> - <li>A <a href="/bugs-generating-backtrace.php">gdb backtrace</a> or <a href="/bugs-generating-backtrace-win32.php">Win32 backtrace</a></li> - </ul> - <br /><br /> - <label for="description">Description: {ERROR_DESCRIPTION}</label> - <textarea rows="10" cols="50" name="description" id="description">{DESCRIPTION}</textarea> - <br /><br />Please <strong>do not</strong> insert any huge text here. Keep the description as short as possible. If we want to get a strace, we will ask for it separately. -<div class="blocker"></div> - <br /> - <label for="reproduce">Reproduce: {ERROR_REPRODUCE}</label> - <textarea rows="10" cols="50" name="reproduce" id="reproduce">{REPRODUCE}</textarea> - <br /><br />Please do not post more than 20 lines of source code. - <br />If the code is longer then 20 lines, provide an URL to the source code that will reproduce the bug. - <br />You could use <a href="http://pastebin.com">Pastebin</a> -<div class="blocker"></div> - <br /> - <label for="expected">Expected: {ERROR_EXPECTED}</label> - <textarea rows="10" cols="50" name="expected" id="expected">{EXPECTED}</textarea> - <br /><br />What do you expect to happen or see when you run the code above? -<div class="blocker"></div> - <br /> - <label for="actual">Actual result: {ERROR_ACTUAL}</label> - <textarea rows="10" cols="50" name="actual" id="actual">{ACTUAL}</textarea> - <br /><br />This could be a <a href="/bugs-generating-backtrace.php">backtrace</a> for example. - <br />Try to keep it as short as possible without leaving anything relevant out. -<div class="blocker"></div> - <input type="submit" value="Send Bug Report" style="margin-right: 200px;" /> -</form> '; +$content .= '</form>'; + +$this->prehtml .= $content;
« previous php.webmaster (#2311) next »