Advertisement:

Author Topic: How to Add Plugin to Moderator's menu?  (Read 1176 times)

Ozgur

  • Newbie
  • *
  • Posts: 7
How to Add Plugin to Moderator's menu?
« on: November 07, 2014, 01:54:20 pm »
Sorry for my english guys

firstly, everyone in this forum doing great job thanks for all of things

so my question is how to add plugin to moderator's menu directly

i found this http://forums.osclass.org/general-help/change-permissions-for-moderators/msg80241/#msg80241 on this forum but its not helped me enough.

is anbody help me?


Ozgur

  • Newbie
  • *
  • Posts: 7
Re: How to Add Plugin to Moderator's menu?
« Reply #1 on: November 07, 2014, 03:18:08 pm »
Hey i prooced a little  :)

for example plugin (developer tools plugin)

i changed this line
Quote
   osc_add_admin_menu_page( __('Geliştirici ','devTools'), '#', 'devTools', null, null , null );
       osc_add_admin_submenu_page( 'devTools', __('Email Şablon Oluşturucu','devTools_codes'), osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'email_temp.php'), 'devTools_options', null, null );   
to this
Quote
   osc_add_admin_menu_page( __('Geliştirici ','devTools'), '#', 'devTools', 'moderator', null , null );
   
    osc_add_admin_submenu_page( 'devTools', __('Email Şablon Oluşturucu','devTools_codes'), osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'email_temp.php'), 'devTools_options', 'moderator', null );   


i added "moderator" and its worked its shows but when i clicked the devtools button its shows a message "you dont have the permisson to do this" like



now how can i set this?
« Last Edit: November 07, 2014, 03:27:34 pm by Ozgur »

Ozgur

  • Newbie
  • *
  • Posts: 7
Re: How to Add Plugin to Moderator's menu?
« Reply #2 on: November 07, 2014, 04:27:39 pm »
Ok guys i Solved this by myself :D

Now when you followed my other steps, just one more thing left.


now open oc-includes/core/AdminSecBaseModel.php and find this lines add your plugin name (i choosed Devlepor tools) like this.

Code: [Select]
if( $this->isModerator() ) {
                if( !in_array($this->page, osc_apply_filter('moderator_access', array('dev_tools','items', 'comments', 'media', 'login', 'admins', 'ajax', 'stats',''))) ) {
                    osc_add_flash_error_message(_m("You don't have enough permissions"), 'admin');
                    $this->redirectTo(osc_admin_base_url());
                }
            }


and delete this lines
Code: [Select]
                    osc_add_flash_error_message(_m("You don't have enough permissions"), 'admin');
                    $this->redirectTo(osc_admin_base_url());


And its done!!!

[Notice] when you did this moderators have access all pages but they cant see other things on menu.







« Last Edit: November 07, 2014, 04:35:35 pm by Ozgur »

jorge.yoma

  • Full Member
  • ***
  • Posts: 127
Re: How to Add Plugin to Moderator's menu?
« Reply #3 on: December 14, 2015, 11:55:12 pm »
Well, I'm having the same issue. I get the 'You don't have enough permissions' message with moderators routes.

Any suggestion to solve this without changing a core file?

jorge.yoma

  • Full Member
  • ***
  • Posts: 127
Re: How to Add Plugin to Moderator's menu?
« Reply #4 on: January 11, 2016, 09:57:59 pm »
Up. Please your help. This is very important as I don't want to give full access to people that should only do administrative tasks.