[aur-dev] [PATCH 4/5] Store account type in local var when possible

Dan McGee dpmcgee at gmail.com
Sun Jan 4 14:23:00 EST 2009


On Sun, Jan 4, 2009 at 1:11 PM, Loui Chang <louipc.ist at gmail.com> wrote:
> On Mon, Dec 29, 2008 at 10:36:06PM -0600, Dan McGee wrote:
>> No need to call this function way too often, especially when on the package
>> list page where it could be called up to once per row.
>>
>> Signed-off-by: Dan McGee <dan at archlinux.org>
>> ---
>>  web/lib/pkgfuncs.inc                |   13 ++++++-------
>>  web/template/header.php             |    4 ++--
>>  web/template/pkg_search_results.php |    3 ++-
>>  3 files changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/web/template/header.php b/web/template/header.php
>> index dcf99f3..5b48cd6 100644
>> --- a/web/template/header.php
>> +++ b/web/template/header.php
>> @@ -49,8 +49,8 @@ if (isset($_COOKIE["AURSID"])) {
>>             <li><a href="pkgsubmit.php"><?php print __("Submit"); ?></a></li>
>>            <li><a href="packages.php?SeB=m&K=<?php print username_from_sid($_COOKIE["AURSID"]); ?>"><?php print __("My Packages"); ?></a></li>
>>  <?php
>> -     if (account_from_sid($_COOKIE["AURSID"]) == "Trusted User"
>> -             || account_from_sid($_COOKIE["AURSID"]) == "Developer") {
>> +     $atype = account_from_sid($SID);
>
> Pushed with one added line:
> $SID = $_COOKIE['AURSID'];
>
> Since SID wasn't being set in header.php.

Great catch, thanks!

-Dan


More information about the aur-dev mailing list