LiveUser
[ class tree: LiveUser ] [ index: LiveUser ] [ all elements ]

Source for file config_mdb.inc.php

Documentation is available at config_mdb.inc.php

  1. <?php
  2. // $Id: config_mdb.inc.php,v 1.2 2004/06/19 17:04:07 arnaud Exp $
  3. require_once 'MDB.php';
  4. require_once 'LiveUser.php';
  5. // Plase configure the following file according to your environment
  6.  
  7. $db_user 'root';
  8. $db_pass '';
  9. $db_host 'localhost';
  10. $db_name 'pear_test';
  11.  
  12. $dsn = "mysql://$db_user:$db_pass@$db_host/$db_name";
  13.  
  14. $db = MDB::connect($dsnarray('sequence_col_name' => 'id'));
  15.  
  16. if (MDB::isError($db)) {
  17.     echo $db->getMessage(' ' $db->getUserInfo();
  18. }
  19.  
  20. $db->setFetchMode(MDB_FETCHMODE_ASSOC);
  21.  
  22.  
  23. $conf =
  24.     array(
  25.         'autoInit' => true,
  26.         'session'  => array(
  27.             'name'     => 'PHPSESSION',
  28.             'varname'  => 'ludata'
  29.         ),
  30.         'login' => array(
  31.             'method'   => 'post',
  32.             'username' => 'handle',
  33.             'password' => 'passwd',
  34.             'force'    => false,
  35.             'function' => '',
  36.             'remember' => 'rememberMe'
  37.         ),
  38.         'logout' => array(
  39.             'trigger'  => 'logout',
  40.             'redirect' => 'home.php',
  41.             'destroy'  => true,
  42.             'method' => 'get',
  43.             'function' => ''
  44.         ),
  45.         'authContainers' => array(
  46.             array(
  47.                 'type'          => 'MDB',
  48.                 'name'          => 'MDB_Local',
  49.                 'loginTimeout'  => 0,
  50.                 'expireTime'    => 3600,
  51.                 'idleTime'      => 1800,
  52.                 'dsn'           => $dsn,
  53.                 'allowDuplicateHandles' => 0,
  54.                 'authTable'     => 'liveuser_users',
  55.                 'authTableCols' => array(
  56.                      'required' => array(
  57.                         'auth_user_id' => array('type' => 'text''name' => 'auth_user_id'),
  58.                         'handle'       => array('type' => 'text''name' => 'handle'),
  59.                         'passwd'       => array('type' => 'text''name' => 'passwd')
  60.                      ),
  61.                      'optional' => array(
  62.                         'lastlogin'      => array('type' => 'timestamp''name' => 'lastlogin'),
  63.                         'is_active'      => array('type' => 'boolean',   'name' => 'is_active'),
  64.                         'owner_user_id'  => array('type' => 'integer',   'name' => 'owner_user_id'),
  65.                         'owner_group_id' => array('type' => 'integer',   'name' => 'owner_group_id')
  66.                      ),
  67.                     'custom' => array (
  68.                         'name'  => array('type' => 'text''name' => 'name'),
  69.                         'email' => array('type' => 'text''name' => 'email'),
  70.                      )
  71.                 )
  72.             )
  73.         ),
  74.         'permContainer' => array(
  75.             'dsn'        => $dsn,
  76.             'type'       => 'MDB_Medium',
  77.             'prefix'     => 'liveuser_'
  78.         )
  79.     );
  80.  
  81. function logOut()
  82. {
  83. }
  84.  
  85. function logIn()
  86. {
  87. }
  88.  
  89. PEAR::setErrorHandling(PEAR_ERROR_RETURN);
  90.  
  91. $usr LiveUser::singleton($conf);
  92. $usr->setLoginFunction('logIn');
  93. $usr->setLogOutFunction('logOut');
  94.  
  95. $e $usr->init();
  96.  
  97. if (PEAR::isError($e)) {
  98. //var_dump($usr);
  99.     die($e->getMessage(' ' $e->getUserinfo());
  100. }

Documentation generated on Mon, 11 Mar 2019 13:56:16 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.