plugins/yubikey/auth.php
changeset 3 d0fe7acaf0e8
parent 2 6edc6ebb3b39
child 5 2114640729a5
equal deleted inserted replaced
2:6edc6ebb3b39 3:d0fe7acaf0e8
     1 <?php
     1 <?php
       
     2 
       
     3 if ( getConfig('yubikey_enable', '1') != '1' )
       
     4     return true;
     2 
     5 
     3 // hook into auth
     6 // hook into auth
     4 $plugins->attachHook('login_process_userdata_json', 'return yubikey_auth_hook_json($userinfo, $req["level"], @$req["remember"]);');
     7 $plugins->attachHook('login_process_userdata_json', 'return yubikey_auth_hook_json($userinfo, $req["level"], @$req["remember"]);');
     5 // hook into special page init
     8 // hook into special page init
     6 $plugins->attachHook('session_started', 'yubikey_add_special_pages();');
     9 $plugins->attachHook('session_started', 'yubikey_add_special_pages();');
   187 function yubikey_add_special_pages()
   190 function yubikey_add_special_pages()
   188 {
   191 {
   189   global $db, $session, $paths, $template, $plugins; // Common objects
   192   global $db, $session, $paths, $template, $plugins; // Common objects
   190   global $lang;
   193   global $lang;
   191   
   194   
       
   195   if ( getConfig('yubikey_enable', '1') != '1' )
       
   196     return true;
       
   197   
   192   $paths->add_page(array(
   198   $paths->add_page(array(
   193       'name' => $lang->get('yubiauth_specialpage_yubikey'),
   199       'name' => $lang->get('yubiauth_specialpage_yubikey'),
   194       'urlname' => 'Yubikey',
   200       'urlname' => 'Yubikey',
   195       'namespace' => 'Special',
   201       'namespace' => 'Special',
   196       'visible' => 0, 'protected' => 0, 'comments_on' => 0, 'special' => 0
   202       'visible' => 0, 'protected' => 0, 'comments_on' => 0, 'special' => 0