Hello,

I was trying to use accounting options in policyd webui. Add a new rule was ok, 
but the problem cames when I tried to change o delete a rule, here is the httpd 
log:

==> /var/log/httpd/error_log <==
[Fri Jun 08 10:51:34 2012] [error] [client 192.168.66.9] PHP Parse error:  
syntax error, unexpected '}' in /var/www/policyd/accounting-change.php on line 
301, referer: http://192.168.66.98:8080/accounting-main.php

==> /var/log/httpd/error_log <==
[Fri Jun 08 11:16:32 2012] [error] [client 192.168.66.9] PHP Parse error:  
syntax error, unexpected '}' in /var/www/policyd/accounting-delete.php on line 
129, referer: http://192.168.66.98:8080/accounting-main.php

After cheking the php code, I've noticed that there is a "mistake" that make my 
server fail. Here are the patches I've applied to solve it.

#  diff -u accounting-delete.php_ori accounting-delete.php
--- accounting-delete.php_ori   2012-06-08 10:41:34.886280550 +0200
+++ accounting-delete.php       2012-06-08 11:19:54.513339046 +0200
@@ -70,7 +70,7 @@
 } elseif ($_POST['frmaction'] == "delete2") {
 ?>
        <p class="pageheader">Accounting Delete Results</p>
-<?
+<?php
        if (isset($_POST['accounting_id'])) {

                if ($_POST['confirm'] == "yes") {



#  diff -u accounting-change.php_ori accounting-change.php
--- accounting-change.php_ori   2012-06-08 10:41:58.617284613 +0200
+++ accounting-change.php       2012-06-08 11:15:35.848151575 +0200
@@ -240,7 +240,7 @@
 } elseif ($_POST['frmaction'] == "change2") {
 ?>
        <p class="pageheader">Accounting Update Results</p>
-<?
+<?php
        $updates = array();

        if (!empty($_POST['accounting_policyid'])) {


I don't know if any one else have got the same error or if there is some 
"custom" configuration in php that avoids this errors, but with my php/httpd 
default server configuration, this is not working. After apply the patch 
everyting works smooth.

I'm using Centos 6 and policyd "cluebringer-snapshot-2.1.x-201205100639.tar.gz" 
and:
#  rpm -qa | grep -iE "httpd|php|amavis"
httpd-tools-2.2.15-15.el6.centos.1.x86_64
httpd-2.2.15-15.el6.centos.1.x86_64
php-mysql-5.3.3-3.el6_2.8.x86_64
php-pdo-5.3.3-3.el6_2.8.x86_64
amavisd-new-2.6.4-2.el5.x86_64
php-cli-5.3.3-3.el6_2.8.x86_64
php-common-5.3.3-3.el6_2.8.x86_64
php-5.3.3-3.el6_2.8.x86_64

I hope this will help someone else :)

Regards.

Manel
                                          
_______________________________________________
Users mailing list
[email protected]
http://lists.policyd.org/mailman/listinfo/users

Reply via email to