Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/vendor/adodb/adodb-php/pear/auth_adodb_example.php
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 09:05:48 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 09:05:48 +0100
commit6854cb3f4d8219cf1829e32122eb2502a916eae9 (patch)
tree350feb504587d932e02837a1442b059759927646 /vendor/adodb/adodb-php/pear/auth_adodb_example.php
initial checkin
Diffstat (limited to 'vendor/adodb/adodb-php/pear/auth_adodb_example.php')
-rw-r--r--vendor/adodb/adodb-php/pear/auth_adodb_example.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/adodb/adodb-php/pear/auth_adodb_example.php b/vendor/adodb/adodb-php/pear/auth_adodb_example.php
new file mode 100644
index 0000000..3b7cf5e
--- /dev/null
+++ b/vendor/adodb/adodb-php/pear/auth_adodb_example.php
@@ -0,0 +1,25 @@
+<?php
+// NOTE: The ADOdb and PEAR directories MUST be in your PHP include_path!
+require_once "Auth/Auth.php";
+
+function loginFunction() {
+?>
+ <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
+ <input type="text" name="username">
+ <input type="password" name="password">
+ <input type="submit">
+ </form>
+<?php
+}
+
+$dsn = 'mysql://username:password@hostname/database';
+// To use encrypted passwords, change cryptType to 'md5'
+$params = array('dsn' => $dsn, 'table' => 'auth', 'cryptType' => 'none',
+ 'usernamecol' => 'username', 'passwordcol' => 'password');
+$a = new Auth("ADOdb", $params, "loginFunction");
+$a->start();
+
+if ($a->getAuth()) {
+ echo "Success";
+ // * The output of your site goes here.
+}