Post by tjsystems » Mon Feb 02, 2015 11:08 pm

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

Live with 2.2.0.0 fully SSL.


Active Member

Posts

Joined
Sun Aug 26, 2012 5:39 pm
Location - NL, Amsterdam

Post by tjsystems » Tue Feb 03, 2015 8:29 am

Bump

Live with 2.2.0.0 fully SSL.


Active Member

Posts

Joined
Sun Aug 26, 2012 5:39 pm
Location - NL, Amsterdam

Post by bero » Tue Feb 03, 2015 6:09 pm

Ben er ook nog niet achter Tim ;)

New member

Posts

Joined
Tue Sep 24, 2013 6:18 am

Post by fido-x » Tue Feb 03, 2015 6:23 pm

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.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by tjsystems » Tue Feb 03, 2015 6:26 pm

Thanks already done that 90x ;)

Still not working.
Last edited by tjsystems on Tue Feb 03, 2015 10:57 pm, edited 1 time in total.

Live with 2.2.0.0 fully SSL.


Active Member

Posts

Joined
Sun Aug 26, 2012 5:39 pm
Location - NL, Amsterdam

Post by bero » Tue Feb 03, 2015 8:04 pm

don't have the source here, but what happends if you include the SendCloud module?

New member

Posts

Joined
Tue Sep 24, 2013 6:18 am

Post by tjsystems » Tue Feb 03, 2015 10:58 pm

bero wrote:don't have the source here, but what happends if you include the SendCloud module?
Hmmm, will test that later.

Live with 2.2.0.0 fully SSL.


Active Member

Posts

Joined
Sun Aug 26, 2012 5:39 pm
Location - NL, Amsterdam

Post by tjsystems » Wed Feb 04, 2015 12:17 am

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.

Live with 2.2.0.0 fully SSL.


Active Member

Posts

Joined
Sun Aug 26, 2012 5:39 pm
Location - NL, Amsterdam

Post by tjsystems » Wed Feb 04, 2015 10:03 pm

bump

Live with 2.2.0.0 fully SSL.


Active Member

Posts

Joined
Sun Aug 26, 2012 5:39 pm
Location - NL, Amsterdam

Post by bero » Thu Feb 05, 2015 5:29 am

And if you make a module of it?

New member

Posts

Joined
Tue Sep 24, 2013 6:18 am

Post by tjsystems » Thu Feb 05, 2015 8:09 am

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.

Live with 2.2.0.0 fully SSL.


Active Member

Posts

Joined
Sun Aug 26, 2012 5:39 pm
Location - NL, Amsterdam

Post by fido-x » Fri Feb 06, 2015 9:08 am

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.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by tjsystems » Thu Feb 12, 2015 4:01 am

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; ?>

Live with 2.2.0.0 fully SSL.


Active Member

Posts

Joined
Sun Aug 26, 2012 5:39 pm
Location - NL, Amsterdam
Who is online

Users browsing this forum: No registered users and 77 guests