REPORT BUGS AND MISSPELLING HERE

Helpdesk for my helpdesk software

Moderator: mkoch227

Poooh
Posts: 8
Joined: Wed Apr 25, 2007 8:10 am

Post by Poooh »

Hi,

After upgrading a working installation it showed a blank page. The bug was in the hesk_settings.inc.php in this line:

Code: Select all

$hesk_settings['server_path']="/home/mysite/public_html/hesk";
I had an extra comma inserted and it looked like this:

Code: Select all

$hesk_settings['server_path']=''/home/mysite/public_html/hesk';
Could someone confirm this bug?

Thanks!
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Don't see a reason why this should happen, certainly not something I can find in the code. Anyone else experienced this?
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
tsjaar
Posts: 14
Joined: Wed May 23, 2007 7:33 am

Post by tsjaar »

Well, I know this is not really a bug, but when deleting a ticket, the attachments are not beeing deleted. Is this on purpose, or is this a feature :D ?

It's hard to find out what attachments can be deleted after a while.

Do you think you will be including this in a next version?

It should be something in delete_tickets.php. I think there are 2 options:
- Read the database for attachments (hesk_tickets, hesk_replies), and delete them one by one.
- Brute force read all files, and if a file starts with the ticket ID, delete it

Wich way do you think is faster? (probably depends on how many attachements there are)
tsjaar
Posts: 14
Joined: Wed May 23, 2007 7:33 am

Post by tsjaar »

I've been coding this bit for myself.
Can you tell me what you think of this solution?
delete_tickets.php

Code: Select all

$i=0;
$numFilesDeleted = 0;
$msgAttDeleted = '';
/* DELETE */
if ($_POST['a']=="delete") {
$title = $hesklang['tickets_deleted'];
$msg = $hesklang['num_tickets_deleted'];

    foreach ($_POST['id'] as $this_id)
    {
      $this_id=hesk_isNumber($this_id,$hesklang['id_not_valid']);
      
      //get track id for deleting attachments
      $sql = "SELECT trackid FROM `hesk_tickets` WHERE `id`=$this_id LIMIT 1";
      $result = hesk_dbQuery($sql) or hesk_error("$hesklang[cant_sql]: $sql</p><p>$hesklang[mysql_said]:<br>".mysql_error()."</p><p>$hesklang[contact_webmsater] $hesk_settings[webmaster_mail]");
      $ticket = hesk_dbFetchAssoc($result);
      $trackID = $ticket[trackid];
      
      $sql="DELETE FROM `hesk_tickets` WHERE `id`=$this_id LIMIT 1";
      hesk_dbQuery($sql) or hesk_error("$hesklang[cant_sql]: $sql</p><p>$hesklang[mysql_said]:<br>".mysql_error()."</p><p>$hesklang[contact_webmsater] $hesk_settings[webmaster_mail]");
      $sql="DELETE FROM `hesk_replies` WHERE `replyto`=$this_id";
      hesk_dbQuery($sql) or hesk_error("$hesklang[cant_sql]: $sql</p><p>$hesklang[mysql_said]:<br>".mysql_error()."</p><p>$hesklang[contact_webmsater] $hesk_settings[webmaster_mail]");
      $i++;

      //delete files starting with $this_id 
      if ($handle = opendir($hesk_settings['server_path'].'/attachments/')) {
        while (false !== ($file = readdir($handle))) {
          if (substr($file, 0, 11) == $trackID .'_') {
            $numFilesDeleted ++;
            unlink($hesk_settings['server_path'].'/attachments/'.$file);
          }
        }
        closedir($handle);
      }
    }
  $msgAttDeleted = ' (' . $hesklang['attachments'] . ':' . $numFilesDeleted . ')';
}
and add the message to the original message:

Code: Select all

<p align="center"><b><?php printf($msg,$i); echo $msgAttDeleted; ?>.</p>
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Will make something for the next version, until I do use whatever works for you :wink:

Reading names from DB and deleting the know files would probably be better than brute-force search of attachments folder.
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
crbmarketing
Posts: 4
Joined: Mon May 28, 2007 6:41 am

Post by crbmarketing »

I believe this is a bug.

we have the main administrator and more than one person doing support and each has assigned categories.

if an account is set as admin then they get notices of ALL mails it totally ignores the click here to be notified only of tickets to your categories option. if you are not admin then you cant access canned responses.

we have tried everything we can think of to fix it even adding the code for category to the submit and reply files in the main and mail folders. that just showed %%CATEGORIES%% in the emails is sent and not the actual category
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Admins have access to all categories (not just individual ones) so they are notified of all responses.

And yes, only admins have access to managing canned responses, you can allow all staff there by removing

Code: Select all

hesk_isAdmin();
from manage_canned.php

And where did you get the info that %%CATEGORIES%% actually shows category in the e-mail? It doesn't and it's not listed as a special tag in readme file. It needs editing to allow something like that, there's another post about it but still needs some work.
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
crbmarketing
Posts: 4
Joined: Mon May 28, 2007 6:41 am

Post by crbmarketing »

I found the tag $category in several places in the files so I
edited the submit_ticket.php file to ad this in both places
$message=str_replace('%%CATEGORY%%',$category,$message);

and placed this in new_ticket_staff.php
Category: %%CATEGORY%%

but when i get the email it shows Category: %%CATEGORY%% not the category like the other similar codes do.
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Well that isn't a bug with Hesk, it's a bug with YOUR modifications which don't work, so it doesn't belong to Hesk bug reports topic.

Just a a guideline you need to place $message=str_replace('%%CATEGORY%%',$category,$message); TWICE inside submit_ticket.php file. The first mail is generated for the customer, the second time it's for the staff (you probably only have it the first time).

Also that alone won't do, it will just print out category ID number, not name. You will also need this:
viewtopic.php?p=6316#6316
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
Phost
Posts: 6
Joined: Mon Jan 07, 2008 1:27 pm

It's not verry secure

Post by Phost »

(Removed by Klemen)
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

You are right, will add some checking in the next version. This shouldn't be viewable to all.
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
Phost
Posts: 6
Joined: Mon Jan 07, 2008 1:27 pm

Re: It's not verry secure

Post by Phost »

Phost wrote:(Removed by Klemen)
Always not fixed...

Please fixe it !
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

You can expect a new version hopefully by the end of February.
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
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

And before the new version is out you can use this fix:
http://www.phpjunkyard.com/extras/att_check.zip
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
tzes
Posts: 5
Joined: Wed Jun 18, 2008 9:41 am

small bug

Post by tzes »

Version 0941, os:Linux

if Ticket status is: Waiting reply from customer
and Staff or customer closes ticket, then reopens it
Status changes to: Waiting reply from staff
Post Reply