Skip to content

Commit 9a9f3e5

Browse files
committed
Fix configuration section in README.md and update session handling in Abstract.php
1 parent ede21f7 commit 9a9f3e5

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Refer to [SslController.php](app/code/community/Kiatng/Shooter/controllers/SslCo
141141
By default, the module allows the first 20 customers (with IDs from 1 to 20) to access the output in the browser. To customize this behavior, you can define the allowed customer IDs in your module `config.xml` configuration file.
142142

143143
1. Open the file `etc/config.xml` in in your module.
144-
2. Add the following configuration under the `<global>` section:
144+
2. Add the following configuration under the `<config>` section:
145145

146146
```xml
147147
<config>
@@ -166,7 +166,7 @@ By default, the module allows the first 20 customers (with IDs from 1 to 20) to
166166
<Your_Module>
167167
<active>true</active>
168168
<codePool>local</codePool>
169-
<depends> <!-- Add dependency here -->
169+
<depends> <!-- Add dependency here and clear the `config` cache -->
170170
<Kiatng_Shooter />
171171
</depends>
172172
</Your_Module>

app/code/community/Kiatng/Shooter/Controller/Abstract.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function preDispatch()
2020
parent::preDispatch();
2121
$session = Mage::getSingleton('customer/session');
2222
if (!$session->authenticate($this)) {
23+
$session->unsIsAllowShooter();
2324
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
2425
} elseif (!$this->_isAllowed()) {
2526
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
@@ -42,7 +43,7 @@ protected function _isAllowed(): bool
4243
}
4344

4445
$allow = false;
45-
$id = (int) $session->getCustomerId();
46+
$id = (int) $session->getId();
4647
if ($id <= (int) Mage::getConfig()->getNode('shooter/access/up_to_ids')) {
4748
$allow = true;
4849
}

0 commit comments

Comments
 (0)