Skip to content
Browse files

Fix examples index to handle optional connect arguments correctly.

  • Loading branch information...
1 parent 59157dc commit e404d16c5a16cbb89c079da4d7a38fdd880cface @davidfstr davidfstr committed Aug 20, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 examples/index.php
View
6 examples/index.php
@@ -3,8 +3,10 @@
require_once '../Splunk.php';
require_once 'settings.php';
-$username = $SplunkExamples_connectArguments['username'];
-$password = $SplunkExamples_connectArguments['password'];
+$username = array_key_exists('username', $SplunkExamples_connectArguments)
+ ? $SplunkExamples_connectArguments['username'] : 'admin';
+$password = array_key_exists('username', $SplunkExamples_connectArguments)
+ ? $SplunkExamples_connectArguments['password'] : 'changeme';
$usingDefaultCredentials = ($username === 'admin' && $password === 'changeme');
$loginFailed = FALSE;

0 comments on commit e404d16

Please sign in to comment.
Something went wrong with that request. Please try again.