/[volute]/trunk/projects/grid/vospace/php_endpoint/backends/file_system/vospace.php
ViewVC logotype

Diff of /trunk/projects/grid/vospace/php_endpoint/backends/file_system/vospace.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 737 by richard.p.wagner, Wed Aug 20 00:20:45 2008 UTC revision 738 by richard.p.wagner, Thu Aug 21 21:45:51 2008 UTC
# Line 8  Line 8 
8    
9  class VOSpace {  class VOSpace {
10    
11      private $AuthInfo;
12    
13      function __construct(){
14        $this->AuthInfo = array('username' => Null,
15                                'password' => Null,
16                                'authenticated' => False);
17      }
18    
19      function getAuthInfo( $sec_header ) {
20    
21        $p = xml_parser_create();
22        xml_parse_into_struct($p, $sec_header->any, $vals, $index);
23        xml_parser_free($p);
24    
25        $username = '';
26        $password = '';
27        foreach( $vals as $element){
28          if( strpos($element['tag'],  "USERNAMETOKEN") === FALSE ){
29            if( strpos($element['tag'],  "USERNAME") !== FALSE )
30              $this->AuthInfo['username']  = $element['value'];
31            if( strpos($element['tag'],  "PASSWORD") !== FALSE )
32              $this->AuthInfo['password'] = $element['value'];
33          }
34        }
35    
36        if( $this->AuthInfo['username'] == 'joe' &&
37            $this->AuthInfo['password'] == 'doe' ){
38          $this->AuthInfo['authenticated'] = True;
39        }else{
40          throw new SoapFault("Server", "Not authenticated.", " ",
41                              array(),
42                              "NotAuthenticatedFault");
43        }
44      }
45    
46      function getAuthorization($method_name){
47        if( $this->AuthInfo['username'] == 'joe'
48            && $method_name == 'GetProperties')
49          return False;
50        else
51          return True;
52      }
53    
54    function getViews(){    function getViews(){
55      global $provided_views;      global $provided_views;
56      global $accepted_views;      global $accepted_views;

Legend:
Removed from v.737  
changed lines
  Added in v.738

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26