yms/yms.php
changeset 6 c1b4f69c187e
parent 5 a917cbab0280
child 8 be4a5f24bb29
equal deleted inserted replaced
5:a917cbab0280 6:c1b4f69c187e
   386   </form>
   386   </form>
   387   <?php
   387   <?php
   388   $output->footer();
   388   $output->footer();
   389 }
   389 }
   390 
   390 
   391 // Add key that's already registered
   391 // Add key, using just an OTP
       
   392 // Requires the key to be in the database as client ID 0
   392 function page_Special_YMS_AddPreregisteredKey()
   393 function page_Special_YMS_AddPreregisteredKey()
   393 {
   394 {
   394   global $db, $session, $paths, $template, $plugins; // Common objects
   395   global $db, $session, $paths, $template, $plugins; // Common objects
   395   global $lang, $output;
   396   global $lang, $output;
   396   
   397   
   633   list($api_key) = $db->fetchrow_num();
   634   list($api_key) = $db->fetchrow_num();
   634   $db->free_result();
   635   $db->free_result();
   635   
   636   
   636   $api_key = yms_tobinary($api_key);
   637   $api_key = yms_tobinary($api_key);
   637   
   638   
       
   639   $validate_url = makeUrlComplete('Special', 'YubikeyValidate');
       
   640   $validate_url = preg_replace('/[?&]auth=[0-9a-f]+/', '', $validate_url);
       
   641   
   638   $output->header();
   642   $output->header();
   639   ?>
   643   ?>
   640   <div class="tblholder">
   644   <div class="tblholder">
   641   <table border="0" cellspacing="1" cellpadding="4">
   645   <table border="0" cellspacing="1" cellpadding="4">
   642   
   646   
   645     </tr>
   649     </tr>
   646     
   650     
   647     <tr>
   651     <tr>
   648       <td class="row2"><?php echo $lang->get('yms_lbl_client_id'); ?></td>
   652       <td class="row2"><?php echo $lang->get('yms_lbl_client_id'); ?></td>
   649       <td class="row1"><?php echo strval($yms_client_id); ?></td>
   653       <td class="row1"><?php echo strval($yms_client_id); ?></td>
       
   654     </tr>
       
   655     
       
   656     <tr>
       
   657       <td class="row2"><?php echo $lang->get('yms_lbl_validate_url'); ?></td>
       
   658       <td class="row1"><?php echo htmlspecialchars($validate_url); ?></td>
   650     </tr>
   659     </tr>
   651     
   660     
   652     <tr>
   661     <tr>
   653       <th colspan="2"><?php echo $lang->get('yms_th_api_key'); ?></th>
   662       <th colspan="2"><?php echo $lang->get('yms_th_api_key'); ?></th>
   654     </tr>
   663     </tr>
   885     
   894     
   886     echo 'ok';
   895     echo 'ok';
   887   }
   896   }
   888 }
   897 }
   889 
   898 
   890 // Add key, using just an OTP
       
   891 // Requires the key to be in the database as client ID 0
       
   892 
       
   893 // Client creation
   899 // Client creation
   894 function page_Special_YMSCreateClient()
   900 function page_Special_YMSCreateClient()
   895 {
   901 {
   896   global $db, $session, $paths, $template, $plugins; // Common objects
   902   global $db, $session, $paths, $template, $plugins; // Common objects
   897   global $lang;
   903   global $lang;