2

I have to modify the password of an account on a vtiger crm. The problem is that I don't know the location of the database. Anyone know the path of the database containing the credential of the users?

4 Answers 4

4

If your username starts with 'ad' like 'admin'. use the following mysql query

UPDATE vtiger_users SET user_password = '$1$ad000000$mnnPAFfqzJOuoYY7aB.mR0' WHERE user_name='admin';

This query will reset the password for user with admin username. The password will be set to password.

Vtiger use encrypt_password function in Users.php on line 264 to encrypt user password.

modules/Users/Users.php

It use crypt_type and username for encrypt new passwords. so Mysql query only work if your username starts with ad for example 'admin' , 'adam' and etc.

function encrypt_password($user_password, $crypt_type='') {
// encrypt the password.
$salt = substr($this->column_fields["user_name"], 0, 2);

// Fix for: http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/4923
if($crypt_type == '') {
    // Try to get the crypt_type which is in database for the user
    $crypt_type = $this->get_user_crypt_type();
}

// For more details on salt format look at: http://in.php.net/crypt
if($crypt_type == 'MD5') {
    $salt = '$1$' . $salt . '$';
} elseif($crypt_type == 'BLOWFISH') {
    $salt = '$2$' . $salt . '$';
} elseif($crypt_type == 'PHP5.3MD5') {
    //only change salt for php 5.3 or higher version for backward
    //compactibility.
    //crypt API is lot stricter in taking the value for salt.
    $salt = '$1$' . str_pad($salt, 9, '0');
}

$encrypted_password = crypt($user_password, $salt);
return $encrypted_password;
}

You can use the following tools on Github. it can change all users password without login into crm and phpmyadmin and update vtiger user privileges file. https://github.com/spadana2004/Vtiger-CRM-Reset-Password-Tools

0
3

Go to My preferences(right top of the browser). There you can change the password of the user.

In database you can't change bcoz there it will be converted to MD5. Then also for your kind information in database check the table vtiger_users for user detail.

1
update vtiger_users set user_password = 'adpexzg3FUZAk', crypt_type = '' where id = '1';

Login: admin Password:admin

0

To make this really easy for admins I created a simple gist that will generate the sql query you need to run to reset a password with any username. Just put in the username and temp password, then run the script and use the SQL it provides. After that just login with that username and password. It is tested with and working on VTiger 7.2.

https://gist.github.com/mav2287/59d5587c7efabdbb105b739c4bc27cb5

<?php
// Put in your username as found in the "vtiger_users" table under the "username" column
$user_name = "";
// Set your TEMPORARY password. You NEED to reset your password after using this to reset it.
$user_password = "password";

// return the approiate stamtent
echo "Run the following SQL query to reset your password: \n";
echo "\"UPDATE vtiger_users SET user_password='".crypt($user_password, substr($user_name, 0, 2))."',crypt_type=''WHERE user_name='".$user_name."'\"";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.