diff options
Diffstat (limited to 'php/Attic/examples/sample-idp/login.php')
| -rw-r--r-- | php/Attic/examples/sample-idp/login.php | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/php/Attic/examples/sample-idp/login.php b/php/Attic/examples/sample-idp/login.php index 33bd4120..21b196f9 100644 --- a/php/Attic/examples/sample-idp/login.php +++ b/php/Attic/examples/sample-idp/login.php @@ -21,14 +21,21 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - $config = unserialize(file_get_contents('config.inc')); require_once 'HTML/QuickForm.php'; require_once 'Log.php'; require_once 'DB.php'; + $config = unserialize(file_get_contents('config.inc')); + + // connect to the data base + $db = &DB::connect($config['dsn']); + if (DB::isError($db)) + die("Could not connect to the database"); + // create logger - $logger = &Log::factory($config['log_handler'], '', $config['log_name']."::".$_SERVER['PHP_SELF']); + $conf['db'] = $db; + $logger = &Log::factory($config['log_handler'], 'log', $_SERVER['PHP_SELF'], $conf); /* * @@ -70,15 +77,6 @@ return (0); } - $db = &DB::connect($config['dsn']); - - if (DB::isError($db)) - { - $logger->log("DB Error :" . $db->getMessage(), PEAR_LOG_ALERT); - $logger->log("DB Error :" . $db->getDebugInfo(), PEAR_LOG_DEBUG); - die("Could not connect to the database"); - } - if ($config['auth_type'] == 'auth_basic') { if (!isset($_SERVER['PHP_AUTH_USER'])) |
