cvs: php-master-web /fetch user.php

From: Date: Fri, 01 May 2009 21:37:41 +0000
Subject: cvs: php-master-web /fetch user.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-4601@lists.php.net to get a copy of this message
bjori Fri May 1 21:37:41 2009 UTC Modified files: /php-master-web/fetch user.php Log: - Use a token I actually know what is - Remove useless exit/echos http://cvs.php.net/viewvc.cgi/php-master-web/fetch/user.php?r1=1.1&r2=1.2&diff_format=u Index: php-master-web/fetch/user.php diff -u php-master-web/fetch/user.php:1.1 php-master-web/fetch/user.php:1.2 --- php-master-web/fetch/user.php:1.1 Fri May 1 20:28:07 2009 +++ php-master-web/fetch/user.php Fri May 1 21:37:41 2009 @@ -1,5 +1,6 @@ <?php // vim: et ts=4 sw=4 -function error($text, $status) { +function error($text, $status) +{ switch((int)$status) { default: case 500: @@ -18,7 +19,7 @@ exit; } -(!isset($token) || md5($token) != "19a3ec370affe2d899755f005e5cd90e") && error("token not correct.", 401); +(!isset($token) || md5($token) != "d3fbcabfcf3648095037175fdeef322f") && error("token not correct.", 401); $USERNAME = filter_input(INPUT_GET, "username", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH); @@ -27,12 +28,11 @@ $stmt = $pdo->prepare("SELECT userid, name, email, username, spamprotect, use_sa, greylist, enable FROM users WHERE username = ? AND cvsaccess LIMIT 1"); if (!$stmt->execute(array($USERNAME))) { error("This error should never happen", 500); - exit; } $results = $stmt->fetch(PDO::FETCH_ASSOC); if (!$results) { - echo error(array("error" => "No such user"), 404); + error(array("error" => "No such user"), 404); } $stmt = $pdo->prepare("SELECT note, entered FROM users_note WHERE userid = ?");

« previous php.webmaster (#4601) next »