Dokuwiki

Installation

Dans répertoire doc

Plugins

BackLinks2

Permet d'afficher des backlinks Pour éviter d'avoir sidebar en backlinks

$conf['hidepages'] = '(sidebar)';
HeaderFooter

Inséré en bas de chaque page par header HeaderFooter. Fichier _footer.txt:

----
===Voir aussi===
{{backlinks>.}}
iframe

Utilisé pour insérer des pages balnam dans une page wikidoc. Mettre en haut de celles-ci

<base target="_parent">

Theme

Bootstrap3 Template

Config

conf/local.php
$conf['disableactions'] = 'register';
$conf['phpok'] = 1;$conf['authtype'] = 'authbalnam';
$conf['userewrite'] = 1;
lin/plugin/authbalnam/auth.php
class auth_plugin_authbalnam extends DokuWiki_Auth_Plugin {
 
 
	function __construct() {
		global $config_cascade;
		global $connection;
 
		$this->cando['external'] = true;
		//$this->cando['logout'] = true;
 
	}
 
	function trustExternal($user, $pass, $sticky = false) {
 
		global $USERINFO;
		global $conf;
		global $connection; 
		$sticky ? $sticky = true : $sticky = false; //sanity check
        $allowed=$_SESSION['user']=='admin';
        if (!$allowed) {
          unset ($_SERVER['REMOTE_USER']);
          unset ($_SESSION[DOKU_COOKIE]['auth']);
          return false;
          }
        
          $_SERVER['REMOTE_USER'] =$_SESSION['user'];
			$_SESSION[DOKU_COOKIE]['auth']['user'] = $_SESSION['user'];
			$_SESSION[DOKU_COOKIE]['auth']['info']['mail'] = 'xx';
			$_SESSION[DOKU_COOKIE]['auth']['info']['pass'] = 'xx';
			$_SESSION[DOKU_COOKIE]['auth']['info']['grps'] = [0=>'admin',1=>'user'];
        
		if (!empty($_SESSION[DOKU_COOKIE]['auth']['info'])) {
          print_r($_SESSION[DOKU_COOKIE]['auth']);
			$USERINFO['name'] = $_SESSION[DOKU_COOKIE]['auth']['info']['user'];
			$USERINFO['mail'] = $_SESSION[DOKU_COOKIE]['auth']['info']['mail'];
			$USERINFO['grps'] = $_SESSION[DOKU_COOKIE]['auth']['info']['grps'];
			$_SERVER['REMOTE_USER'] = $_SESSION[DOKU_COOKIE]['auth']['user'];
			return true;
		}
        
        /*if ($_SESSION['user']=='admin') {
		    $_SERVER['REMOTE_USER'] =$_SESSION['user'];
			$_SESSION[DOKU_COOKIE]['auth']['user'] = $_SESSION['user'];
			$_SESSION[DOKU_COOKIE]['auth']['info']['mail'] = 'xx';
			$_SESSION[DOKU_COOKIE]['auth']['info']['pass'] = 'xx';
			$_SESSION[DOKU_COOKIE]['auth']['info']['grps'] = [0=>'admin',1=>'user'];
			return true;
		} else {
			return false;
		}     */
        return true;
 
	}
} 

Voir aussi