summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael pereira2012-02-27 02:16:05 +0100
committermichael pereira2012-02-27 02:16:05 +0100
commit54ab65d32f5fe458dc491b19d5ae631b86bcac7a (patch)
treea57dd091e93a00b3ab3690e73e45bfea8279b53b
parentadded certificate DB (diff)
downloadpbs2-54ab65d32f5fe458dc491b19d5ae631b86bcac7a.tar.gz
pbs2-54ab65d32f5fe458dc491b19d5ae631b86bcac7a.tar.xz
pbs2-54ab65d32f5fe458dc491b19d5ae631b86bcac7a.zip
certificate auth
-rw-r--r--application/modules/fbgui/controllers/AuthController.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/application/modules/fbgui/controllers/AuthController.php b/application/modules/fbgui/controllers/AuthController.php
index 5757b51..c9f750a 100644
--- a/application/modules/fbgui/controllers/AuthController.php
+++ b/application/modules/fbgui/controllers/AuthController.php
@@ -27,7 +27,21 @@ class Fbgui_AuthController extends Zend_Controller_Action {
$this->_redirect('/fbgui/');
}
elseif($_SERVER['SSL_CLIENT_VERIFY'] === 'SUCCESS'){
- print_a($_SERVER);
+ $serial = $_SERVER['SSL_CLIENT_M_SERIAL'];
+ $issuerdn = $_SERVER['SSL_CLIENT_I_DN'];
+ $certificatemapper = new Application_Model_CertificateMapper();
+ $certificate = $certificatemapper->findBy(array('serial' => $serial, 'issuerdn' => $issuerdn));
+ if(isset($certificate)){
+ if (!$certificate->getRevoked() && !$certificate->getGuestcert() && ($certificate->getExpiredate() - time()) > 0){
+ $person = $this->personmapper->find($certificate->getPersonID());
+ $date = new DateTime();
+ $person->setLogindate($date->getTimestamp());
+ $this->personmapper->save($person);
+ $this->_helper->redirector('selectmembership', 'person');
+ return;
+ }
+ }
+ $this->_redirect('/fbgui/');
}
else {
@@ -66,7 +80,7 @@ class Fbgui_AuthController extends Zend_Controller_Action {
}
}
}
-// $this->view->loginForm = $loginForm;
+ $this->view->loginForm = $loginForm;
}
}