[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-plugins
Subject:    Re: [SM-PLUGINS] administrator plugin in Squirrelmail-1.4.4
From:       "Gareth Johnston" <gareth () jgjohnston ! com>
Date:       2005-01-28 15:53:08
Message-ID: 33816.81.152.77.118.1106927588.squirrel () www ! jgjohnston ! com
[Download RAW message or body]

>> Whilst testing the new SQMail-1.4.4 I enabled the administrator plugin.
>>
>> Following the instructions in INSTALL regarding file permissions and
>> UID/GID for the config.php file:
>>
>> UID: User allowed access
>> GID: User running php (webserver user)
>> File permissions: 660
>> Admins File: (Does NOT exist)
>> Plugin enabled thru conf.pl and saved.
>>
>> I tried to access the plugin through the options page, but it didn't
>> show
>> on the page at all. It worked perfectly with the package I am using in
>> production: SQMail-1.4.3a-2.noarch.rpm
>>
>> I substituted the plugin from the production package(1.4.3a-2) to the
>> 1.4.4 package and the plugin showed in the test setup and worked fine.
>> Subsequently i 'diff'ed the 2 auth.php files from the packages finding
>> an
>> added '&&' statement in the "} else if {" on line 39 in 1.4.4.
>>
>> Squirrelmail-1.4.3a-2/plugins/administrator/auth.php
>>
>> Line 29-31:
>>
>> } else if ($adm_id = fileowner(SM_PATH . 'config/config.php')) {
>>         $adm = posix_getpwuid( $adm_id );
>>         $auth = ($username == $adm['name']);
>>
>> Squirrelmail-1.4.4/plugins/administrator/auth.php
>>
>> Line 39-42:
>>
>> } else if ($adm_id = fileowner(SM_PATH . 'config/config.php') &&
>>                function_exists('posix_getpwuid')) {
>>         $adm = posix_getpwuid( $adm_id );
>>         $auth = ($username == $adm['name']);
>>
>> I then removed the added '&&' statement from the original
>> (1.4.4)auth.php
>> file and replaced that plugin in the test setup. Doing so showed the
>> plugin in the options page and it works fine.
>>
>> I'm not very up on php, but this added statement to me reads:
>>
>> 'and if function posix_getpwuid exists then execute the following'.
>>
>> As the function is indeed called to get the UID allowed access on my
>> system, on the following line, why is this added statement breaking the
>> plugin in 1.4.4?
>>
>> System details:
>>
>> SQMail-1.4.4
>> Fedora Core 1
>> Apache/2.0.50
>> PHP 4.3.8
>> IMAP Server: UW
>> Browser: Any and all
>>
>> Any help/guidance greatly appreciated ;)
>
> fix tried to make sure that posix extension is present. Plugin follows
> squirrelmail requirements and don't ask for posix support in php. error
> happens because instead of assigning to $adm_id results of fileowner call,
> $adm_id gets result of entire test. My mistake.
>
> -} else if ($adm_id = fileowner(SM_PATH . 'config/config.php') &&
> +} else if (($adm_id = fileowner(SM_PATH . 'config/config.php')) &&
>                 function_exists('posix_getpwuid')) {
>          $adm = posix_getpwuid( $adm_id );
>          $auth = ($username == $adm['name']);
>

Thanks Tomas for your help and support again! ;)

There seems to be a lag in receiveing the list messages, plus my server
was offline for a while. Please ignore the message i sent to the users
list and forgive my impatience.

Many thanks.

Gareth




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
--
squirrelmail-plugins mailing list
Posting Guidelines: http://squirrelmail.org/wiki/wiki.php?MailingListPostingGuidelines
List Address: squirrelmail-plugins@lists.sourceforge.net
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.plugins
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3931
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic