From 5556f3a1169545ddbd24a588a6242deb354650cb Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 15 Sep 2010 12:37:31 +0000 Subject: Do not use the \ based list for modules because it treats even the comments as modules. Simplify logic and make sure php.ini exists in both paths when needed. --- etc/rc.php_ini_setup | 114 +++++++++++++++++++-------------------------------- 1 file changed, 43 insertions(+), 71 deletions(-) diff --git a/etc/rc.php_ini_setup b/etc/rc.php_ini_setup index 34d89cf..b2b6320 100755 --- a/etc/rc.php_ini_setup +++ b/etc/rc.php_ini_setup @@ -25,13 +25,6 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -if [ -f /usr/local/etc/php.ini ]; then - rm /usr/local/etc/php.ini -fi -if [ -f /usr/local/lib/php.ini ]; then - rm /usr/local/lib/php.ini -fi - # Set our operating platform PLATFORM=`cat /etc/platform` EXTENSIONSDIR="/usr/local/lib/php/20060613/" @@ -84,48 +77,43 @@ fi # Define php modules. Do not add .so, it will # be done automatically by the script below. -PHPMODULES="apc \ +PHPMODULES="apc" +PHPMODULES="$PHPMODULES standard" # Downloading via HTTP/FTP (pkg mgr, etc) - curl \ - date \ +PHPMODULES="$PHPMODULES curl date" # Internationalization - gettext \ +PHPMODULES="$PHPMODULES gettext" # User manager - ldap \ - openssl \ - pcntl \ +PHPMODULES="$PHPMODULES ldap openssl pcntl" +PHPMODULES="$PHPMODULES mhash" # Regexs, PERL style! - pcre \ +PHPMODULES="$PHPMODULES pcre" # The mighty posix! - posix \ - readline \ +PHPMODULES="$PHPMODULES posix" +PHPMODULES="$PHPMODULES readline" # Login sessions - session \ - standard \ +PHPMODULES="$PHPMODULES session" # Extra sanity seatbelts - suhosin \ - pfSense \ +PHPMODULES="$PHPMODULES suhosin" # Firewall rules edit - ctype \ +PHPMODULES="$PHPMODULES ctype" # Config read/write - xml \ - xmlreader \ - xmlwriter \ - libxml \ -# user manager - mhash \ +PHPMODULES="$PHPMODULES xml xmlreader xmlwriter libxml" +PHPMODULES="$PHPMODULES simplexml" # firewall_rules_edit.php - mbstring \ - shmop \ +PHPMODULES="$PHPMODULES mbstring" +# Synchronization primitives +PHPMODULES="$PHPMODULES shmop" # Page compression - zlib \ -# SQLlite - simplexml \ - spl \ - pdo \ - sqlite \ +PHPMODULES="$PHPMODULES zlib" +# SQLlite & Database +PHPMODULES="$PHPMODULES spl" +PHPMODULES="$PHPMODULES pdo" +PHPMODULES="$PHPMODULES sqlite" # ZeroMQ - zmq" +PHPMODULES="$PHPMODULES zmq" +# pfSense extensions +PHPMODULES="$PHPMODULES pfSense" # Modules previously included. # can be turned on by touching @@ -142,15 +130,16 @@ PHPMODULES="apc \ # bz2 \ # json \ -# Get a loaded module list in the stock php +# Clear the .ini file to make sure we are clean if [ -f /usr/local/etc/php.ini ]; then rm /usr/local/etc/php.ini fi if [ -f /usr/local/lib/php.ini ]; then rm /usr/local/lib/php.ini fi -LOADED_MODULES=`php -m | grep -v "\["` +LOADED_MODULES=`/usr/local/bin/php -m | grep -v "\["` +# Get a loaded module list in the stock php # Populate a dummy php.ini to avoid # the file being clobbered and the firewall # not being able to boot back up. @@ -178,6 +167,9 @@ extension_dir=${EXTENSIONSDIR} EOF +# Copy php.ini file to etc/ too (cli) +cp /usr/local/lib/php.ini /usr/local/etc/php.ini + # Ensure directory exists if [ ! -d /etc/php_dynamodules ]; then mkdir /etc/php_dynamodules @@ -211,27 +203,6 @@ done RAM=`sysctl hw.realmem | awk '{print $2/1000000}' | awk -F '.' '{print $1}'` export RAM export LOWMEM -if [ "$RAM" -lt "97" ]; then - LOWMEM="TRUE" - cat >>/usr/local/lib/php.ini <>/usr/local/lib/php.ini <>> WARNING! under 128 megabytes of ram detected. Not enabling APC." + echo ">>> WARNING! under 128 megabytes of ram detected. Not enabling APC." | logger -p daemon.info -i -t rc.php_ini_setup +fi + + cat >>/usr/local/lib/php.ini <>> WARNING! under 128 megabytes of ram detected. Not enabling APC." - echo ">>> WARNING! under 128 megabytes of ram detected. Not enabling APC." | logger -p daemon.info -i -t rc.php_ini_setup - -fi # Copy php.ini file to etc/ too (cli) cp /usr/local/lib/php.ini /usr/local/etc/php.ini @@ -277,7 +252,7 @@ for EXT in $PHPMODULES; do done # Check loaded modules and remove anything that did not load correctly -LOADED_MODULES=`php -m | tr '[:upper:]' '[:lower:]' 2>/dev/null | grep -v "\["` +LOADED_MODULES=`/usr/local/bin/php -m | tr '[:upper:]' '[:lower:]' 2>/dev/null | grep -v "\["` for EXT in $PHPMODULESLC; do SHOULDREMOVE="true" for LM in $LOADED_MODULES; do @@ -298,6 +273,7 @@ for EXT in $PHPMODULESLC; do if [ -f "${EXTENSIONSDIR}${EXT}.so" ]; then echo ">>> ${EXT} did not load correctly. Removing from php.ini..." >> /var/run/php_modules_load_errors.txt cat /usr/local/lib/php.ini | grep -v $EXT > /tmp/php.ini + rm -f /usr/local/lib/php.ini mv /tmp/php.ini /usr/local/lib/php.ini fi fi @@ -305,7 +281,3 @@ done # Copy php.ini file to etc/ too (cli) cp /usr/local/lib/php.ini /usr/local/etc/php.ini - - - - -- cgit v1.1 From c9cb32c4a302ebbfd1bfcc18050389cae47413cf Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 15 Sep 2010 13:04:44 +0000 Subject: Do not overwrite the redirurl parameter already taken care of. --- usr/local/captiveportal/index.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index 79a9fa6..70188f6 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -49,10 +49,11 @@ $orig_request = $_REQUEST['redirurl']; $clientip = $_SERVER['REMOTE_ADDR']; if (!$clientip) { - /* not good - bail out */ - echo "An error occurred. Please check the system logs for more information."; - log_error("Captive portal could not determine client's IP address."); - exit; + /* not good - bail out */ + log_error("Captive portal could not determine client's IP address."); + $error_message = "An error occurred. Please check the system logs for more information."; + portal_reply_page($redirurl, "error", $errormsg); + exit; } if (isset($config['captiveportal']['httpslogin'])) @@ -78,8 +79,6 @@ if ($orig_host != $ourhostname) { } if (preg_match("/redirurl=(.*)/", $orig_request, $matches)) $redirurl = urldecode($matches[1]); -if ($_POST['redirurl']) - $redirurl = $_POST['redirurl']; if (!empty($config['captiveportal']['redirurl'])) $redirurl = $config['captiveportal']['redirurl']; -- cgit v1.1 From cf6a1f80e8ec88b0393f925f44ce525bef0d2850 Mon Sep 17 00:00:00 2001 From: Warren Baker Date: Wed, 15 Sep 2010 14:32:25 +0200 Subject: Change windows.onLoad event to rely on DOM readiness instead, for enablechange() function. Tested on Safari, Chrome, FFox and IE7+8 on windows and OSX. --- usr/local/www/pkg_edit.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index c7a444b..015c6fb 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -261,10 +261,28 @@ if ($pkg['custom_php_after_head_command']) ?> - + "") { ?>