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

Beta 4 Bugs
https://www.open-audit.org/phpBB3/viewtopic.php?f=20&t=5784
Page 1 of 1

Author:  kumail [ Tue Oct 25, 2011 6:21 am ]
Post subject:  Beta 4 Bugs

I have an issue with an audit that ran on one of my company's Windows laptops. At submit time, the audit submits, but a PHP Error occurs. The audit is still processed, inserted into the DB, and shows on the PHP front-end details for that system.

The error is as follows.....

Update

A PHP Error was encountered

Severity: Notice

Message: Undefined property: System::$m_oa_group

Filename: controllers/system.php

Line Number: 159

Fatal error: Call to a member function update_system_groups() on a non-object in E:\xampplite\OAv2\code_igniter\system\application\controllers\system.php on line 159

Any ideas?

Author:  joofoo [ Wed Oct 26, 2011 7:05 pm ]
Post subject:  Re: Beta 4 Bugs

@kumail
That's not an OpenAudit bug, but rather a server-side misconfiguration.
Actually, this is not a critical error, not even a warning error, but rather a "notice" (nothing you should pay much attention to). On production servers, PHP error messages should not be displayed/forwarded to the end users, and therefore errors should only be tracked via your webservers standard logging mechanisms (logfiles). To achieve this on PHP applications, one has to edit the webserver's php.ini file and modify the error_reporting directive.

In your case, you could just disable notices and let only the more important errors display by modifying the error_reporting directive your php.ini (in my linux system the file's path is /etc/php.ini, on windows the file is somewhere in the xampp folder, e.g. c:\xampp\php\php.ini) as shown bellow:
[code]error_reporting = E_ALL & ~E_NOTICE[/code]
This will still show all errors and turn off notices.

Author:  jpa [ Thu Oct 27, 2011 3:47 am ]
Post subject:  Re: Beta 4 Bugs

I don't think this is an error that should be papered over.

Looking at the code it looks like line 159 in application\controllers\system.php tries to call update_system_groups on m_oa_group before the m_oa_group model is loaded in line 166.

So maybe from this:
[code] // update any tags for new printers
$this->m_sys_man_audits->update_audit($details, 'network printers');
$network_printers = $this->m_printer->get_new_network_printer($details);
if (count($network_printers) > 0) {
foreach ($network_printers as $printer) {
$this->m_oa_group->update_system_groups($printer);
}
}


// Finally, update any tags for this system
$this->m_sys_man_audits->update_audit($details, 'system groups');
$this->load->model("m_oa_group");[/code]

to this:

[code] // update any tags for new printers
$this->load->model("m_oa_group");
$this->m_sys_man_audits->update_audit($details, 'network printers');
$network_printers = $this->m_printer->get_new_network_printer($details);
if (count($network_printers) > 0) {
foreach ($network_printers as $printer) {
$this->m_oa_group->update_system_groups($printer);
}
}


// Finally, update any tags for this system
$this->m_sys_man_audits->update_audit($details, 'system groups'); [/code]

Or I could be totally wrong and that is how Mark intended it.

Author:  Mark [ Thu Oct 27, 2011 8:28 am ]
Post subject:  Re: Beta 4 Bugs

Looks like a bug.
I've fixed it locally...

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