我必须修改 vtiger crm 上的帐户密码。问题是我不知道数据库的位置。有人知道包含用户凭据的数据库路径吗?
4 回答
如果您的用户名以“ad”开头,例如“admin”。使用以下 mysql 查询
UPDATE vtiger_users SET user_password = '$1$ad000000$mnnPAFfqzJOuoYY7aB.mR0' WHERE user_name='admin';
此查询将为具有管理员用户名的用户重置密码。密码将设置为password。
Vtiger 在第 264 行的 Users.php 中使用encrypt_password函数来加密用户密码。
modules/Users/Users.php
它使用 crypt_type 和 username 来加密新密码。所以 Mysql 查询仅在您的用户名以广告开头时才有效,例如 'admin' 、 'adam' 等。
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;
}
您可以在 Github 上使用以下工具。它可以在不登录 crm 和 phpmyadmin 的情况下更改所有用户密码并更新 vtiger 用户权限文件。 https://github.com/spadana2004/Vtiger-CRM-Reset-Password-Tools
转到我的首选项(浏览器的右上方)。在那里您可以更改用户的密码。
在数据库中,您无法更改 bcoz,它将被转换为 MD5。然后还要为您在数据库中的种类信息检查表 vtiger_users 以获取用户详细信息。
update vtiger_users set user_password = 'adpexzg3FUZAk', crypt_type = '' where id = '1';
登录名:admin 密码:admin
为了让管理员真正容易做到这一点,我创建了一个简单的 gist,它将生成您需要运行的 sql 查询,以使用任何用户名重置密码。只需输入用户名和临时密码,然后运行脚本并使用它提供的 SQL。之后,只需使用该用户名和密码登录即可。它在 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."'\"";