Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to disable Signature for member

This discussion is related to the Signatures addon.
ChanuxChanux Admin of Geek.lk ✭✭

How to disable Signature for member. i jest want to "only admin can add signature for member"

Comments

  • peregrineperegrine MVP
    edited May 2013

    With this change only Admins (or roles that can edit users) can make a signature or edit a signature for a user.

    to prevent option from showing to non-admins

    change line 64

          $SideMenu->AddLink('Options', T('Signature Settings'), '/profile/signature', FALSE, array('class' => 'Popup'));
    

    to

     $SideMenu->AddLink('Options', T('Signature Settings'), '/profile/signature','Garden.Users.Edit' , array('class' => 'Popup'));
    

    to prevent non-admins from getting to the link if they know it, change ....

    public function ProfileController_Signature_Create($Sender) {
          if (!C('Plugins.Signatures.Enabled'))
             return;
    
    to
    
     public function ProfileController_Signature_Create($Sender) {
          if (!C('Plugins.Signatures.Enabled'))
             return;
     //add these three lines here below    
      $IsAdmin = Gdn::Session()->CheckPermission('Garden.Users.Edit');
          if (!$IsAdmin)
             return;
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

    hgtonight
  • @so chanux, did this ever work for you?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • if I may hijack for a moment, what file is that you are editing here? Is there one master file where all the good stuff is?

  • peregrineperegrine MVP
    edited November 2013

    look in the signatures plugin.

    generally if someone posts a change to a plugin

    it is code in the plugin folder

    generally default.php (if there is one)

    or class.FILLINTHENAMEOFTHEPLUGIN,plugin.php

    since there are generallt very few php files in a plugin.

    you can always get notepad++ or some other editor and search for line references.

    so you could always search all the php files in the signature plugin for "ProfileController_Signature_Create" and that would tell you the file.

    in this case it would be class.signatures,plugin.php

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Ok thanks peregrine, really big help. I need to look at the back end files more carefully.

  • @qh3
    thanks for responding back. let us know if it works for you.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.