User Ticket Delete Function Disable *RESOLVED*

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Crunch
Posts: 15
Joined: Mon Aug 06, 2007 11:32 am

User Ticket Delete Function Disable *RESOLVED*

Post by Crunch »

What terms did you try when SEARCHING for a solution: user delete

Write your message below:

Great script.... Thanks, I think our club has found a simple solution to its simple HelpDesk. It has been in use for a couple of weeks now. First some praise for your script.

Our club has been using PerlDesk for about 4 years and it is many upgrades behind. I wanted something a little more simple to install for our move to a new host. Perldesk had two problems for us. #1 - To have a 'Username assigned to a ticket' the person had to register, or all those tickets had a username 'unassigned'. We then manually added the username. A lot of work for someone just wanting to ask the club a simple question. #2 Email Piping for our email notifications was starting to get hit by spam and I was tired of changing the email address to stay ahead of it. I see where people have asked for piping and it is a good feature, if no-one ever finds out what the email address is. Anyway back to Hesk....

I did a search and found the following post from Sat Jul 30, 2005.
viewtopic.php?t=268&highlight=user+delete

Answer was
Not without editing the source code...
I also see it asked for in the 'new features' list.

So is there a quick way to just disable delete function totally.
It will be a pain if one of the committee members deletes a ticket that we have no way to get back.

Is it possible to just remove it from the drop down box so no one can delete a ticket. I tried to look at the code but got lost.......

I was thinking I would keep two copies of the page the code is changed on and just revert to the 'delete page' now and then when I want to clean up as Admin.

Thanks Kevin
Last edited by Crunch on Tue Aug 07, 2007 11:10 am, edited 2 times in total.
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Thanks for the kudos.

I tend to give more and more of these "Can this been done..." questions the answer "yes, if you can edit the code" because:
a) it's true and
b) I don't have the time to hear to all the requests, because I'm (as mentioned many times here before :wink: ) currently writing my diploma and that takes a lot of time.

When I look at it, this one might be quite simple: try adding

Code: Select all

hesk_error('This function has been disabled!');
to file delete_tickets.php just below line 39

Code: Select all

hesk_isLoggedIn();  
That might do the trick, but haven't tested it.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image 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
Crunch
Posts: 15
Joined: Mon Aug 06, 2007 11:32 am

Post by Crunch »

Thanks for the time to provide a quick fix. Did as you said in delete_tickets.php

:D Perfect.

Now I can just comment out line when I want to do a cleanup.

Code: Select all

/* Get all the required files and functions */
require_once('hesk_settings.inc.php');
require_once('language/'.$hesk_settings['language'].'.inc.php');
require_once('inc/common.inc.php');
hesk_session_start();
hesk_isLoggedIn();

/* next line HESK_ERROR Disables Delete Function */
hesk_error('This function has been disabled!');

$random=rand(10000,99999);
And for those of you who may follow ......
As I am the only one with Admin privileges I may change the error message from 'This function has been disabled!'
to ' Delete Function only available to Admin!'

Thanks Kevin
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

You're welcome.

Note: if you're the only admin, you can use this code

Code: Select all

hesk_isAdmin();
instead of

Code: Select all

hesk_error('This function has been disabled!');
. This will make sure deleting tickets still works, but only for admins (not regular staff).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image 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
Crunch
Posts: 15
Joined: Mon Aug 06, 2007 11:32 am

Disable Delete Function for Admin Only * RESOLVED *

Post by Crunch »

Sweet :D

Thankyou for this.

In file delete_tickets.php

Code: Select all

/* Get all the required files and functions */
require_once('hesk_settings.inc.php');
require_once('language/'.$hesk_settings['language'].'.inc.php');
require_once('inc/common.inc.php');
hesk_session_start();
hesk_isLoggedIn();

/* next line HESK_ERROR Disables Ticket Delete Function Fully */
/* hesk_error(''This function has been disabled!'); */

/* next line HESK_ISADMIN Disables Ticket Delete Function for all but Admin */
hesk_isAdmin();

$random=rand(10000,99999);
Kevin
Post Reply