I'd like to know how to prevent users from opening multiple tickets. I've already tried this and it doesnt seem to work. I was able to open multiple tickets and have seen others do so. I've changed all the 3's to 1's and then 2's nothing seems to work.
1. Paste the following below the hesk_dbConnect(); in the submit_ticket.php
$sql = "SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` WHERE `status` != '3' AND (`email` LIKE '".hesk_dbEscape($email)."' OR `ip` LIKE '".hesk_dbEscape($_SERVER['REMOTE_ADDR'])."')";
$res = hesk_dbQuery($sql);
if (hesk_dbNumRows($res) >= 3)
{
hesk_error("You can have maximum 3 open tickets at a time!");
}
Paste it just below: Code:
hesk_dbConnect();
2. To limit the number of tickets to one change all the 3's to 1's
Limit the number of open tickets
Moderator: mkoch227
What version are you using?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 65
- Joined: Sat Aug 15, 2009 9:38 pm
I just tested version 2.1 and this code works fine for me - it doesn't allow more than 3 open tickets. Just make 100% sure you paste it BELOW hesk_dbConnect();
Code: Select all
$sql = "SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` WHERE `status` != '3' AND (`email` LIKE '".hesk_dbEscape($email)."' OR `ip` LIKE '".hesk_dbEscape($_SERVER['REMOTE_ADDR'])."')";
$res = hesk_dbQuery($sql);
if (hesk_dbNumRows($res) > 2)
{
hesk_error("You can have maximum 3 open tickets at a time!");
}
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 65
- Joined: Sat Aug 15, 2009 9:38 pm
Yes, but they probably used a different e-mail address? Or they re-opened a ticket that was already closed in the past?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 65
- Joined: Sat Aug 15, 2009 9:38 pm
-
- Posts: 65
- Joined: Sat Aug 15, 2009 9:38 pm
$sql = "SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` WHERE `status` != '2' AND (`email` LIKE '".hesk_dbEscape($email)."' OR `ip` LIKE '".hesk_dbEscape($_SERVER['REMOTE_ADDR'])."')";
$res = hesk_dbQuery($sql);
if (hesk_dbNumRows($res) >= 1)
{
hesk_error("You can have maximum 1 open tickets at a time!");
}
THIS IS THE CORRECT CODE
$res = hesk_dbQuery($sql);
if (hesk_dbNumRows($res) >= 1)
{
hesk_error("You can have maximum 1 open tickets at a time!");
}
THIS IS THE CORRECT CODE
Wait, wait, this is the first time you made sense now - you are talking about reopening tickets now, not opening new ones!
If you want to prevent them to REopen more than XY tickets you will need to add the same ticket checking code into the change_status.php file i n line 65, just above:
$status = 1;
If you want to prevent them to REopen more than XY tickets you will need to add the same ticket checking code into the change_status.php file i n line 65, just above:
$status = 1;
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools