Open-AudIT
https://www.open-audit.org/phpBB3/

Audit Configuration problem (fixed)
https://www.open-audit.org/phpBB3/viewtopic.php?f=5&t=5858
Page 1 of 2

Author:  angel [ Tue Apr 10, 2012 8:53 pm ]
Post subject:  Audit Configuration problem (fixed)

Hello,

I'm unable to add an audit configuration. When I submit the settings I get an error in IE 8:
An hexadecimal digit was expected in audit_configuration line 1 char 88

It doesn't work in Firefox but in that case I don't get any error.

Any suggestion?

Author:  jpa [ Wed Apr 11, 2012 12:43 am ]
Post subject:  Re: Audit Configuration problem

Maybe you're running into MySQL Strict mode problems. If you're already on the latest SVN version of OpenAudit you can try the attached file and see if it helps.

Remove the ".txt" from the downloaded file and copy to your OpenAudit htdocs directory.

Attachments:
audit_config_add_ajax.php.txt [14.26 KiB]
Downloaded 580 times

Author:  angel [ Fri Apr 13, 2012 1:11 am ]
Post subject:  Re: Audit Configuration problem

Hi jpa,

I changed the file but doesn't work.
I'm getting the same error

Any suggestion?

Thanks

Author:  jpa [ Fri Apr 13, 2012 1:39 am ]
Post subject:  Re: Audit Configuration problem

You'll need to post some more info about the configuration you're trying to add.

Author:  angel [ Fri Apr 13, 2012 4:28 pm ]
Post subject:  Re: Audit Configuration problem

hi,

Here you have an screen capture.

Thanks

Attachments:
AuditConfig.png
AuditConfig.png [ 143.37 KiB | Viewed 14875 times ]

Author:  jpa [ Sat Apr 14, 2012 2:48 am ]
Post subject:  Re: Audit Configuration problem

I can't replicate this. Is there anything in your php error logs that might help?

Author:  angel [ Sun Apr 15, 2012 2:19 am ]
Post subject:  Re: Audit Configuration problem

Hi,

Here are the errors I'm getting ...

[14-Apr-2012 18:13:28] PHP Notice: Undefined index: config_id in PATH_TO\audit_configuration.php on line 76
[14-Apr-2012 18:13:28] PHP Notice: Undefined index: config_id in PATH_TO\audit_configuration.php on line 116
[14-Apr-2012 18:13:29] PHP Notice: Undefined offset: 1 in PATH_TO\audit_configuration.php on line 274
[14-Apr-2012 18:13:29] PHP Notice: Undefined offset: 2 in PATH_TO\audit_configuration.php on line 274
[14-Apr-2012 18:13:29] PHP Notice: Undefined offset: 3 in PATH_TO\audit_configuration.php on line 274
[14-Apr-2012 18:13:29] PHP Notice: Undefined offset: 1 in PATH_TO\audit_configuration.php on line 277
[14-Apr-2012 18:13:29] PHP Notice: Undefined offset: 2 in PATH_TO\audit_configuration.php on line 277
[14-Apr-2012 18:13:29] PHP Notice: Undefined variable: ip_end in PATH_TO\audit_configuration.php on line 277
[14-Apr-2012 18:13:29] PHP Notice: Undefined variable: linux_software in PATH_TO\audit_configuration.php on line 365


Thanks!

Author:  angel [ Sun Apr 15, 2012 2:48 am ]
Post subject:  Re: Audit Configuration problem

Hi again,

Are maybe my problems related with my OA, apache, php and mysql versions?
Which are the supported ones with my OA version?

Author:  jpa [ Wed Apr 18, 2012 2:50 am ]
Post subject:  Re: Audit Configuration problem

Those errors are expected and don't indicate a problem.

I tested with Apache 2.2.22, MySQL 5.5.22 and PHP 5.2.13/5.3.10/5.4.0 and successfully added a configuration.

What happens if you don't use a preconfigured LDAP connection?

Author:  angel [ Thu Apr 19, 2012 4:06 pm ]
Post subject:  Re: Audit Configuration problem

Hi jpa,

Thanks for your help.
I get the same error with an ldap entry preconfigured.
In fact if I leave all the fields blank I get the same error.

The javascript error is the next one
<b>Notice</b>: Undefined index: config_id in <b>C:\xampp\htdocs\OAv1\audit_configuration.php</b> on line <b>76</b><br />

