cvs: bugtracker /htdocs cache.php /includes cache_generate.php /template/generic/admin index.php purge.php

From: Date: Thu, 14 Aug 2008 10:00:54 +0000
Subject: cvs: bugtracker /htdocs cache.php /includes cache_generate.php /template/generic/admin index.php purge.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-2423@lists.php.net to get a copy of this message
bcarlyon Thu Aug 14 10:00:54 2008 UTC Added files: /bugtracker/template/generic/admin purge.php Removed files: /bugtracker/htdocs cache.php Modified files: /bugtracker/includes cache_generate.php /bugtracker/template/generic/admin index.php Log: Created ability for karma admin users to purge and regenerate the cache http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache_generate.php?r1=1.10&r2=1.11&diff_format=u Index: bugtracker/includes/cache_generate.php diff -u bugtracker/includes/cache_generate.php:1.10 bugtracker/includes/cache_generate.php:1.11 --- bugtracker/includes/cache_generate.php:1.10 Thu Aug 14 00:43:32 2008 +++ bugtracker/includes/cache_generate.php Thu Aug 14 10:00:51 2008 @@ -37,7 +37,7 @@ * @author Barry Carlyon <bcarlyon@php.net> * @copyright 2008-2008 Barry Carlyon * @license http://www.opensource.org/licenses/bsd-license.php BSD License -* @version CVS: $Id: cache_generate.php,v 1.10 2008/08/14 00:43:32 bcarlyon Exp $ +* @version CVS: $Id: cache_generate.php,v 1.11 2008/08/14 10:00:51 bcarlyon Exp $ * @link http://gsoc.barrycarlyon.servegame.org/ */ @@ -77,7 +77,7 @@ $users .= "\n"; - $timetowrite = fopen('../includes/cache/users.php',"w+"); + $timetowrite = fopen($_SERVER['DOCUMENT_ROOT'] . '../includes/cache/users.php',"w+"); fwrite($timetowrite,$users); fclose($timetowrite); } @@ -126,7 +126,7 @@ //// $cachetext .= '\?\>'; // } - $timetowrite = fopen('../includes/cache/' . $data . '.php',"w+"); + $timetowrite = fopen($_SERVER['DOCUMENT_ROOT'] . '../includes/cache/' . $data . '.php',"w+"); fwrite($timetowrite,$cachetext); fclose($timetowrite); } http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/admin/index.php?r1=1.6&r2=1.7&diff_format=u Index: bugtracker/template/generic/admin/index.php diff -u bugtracker/template/generic/admin/index.php:1.6 bugtracker/template/generic/admin/index.php:1.7 --- bugtracker/template/generic/admin/index.php:1.6 Wed Aug 13 23:42:13 2008 +++ bugtracker/template/generic/admin/index.php Thu Aug 14 10:00:53 2008 @@ -37,15 +37,25 @@ * @author Barry Carlyon <bcarlyon@php.net> * @copyright 2008-2008 Barry Carlyon * @license http://www.opensource.org/licenses/bsd-license.php BSD License -* @version CVS: $Id: index.php,v 1.6 2008/08/13 23:42:13 bcarlyon Exp $ +* @version CVS: $Id: index.php,v 1.7 2008/08/14 10:00:53 bcarlyon Exp $ * @link http://gsoc.barrycarlyon.servegame.org/ */ -if (!$user->logged_in || $user->check_karma('bugz_admin')) { +if (!$user->logged_in || !$user->check_karma('bugz_admin')) { $template->meta_refresh('/'); trigger_error('You need to be logged in and have the required Karma', E_USER_ERROR); } $template->page_title .= 'Admin'; $template->content_title = 'Admin'; -$content = 'Admin'; + +$content = 'What would you like to do today?'; +$content .= '<ul> +<li>Update Karma</li> +<li>Edit User</li> +<li>Change Cache</li> +<li><a href="/admin/purge/" title="Purge">Purge and Regenerate the Cache</a></li> +</ul>'; + +$template->prehtml = $content; + http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/admin/purge.php?view=markup&rev=1.1 Index: bugtracker/template/generic/admin/purge.php +++ bugtracker/template/generic/admin/purge.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:*/ /** * template/generic/admin/purgephp * Regenerate the cache * * Copyright (c) 2008, Barry Carlyon <bcarlyon@php.net> * All rights reserved. * * PHP versions 5 * * LICENSE: Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "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 FREEBSD PROJECT 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. * * @category BugTracking * @package GSoC Bugtracker * @author Barry Carlyon <bcarlyon@php.net> * @copyright 2008-2008 Barry Carlyon * @license http://www.opensource.org/licenses/bsd-license.php BSD License * @version CVS: $Id: purge.php,v 1.1 2008/08/14 10:00:54 bcarlyon Exp $ * @link http://gsoc.barrycarlyon.servegame.org/ */ if ($user->logged_in && $user->check_karma('bugz_admin')) { include('cache_generate.php'); $template->prehtml = '<div id="success">Cache Purged OK</div>'; $template->meta_refresh(); } else { $session->end_session(); }

« previous php.webmaster (#2423) next »