enrollment.php 841 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. $cidReset = true;
  4. require_once __DIR__.'/../../main/inc/global.inc.php';
  5. api_block_anonymous_users(true);
  6. $userId = api_get_user_id();
  7. $plugin = WhispeakAuthPlugin::create();
  8. $plugin->protectTool();
  9. $sampleText = $plugin->get_lang('EnrollmentSampleText');
  10. $htmlHeadXtra[] = api_get_js('rtc/RecordRTC.js');
  11. $htmlHeadXtra[] = api_get_js_simple(api_get_path(WEB_PLUGIN_PATH).'whispeakauth/assets/js/RecordAudio.js');
  12. $template = new Template();
  13. $template->assign('is_authenticated', WhispeakAuthPlugin::checkUserIsEnrolled($userId));
  14. $template->assign('sample_text', $sampleText);
  15. $content = $template->fetch('whispeakauth/view/record_audio.html.twig');
  16. $template->assign('header', $plugin->get_title());
  17. $template->assign('content', $content);
  18. $template->display_one_col_template();