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

Source for file conf.php

Documentation is available at conf.php

  1. <?php
  2. require_once 'DB.php';
  3. require_once 'LiveUser.php';
  4. // Plase configure the following file according to your environment
  5.  
  6. //$dsn = '{dbtype}://{user}:{passwd}@{dbhost}/{dbname}';
  7.  
  8. $dsn 'mysql://root:@localhost/pear_test';
  9.  
  10. $db = DB::connect($dsn);
  11.  
  12. if (DB::isError($db)) {
  13.     echo $db->getMessage(' ' $db->getUserInfo();
  14. }
  15.  
  16. $db->setFetchMode(DB_FETCHMODE_ASSOC);
  17.  
  18.  
  19. $conf =
  20.     array(
  21.         'autoInit' => false,
  22.         'session'  => array(
  23.             'name'     => 'PHPSESSION',
  24.             'varname'  => 'ludata'
  25.         ),
  26.         'login' => array(
  27.             'method'   => 'post',
  28.             'username' => 'handle',
  29.             'password' => 'passwd',
  30.             'force'    => false,
  31.             'function' => '',
  32.             'remember' => 'rememberMe'
  33.         ),
  34.         'logout' => array(
  35.             'trigger'  => 'logout',
  36.             'redirect' => 'home.php',
  37.             'destroy'  => true,
  38.             'method' => 'get',
  39.             'function' => ''
  40.         ),
  41.         'authContainers' => array(
  42.             array(
  43.                 'type'          => 'DB',
  44.                 'name'          => 'DB_Local',
  45.                 'loginTimeout'  => 0,
  46.                 'expireTime'    => 3600,
  47.                 'idleTime'      => 1800,
  48.                 'dsn'           => $dsn,
  49.                 'allowDuplicateHandles' => 0,
  50.                 'authTable'     => 'liveuser_users',
  51.                 'authTableCols' => array(
  52.                     'required' => array(
  53.                         'auth_user_id' => array('name' => 'auth_user_id''type' => ''),
  54.                         'handle'       => array('name' => 'handle',       'type' => ''),
  55.                         'passwd'       => array('name' => 'passwd',       'type' => ''),
  56.                     ),
  57.                     'optional' => array(
  58.                         'lastlogin'    => array('name' => 'lastlogin',    'type' => ''),
  59.                         'is_active'    => array('name' => 'is_active',    'type' => '')
  60.                     )
  61.                 )
  62.             )
  63.         ),
  64.         'permContainer' => array(
  65.             'dsn'        => $dsn,
  66.             'type'       => 'DB_Medium',
  67.             'prefix'     => 'liveuser_'
  68.         )
  69.     );
  70.  
  71. function logOut()
  72. {
  73. }
  74.  
  75. function logIn()
  76. {
  77. }
  78.  
  79. PEAR::setErrorHandling(PEAR_ERROR_RETURN);
  80.  
  81. $usr LiveUser::singleton($conf);
  82. $usr->setLoginFunction('logIn');
  83. $usr->setLogOutFunction('logOut');
  84.  
  85. $e $usr->init();
  86.  
  87. if (PEAR::isError($e)) {
  88. //var_dump($usr);
  89.     die($e->getMessage(' ' $e->getUserinfo());
  90. }

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