[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/libraries/adodb/pear/ -> auth_adodb_example.php (source)

   1  <?php
   2  // NOTE: The ADOdb and PEAR directories MUST be in your PHP include_path!
   3  require_once "Auth/Auth.php";
   4  
   5  function loginFunction() {
   6  ?>
   7      <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
   8      <input type="text" name="username">
   9      <input type="password" name="password">
  10      <input type="submit">
  11      </form>
  12  <?php
  13  }
  14  
  15  $dsn = 'mysql://username:password@hostname/database';
  16  // To use encrypted passwords, change cryptType to 'md5'
  17  $params = array('dsn' => $dsn, 'table' => 'auth', 'cryptType' => 'none',
  18                  'usernamecol' => 'username', 'passwordcol' => 'password');
  19  $a = new Auth("ADOdb", $params, "loginFunction");
  20  $a->start();
  21  
  22  if ($a->getAuth()) {
  23      echo "Success";
  24      // * The output of your site goes here.
  25  }


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1