note 118359 added to features.http-auth

From: Date: Sun, 22 Nov 2015 19:05:04 +0000
Subject: note 118359 added to features.http-auth
Groups: php.notes 
Request: Send a blank email to php-notes+get-204206@lists.php.net to get a copy of this message
Here is my attempt to create a digest authentication class that will log the user in and out without using a cookie,session,db,or file. At the core is this simple code to parse the digest string into variables works for several browsers. <?php // explode the digest with multibrowser support by Tony Wyatt 21jun07 public function explodethedigest($instring) { $quote = '"'; $equal = '='; $comma = ','; $space = ' '; $a = explode( $comma, $instring); $ax = explode($space, $a[0]); $b = explode( $equal, $ax[1], 2); $c = explode( $equal, $a[1], 2); $d = explode( $equal, $a[2], 2); $e = explode( $equal, $a[3], 2); $f = explode( $equal, $a[4], 2); $g = explode( $equal, $a[5], 2); $h = explode( $equal, $a[6], 2); $i = explode( $equal, $a[7], 2); $j = explode( $equal, $a[8], 2); $k = explode( $equal, $a[9], 2); $l = explode( $equal, $a[10], 2); $parts = array(trim($b[0])=>trim($b[1], '"'), trim($c[0])=>trim($c[1], '"'), trim($d[0])=>trim($d[1], '"'), trim($e[0])=>trim($e[1], '"'), trim($f[0])=>trim($f[1], '"'), trim($g[0])=>trim($g[1], '"'), trim($h[0])=>trim($h[1], '"'), trim($i[0])=>trim($i[1], '"'), trim($j[0])=>trim($j[1], '"'), trim($k[0])=>trim($k[1], '"'), trim($l[0])=>trim($l[1], '"')); return $parts; } ?> Give it a try at http://www.creativetheory.ca/ /tests/ta1.php Log in with user test password pass or user guest password guest. Go to page two for links to the code. Comments, ideas, suggestions, or critique welcome. ---- Server IP: 72.52.91.14 Probable Submitter: 68.146.148.38 ---- Manual Page -- http://php.net/manual/en/features.http-auth.php Edit -- https://master.php.net/note/edit/118359 Del: integrated -- https://master.php.net/note/delete/118359/integrated Del: useless -- https://master.php.net/note/delete/118359/useless Del: bad code -- https://master.php.net/note/delete/118359/bad+code Del: spam -- https://master.php.net/note/delete/118359/spam Del: non-english -- https://master.php.net/note/delete/118359/non-english Del: in docs -- https://master.php.net/note/delete/118359/in+docs Del: other reasons-- https://master.php.net/note/delete/118359 Reject -- https://master.php.net/note/reject/118359 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#204206) next »