Version Notes
Initial functionality is added in this module
Download this release
Release Info
Developer | Commerce Bees |
Extension | Admin_Activity_Logger |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- CommerceBees_Admin_Activity_Logger_Extension_Guide_V1.0.0 .pdf +0 -0
- app/code/community/Ameex/Adminlog/Block/Adminhtml/GridContainer.php +12 -0
- app/code/community/Ameex/Adminlog/Block/Adminhtml/GridContainer/Grid.php +88 -0
- app/code/community/Ameex/Adminlog/Helper/Data.php +4 -0
- app/code/community/Ameex/Adminlog/Model/Adminlog.php +9 -0
- app/code/community/Ameex/Adminlog/Model/Observer.php +116 -0
- app/code/community/Ameex/Adminlog/Model/Observer2.php +193 -0
- app/code/community/Ameex/Adminlog/Model/Observernew.php +49 -0
- app/code/community/Ameex/Adminlog/Model/Resource/Adminlog.php +8 -0
- app/code/community/Ameex/Adminlog/Model/Resource/Adminlog/Collection.php +8 -0
- app/code/community/Ameex/Adminlog/Model/Resource/Setup.php +4 -0
- app/code/community/Ameex/Adminlog/controllers/Adminhtml/AdminlogController.php +67 -0
- app/code/community/Ameex/Adminlog/etc/adminhtml.xml +43 -0
- app/code/community/Ameex/Adminlog/etc/config.xml +77 -0
- app/code/community/Ameex/Adminlog/etc/system.xml +50 -0
- app/code/community/Ameex/Adminlog/sql/adminlog_setup/install-1.0.0.php +33 -0
- app/etc/modules/Ameex_Adminlog.xml +8 -0
- package.xml +19 -0
CommerceBees_Admin_Activity_Logger_Extension_Guide_V1.0.0 .pdf
ADDED
Binary file
|
app/code/community/Ameex/Adminlog/Block/Adminhtml/GridContainer.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ameex_Adminlog_Block_Adminhtml_GridContainer extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_controller='adminhtml_gridContainer';
|
7 |
+
$this->_blockGroup='adminlog';
|
8 |
+
$this->_headerText=Mage::helper('adminlog')->__('Admin activity log manager');
|
9 |
+
parent::__construct();
|
10 |
+
$this->_removeButton('add');
|
11 |
+
}
|
12 |
+
}
|
app/code/community/Ameex/Adminlog/Block/Adminhtml/GridContainer/Grid.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ameex_Adminlog_Block_Adminhtml_GridContainer_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setId('adminlog_grid');
|
8 |
+
$this->setDefaultSort('logged_at');
|
9 |
+
$this->setDefaultDir('DESC');
|
10 |
+
$this->setSaveParametersInSession(true);
|
11 |
+
$this->setUseAjax(true);
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _prepareCollection()
|
15 |
+
{
|
16 |
+
$collection=Mage::getModel('adminlog/adminlog')->getCollection();
|
17 |
+
$this->setCollection($collection);
|
18 |
+
return parent::_prepareCollection();
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function _prepareColumns()
|
22 |
+
{
|
23 |
+
$this->addColumn('logged_at', array(
|
24 |
+
'header' => Mage::helper('adminlog')->__('Logged At'),
|
25 |
+
'type' => 'datetime',
|
26 |
+
'index' => 'logged_at',
|
27 |
+
'gmtoffset' => true
|
28 |
+
));
|
29 |
+
|
30 |
+
$this->addColumn('user_email', array(
|
31 |
+
'header' => Mage::helper('adminlog')->__('User Email'),
|
32 |
+
'index' => 'user_email'
|
33 |
+
));
|
34 |
+
|
35 |
+
$this->addColumn('full_path', array(
|
36 |
+
'header' => Mage::helper('adminlog')->__('Full Path'),
|
37 |
+
'index' => 'full_path'
|
38 |
+
));
|
39 |
+
|
40 |
+
$this->addColumn('controller_name', array(
|
41 |
+
'header' => Mage::helper('adminlog')->__('Viewed Section'),
|
42 |
+
'index' => 'controller_name'
|
43 |
+
));
|
44 |
+
|
45 |
+
$this->addColumn('action', array(
|
46 |
+
'header' => Mage::helper('adminlog')->__('Action'),
|
47 |
+
'index' => 'action'
|
48 |
+
));
|
49 |
+
|
50 |
+
$this->addColumn('additional_info', array(
|
51 |
+
'header' => Mage::helper('adminlog')->__('Additional Information'),
|
52 |
+
'index' => 'additional_info'
|
53 |
+
));
|
54 |
+
|
55 |
+
$this->addColumn('store_name', array(
|
56 |
+
'header' => Mage::helper('adminlog')->__('Store Name'),
|
57 |
+
'index' => 'store_name'
|
58 |
+
));
|
59 |
+
|
60 |
+
$this->addColumn('remote_ip', array(
|
61 |
+
'header' => Mage::helper('adminlog')->__('IP Address'),
|
62 |
+
'index' => 'remote_ip'
|
63 |
+
));
|
64 |
+
|
65 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('adminlog')->__('CSV'));
|
66 |
+
$this->addExportType('*/*/exportXml', Mage::helper('adminlog')->__('XML'));
|
67 |
+
$this->addExportType('*/*/exportExcel', Mage::helper('adminlog')->__('EXCEL'));
|
68 |
+
|
69 |
+
return parent::_prepareColumns();
|
70 |
+
}
|
71 |
+
|
72 |
+
public function getGridUrl()
|
73 |
+
{
|
74 |
+
return $this->getUrl('*/*/grid', array('_current'=>true));
|
75 |
+
}
|
76 |
+
|
77 |
+
protected function _prepareMassaction()
|
78 |
+
{
|
79 |
+
$this->setMassactionIdField('id');
|
80 |
+
$this->getMassactionBlock()->setFormFieldName('id');
|
81 |
+
$this->getMassactionBlock()->setUseSelectAll(false);
|
82 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
83 |
+
'label'=> Mage::helper('adminlog')->__('Delete Logs'),
|
84 |
+
'url' => $this->getUrl('*/adminlog/massDelete'),
|
85 |
+
));
|
86 |
+
return $this;
|
87 |
+
}
|
88 |
+
}
|
app/code/community/Ameex/Adminlog/Helper/Data.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ameex_Adminlog_Helper_data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
}
|
app/code/community/Ameex/Adminlog/Model/Adminlog.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ameex_Adminlog_Model_Adminlog extends Mage_Core_Model_Abstract
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->_init('adminlog/adminlog');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Ameex/Adminlog/Model/Observer.php
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ameex_Adminlog_Model_Observer
|
4 |
+
{
|
5 |
+
|
6 |
+
public function getLog()
|
7 |
+
{
|
8 |
+
//echo "<pre>";
|
9 |
+
$request = Mage::app()->getRequest();
|
10 |
+
$actionName = $request->getActionName();
|
11 |
+
$controllerName = $request->getControllerName();
|
12 |
+
$implodedControllerName = implode(' => ', array_map('ucfirst', explode('_', $controllerName)));
|
13 |
+
|
14 |
+
if ($this->_isLogNeeded($actionName, $implodedControllerName)) {
|
15 |
+
|
16 |
+
$entity = end(explode('_', $controllerName));
|
17 |
+
$user = Mage::getSingleton('admin/session')->getUser();
|
18 |
+
|
19 |
+
$adminlog = Mage::getModel('adminlog/adminlog');
|
20 |
+
$dynamicValues = $this->_getDynamicValues($controllerName);
|
21 |
+
//print_r($dynamicValues);
|
22 |
+
$currentId = $request->getParam($dynamicValues[0]);
|
23 |
+
$storeId = $request->getParam('store');
|
24 |
+
$store = Mage::getModel('core/store')->load($storeId);
|
25 |
+
|
26 |
+
if ($user) {
|
27 |
+
|
28 |
+
$data['user_id'] = $user->getUserId();
|
29 |
+
$data['user_email'] = $user->getEmail();
|
30 |
+
$data['remote_ip'] = Mage::helper('core/http')->getRemoteAddr();
|
31 |
+
$data['store_name'] = $store->getName() ? $store->getName() : 'All store views';
|
32 |
+
$data['controller_name'] = $implodedControllerName;
|
33 |
+
$data['action'] = ucfirst($actionName);
|
34 |
+
$data['full_path'] = $request->getModulename() . "/" . $controllerName . "/" . $actionName;
|
35 |
+
$data['logged_at'] = time();
|
36 |
+
|
37 |
+
$data['additional_info'] = "";
|
38 |
+
if (!empty($dynamicValues)) {
|
39 |
+
if (($actionName == "save") && ($dynamicValues[1] == "catalog/product")) {
|
40 |
+
$product = $request->getParam('product');
|
41 |
+
echo $data['additional_info'] = $dynamicValues[3] . $product['sku'];
|
42 |
+
} elseif (($actionName == "save") && ($dynamicValues[1] == "customer/customer")) {
|
43 |
+
echo $account = $request->getParam('account');
|
44 |
+
echo $data['additional_info'] = $dynamicValues[3] . $account['firstname'] . " " . $account['lastname'];
|
45 |
+
} elseif ($actionName == "save") {
|
46 |
+
echo $data['additional_info'] = $dynamicValues[3] . $request->getParam($dynamicValues[4]);
|
47 |
+
} elseif (($actionName == "new")) {
|
48 |
+
echo $data['additional_info'] = "Tried to create a new " . $entity;
|
49 |
+
} elseif (($actionName == "duplicate")) {
|
50 |
+
$productId = $request->getParam('id');
|
51 |
+
$_product = Mage::getModel('catalog/product')->load($productId);
|
52 |
+
echo $data['additional_info'] = "Duplicated the " . $entity." ".$_product['sku'];
|
53 |
+
} elseif (($actionName == "delete")) {
|
54 |
+
echo $data['additional_info'] = "Deleted the " . $entity;
|
55 |
+
}
|
56 |
+
|
57 |
+
} else {
|
58 |
+
$data['additional_info'] = str_replace(" => ", " ", $implodedControllerName) . " section was modified.";
|
59 |
+
}
|
60 |
+
|
61 |
+
try {
|
62 |
+
$adminlog->setData($data)->save();
|
63 |
+
} catch (Exception $e) {
|
64 |
+
Mage::getSingleton('core/session')->addError($entity . ' saved successfully. However, there occured an error while saving the log.');
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
protected function _getDynamicValues($controllerName)
|
72 |
+
{
|
73 |
+
switch ($controllerName) {
|
74 |
+
case 'customer':
|
75 |
+
return array('id', 'customer/customer', 'name', 'Name of the saved customer : ', 'firstname');
|
76 |
+
case 'catalog_product':
|
77 |
+
return array('id', 'catalog/product', 'sku', 'SKU of the saved product : ', 'sku');
|
78 |
+
case 'cms_page':
|
79 |
+
return array('page_id', 'cms/page', 'title', 'Title of the saved CMS page : ', 'title');
|
80 |
+
case 'cms_block':
|
81 |
+
return array('block_id', 'cms/block', 'title', 'Title of the saved static block : ', 'title');
|
82 |
+
case 'system_config':
|
83 |
+
return array('section', '', '', 'Saved section : ', 'section');
|
84 |
+
default:
|
85 |
+
return '';
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
public function cleanLog($observer)
|
90 |
+
{
|
91 |
+
$isExpire = Mage::getStoreConfig('adminlog_options/adminlog_group/adminlog_expire');
|
92 |
+
$time = time();
|
93 |
+
$to = date('Y-m-d H:i:s', $time);
|
94 |
+
$logs = Mage::getResourceModel('adminlog/adminlog_collection')
|
95 |
+
->addFieldToSelect('id')
|
96 |
+
->addFieldToSelect('viewed_at');
|
97 |
+
foreach ($logs as $log) {
|
98 |
+
$time1 = new DateTime($log->getViewedAt());
|
99 |
+
$time2 = new DateTime($to);
|
100 |
+
$interval = $time1->diff($time2);
|
101 |
+
$daysExpire = $interval->d;
|
102 |
+
if($daysExpire > $isExpire) {
|
103 |
+
$log->delete();
|
104 |
+
}
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
protected function _isLogNeeded($actionName, $implodedControllerName)
|
109 |
+
{
|
110 |
+
$isActive = Mage::getStoreConfig('adminlog_options/adminlog_group/adminlog_enable');
|
111 |
+
$excludedActions = array('index','validate','edit','grid');
|
112 |
+
|
113 |
+
return (($isActive == 1) && !in_array($actionName, $excludedActions) && ($implodedControllerName != 'Adminlog'));
|
114 |
+
}
|
115 |
+
|
116 |
+
}
|
app/code/community/Ameex/Adminlog/Model/Observer2.php
ADDED
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ameex_Adminlog_Model_Observer
|
4 |
+
{
|
5 |
+
public function getLog()
|
6 |
+
{ if(!isset($_COOKIE['path'])) {
|
7 |
+
setcookie($_COOKIE['path'],' ');;
|
8 |
+
}
|
9 |
+
$isActive = Mage::getStoreConfig('adminlog_options/adminlog_group/adminlog_enable');
|
10 |
+
$request = Mage::app()->getRequest();
|
11 |
+
//echo "<pre>";
|
12 |
+
// print_r($request->getRequestedRouteName());
|
13 |
+
// print_r(get_class_methods($request));
|
14 |
+
$currentPath = $request->getOriginalPathInfo();
|
15 |
+
|
16 |
+
if(($isActive == 1) && ($currentPath != $_COOKIE['path'])) {
|
17 |
+
$openActions = array('Index','Validate','Edit','Grid');
|
18 |
+
$request = Mage::app()->getRequest();
|
19 |
+
$fullPathInfo = $request->getOriginalPathInfo();
|
20 |
+
setcookie($_COOKIE['path'],$fullPathInfo);
|
21 |
+
$controllerName = $request->getControllerName();
|
22 |
+
$newActionControllerName = explode('_',$controllerName);
|
23 |
+
$newActionControllerName = end($newActionControllerName);
|
24 |
+
$implodedControllerName = implode(' => ', array_map('ucfirst', explode('_', $controllerName)));
|
25 |
+
$actionName = ucwords($request->getActionName());
|
26 |
+
$adminlog = Mage::getModel('adminlog/adminlog');
|
27 |
+
$adminLogLastItem = $adminlog->getCollection()->getLastItem();
|
28 |
+
$lastItemControllerName = $adminLogLastItem->getControllerPath();
|
29 |
+
$lastItemActionName = $adminLogLastItem->getActionPath();
|
30 |
+
$lastItemSectionId = $adminLogLastItem->getSectionId();
|
31 |
+
$id = $this->getDynamicVal($controllerName);
|
32 |
+
$activeId = $request->getParam($id[0]);
|
33 |
+
$adminlog->setSectionId($activeId);
|
34 |
+
if((!in_array($actionName,$openActions) && ($implodedControllerName != 'Adminlog'))) {
|
35 |
+
$moduleName = $request->getModulename();
|
36 |
+
$currentPath = $request->getOriginalPathInfo();
|
37 |
+
|
38 |
+
$storeId = $request->getParam('store');
|
39 |
+
$store = Mage::getModel('core/store')->load($storeId);
|
40 |
+
$storeName = $store->getName();
|
41 |
+
|
42 |
+
$adminSession = Mage::getSingleton('admin/session');
|
43 |
+
$user = $adminSession->getUser();
|
44 |
+
if ($user) {
|
45 |
+
$userId = $user->getUserId();
|
46 |
+
$userName = $user->getName();
|
47 |
+
$userEmail = $user->getEmail();
|
48 |
+
$remoteIp = Mage::helper('core/http')->getRemoteAddr();
|
49 |
+
|
50 |
+
$adminlog->setCustomerId($userId);
|
51 |
+
$adminlog->setCustomerEmail($userEmail);
|
52 |
+
$adminlog->setAdminFrontname($moduleName);
|
53 |
+
if($storeName) {
|
54 |
+
$adminlog->setStoreName($storeName);
|
55 |
+
} else {
|
56 |
+
$adminlog->setStoreName("All Store Views");
|
57 |
+
}
|
58 |
+
$adminlog->setControllerPath(ucfirst($implodedControllerName));
|
59 |
+
$adminlog->setActionPath(ucfirst($actionName));
|
60 |
+
|
61 |
+
|
62 |
+
if(!empty($id)) {
|
63 |
+
|
64 |
+
if(empty($id[1])) {
|
65 |
+
$activeName = $activeId." ".ucwords($id[0]);
|
66 |
+
} else {
|
67 |
+
$activeName = Mage::getModel($id[1])->load($activeId)->getData($id[2]);
|
68 |
+
}
|
69 |
+
if (($actionName == "Save") && ($id[1] == "catalog/product")) {
|
70 |
+
$activeName= $request->getParam('product');
|
71 |
+
$adminlog->setAdditionalInfo($id[3]." ".$activeName['sku']);
|
72 |
+
} else if (($actionName == "Save") && ($id[1] == "customer/customer")) {
|
73 |
+
$activeName = $request->getParam('account');
|
74 |
+
$adminlog->setAdditionalInfo($id[3]." ".$activeName['firstname']." ".$activeName['lastname']);
|
75 |
+
} else if($actionName == "Save") {
|
76 |
+
$activeName = $id[3]." ".$request->getParam($id[4]);
|
77 |
+
$adminlog->setAdditionalInfo($activeName);
|
78 |
+
} else if (($actionName == "New")) {
|
79 |
+
$adminlog->setAdditionalInfo("Trying to create a new ".$newActionControllerName);
|
80 |
+
}
|
81 |
+
else if (($actionName == "Duplicate")) {
|
82 |
+
|
83 |
+
$adminlog->setAdditionalInfo("Duplicated the ".$newActionControllerName);
|
84 |
+
}
|
85 |
+
else if (($actionName == "Delete")) {
|
86 |
+
|
87 |
+
$adminlog->setAdditionalInfo("Deleted the ".$newActionControllerName);
|
88 |
+
}
|
89 |
+
} else {
|
90 |
+
$adminlog->setAdditionalInfo("Modified Content is:"." ".str_replace("=>", " ",$implodedControllerName)." Section");
|
91 |
+
}
|
92 |
+
$urlPath = $moduleName."/".$controllerName."/".lcfirst($actionName);
|
93 |
+
$adminlog->setViewPath($urlPath);
|
94 |
+
$adminlog->setViewedAt(time());
|
95 |
+
$adminlog->setRemoteIp($remoteIp);
|
96 |
+
|
97 |
+
$adminlog->save();
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
|
104 |
+
public function getDynamicVal($controllerName)
|
105 |
+
{
|
106 |
+
switch ($controllerName) {
|
107 |
+
case 'customer':
|
108 |
+
return array('id', 'customer/customer', 'name','Saved Customer Name Is :','firstname');
|
109 |
+
break;
|
110 |
+
case 'catalog_product':
|
111 |
+
return array('id','catalog/product', 'sku','Saved Product Sku Is :','sku');
|
112 |
+
break;
|
113 |
+
case 'cms_page':
|
114 |
+
return array('page_id','cms/page','title','Saved Cms Page Title Is :','title');
|
115 |
+
break;
|
116 |
+
case 'cms_block':
|
117 |
+
return array('block_id','cms/block','title','Saved Cms Block Title Is :','title');
|
118 |
+
break;
|
119 |
+
case 'system_config':
|
120 |
+
return array('section','','','Saved Section Is :','section');
|
121 |
+
break;
|
122 |
+
default:
|
123 |
+
return '';
|
124 |
+
break;
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
public function cleanLog($observer)
|
129 |
+
{
|
130 |
+
$isExpire = Mage::getStoreConfig('adminlog_options/adminlog_group/adminlog_expire');
|
131 |
+
$time = time();
|
132 |
+
$to = date('Y-m-d H:i:s', $time);
|
133 |
+
$logs = Mage::getResourceModel('adminlog/adminlog_collection')
|
134 |
+
->addFieldToSelect('id')
|
135 |
+
->addFieldToSelect('viewed_at');
|
136 |
+
foreach ($logs as $log) {
|
137 |
+
$time1 = new DateTime($log->getViewedAt());
|
138 |
+
$time2 = new DateTime($to);
|
139 |
+
$interval = $time1->diff($time2);
|
140 |
+
$daysExpire = $interval->d;
|
141 |
+
if($daysExpire > $isExpire){
|
142 |
+
$log->delete();
|
143 |
+
}
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
public function modelSaveAfter($observer)
|
148 |
+
{
|
149 |
+
|
150 |
+
$isActive = Mage::getStoreConfig('adminlog_options/adminlog_group/adminlog_enable');
|
151 |
+
if($isActive == 1) {
|
152 |
+
$adminSession = Mage::getSingleton('admin/session');
|
153 |
+
$user = $adminSession->getUser();
|
154 |
+
$openControllerNames = array("Index => Event","CatalogInventory => Stock");
|
155 |
+
$requestModuleName = Mage::app()->getRequest()->getModulename();
|
156 |
+
$request = $observer->getEvent()->getObject();
|
157 |
+
echo $requestModelName = get_class($request);
|
158 |
+
echo "<pre>";
|
159 |
+
// print_r($request->getData());
|
160 |
+
if($requestModelName == "Ameex_Adminlog_Model_Adminlog"){
|
161 |
+
return;
|
162 |
+
}
|
163 |
+
$implodedRequestModelName = explode('_', $requestModelName);
|
164 |
+
$controllerName = $implodedRequestModelName[1]." => ".$implodedRequestModelName[3];
|
165 |
+
$actionName = "Save";
|
166 |
+
if(($user) && (!in_array($controllerName,$openControllerNames))) {
|
167 |
+
$storeId = $request->getStoreId();
|
168 |
+
$store = Mage::getModel('core/store')->load($storeId);
|
169 |
+
$storeName = $store->getName();
|
170 |
+
$userId = $user->getUserId();
|
171 |
+
$userEmail = $user->getEmail();
|
172 |
+
$remoteIp = Mage::helper('core/http')->getRemoteAddr();
|
173 |
+
$adminlog = Mage::getModel('adminlog/adminlog');
|
174 |
+
$adminlog->setCustomerId($userId);
|
175 |
+
$adminlog->setCustomerEmail($userEmail);
|
176 |
+
$adminlog->setAdminFrontname($requestModuleName);
|
177 |
+
$adminlog->setControllerPath(ucfirst($controllerName));
|
178 |
+
$adminlog->setActionPath($actionName);
|
179 |
+
$adminlog->setAdditionalInfo(1);
|
180 |
+
$adminlog->setSectionId(1);
|
181 |
+
if($storeName){
|
182 |
+
$adminlog->setStoreName($storeName);
|
183 |
+
} else {
|
184 |
+
$adminlog->setStoreName("All Store Views");
|
185 |
+
}
|
186 |
+
$adminlog->setViewedAt(time());
|
187 |
+
$adminlog->setRemoteIp($remoteIp);
|
188 |
+
$adminlog->save();
|
189 |
+
}
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
}
|
app/code/community/Ameex/Adminlog/Model/Observernew.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ameex_Adminlog_Model_Observer
|
3 |
+
{
|
4 |
+
public function modelSaveAfter($observer)
|
5 |
+
{
|
6 |
+
|
7 |
+
$isActive = Mage::getStoreConfig('adminlog_options/adminlog_group/adminlog_enable');
|
8 |
+
if($isActive == 1) {
|
9 |
+
$adminSession = Mage::getSingleton('admin/session');
|
10 |
+
$user = $adminSession->getUser();
|
11 |
+
$openControllerNames = array("Index => Event","CatalogInventory => Stock");
|
12 |
+
$requestModuleName = Mage::app()->getRequest()->getModulename();
|
13 |
+
$request = $observer->getEvent()->getObject();
|
14 |
+
echo $requestModelName = get_class($request);
|
15 |
+
echo "<pre>";
|
16 |
+
// print_r($request->getData());
|
17 |
+
if($requestModelName == "Ameex_Adminlog_Model_Adminlog"){
|
18 |
+
return;
|
19 |
+
}
|
20 |
+
$implodedRequestModelName = explode('_', $requestModelName);
|
21 |
+
$controllerName = $implodedRequestModelName[1]." => ".$implodedRequestModelName[3];
|
22 |
+
$actionName = "Save";
|
23 |
+
if(($user) && (!in_array($controllerName,$openControllerNames))) {
|
24 |
+
$storeId = $request->getStoreId();
|
25 |
+
$store = Mage::getModel('core/store')->load($storeId);
|
26 |
+
$storeName = $store->getName();
|
27 |
+
$userId = $user->getUserId();
|
28 |
+
$userEmail = $user->getEmail();
|
29 |
+
$remoteIp = Mage::helper('core/http')->getRemoteAddr();
|
30 |
+
$adminlog = Mage::getModel('adminlog/adminlog');
|
31 |
+
$adminlog->setCustomerId($userId);
|
32 |
+
$adminlog->setCustomerEmail($userEmail);
|
33 |
+
$adminlog->setAdminFrontname($requestModuleName);
|
34 |
+
$adminlog->setControllerPath(ucfirst($controllerName));
|
35 |
+
$adminlog->setActionPath($actionName);
|
36 |
+
$adminlog->setAdditionalInfo(1);
|
37 |
+
$adminlog->setSectionId(1);
|
38 |
+
if($storeName){
|
39 |
+
$adminlog->setStoreName($storeName);
|
40 |
+
} else {
|
41 |
+
$adminlog->setStoreName("All Store Views");
|
42 |
+
}
|
43 |
+
$adminlog->setViewedAt(time());
|
44 |
+
$adminlog->setRemoteIp($remoteIp);
|
45 |
+
$adminlog->save();
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
app/code/community/Ameex/Adminlog/Model/Resource/Adminlog.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ameex_Adminlog_Model_Resource_Adminlog extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('adminlog/adminlog','id');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Ameex/Adminlog/Model/Resource/Adminlog/Collection.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ameex_Adminlog_Model_Resource_Adminlog_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('adminlog/adminlog');
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Ameex/Adminlog/Model/Resource/Setup.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ameex_Adminlog_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
|
3 |
+
{
|
4 |
+
}
|
app/code/community/Ameex/Adminlog/controllers/Adminhtml/AdminlogController.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Ameex_Adminlog_Adminhtml_AdminlogController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
|
5 |
+
public $_currentDate;
|
6 |
+
|
7 |
+
public function _construct()
|
8 |
+
{
|
9 |
+
parent::_construct();
|
10 |
+
$this->_currentDate = date("d-m-Y", Mage::getModel('core/date')->timestamp(time()));
|
11 |
+
}
|
12 |
+
public function _initAction()
|
13 |
+
{
|
14 |
+
$this->loadLayout()->_setActiveMenu('adminlogdetails/adminlog')->_addBreadcrumb(Mage::helper('adminlog')->__('Admin Log Activity Manager'), Mage::helper('adminlog')->__('Admin Log Activity Manager'));
|
15 |
+
return $this;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function indexAction()
|
19 |
+
{
|
20 |
+
$this->_initAction();
|
21 |
+
$this->_addContent($this->getLayout()->createBlock('adminlog/adminhtml_gridContainer'));
|
22 |
+
$this->renderLayout();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function gridAction()
|
26 |
+
{
|
27 |
+
$this->loadLayout();
|
28 |
+
$this->getResponse()->setBody($this->getLayout()->createBlock('adminlog/adminhtml_gridContainer_grid')->toHtml());
|
29 |
+
}
|
30 |
+
|
31 |
+
public function exportCsvAction()
|
32 |
+
{
|
33 |
+
$fileName = 'adminlog.csv'."_".$this->_currentDate;
|
34 |
+
$content = $this->getLayout()->createBlock('adminlog/adminhtml_gridContainer_grid');
|
35 |
+
$this->_prepareDownloadResponse($fileName, $content->getCsvFile());
|
36 |
+
}
|
37 |
+
|
38 |
+
public function exportXmlAction()
|
39 |
+
{
|
40 |
+
$fileName = 'adminlog.xml'."_".$this->_currentDate;
|
41 |
+
$content = $this->getLayout()->createBlock('adminlog/adminhtml_gridContainer_grid');
|
42 |
+
$this->_prepareDownloadResponse($fileName, $content->getXml());
|
43 |
+
}
|
44 |
+
|
45 |
+
public function exportExcelAction()
|
46 |
+
{
|
47 |
+
$fileName = 'adminlog.xls'."_".$this->_currentDate;
|
48 |
+
$content = $this->getLayout()->createBlock('adminlog/adminhtml_gridContainer_grid');
|
49 |
+
$this->_prepareDownloadResponse($fileName, $content->getExcelFile());
|
50 |
+
}
|
51 |
+
|
52 |
+
public function massDeleteAction()
|
53 |
+
{
|
54 |
+
$logIds = $this->getRequest()->getPost('id');
|
55 |
+
try {
|
56 |
+
$adminlog = Mage::getSingleton('adminlog/adminlog');
|
57 |
+
foreach ($logIds as $logId) {
|
58 |
+
$adminlog->load($logId)->delete();
|
59 |
+
}
|
60 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Total of %d record(s) were deleted.', count($logIds)));
|
61 |
+
} catch (Exception $e) {
|
62 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
63 |
+
}
|
64 |
+
$this->_redirect('*/*/');
|
65 |
+
}
|
66 |
+
|
67 |
+
}
|
app/code/community/Ameex/Adminlog/etc/adminhtml.xml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" ?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<adminlogdetails translate="title" module="adminlog">
|
5 |
+
<title>Admin activity logger</title>
|
6 |
+
<sort_order>150</sort_order>
|
7 |
+
<children>
|
8 |
+
<adminlog translate="title">
|
9 |
+
<sort_order>10</sort_order>
|
10 |
+
<title>Activity log details</title>
|
11 |
+
<action>adminhtml/adminlog/index</action>
|
12 |
+
</adminlog>
|
13 |
+
</children>
|
14 |
+
</adminlogdetails>
|
15 |
+
</menu>
|
16 |
+
<acl>
|
17 |
+
<resources>
|
18 |
+
<admin>
|
19 |
+
<children>
|
20 |
+
<adminlogdetails>
|
21 |
+
<title>Ameex Admin Logger</title>
|
22 |
+
<children>
|
23 |
+
<adminlog translate="title" module="adminlog">
|
24 |
+
<title>Admin activity log details</title>
|
25 |
+
</adminlog>
|
26 |
+
</children>
|
27 |
+
</adminlogdetails>
|
28 |
+
<system>
|
29 |
+
<children>
|
30 |
+
<config>
|
31 |
+
<children>
|
32 |
+
<adminlog_options>
|
33 |
+
<title>Admin log manager configuration</title>
|
34 |
+
</adminlog_options>
|
35 |
+
</children>
|
36 |
+
</config>
|
37 |
+
</children>
|
38 |
+
</system>
|
39 |
+
</children>
|
40 |
+
</admin>
|
41 |
+
</resources>
|
42 |
+
</acl>
|
43 |
+
</config>
|
app/code/community/Ameex/Adminlog/etc/config.xml
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" ?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Ameex_Adminlog>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</Ameex_Adminlog>
|
7 |
+
</modules>
|
8 |
+
<adminhtml>
|
9 |
+
<events>
|
10 |
+
<controller_action_predispatch>
|
11 |
+
<observers>
|
12 |
+
<ameex_adminlog_controller_action_predispatch>
|
13 |
+
<class>adminlog/observer</class>
|
14 |
+
<method>getLog</method>
|
15 |
+
</ameex_adminlog_controller_action_predispatch>
|
16 |
+
</observers>
|
17 |
+
</controller_action_predispatch>
|
18 |
+
</events>
|
19 |
+
</adminhtml>
|
20 |
+
<global>
|
21 |
+
<blocks>
|
22 |
+
<adminlog>
|
23 |
+
<class>Ameex_Adminlog_Block</class>
|
24 |
+
</adminlog>
|
25 |
+
</blocks>
|
26 |
+
<helpers>
|
27 |
+
<adminlog>
|
28 |
+
<class>Ameex_Adminlog_Helper</class>
|
29 |
+
</adminlog>
|
30 |
+
</helpers>
|
31 |
+
<models>
|
32 |
+
<adminlog>
|
33 |
+
<class>Ameex_Adminlog_Model</class>
|
34 |
+
<resourceModel>adminlog_resource</resourceModel>
|
35 |
+
</adminlog>
|
36 |
+
<adminlog_resource>
|
37 |
+
<class>Ameex_Adminlog_Model_Resource</class>
|
38 |
+
<entities>
|
39 |
+
<adminlog>
|
40 |
+
<table>adminlog_activities</table>
|
41 |
+
</adminlog>
|
42 |
+
</entities>
|
43 |
+
</adminlog_resource>
|
44 |
+
</models>
|
45 |
+
<resources>
|
46 |
+
<adminlog_setup>
|
47 |
+
<setup>
|
48 |
+
<module>Ameex_Adminlog</module>
|
49 |
+
<class>Ameex_Adminlog_Model_Resource_Setup</class>
|
50 |
+
</setup>
|
51 |
+
</adminlog_setup>
|
52 |
+
</resources>
|
53 |
+
</global>
|
54 |
+
<admin>
|
55 |
+
<routers>
|
56 |
+
<adminhtml>
|
57 |
+
<args>
|
58 |
+
<modules>
|
59 |
+
<Ameex_Adminlog after="Mage_Adminhtml">Ameex_Adminlog_Adminhtml</Ameex_Adminlog>
|
60 |
+
</modules>
|
61 |
+
</args>
|
62 |
+
</adminhtml>
|
63 |
+
</routers>
|
64 |
+
</admin>
|
65 |
+
<crontab>
|
66 |
+
<jobs>
|
67 |
+
<ameex_adminlog>
|
68 |
+
<schedule>
|
69 |
+
<cron_expr>*/1 * * * *</cron_expr><!-- every 1 minutes -->
|
70 |
+
</schedule>
|
71 |
+
<run>
|
72 |
+
<model>adminlog/observer::cleanLog</model>
|
73 |
+
</run>
|
74 |
+
</ameex_adminlog>
|
75 |
+
</jobs>
|
76 |
+
</crontab>
|
77 |
+
</config>
|
app/code/community/Ameex/Adminlog/etc/system.xml
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" ?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<adminlogconfig translate="label" module="adminlog">
|
5 |
+
<label>Admin log configuration</label>
|
6 |
+
<sort_order>1000</sort_order>
|
7 |
+
</adminlogconfig>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<adminlog_options translate="label" module="adminlog">
|
11 |
+
<label>Admin log manager</label>
|
12 |
+
<tab>adminlogconfig</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>1000</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<adminlog_group translate="label">
|
20 |
+
<label>Adminlog config fields</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>1</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
<fields>
|
27 |
+
<adminlog_enable>
|
28 |
+
<label>Enable admin log module</label>
|
29 |
+
<frontend_type>select</frontend_type>
|
30 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
+
<sort_order>1</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
</adminlog_enable>
|
36 |
+
<adminlog_expire>
|
37 |
+
<label>Delete log records after X days</label>
|
38 |
+
<comment>You can specify the number of days you want to maintain the logs</comment>
|
39 |
+
<frontend_type>text</frontend_type>
|
40 |
+
<sort_order>2</sort_order>
|
41 |
+
<show_in_default>1</show_in_default>
|
42 |
+
<show_in_website>1</show_in_website>
|
43 |
+
<show_in_store>1</show_in_store>
|
44 |
+
</adminlog_expire>
|
45 |
+
</fields>
|
46 |
+
</adminlog_group>
|
47 |
+
</groups>
|
48 |
+
</adminlog_options>
|
49 |
+
</sections>
|
50 |
+
</config>
|
app/code/community/Ameex/Adminlog/sql/adminlog_setup/install-1.0.0.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
$table = $installer->getConnection()->newTable($installer->getTable('adminlog/adminlog'))
|
5 |
+
->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, 11, array(
|
6 |
+
'unsigned' => true,
|
7 |
+
'nullable' => false,
|
8 |
+
'primary' => true,
|
9 |
+
'identity' => true,
|
10 |
+
), 'Id')
|
11 |
+
->addColumn('user_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 11, array(
|
12 |
+
), 'User Id')
|
13 |
+
->addColumn('logged_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
|
14 |
+
'nullable' => false,), 'Logged At')
|
15 |
+
->addColumn('user_email', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
16 |
+
), 'User Email')
|
17 |
+
->addColumn('full_path', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
18 |
+
), 'Full Path')
|
19 |
+
->addColumn('store_name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
20 |
+
), 'Store Name')
|
21 |
+
->addColumn('controller_name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
22 |
+
), 'Controller Name')
|
23 |
+
->addColumn('action',Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
24 |
+
), 'Action')
|
25 |
+
->addColumn('additional_info',Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
26 |
+
), 'Additional Info')
|
27 |
+
->addColumn('remote_ip', Varien_Db_Ddl_Table::TYPE_TEXT,255, array(
|
28 |
+
'nullable' => false,
|
29 |
+
'default' => '0',
|
30 |
+
), 'Remote IP')
|
31 |
+
->setComment('Admin log activities');
|
32 |
+
$installer->getConnection()->createTable($table);
|
33 |
+
$installer->endSetup();
|
app/etc/modules/Ameex_Adminlog.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<modules>
|
3 |
+
<Ameex_Adminlog>
|
4 |
+
<active>true</active>
|
5 |
+
<codePool>community</codePool>
|
6 |
+
</Ameex_Adminlog>
|
7 |
+
</modules>
|
8 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Admin_Activity_Logger</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>Open Software License (OSL)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Admin activity logger module is used to monitoring the admin user activities.</summary>
|
10 |
+
<description>Admin activity logger module is used to monitoring the admin user activities. so that we can monitor the every&#xD;
|
11 |
+
admin user activities and also find the modified contents.</description>
|
12 |
+
<notes>Initial functionality is added in this module</notes>
|
13 |
+
<authors><author><name>commercebees</name><user>CommerceBees</user><email>commercebees@ameexusa.com</email></author><author><name>parthipan p</name><user>parthipan_ameex</user><email>p.parthi001@gmail.com</email></author></authors>
|
14 |
+
<date>2015-10-12</date>
|
15 |
+
<time>14:14:41</time>
|
16 |
+
<contents><target name="magecommunity"><dir><dir name="Ameex"><dir name="Adminlog"><dir><dir name="Block"><dir name="Adminhtml"><dir name="GridContainer"><file name="Grid.php" hash="019512f723c3c50173b7eeb705636abf"/></dir><file name="GridContainer.php" hash="8fbec0fb12dbb46a8d48687808a237ac"/></dir></dir><dir name="Helper"><file name="Data.php" hash="43438a581adc8975e1fe43983f5f3e81"/></dir><dir name="Model"><file name="Adminlog.php" hash="6d433db27deab3c8c973aa5c96fc2544"/><file name="Observer.php" hash="7fe4af496f317f0f59a2afdd5272061c"/><file name="Observer2.php" hash="4781b9c9ed4a7e13c55cab7e85f3cea5"/><file name="Observernew.php" hash="01f9551904a233b14d2673bba222f69f"/><dir name="Resource"><dir name="Adminlog"><file name="Collection.php" hash="79ec7c124a081902f7e11b8d470bddc2"/></dir><file name="Adminlog.php" hash="e850d4e71f23d83d8f6f5f53fb592f74"/><file name="Setup.php" hash="123d1a75a27a47fb08138f990aa95b8c"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AdminlogController.php" hash="a4b4d72d1f95ae17fba12060612a590a"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="cb4c5949af74421c60157761dc9421c3"/><file name="config.xml" hash="7fe4da27270a6ca0917b15dce13a60ac"/><file name="system.xml" hash="966a805470a697d1e3387da4f3bad3c0"/></dir><dir name="sql"><dir name="adminlog_setup"><file name="install-1.0.0.php" hash="a2113924a5963de7d50af2a6e12f0e23"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Ameex_Adminlog.xml" hash="1cfc4192209af809e8baee26113de620"/></dir></dir></target><target name="mage"><dir name="."><file name="CommerceBees_Admin_Activity_Logger_Extension_Guide_V1.0.0 .pdf" hash="40f9079c679b12bcefb247bb241194b9"/></dir></target></contents>
|
17 |
+
<compatible/>
|
18 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
+
</package>
|