pearweb_manual
[ class tree: pearweb_manual ] [ index: pearweb_manual ] [ all elements ]

Source for file add-note-form.php

Documentation is available at add-note-form.php

  1. <?php
  2. /**
  3.  * Let's define some sample errors so
  4.  * it's easier to maintain later on..
  5.  */
  6. define ('NOTE_ADD_ERROR_NO_URI', 'No URI passed to the form');
  7.  
  8. require_once 'Services/ReCaptcha.php';
  9.  
  10. $captcha = new Services_ReCaptcha(PEAR_RECAPTCHA_PUBLIC_KEY, PEAR_RECAPTCHA_PRIVATE_KEY);
  11.  
  12.  
  13. /**
  14.  * This parameter should be passed from the
  15.  * template manual with basically the
  16.  * $_SERVER['REQUEST_URI'] in the uri get
  17.  * parameter.
  18.  */
  19. if (!isset($_GET['uri'])) {
  20.     $error = NOTE_ADD_ERROR_NO_URI;
  21. }
  22.  
  23. $loggedin = isset($auth_user) && $auth_user->registered;
  24. $email = 'user@example.com';
  25. $note = '';
  26. $noteUrl   = strip_tags($_GET['uri']);
  27. $redirect  = strip_tags($_GET['redirect']);
  28. if (!$loggedin) {
  29.     $spamCheck = $captcha->getOperation();
  30.     $_SESSION['answer'] = $captcha->getAnswer();
  31. }
  32.  
  33. // Template of the form to add a note
  34. require PEARWEB_TEMPLATEDIR . '/notes/add-note-form.tpl.php';

Documentation generated on Mon, 11 Mar 2019 16:04:25 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.