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.
Options

Any Idea on how to integrate a wiki to this forum?

Hi, I am setting up a forum for a software, and I'd like to integrate a wiki or knowledge base somehow. Any idea would be very appreciated.
So far I have thought of the possibility of a wordpress site, with a wiki plugin, and vanilla forum integrated, too.

Regards,

Marvin M

Best Answer

Answers

  • Options
    hgtonighthgtonight ∞ · New Moderator
    Answer ✓

    A wiki would be a great application!

    The biggest thing would be creating a revision history.

    That said, it would almost certainly be better to create an SSO integration with existing wiki software.

    Ideas:

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    mtschirsmtschirs ✭✭✭

    I just stitched together a simple dokuwiki auth plugin allowing vanilla users to automatically be logged into the wiki (SSO).

    We plan to have such a wiki integration for our german - chinese forum and news site nihaochina.de. Perhaps I will make an official (dokuwiki-)plugin out of it in the future...

    Here is the auth.php file to be put into an 'authvanilla' folder in your dokuwiki plugin directory:

    <?php
    if(!defined('DOKU_INC')) die();
    
    class auth_plugin_authvanilla extends DokuWiki_Auth_Plugin {
        protected $vanilla_path = null;
    
        public function __construct() {
            parent::__construct();
            $this->cando['external'] = true;
            $this->cando['logout']   = false;
            $this->vanilla_path = realpath(dirname(__FILE__)."/../../../".trim($this->getConf("vanilla_path"), "/\\"));
            $this->success = true;
        }
    
        /**
         * Do all authentication
         *
         * @param   string  $user    Username
         * @param   string  $pass    Cleartext Password
         * @param   bool    $sticky  Cookie should not expire
         * @return  bool             true on successful auth
         */
        public function trustExternal($user, $pass, $sticky = false) {
            global $USERINFO, $lang;
    
            define('APPLICATION', 'Vanilla');
            define('APPLICATION_VERSION', '2.0');
            define('DS', '/');
            define('PATH_ROOT', $this->vanilla_path);
            ob_start();
            require_once(PATH_ROOT.DS.'bootstrap.php');
            ob_end_clean();
    
            $session = Gdn::Session();
            if ($session->IsValid() && $session->User->Confirmed && !$session->User->Banned && !$session->User->Deleted) {
                $USERINFO = array('name' => $session->User->Name, 'mail' => $session->User->Email, 'grps' => array());
                if ($session->User->Admin == '1') {
                    $USERINFO['grps'][] = "admin";
                } else {
                    $USERINFO['grps'][] = "user";
                }
    
                $_SERVER['REMOTE_USER'] = $session->User->UserID;
                $_SESSION[DOKU_COOKIE]['auth']['user'] = $session->User->UserID;
                $_SESSION[DOKU_COOKIE]['auth']['info'] = $USERINFO;
                return true;
            }
            return false;
        }
    }
    
  • Options
    hgtonighthgtonight ∞ · New Moderator

    @mtschirs said:

          if ($session->User->Admin == '1') {
              $USERINFO['grps'][] = "admin";
          } else {
              $USERINFO['grps'][] = "user";
          }
    

    I would use a permission check rather than checking the Admin field. The current way will only give admin to the super-admin.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.