714 Views
To clear the user access log in VtigerCRM 7.3 (open source), you’ll need to delete the entries from the vtiger_loginhistory
table, which stores the user access logs.
Here’s how you can do it:
Method 1: Using phpMyAdmin or MySQL CLI
- Access the Database:
- Open phpMyAdmin or connect to your MySQL database using a command-line interface.
2. Select the Vtiger Database:
- Use the following SQL command to select the database (replace
your_database_name
with your actual Vtiger database name):
USE your_database_name;
- Clear the User Access Log:
- Run the following SQL command to delete all records from the
vtiger_loginhistory
table:
DELETE FROM vtiger_loginhistory;
- Optimize the Table (Optional):
- You can optimize the table after deleting the records to reclaim storage space:
OPTIMIZE TABLE vtiger_loginhistory;
Method 2: Using a Custom Script
If you prefer not to use the database directly, you can create a custom PHP script to clear the user access logs:
- Create a PHP Script:
- Create a new PHP file (e.g.,
clear_user_access_log.php
) in the root directory of your Vtiger installation.
2. Add the Following Code to the PHP Script:
<?php
require_once 'includes/main/WebUI.php';
global $adb;
// Clear the user access log
$query = "DELETE FROM vtiger_loginhistory";
$adb->pquery($query, array());
echo "User access log cleared successfully.";
?>
- Run the Script:
- Execute the script by accessing it via a web browser:
http://your-crm-url/clear_user_access_log.php
- Delete the Script:
- For security reasons, remove the script after you have successfully run it.
Important Notes
- Backup Your Database: Before performing any deletion operation, make sure to backup your database to avoid accidental data loss.
- Permissions: Ensure that the database user has the necessary permissions to delete records from the table.
By following either method, you can clear the user access log in Vtiger CRM 7.3.
Conclusion
To easily clear the log-in access of a user in Vtiger CRM 7.3 (basically an open source), you just have to delete all the entries from the table named vtiger_loginhistory, which usually contains the logs of user access with the best Vtiger hosting solutions.