From: Gareth J. <ga...@jg...> - 2005-01-28 15:53:43
|
>> 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 |