includes/pageutils.php
changeset 402 d907601ccad2
parent 401 6ae6e387a0e3
child 408 7ecbe721217c
equal deleted inserted replaced
401:6ae6e387a0e3 402:d907601ccad2
   697     if(getConfig('comments_need_login') == '2' && !$session->user_logged_in) _die('Access denied to post comments: you need to be logged in first.');
   697     if(getConfig('comments_need_login') == '2' && !$session->user_logged_in) _die('Access denied to post comments: you need to be logged in first.');
   698     if(getConfig('comments_need_login') == '1' && !$session->user_logged_in)
   698     if(getConfig('comments_need_login') == '1' && !$session->user_logged_in)
   699     {
   699     {
   700       if(!$captcha_code || !$captcha_id) _die('BUG: PageUtils::addcomment: no CAPTCHA data passed to method');
   700       if(!$captcha_code || !$captcha_id) _die('BUG: PageUtils::addcomment: no CAPTCHA data passed to method');
   701       $result = $session->get_captcha($captcha_id);
   701       $result = $session->get_captcha($captcha_id);
   702       if($captcha_code != $result) _die('The confirmation code you entered was incorrect.');
   702       if(strtolower($captcha_code) != strtolower($result)) _die('The confirmation code you entered was incorrect.');
   703     }
   703     }
   704     $text = RenderMan::preprocess_text($text);
   704     $text = RenderMan::preprocess_text($text);
   705     $name = $session->user_logged_in ? RenderMan::preprocess_text($session->username) : RenderMan::preprocess_text($name);
   705     $name = $session->user_logged_in ? RenderMan::preprocess_text($session->username) : RenderMan::preprocess_text($name);
   706     $subj = RenderMan::preprocess_text($subject);
   706     $subj = RenderMan::preprocess_text($subject);
   707     if(getConfig('approve_comments')=='1') $appr = '0'; else $appr = '1';
   707     if(getConfig('approve_comments')=='1') $appr = '0'; else $appr = '1';