Proyectos de Subversion LeadersLinked - Services

Rev

Rev 187 | Rev 283 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 187 Rev 188
Línea 48... Línea 48...
48
        
48
        
-
 
49
        
Línea 49... Línea 50...
49
        
50
        
50
        
51
 
Línea 51... Línea 52...
51
 
52
        $this->hasNetwork = false;
52
        $this->hasNetwork = false;
53
        $networkMapper = NetworkMapper::getInstance($adapter);
53
        
54
        
Línea 54... Línea 55...
54
        
55
        
-
 
56
        $request_uri = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI'];
55
        $request_uri = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI'];
57
        if($request_uri) {
-
 
58
            
-
 
59
            if(substr($request_uri, 0, 1) == '/') {
-
 
60
                $request_uri = substr($request_uri, 1);
-
 
61
            }
-
 
62
        
-
 
63
            $parts = explode('/', $request_uri);
Línea 56... Línea -...
56
        if($request_uri) {
-
 
Línea 57... Línea -...
57
            
-
 
-
 
64
            if($parts[0] == 'services') {
Línea 58... Línea 65...
58
            if(substr($request_uri, 0, 1) == '/') {
65
                
59
                $request_uri = substr($request_uri, 1);
-
 
60
            }
66
                $this->network = $networkMapper->fetchOneByDefault();
61
        
-
 
62
        $parts = explode('/', $request_uri);
-
 
63
        
-
 
64
        
-
 
65
        echo $request_uri . '<br>';
-
 
66
        
67
                if($this->network) {
67
        print_r($parts); exit;
68
                    $this->hostname = $this->network->main_hostname;
68
        
69
                    $this->hasNetwork = true;
Línea 69... Línea 70...
69
        }
70
                }
70
        
-
 
71
        
71
            }
72
        
-
 
73
        
-
 
74
        
-
 
75
        $hostname = empty($_SERVER['HTTP_ORIGIN']) ? '' : $_SERVER['HTTP_ORIGIN'];
72
        
76
        
-
 
77
        if(empty($hostname)) {
-
 
78
        
-
 
79
            $hostname = empty($_SERVER['HTTP_REFERER']) ?  '' : $_SERVER['HTTP_REFERER'];
-
 
80
            
73
        
81
            if(empty($hostname)) {
74
       
82
                $hostname = empty($_SERVER['HTTP_HOST']) ?  '' : $_SERVER['HTTP_HOST'];
-
 
83
    
-
 
84
            }
-
 
85
        }
75
        
86
        
-
 
87
        $hostname = trim(str_replace(['https://', 'http://'], '', $hostname));
-
 
88
        
-
 
89
        
-
 
Línea 90... Línea 76...
90
        //echo $hostname; exit;
76
        }
-
 
77
       
-
 
78
        if(!$this->hasNetwork) {
-
 
79
            
-
 
80
            $hostname = empty($_SERVER['HTTP_ORIGIN']) ? '' : $_SERVER['HTTP_ORIGIN'];
Línea -... Línea 81...
-
 
81
            
-
 
82
            if(empty($hostname)) {
-
 
83
            
-
 
84
                $hostname = empty($_SERVER['HTTP_REFERER']) ?  '' : $_SERVER['HTTP_REFERER'];
-
 
85
                
-
 
86
                if(empty($hostname)) {
-
 
87
                    $hostname = empty($_SERVER['HTTP_HOST']) ?  '' : $_SERVER['HTTP_HOST'];
-
 
88
        
-
 
89
                }
-
 
90
            }
-
 
91
            
-
 
92
            $hostname = trim(str_replace(['https://', 'http://'], '', $hostname));
-
 
93
            
-
 
94
            
-
 
95
            //echo $hostname; exit;
91
        
96
            
92
 
97
    
-
 
98
            $parts = explode('/', $hostname);
93
        $parts = explode('/', $hostname);
99
            
94
        
100
            
Línea 95... Línea 101...
95
        
101
            
96
        
102
            $hostname = $parts > 1 ? $parts[0] : $hostname;