duplicate user name

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
ashercharles
Posts: 7
Joined: Tue Feb 05, 2008 6:17 am

duplicate user name

Post by ashercharles »

hai klenmen

well im facing a samll trouble out here ...
well there is a chance that a login is created for the the same user twice .....is there a fix to prevent repetition of username,category....

pls help
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Hi,

I'm aware of the problem and it's already fixed in the 0.95 version (which will probably be released by the end of this year). For now you can try fixing this manually by changing:

In manage_users.php change the FIRST (leave the second instance of this code intact)

Code: Select all

$myuser=hesk_validateUserInfo();
to

Code: Select all

$myuser = hesk_validateUserInfo();

$sql = "SELECT * FROM `hesk_users` WHERE `user` = '$myuser[user]' 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]");
if (hesk_dbNumRows($result) != 0)
{
    hesk_error('Duplicate username!');
}
This will take care of duplicate usernames. Similalry you can get rid of duplicate categories, in manage_categories.php change

Code: Select all

$catname=hesk_Input($_POST['name'],$hesklang['enter_cat_name']);
to

Code: Select all

$catname=hesk_Input($_POST['name'],$hesklang['enter_cat_name']);

$sql = "SELECT * FROM `hesk_categories` WHERE `name` = '$catname' 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]");
if (hesk_dbNumRows($result) != 0)
{
    hesk_error('Duplicate category name!');
}
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
Post Reply