cvs: php-bugs-web / report.php /include cvs-auth.inc

From: Date: Thu, 20 Nov 2008 01:19:23 +0000
Subject: cvs: php-bugs-web / report.php /include cvs-auth.inc
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-3093@lists.php.net to get a copy of this message
philip Thu Nov 20 01:19:23 2008 UTC Modified files: /php-bugs-web/include cvs-auth.inc /php-bugs-web report.php Log: Implement and test is_cvs_user(). http://cvs.php.net/viewvc.cgi/php-bugs-web/include/cvs-auth.inc?r1=1.2&r2=1.3&diff_format=u Index: php-bugs-web/include/cvs-auth.inc diff -u php-bugs-web/include/cvs-auth.inc:1.2 php-bugs-web/include/cvs-auth.inc:1.3 --- php-bugs-web/include/cvs-auth.inc:1.2 Wed Oct 27 07:30:51 2004 +++ php-bugs-web/include/cvs-auth.inc Thu Nov 20 01:19:23 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: cvs-auth.inc,v 1.2 2004/10/27 07:30:51 derick Exp $ */ +/* $Id: cvs-auth.inc,v 1.3 2008/11/20 01:19:23 philip Exp $ */ $ignore_password = false; $passwd_file = "/repository/CVSROOT/passwd"; @@ -34,4 +34,18 @@ return false; } -?> +function is_cvs_user ($MC) { + + if (empty($MC)) { + return false; + } + + // 0 = username, 1 = password + $c = explode(':', base64_decode($MC)); + + if (!verify_password($c[0], $c[1])) { + return false; + } + + return true; +} http://cvs.php.net/viewvc.cgi/php-bugs-web/report.php?r1=1.71&r2=1.72&diff_format=u Index: php-bugs-web/report.php diff -u php-bugs-web/report.php:1.71 php-bugs-web/report.php:1.72 --- php-bugs-web/report.php:1.71 Thu Oct 16 12:07:14 2008 +++ php-bugs-web/report.php Thu Nov 20 01:19:23 2008 @@ -258,6 +258,12 @@ <th align="right">Your email address:</th> <td colspan="2"> <input type="text" size="20" maxlength="50" name="in[email]" value="<?php echo clean($in['email']);?>" /> + <?php + // Temporary test code (tm) + if (is_cvs_user($_COOKIE['MAGIC_COOKIE'])) { + echo " (logged in)"; + } + ?> </td> </tr><tr> <th align="right">PHP version:</th>

« previous php.webmaster (#3093) next »