Page 1 of 1

duplicate user name

Posted: Tue Oct 21, 2008 7:25 am
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

Posted: Wed Oct 22, 2008 5:40 pm
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!');
}