Ask not what osTicket community can do for you - ask what you can do for osTicket community

Go Back   osTicket Forums > Project Tools > osTicket Bug Tracker > Bug

Issue Type Bug   Project osTicket Bug Tracker
Captcha missing on client New Ticket submit
Category Unknown
Affected Version 1.6 Stable
Priority Unknown
Status Fixed
Fixed Version 1.6 Stable
Submitted 02-17-2010
Assigned Users (none) Tags (none)

issueid=182 02-17-2010 08:49 AM
Junior Member
Captcha missing on client New Ticket submit

When a client initially submits a ticket via the web, the captcha is visible. However, if they are logged in, viewing their tickets, and click the New Ticket icon to submit a ticket - the captcha is not visible and it's giving them an error and not allowing them to submit a ticket, due to the missing captcha.
Reply

02-17-2010 10:23 AM
Developer
 
This is totally my fault.

Open open.php and change the following code;

PHP Code:
    if($cfg->enableCaptcha()){
        if(!
$_POST['captcha'])
            
$errors['captcha']='Enter text shown on the image';
        elseif(
strcmp($_SESSION['captcha'],md5($_POST['captcha'])))
            
$errors['captcha']='Invalid - try again!';
    } 

To:

PHP Code:
    if($cfg->enableCaptcha() && !$thisclient){
        if(!
$_POST['captcha'])
            
$errors['captcha']='Enter text shown on the image';
        elseif(
strcasecmp($_SESSION['captcha'],md5($_POST['captcha'])))
            
$errors['captcha']='Invalid - try again!';
    } 
Please test it and let me know so I can push the changes to the main release.
Reply
02-17-2010 12:42 PM
Junior Member
 
Yes - that fixed it! Thank you!
Reply
03-02-2010 11:20 PM
Junior Member
 
Hi peter, thanks for this great software.

Right now i got the same problem of the missing captcha on client new ticket, I try to change the code you posted below, but it not seems to work.

I got this code in the open.php file

Code:
if(!$thisuser &&  $cfg->enableCaptcha()){
        if(!$_POST['captcha'])
            $errors['captcha']='Enter text shown on the image';
        elseif(strcmp($_SESSION['captcha'],md5($_POST['captcha'])))
            $errors['captcha']='Invalid - try again!';
    }
Thanks
Reply
03-05-2010 08:09 PM
Junior Member
 
I had the same problem, but I'm also using a clientside theme. Check the theme and see if it requires a variable to be enabled to show it. In my case:

clientt-hred/config.php

define('CTHEME_CAPTCHA',0);

to

define('CTHEME_CAPTCHA',1);

and now it works.
Reply
03-10-2010 02:23 AM
Junior Member
 
Quote:
Originally Posted by CoLo
Hi peter, thanks for this great software.

Right now i got the same problem of the missing captcha on client new ticket, I try to change the code you posted below, but it not seems to work.

I got this code in the open.php file

Code:
if(!$thisuser &&  $cfg->enableCaptcha()){
        if(!$_POST['captcha'])
            $errors['captcha']='Enter text shown on the image';
        elseif(strcmp($_SESSION['captcha'],md5($_POST['captcha'])))
            $errors['captcha']='Invalid - try again!';
    }
Thanks
I enforce captcha by following step:

Open open.inc.php and change the following code:
PHP Code:
if($cfg && $cfg->enableCaptcha() && (!$thisclient || !$thisclient->isValid())) { 
To:
PHP Code:
if($cfg && $cfg->enableCaptcha() && ($thisclient && $thisclient->isValid())) { 
Reply
03-10-2010 02:38 AM
Developer
 
@Dark - you code changes doesn't make sense - can you explain?

Captcha is suppose to show up for users who're NOT logged in not the other way round.
Reply
03-10-2010 03:50 AM
Junior Member
 
Sorry, I made a mistake...
I did not check my code for users who're not logged.

I got this code in the open.php file (osTicket 1.6 stable)
PHP Code:
if(!$thisuser &&  $cfg->enableCaptcha()){ 
Not
PHP Code:
if($cfg->enableCaptcha()){ 
Can I still replace with ' if($cfg->enableCaptcha() && !$thisclient){ ' ?
Reply
03-16-2010 10:23 PM
Junior Member
 
Hi,

Installed 1.0.6 stable and all looks great apart from no captcha image. This is a deal breaker for me as forms are dead in the water without them. Here's a couple of screen shots of my set up

Admin


Front end form


Have tried the installation 3 times now but still get no captcha image. I appreciate any advice.

Many thanks,

Terry
Reply
03-26-2010 12:12 PM
Junior Member
 
I have the same Problem but i habe the following Code in my open.php.

PHP Code:
<?php
/*********************************************************************
    open.php

    New tickets handle.

    Peter Rotich <peter@osticket.com>
    Copyright (c)  2006-2010 osTicket
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
    $Id: $
**********************************************************************/
require('client.inc.php');
define('SOURCE','Web'); //Ticket source.
$inc='open.inc.php';    //default include.
$errors=array();
if(
$_POST):
    
$_POST['deptId']=$_POST['emailId']=0//Just Making sure we don't accept crap...only topicId is expected.
    
if(!$thisuser && $cfg->enableCaptcha()){
        if(!
$_POST['captcha'])
            
$errors['captcha']='Geben Sie den im Bild angezeigten Text ein.';
        elseif(
strcmp($_SESSION['captcha'],md5($_POST['captcha'])))
            
$errors['captcha']='Falsche Eingabe - bitte nochmal versuchen!';
    }
    
//Ticket::create...checks for errors..
    
if(($ticket=Ticket::create($_POST,$errors,SOURCE))){
        
$msg='Supportticket wurde erstellt';
        if(
$thisclient && $thisclient->isValid()) //Logged in...simply view the newly created ticket.
            
@header('Location: tickets.php?id='.$ticket->getExtId());
        
//Thank the user and promise speedy resolution!
        
$inc='thankyou.inc.php';
    }else{
        
$errors['err']=$errors['err']?$errors['err']:'Ticket wurde nicht erstellt. Bitte korrigieren Sie die folgenden Fehler!';
    }
endif;

//page
require(CLIENTINC_DIR.'header.inc.php');
require(
CLIENTINC_DIR.$inc);
require(
CLIENTINC_DIR.'footer.inc.php');
?>
How can i fix it ?
Reply
04-12-2010 02:49 AM
Member
 
Terry222 Hello,

is installed on your server, the gd-library?
Reply

Issue Tools
Subscribe to this issue

All times are GMT -4. The time now is 12:12 PM.