cvs: bugtracker /htdocs config.php /includes template.php user.php /template/generic/admin index.php /template/generic/bug comment.php

From: Date: Wed, 13 Aug 2008 11:33:12 +0000
Subject: cvs: bugtracker /htdocs config.php /includes template.php user.php /template/generic/admin index.php /template/generic/bug comment.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-2391@lists.php.net to get a copy of this message
bcarlyon Wed Aug 13 11:33:12 2008 UTC Added files: /bugtracker/template/generic/admin index.php Modified files: /bugtracker/htdocs config.php /bugtracker/includes template.php user.php /bugtracker/template/generic/bug comment.php Log: Basic Karma Checks http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/config.php?r1=1.8&r2=1.9&diff_format=u Index: bugtracker/htdocs/config.php diff -u bugtracker/htdocs/config.php:1.8 bugtracker/htdocs/config.php:1.9 --- bugtracker/htdocs/config.php:1.8 Tue Aug 12 16:30:20 2008 +++ bugtracker/htdocs/config.php Wed Aug 13 11:33:12 2008 @@ -42,6 +42,7 @@ define('TEMP_USER_TABLE', 'temp_account'); define('SESSION_TABLE', 'sessions'); +define('KARMA_TABLE', 'karma'); // partial implemneted define define('BUG_TABLE', 'bug'); http://cvs.php.net/viewvc.cgi/bugtracker/includes/template.php?r1=1.17&r2=1.18&diff_format=u Index: bugtracker/includes/template.php diff -u bugtracker/includes/template.php:1.17 bugtracker/includes/template.php:1.18 --- bugtracker/includes/template.php:1.17 Wed Aug 13 10:22:24 2008 +++ bugtracker/includes/template.php Wed Aug 13 11:33:12 2008 @@ -419,7 +419,14 @@ if ($user->logged_in) { - $this->login = '<li><a href="/user/profile/" title="Profile">Profile (' . $user->handle . ')</a></li><li><a href="/user/logout/" title="Logout">Logout</a></li>'; + $this->login = ''; + + if ($user->check_karma('bugz_admin')) + { + $this->login = '<li><a href="/admin/" title="Admin">Admin</a></li>'; + } + + $this->login .= '<li><a href="/user/profile/" title="Profile">Profile (' . $user->handle . ')</a></li><li><a href="/user/logout/" title="Logout">Logout</a></li>'; } $this->swap('login', $this->login ); http://cvs.php.net/viewvc.cgi/bugtracker/includes/user.php?r1=1.15&r2=1.16&diff_format=u Index: bugtracker/includes/user.php diff -u bugtracker/includes/user.php:1.15 bugtracker/includes/user.php:1.16 --- bugtracker/includes/user.php:1.15 Wed Aug 13 11:04:39 2008 +++ bugtracker/includes/user.php Wed Aug 13 11:33:12 2008 @@ -59,7 +59,18 @@ return; } - function check_karma() { + function check_karma($check = '', $handle = '') { + if ($check) { + global $db, $user; + $handle = $handle ? $handle : ( $user->handle ? $user->handle : '' ); + if ($handle) { + $query = 'SELECT ref_id FROM ' . KARMA_TABLE . ' WHERE handle = \'' . $user->handle . '\' AND level = \'' . $check . '\''; + $db->get_data($query); + if ($db->total_rows) + return TRUE; + } + } + return FALSE; } function temp_account($handle,$email,$password) { http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/comment.php?r1=1.8&r2=1.9&diff_format=u Index: bugtracker/template/generic/bug/comment.php diff -u bugtracker/template/generic/bug/comment.php:1.8 bugtracker/template/generic/bug/comment.php:1.9 --- bugtracker/template/generic/bug/comment.php:1.8 Wed Aug 13 11:04:39 2008 +++ bugtracker/template/generic/bug/comment.php Wed Aug 13 11:33:12 2008 @@ -99,6 +99,7 @@ $comment->spawn_form($form_data, $error_data); $content .= '</table>'; } + $template->meta_refresh('/bug/' . $form_data['bug_id']); } elseif (!$content) { http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/admin/index.php?view=markup&rev=1.1 Index: bugtracker/template/generic/admin/index.php +++ bugtracker/template/generic/admin/index.php <?php /* Copyright (c) 2008, Barry Carlyon <bcarlyon@php.net> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the GSOC_PHP_BUGTRACKER nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ $template->page_title .= 'Admin'; $template->content_title = 'Admin'; $content = 'ADmin';

« previous php.webmaster (#2391) next »