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

Error--Notice: Undefined index: 0 audit_schedule.php
https://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;[/code]

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

[code] <?php Get_Audit_Configs($cfg[$id]['config_id']); ?>[/code]

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"; } ?>/>[/code]

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"; } ?>/>[/code]


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 [url=http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html]MySQL strict mode[/url].

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");[/code]

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");[/code]

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/