<b>Notice</b>: Undefined index: config_id in <b>C:\xampp\htdocs\OAv1\audit_configuration.php</b> on line <b>116</b><br />

and the piece of code from the audit_configuration.php are the next ones

76 line
<form action="javascript:SubmitForm('config','<?php echo $form_action ?>','<?php echo $_GET['config_id']; ?>');" method="post" id="form_config">

116 line
<input type="hidden" value="<?php echo $_GET['config_id']; ?>" id="config_id"/>

I'm not used to work with php but seems that the parameter config_id is missed.

Any idea?

Author:  jpa [ Fri Apr 20, 2012 2:08 am ]
Post subject:  Re: Audit Configuration problem

I'm pretty sure the php errors from the log aren't your problem. I think you've got some kind of javascript or file corruption thing going. If you click Submit on a blank add configuration page you should get an error message like the following.

Attachment:
EmptyAddConfigError.png
EmptyAddConfigError.png [ 7.3 KiB | Viewed 14804 times ]


The errors in the php log are from when you first load the Add a Configuration page and so are before when you see the error message. At this point I would back up the OpenAudit www directory on your server then wipe it and start from a fresh SVN download.

Author:  angel [ Mon Apr 23, 2012 8:54 pm ]
Post subject:  Re: Audit Configuration problem

Hello,

I tried with a fresh installation but I get the same error.

malformed hexadecimal character escape sequence
javascript:SubmitForm('config','add','<br%20/><b>Notice</b>:%20%20Undefined%20index:%20config_id%20in%20<b>PATH_TO\audit_configuration.php</b>%20on%20line%20<b>76</b><br%20/>');
Line 1

Any idea?

Author:  jpa [ Tue Apr 24, 2012 3:08 am ]
Post subject:  Re: Audit Configuration problem

Try the attached audit_configuration.php file. I can't replicate this error but I've changed one thing that might help.

Attachments:
audit_configuration.php.txt [20.77 KiB]
Downloaded 575 times

Author:  angel [ Thu Apr 26, 2012 9:25 pm ]
Post subject:  Re: Audit Configuration problem

Hey!

It works!!!

Thanks a lot.

Yo have changed these lines...

$ip_end = ( !is_null($cfg[$id]) ) ? $cfg[$id]['ip_end']

<input type="hidden" value="<?php echo $id; ?>" id="conf

please, could you explain the goal?

Thanks!

Author:  jpa [ Fri Apr 27, 2012 1:34 am ]
Post subject:  Re: Audit Configuration problem

The audit_configuration.php file is used to add and change configurations. On first accessing the file there is no configuration selected for editing and so $_GET['config_id'] isn't set. One of the first things in the code is to check for this and set $id = 0 if we're not editing an existing configuration.
Code:
 $id = ( isset($_GET['config_id']) ) ? $_GET['config_id'] : '0';

It looks like for some reason on your machine when config_id isn't set $_GET['config_id'] returns an error string ( <br%20/><b>Notice</b>:%20%20Undefined%20index:%20config_id%20in%20<b>PATH_TO\audit_configuration.php</b>%20on%20line%20<b>76</b><br%20/>).
After $id is set early in the code further code should use $id rather than $_GET['config_id']. Two places in the released code are using $_GET['config_id'] rather than $id. I changed this because the garbage returned in your configuration was causing problems.
Code:
   <form action="javascript:SubmitForm('config','<?php echo $form_action ?>','<?php echo $_GET['config_id']; ?>');" method="post" id="form_config">
should be
   <form action="javascript:SubmitForm('config','<?php echo $form_action ?>','<?php echo $id; ?>');" method="post" id="form_config">

   <input type="hidden" value="<?php echo $_GET['config_id']; ?>" id="config_id"/>
should be
   <input type="hidden" value="<?php echo $id; ?>" id="config_id"/>


If we are editing a configuration then $id is set to the configuration id and the configuration information is retrieved and presented for editing. The released code was not retrieving the last octet of "IP End" for an "IP Range" type audit. So I added the following to get this info.
Code:
 $ip_end = ( !is_null($cfg[$id]) ) ? $cfg[$id]['ip_end']     : '0';

Page 1 of 2 All times are UTC + 10 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/