recovering admin password

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
vexal
Posts: 4
Joined: Wed Jan 28, 2009 5:04 pm

recovering admin password

Post by vexal »

is there any way that I can recover the admin password?
short of a new install?
thanks
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

1. Save this code as a PHP file (like reset_pass.php):

Code: Select all

<?php
define('IN_SCRIPT',1);
define('HESK_PATH','');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'language/'.$hesk_settings['language'].'.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/database.inc.php');

hesk_dbConnect();

$sql = "UPDATE `".$hesk_settings['db_pfix']."users` SET `pass`='499d74967b28a841c98bb4baaabaad699ff3c079' WHERE `id`=1 LIMIT 1";
hesk_dbQuery($sql);

echo "Admin password reset to: admin";
?>
2. Upload it to your server in the Hesk folder
3. Open it in your browser, the main admin password will be reset to "admin"
4. delete the file from the server
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
vexal
Posts: 4
Joined: Wed Jan 28, 2009 5:04 pm

Post by vexal »

Klemen wrote:1. Save this code as a PHP file (like reset_pass.php):

Code: Select all

<?php
define('IN_SCRIPT',1);
define('HESK_PATH','');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'language/'.$hesk_settings['language'].'.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/database.inc.php');

hesk_dbConnect();

$sql = "UPDATE `".$hesk_settings['db_pfix']."users` SET `pass`='499d74967b28a841c98bb4baaabaad699ff3c079' WHERE `id`=1 LIMIT 1";
hesk_dbQuery($sql);

echo "Admin password reset to: admin";
?>
2. Upload it to your server in the Hesk folder
3. Open it in your browser, the main admin password will be reset to "admin"
4. delete the file from the server
Thanks - your method is cleaner than mine - I was going to created an 40 character hash string from a known password and the edited the mysql data directly.

This is a grete product!!
thanks
DanielWalters6
Posts: 12
Joined: Wed May 14, 2008 12:46 pm

Post by DanielWalters6 »

Vexel: I did just that too.

I'm working on a php page which will allow the administrator to list up to 30 usernames at a time, and by generating a 40 character hash like you described, assign them all a password.

I'm working on the code to email each of the new users with their new passwords.
DanielWalters6
Posts: 12
Joined: Wed May 14, 2008 12:46 pm

Post by DanielWalters6 »

DanielWalters6 wrote:Vexel: I did just that too.

I'm working on a php page which will allow the administrator to list up to 30 usernames at a time, and by generating a 40 character hash like you described, assign them all a password.

I'm working on the code to email each of the new users with their new passwords.
Thinking about it, I should really link into the core of hesk, and allow the assignment of categories for each aswell...
Post Reply