....without giving them admin access. And without putting a bunch of IP addresses in my htaccess.
v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
Order desk.Joe1234 wrote: ↑Tue Jan 10, 2023 5:44 amIs there a way I can give people access to the site while in maintenance mode? Or some other type of workaround to blocking general access to the site and giving specific people access by ways of registering them or a direct url?
....without giving them admin access. And without putting a bunch of IP addresses in my htaccess.
https://www.opencart.com/index.php?rout ... aintenance
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
You can use an .htaccess password rather than restrict it to IPs.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
@paulfeakins forgot about htpassword, good thought, but I was hoping to avoid all of ht stuff because I have a signup and quick info on the maintenance page I wanted to display...I'm assuming with the htpassword I would set it in the main dir and turn off the maintenance.
v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
What I would do first to find that out is inspect the button in the admin to find out its name which might give a hint at the variable / setting name being used in the code / database. Then I'd probably grep the source for that variable.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Add column to customer_group in model/account/customer_group:Joe1234 wrote: ↑Tue Jan 10, 2023 5:44 amIs there a way I can give people access to the site while in maintenance mode? Or some other type of workaround to blocking general access to the site and giving specific people access by ways of registering them or a direct url?
....without giving them admin access. And without putting a bunch of IP addresses in my htaccess.
Code: Select all
public function check_group_table() {
$group_altered = $this->db->query("SHOW COLUMNS FROM `".DB_PREFIX."customer_group` LIKE 'grant_access';");
if ( !$group_altered->row ) {
$this->db->query("ALTER TABLE `".DB_PREFIX."customer_group` ADD `grant_access` tinyint NOT NULL DEFAULT '0';");
}
}
Code: Select all
public function getCustomerGroup($customer_group_id) {
Code: Select all
$this->check_group_table();
Then in controller/startup/maintenance.php after:
Code: Select all
$this->user = new Cart\User($this->registry);
Code: Select all
$this->load->model('account/customer');
$customer_id = $this->customer->isLogged();
$deny_access = true;
if ($customer_id) {
$customer_info = $this->model_account_customer->getCustomer($customer_id);
$this->load->model('account/customer_group');
$customer_group = $this->model_account_customer_group->getCustomerGroup($customer_info['customer_group_id']);
if (isset($customer_group['grant_access']) && $customer_group['grant_access'] == 1) {
$deny_access = false;
}
}
Code: Select all
$ignore = array(
'account/login',
'common/language/language',
'common/currency/currency'
);
Code: Select all
if ((substr($route, 0, 17) != 'extension/payment' && substr($route, 0, 3) != 'api') && !in_array($route, $ignore) && !$this->user->isLogged()) {
Code: Select all
if ((substr($route, 0, 17) != 'extension/payment' && substr($route, 0, 3) != 'api') && !in_array($route, $ignore) && !$this->user->isLogged() && $deny_access) {
@pprmkr I'll test out that mod when I have a chance. It may still be useful to me, thanks.
v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
Users browsing this forum: No registered users and 43 guests