Permalink
Browse files

Added token generation logic

  • Loading branch information...
1 parent ea97f85 commit 45c289a5d04b4e9d6a43d2e73632be8f6c346bb1 @craig552uk committed Jan 16, 2011
Showing with 12 additions and 4 deletions.
  1. +12 −4 raplet-login.php
View
@@ -26,11 +26,19 @@
$authenticated = (isset($data['dn'])) ? true : false;
if ($authenticated){
- // Get token
+ // Re-bind as privileged user
+ my_ldap_bind($conn);
+
+ // Get token from user data
$token = contains_token($data['tokens']);
- // Set new token if needed
- if (!is_string($token)) $token = gen_token($data['dn']);
- }
+
+ if (!is_string($token)){
+ // Create new token if needed
+ $token = gen_token($data['dn']);
+ // Save new token in LDAP directory
+ my_ldap_add_token($conn, $data['dn'], $token);
+ }
+ }
}
?>

0 comments on commit 45c289a

Please sign in to comment.