Changeset 1352 for feedmelinks/api/restricted
- Timestamp:
- 03/01/07 18:58:29 (2 years ago)
- Files:
-
- feedmelinks/api/restricted/secure-call.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedmelinks/api/restricted/secure-call.php
r1350 r1352 7 7 $u = $PHP_AUTH_USER ? $PHP_AUTH_USER : ( $user ? $user : $_COOKIE["c_uid"] ); 8 8 $tok = $authenticated = $_COOKIE["c_pass_token"]; 9 header( "Content-type: text/xml"); 9 10 10 11 if( $pass && $pass == getPasswdForUser( $u ) || ($tok && $tok == md5( getPasswdForUser( $u )))) { 11 12 12 13 if( ! isSuperUser( $u )) { 13 echo " This is a restricted API call. go away.";14 echo "<rest><response>This is a restricted API call. go away.</response></rest>"; 14 15 return; 15 16 } 16 17 17 header( "Content-type: text/xml"); 18 echo "<call>\n"; 18 echo "<rest>\n"; 19 19 echo " <request>$call($user)</request>\n"; 20 20 echo " <response>" . call_user_func( $call, $user ) . "</response>\n"; 21 echo "</ call>";21 echo "</rest>"; 22 22 23 if( $error ) {24 Header("HTTP/1.0 404 Not Found");25 echo $error;26 }27 23 } else { 28 header('WWW-Authenticate: Basic realm="Feed Me Links XMLAPI"');29 header('HTTP/1.0 401 Unauthorized');30 echo " login first, please.";24 header('WWW-Authenticate: Basic realm="Feed_Me_Links_XML_API"'); 25 #header('HTTP/1.0 401 Unauthorized'); 26 echo "<rest><response>login first, please.</response></rest>"; 31 27 } 32 28 ?>