Basic authentication via X.org.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 25 May 2008 20:10:13 +0000 (22:10 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 25 May 2008 20:10:13 +0000 (22:10 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
class.xorg.auth.php

index 12d46ac..2bc1375 100644 (file)
@@ -3,14 +3,26 @@
 require_once dirname(__FILE__) . '/../../inc/core/class.dc.auth.php';
 
 class xorgAuth extends dcAuth {
+  public $xorg_infos = array('forlife' => null,
+                             'prenom' => null,
+                             'nom' => null);
+
+  public function __construct() {
+    @session_start();
+    if (@$_SESSION['auth-xorg']) {
+      foreach ($this->xorg_infos as $key => $val) {
+        $this->xorg_infos[$key] = $_SESSION['auth-xorg-' . $key];
+      }
+    }
+  }
+
   public function checkUser($user_id, $pwd = null, $user_key = null) {
-    echo 1;
 //    echo "checking auth for " . $user_id;
     return parent::checkUser($user_id, $pwd, $user_key);
   }
 
   public function check($permissions, $blog_id) {
-    echo "Checking right to view $permissions on $blog_id";
+//    echo "Checking right to view $permissions on $blog_id";
     return parent::check($permissions, $blog_id);
   }
 }