Page 1 of 1

Tracking ID

Posted: Fri Jun 25, 2010 11:37 am
by shill58
Script URL: http://www.hesk.com
Version of script:2.2


Write your message below: Is there a way to change the tracking ID to like $trackingID .= date('ymdGi'); in previous Version: 0.94.1 @ October 25, 2007 this is the code i modified the code but now it will not work with new version
/* Generate tracking ID */
/*
$useChars='AEUYBDGHJLMNPQRSTVWXZ123456789';
$trackingID = $useChars{mt_rand(0,29)};
for($i=1;$i<18;$i++)
*/
{
/* $trackingID .= $useChars{mt_rand(0,29)};*/
$trackingID= $trackingID .= date('ymdGi');

Posted: Fri Jun 25, 2010 11:46 am
by Klemen
If you change

Code: Select all

/* Generate tracking ID and make sure it's not a duplicate one */
$useChars = 'AEUYBDGHJLMNPQRSTVWXZ123456789';
$trackingID = $useChars{mt_rand(0,29)};
for($i=1;$i<10;$i++)
{
	$trackingID .= $useChars{mt_rand(0,29)};
}
to

Code: Select all

/* Generate tracking ID and make sure it's not a duplicate one */
$trackingID= date('ymdGi');
it should work.

But you do realize you will only be able to create ONE ticket per minute and it is easy for anyone to guess the ticket ID this way?

Good Point

Posted: Fri Jun 25, 2010 12:00 pm
by shill58
your right were not that secure here, but i did not think about only a ticket a minute.

Thanks for such awesome work you do!

Posted: Fri Jun 25, 2010 12:07 pm
by shill58
changed it to /* Generate tracking ID and make sure it's not a duplicate one */
$trackingID= date('ymdGii');

the extra i put in the second

Ticket subject: test
Tracking ID: 10062570505
Name: Shannon Hill

Posted: Fri Jun 25, 2010 3:39 pm
by Klemen
Note: ticket ID can be maximum 10 chars long, longer chars will be truncated to 10 unless you change the mySQL setup to accept longer strings for the tracking id.

Posted: Fri Jun 25, 2010 3:40 pm
by shill58
I have it accepting 18 characters