Page 1 of 1

recovering admin password

Posted: Thu Jan 29, 2009 5:29 pm
by vexal
is there any way that I can recover the admin password?
short of a new install?
thanks

Posted: Thu Jan 29, 2009 6:37 pm
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

Posted: Thu Jan 29, 2009 7:43 pm
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

Posted: Fri Apr 03, 2009 9:46 am
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.

Posted: Fri Apr 03, 2009 9:47 am
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...