Page 1 of 1

[2.x] Call page in Admin.... Permission Denied!

Posted: Mon Feb 02, 2015 11:08 pm
by tjsystems
Hi all,

I've successfully made a OCmod to add a item to the admin menu and uploaded the module files, works all good. Item is showing also the sub-items. However when is click on a sub-item in the menu i get the message "Permission Denied!" (on the correct url to the module page).

Do I need to register the pages i'm calling? Are am I missing something? If I call a page like; sale/order_list, it's showing normal without any error.

Also test this: http://stackoverflow.com/questions/1070 ... n-opencart

Thanks,
Tim

Re: [2.x] Call page in Admin.... Permission Denied!

Posted: Tue Feb 03, 2015 8:29 am
by tjsystems
Bump

Re: [2.x] Call page in Admin.... Permission Denied!

Posted: Tue Feb 03, 2015 6:09 pm
by bero
Ben er ook nog niet achter Tim ;)

Re: [2.x] Call page in Admin.... Permission Denied!

Posted: Tue Feb 03, 2015 6:23 pm
by fido-x
Go to "System->Users->User Groups" and edit the top-level admin group. Make sure the checkboxes in the access and modify lists are checked.

Re: [2.x] Call page in Admin.... Permission Denied!

Posted: Tue Feb 03, 2015 6:26 pm
by tjsystems
Thanks already done that 90x ;)

Still not working.

Re: [2.x] Call page in Admin.... Permission Denied!

Posted: Tue Feb 03, 2015 8:04 pm
by bero
don't have the source here, but what happends if you include the SendCloud module?

Re: [2.x] Call page in Admin.... Permission Denied!

Posted: Tue Feb 03, 2015 10:58 pm
by tjsystems
bero wrote:don't have the source here, but what happends if you include the SendCloud module?
Hmmm, will test that later.

Re: [2.x] Call page in Admin.... Permission Denied!

Posted: Wed Feb 04, 2015 12:17 am
by tjsystems
going nuts on this....

- add sub menu to admin menu (https://github.com/nosite/SendCloud-Ope ... .ocmod.xml)
- make .tpl files for new pages (https://github.com/nosite/SendCloud-Ope ... sendcloud/)
- upload and add OCmod
- menu showing ok
- when click.... Permission Denied!
- set user rights. (disable all /enable all)

Still same..... Permission Denied!

Please give me a hand on this.

Re: [2.x] Call page in Admin.... Permission Denied!

Posted: Wed Feb 04, 2015 10:03 pm
by tjsystems
bump

Re: [2.x] Call page in Admin.... Permission Denied!

Posted: Thu Feb 05, 2015 5:29 am
by bero
And if you make a module of it?

Re: [2.x] Call page in Admin.... Permission Denied!

Posted: Thu Feb 05, 2015 8:09 am
by tjsystems
THe OCmod is fine, works also with other links. Problem is the controller file or/and template file.

Found this https://bitbucket.org/mariavilaro/openc ... rld-module

No change to play with it yet.

Re: [2.x] Call page in Admin.... Permission Denied!

Posted: Fri Feb 06, 2015 9:08 am
by fido-x
In the controller that you created, is the "index" function public or protected? For example:

Code: Select all

public function index() {
or

Code: Select all

protected function index() {
if it is protected, change it to public.

Re: [2.x] Call page in Admin.... Permission Denied!

Posted: Thu Feb 12, 2015 4:01 am
by tjsystems
Ok, finale some to play with this again.

The controller has the public funtion, also played with to to make it private... no luck!
Any other ideas?


This is the code for the controller:

Code: Select all

<?php
class ControllerModuleSendclousParcelList extends Controller {
    private $error = array(); // This is used to set the errors, if any.
 
    public function index() {
        // Loading the language file
        $this->load->language('sendcloud/parcel_list'); 
     
        // Set the title of the page to the heading title in the Language file i.e., Hello World
        $this->document->setTitle($this->language->get('heading_title'));
     
        // Load the Setting Model  (All of the OpenCart Module & General Settings are saved using this Model )
        $this->load->model('setting/setting');
     
        // Assign the language data for parsing it to view
        $data['heading_title'] = $this->language->get('heading_title');
        $data['text_edit']    = $this->language->get('text_edit');
        $data['text_module'] = $this->language->get('text_module');
        $data['text_success'] = $this->language->get('text_success');
        $data['text_content_top'] = $this->language->get('text_content_top');
        $data['text_content_bottom'] = $this->language->get('text_content_bottom');      
        $data['text_column_left'] = $this->language->get('text_column_left');
        $data['text_column_right'] = $this->language->get('text_column_right');
        $data['entry_code'] = $this->language->get('entry_code');
        $data['entry_layout'] = $this->language->get('entry_layout');
        $data['entry_position'] = $this->language->get('entry_position');
        $data['entry_status'] = $this->language->get('entry_status');
        $data['entry_sort_order'] = $this->language->get('entry_sort_order');

         
        // This Block returns the warning if any
        if (isset($this->error['warning'])) {
            $data['error_warning'] = $this->error['warning'];
        } else {
            $data['error_warning'] = '';
        }
     
        // This Block returns the error code if any
        if (isset($this->error['code'])) {
            $data['error_code'] = $this->error['code'];
        } else {
            $data['error_code'] = '';
        }     
     
        // Making of Breadcrumbs to be displayed on site
        $data['breadcrumbs'] = array();
        $data['breadcrumbs'][] = array(
            'text'      => $this->language->get('text_home'),
            'href'      => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
            'separator' => false
        );
        $data['breadcrumbs'][] = array(
            'text'      => $this->language->get('text_module'),
            'href'      => $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'),
            'separator' => ' :: '
        );
        $data['breadcrumbs'][] = array(
            'text'      => $this->language->get('heading_title'),
            'href'      => $this->url->link('sendcloud/parcel_list', 'token=' . $this->session->data['token'], 'SSL'),
            'separator' => ' :: '
        );
          
        $data['action'] = $this->url->link('sendcloud/parcel_list', 'token=' . $this->session->data['token'], 'SSL'); // URL to be directed when the save button is pressed
     
        $data['cancel'] = $this->url->link('sendcloud/parcel_list', 'token=' . $this->session->data['token'], 'SSL'); // URL to be redirected when cancel button is pressed

        $data['header'] = $this->load->controller('common/header');
        $data['column_left'] = $this->load->controller('common/column_left');
        $data['footer'] = $this->load->controller('common/footer');

        $this->response->setOutput($this->load->view('sendcloud/parcel_list.tpl', $data));

    }

}
and this the template file.

Code: Select all

<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
<div class="page-header">
<div class="container-fluid">
<h1><?php echo $heading_title; ?></h1>
<ul class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
<?php } ?>
</ul>
</div>
</div>
<div class="container-fluid">
<?php if ($error_warning) { ?>
<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
<button type="button" class="close" data-dismiss="alert">&times;</button>
</div>
<?php } ?>
<?php if ($success) { ?>
<div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success; ?>
<button type="button" class="close" data-dismiss="alert">&times;</button>
</div>
<?php } ?>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list"></i> <?php echo $text_list; ?></h3>
</div>
<div class="panel-body">
<h3>some code here</h3>
<div class="row">
<div class="col-sm-6 text-left"><?php echo $pagination; ?></div>
<div class="col-sm-6 text-right"><?php echo $results; ?></div>
</div>
</div>
</div>
</div>
</div>
<?php echo $footer; ?>