public
Description: Midgard Components Framework 3rd generation
Homepage: http://www.midgard-project.org
Clone URL: git://github.com/bergie/midcom.git
Check for basic auth when starting the authentication service
bergie (author)
Fri Apr 04 05:14:08 -0700 2008
commit  d50b10c59ab235bd56d88ffd8e1bf0b83631eb50
tree    6165d19d00765d2884d94354ad2d1336b954dfc6
parent  4265f6478a9d0b7791e1000f20ac16d014cf2d6e
...
30
31
32
33
 
34
35
36
...
30
31
32
 
33
34
35
36
0
@@ -30,7 +30,7 @@ class midcom_core_controllers_page
0
         }
0
         $data['page'] = new midgard_page();
0
         $data['page']->get_by_id($_MIDGARD['page']);
0
-
0
+
0
         $_MIDCOM->authorization->require_do('midgard:update', $data['page']);
0
 
0
         if (isset($_POST['save']))
...
15
16
17
 
 
18
19
20
...
15
16
17
18
19
20
21
22
0
@@ -15,6 +15,8 @@ interface midcom_core_services_authentication
0
 {
0
     public function get_person();
0
     
0
+ public function is_user();
0
+
0
     public function login($username, $password);
0
     
0
     public function logout();
...
15
16
17
18
 
 
 
 
 
 
 
 
 
19
20
21
 
 
 
 
 
 
 
 
 
 
22
23
24
...
15
16
17
 
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
0
@@ -15,10 +15,28 @@ class midcom_core_services_authentication_basic implements midcom_core_services_
0
 {
0
     private $user = null;
0
     
0
- public function get_person()
0
+ public function __construct()
0
+ {
0
+ if (isset($_SERVER['PHP_AUTH_USER']))
0
+ {
0
+ $this->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
0
+ }
0
+ }
0
+
0
+ public function is_user()
0
     {
0
         if (!$this->user)
0
         {
0
+ return false;
0
+ }
0
+
0
+ return true;
0
+ }
0
+
0
+ public function get_person()
0
+ {
0
+ if (!$this->is_user())
0
+ {
0
             return null;
0
         }
0
         
...
92
93
94
95
 
96
97
98
...
92
93
94
 
95
96
97
98
0
@@ -92,7 +92,7 @@ class midcom_core_services_authorization_simple implements midcom_core_services_
0
             return true;
0
         }
0
 
0
- if ($_MIDGARD['user'])
0
+ if ($_MIDCOM->authentication->is_user())
0
         {
0
             return true;
0
         }

Comments

    No one has commented yet.