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

Error--Notice: Undefined index: 0 audit_schedule.php
http://www.open-audit.org/phpBB3/viewtopic.php?f=5&t=5746
Page 1 of 1

Author:  banso_boy [ Fri Jul 15, 2011 10:46 pm ]
Post subject:  Error--Notice: Undefined index: 0 audit_schedule.php

Hi everyone,
trying to do some scheduling but had this error.
I have included the lines where the error originates with the hope that someone will give me a solution or a tip on how to avoid.

Notice: Undefined index: 0 in C:\xampp\htdocs\openaudit\audit_schedule.php on line 24

Code:
 $daily_frq = (!is_null($cfg[$id])) ? $cfg[$id]['daily_frequency'] : 1;


Notice: Undefined index: 0 in C:\xampp\htdocs\openaudit\audit_schedule.php on line 52

Code:
 <?php Get_Audit_Configs($cfg[$id]['config_id']); ?>


Notice: Undefined index: 0 in C:\xampp\htdocs\openaudit\audit_schedule.php on line 74

Code:
 <input type="checkbox" onclick="toggleLogging(this)" size="20" id="check_log_disable" name="check_log_disable" <?php if ( $cfg[$id]['log_disabled'] ) { echo "CHECKED"; } ?>/>


Notice: Undefined index: 0 in C:\xampp\htdocs\openaudit\audit_schedule.php on line 77

Code:
<input type="checkbox" onclick="toggleEmail(this)" size="20" id="check_email_log" name="check_email_log" <?php if ( $cfg[$id]['email_log'] ) { echo "CHECKED"; } ?>/>



Infact I just noticed I have lots of "Undefined index:0" errors. How can work on this?

Author:  jpa [ Sat Jul 16, 2011 3:01 am ]
Post subject:  Re: Error--Notice: Undefined index: 0 audit_schedule.php

I don't use the web scheduling as the code came after I started using OpenAudit. I've also found it to be a bit touchy and likely to explode at any moment; As you've discovered.

Having said that I don't think the undefined index is your problem. The web scheduling portion of OpenAudit doesn't handle MySQL strict mode.

Edit audit_sched_add_ajax.php and change the following around line 150:
Code:
$db = GetOpenAuditDbConnection();
mysql_query($sql,$db) or die("Could not add/update schedule: " . mysql_error() . "<br>$sql");


To this:
Code:
$db = GetOpenAuditDbConnection();
$result = mysql_query("SET @@session.sql_mode=''",$db);
mysql_query($sql,$db) or die("Could not add/update schedule: " . mysql_error() . "<br>$sql");


See what that does.

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