Not logged in. · Lost password · Register

All posts by oli_v_ier (13)

topic: BUG : accents dans les noms d'utilisateurs  in the forum: Non-English Discussion French discussion
Avatar
oli_v_ier #1
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
Subject: BUG : accents dans les noms d'utilisateurs
Bonjour,

J'utilise dokuwiki avec une authentification via FluxBB, lorsqu'un nom d'utilisateur contient un accent le problème est que ce nom n'apparait pas dans la liste des pages modifiées.
Exemple (en rouge : l'absence de pseudo) :
[Image: https://www.randonner-leger.org/forum/uploads/i/16/7xfUfnNZ5.pas_pseudo.png]

Une idée d'où regarder pour résoudre le problème ?
topic: Plugin , not plugin  in the forum: General Help and Support Installation and Configuration
Avatar
oli_v_ier #2
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 64277
Thank you for your answers.
As it might affect other people, I'll explain : Windows operating system does not distinguish between upper case and lower case in file and folder names, so if you paste a file named Plugin.php in a folder that aldready has a plugin.php file, the content of the file will be replaced, but not the name.
topic: Plugin , not plugin  in the forum: General Help and Support Installation and Configuration
Avatar
oli_v_ier #3
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
Subject: Plugin , not plugin
Hello,

I've tried to install 2018-04-22b "Greebo" from : https://download.dokuwiki.org/

Got an 500 error on a linux server.

Solved with : inc/plugin.php renamed inc/Plugin.php

...
topic: Unable to logout  in the forum: General Help and Support Installation and Configuration
Avatar
oli_v_ier #4
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 50467
I've rebooted my computer, I'm now able to logout normaly.

Though I'm still interested in any explanation :huh: .
topic: Unable to logout  in the forum: General Help and Support Installation and Configuration
Avatar
oli_v_ier #5
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
Subject: Unable to logout
Hi,

I use Dokuwiki Detritus with FluxBB forum authentication.

When I logout from forum and go back to wiki, it seems I'm logged out, but if I do F5 on a wiki page, I'm logged in on the forum and the wiki again !

I've deleted all my browser data (cookies,etc), changed browser, tried private mode, etc, and I'm still logged in.

The only way I've found to logout is to change IP by using Tor Browser.

Any idea how to solve this problem ?

This is my /lib/plugin/authfluxbb/auth.php file

  1. <?php
  2. /**
  3. * FluxBB auth backend
  4. *
  5. * Uses external Trust mechanism to check against FluxBB's
  6. * user cookie. FluxBB's PUN_ROOT must be defined correctly.
  7. *
  8. * @author    Andreas Gohr <andi@splitbrain.org>
  9. */
  10. #dbg($GLOBALS);
  11. #dbg($forum_user);
  12.  
  13. class auth_plugin_authfluxbb extends DokuWiki_Auth_Plugin {
  14.  
  15.  /**
  16.    * Constructor.
  17.    *
  18.    * Sets additional capabilities and config strings
  19.    */
  20.   public function __construct() {
  21.         parent::__construct();
  22.     global $conf;
  23.     $this->cando['external'] = true;
  24.  
  25.     $conf['passcrypt'] = 'sha1';
  26.  
  27.     // get global vars from fluxbb config
  28.     global $db_host;
  29.     global $db_name;
  30.     global $db_username;
  31.     global $db_password;
  32.     global $db_prefix;
  33.  
  34.     // now set up the mysql config strings
  35.     $conf['auth']['mysql']['server']   = $db_host;
  36.     $conf['auth']['mysql']['user']     = $db_username;
  37.     $conf['auth']['mysql']['password'] = $db_password;
  38.     $conf['auth']['mysql']['database'] = $db_name;
  39.  
  40.     $conf['auth']['mysql']['checkPass']   = "SELECT u.password AS pass
  41.                                                FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
  42.                                               WHERE u.group_id = g.g_id
  43.                                                 AND u.username = '%{user}'
  44.                                                 AND g.g_title   != 'Guest'";
  45.     $conf['auth']['mysql']['getUserInfo'] = "SELECT password AS pass, realname AS name, email AS mail,
  46.                                                     id, g_title as `group`
  47.                                                FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
  48.                                               WHERE u.group_id = g.g_id
  49.                                                 AND u.username = '%{user}'";
  50.     $conf['auth']['mysql']['getGroups']   = "SELECT g.g_title as `group`
  51.                                                FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
  52.                                               WHERE u.group_id = g.g_id
  53.                                                 AND u.username = '%{user}'";
  54.     $conf['auth']['mysql']['getUsers']    = "SELECT DISTINCT u.username AS user
  55.                                                FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
  56.                                               WHERE u.group_id = g.g_id";
  57.     $conf['auth']['mysql']['FilterLogin'] = "u.username LIKE '%{user}'";
  58.     $conf['auth']['mysql']['FilterName']  = "u.realname LIKE '%{name}'";
  59.     $conf['auth']['mysql']['FilterEmail'] = "u.email    LIKE '%{email}'";
  60.     $conf['auth']['mysql']['FilterGroup'] = "g.g_title    LIKE '%{group}'";
  61.     $conf['auth']['mysql']['SortOrder']   = "ORDER BY u.username";
  62.     $conf['auth']['mysql']['addUser']     = "INSERT INTO ${db_prefix}users
  63.                                                     (username, password, email, realname)
  64.                                              VALUES ('%{user}', '%{pass}', '%{email}', '%{name}')";
  65.     $conf['auth']['mysql']['addGroup']    = "INSERT INTO ${db_prefix}groups (g_title) VALUES ('%{group}')";
  66.     $conf['auth']['mysql']['addUserGroup']= "UPDATE ${db_prefix}users
  67.                                                 SET group_id=%{gid}
  68.                                               WHERE id='%{uid}'";
  69.     $conf['auth']['mysql']['delGroup']    = "DELETE FROM ${db_prefix}groups WHERE g_id='%{gid}'";
  70.     $conf['auth']['mysql']['getUserID']   = "SELECT id FROM ${db_prefix}users WHERE username='%{user}'";
  71.     $conf['auth']['mysql']['updateUser']  = "UPDATE ${db_prefix}users SET";
  72.     $conf['auth']['mysql']['UpdateLogin'] = "username='%{user}'";
  73.     $conf['auth']['mysql']['UpdatePass']  = "password='%{pass}'";
  74.     $conf['auth']['mysql']['UpdateEmail'] = "email='%{email}'";
  75.     $conf['auth']['mysql']['UpdateName']  = "realname='%{name}'";
  76.     $conf['auth']['mysql']['UpdateTarget']= "WHERE id=%{uid}";
  77.     $conf['auth']['mysql']['delUserGroup']= "UPDATE ${db_prefix}users SET g_id=4 WHERE id=%{uid}";
  78.     $conf['auth']['mysql']['getGroupID']  = "SELECT g_id AS id FROM ${db_prefix}groups WHERE g_title='%{group}'";
  79.  
  80.     $conf['auth']['mysql']['TablesToLock']= array("${db_prefix}users", "${db_prefix}users AS u",
  81.                                                   "${db_prefix}groups", "${db_prefix}groups AS g");
  82.  
  83.     $conf['auth']['mysql']['debug'] = 1;
  84.     // call mysql constructor
  85.     parent::__construct();
  86.  }
  87.  
  88.  /**
  89.    * Just checks against the $forum_user variable
  90.    */
  91.  function trustExternal($user,$pass,$sticky=false){
  92.     global $USERINFO;
  93.     global $conf;
  94.     global $lang;
  95.     global $pun_user;
  96.     global $pun_config;
  97.     global $cookie_name;
  98.     $sticky ? $sticky = true : $sticky = false; //sanity check
  99.  
  100.     if(isset($pun_user) && !$pun_user['is_guest']){
  101.       // okay we're logged in - set the globals
  102.       $USERINFO['pass'] = $pun_user['password'];
  103.       $USERINFO['name'] = utf8_encode($pun_user['realname']);
  104.       $USERINFO['mail'] = $pun_user['email'];
  105.       $USERINFO['grps'] = array($pun_user['g_title']);
  106.       if ($pun_user['is_admmod'])
  107.         $USERINFO['grps'][] = 'admin';
  108.  
  109.       $_SERVER['REMOTE_USER'] = utf8_decode($pun_user['username']);
  110.       $_SESSION[DOKU_COOKIE]['auth']['user'] = $pun_user['username'];
  111.       $_SESSION[DOKU_COOKIE]['auth']['info'] = $USERINFO;
  112.       return true;
  113.     }
  114.  
  115.     // to be sure
  116.     auth_logoff();
  117.  
  118.     $USERINFO['grps'] = array();
  119.     return false;
  120.  }
  121. }
  122. //Setup VIM: ex: et ts=2 enc=utf-8 :
topic: 'include' function in local.protected.php = no image  in the forum: General Help and Support Installation and Configuration
Avatar
oli_v_ier #6
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 50267
Solved. A whitespace at the beginning of file in /forum/lang/ ...

Usefull script :

  1. <?php
  2. /**
  3. * This script will search all PHP files in the same directory
  4. * and below and will check for trailing or leading whitespaces
  5. * and UTF-8 BOMs
  6. */
  7.  
  8. header("Content-Type: text/plain");
  9.  
  10. echo "starting...\n";
  11. traverse(dirname(__FILE__));
  12. echo "finished...\n";
  13.  
  14. function traverse($dir){
  15.     if ($dh = opendir($dir)) {
  16.         while (($file = readdir($dh)) !== false) {
  17.             //skip hidden files and upper dirs
  18.             if(preg_match('/^[\._]/',$file)) continue;
  19.             if(is_dir($dir.'/'.$file)){
  20.                 traverse($dir.'/'.$file);
  21.                 continue;
  22.             }
  23.             flush();
  24.  
  25.             if(!preg_match('/\.php$/',$file)) continue;
  26.             $check = @file_get_contents("$dir/$file",0,null,0,3);
  27.             if(!$check){
  28.                 echo "$dir/$file is not readable.\n";
  29.                 continue;
  30.             }
  31.  
  32.             if($check == "\xef\xbb\xbf"){
  33.                 echo "$dir/$file has UTF-8 BOM at start.\n";
  34.                 continue;
  35.             }
  36.  
  37.             if($check != '<?p'){
  38.                 echo "$dir/$file doesn't start with <?php\n";
  39.                 continue;
  40.             }
  41.  
  42.             $check = file_get_contents("$dir/$file",0,null,
  43.                                 filesize("$dir/$file")-5,5);
  44.             $pos = strpos($check, '?>');
  45.             if($pos !== false && !(substr($check,-2) == '?>' || substr($check,-3) == "?>\n") ){
  46.                 echo "$dir/$file has trailing chars after closing ?>\n";
  47.                 continue;
  48.             }
  49.        }
  50.        closedir($dh);
  51.    }
  52. }
topic: 'include' function in local.protected.php = no image  in the forum: General Help and Support Installation and Configuration
Avatar
oli_v_ier #7
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
Subject: 'include' function in local.protected.php = no image
Hello,

I'm using dokuwiki since many years with an FluxBB authentication.

I've just upgraded both and have a strange problem : when I put an include function in local.protected.php the images don't appear anymore in the wiki.

Simple :
- without include : all images
- with include, no images from the data/media/ .

Anyone have and idea how to add include function in local.protected.php without this image problem ?

I need this function in local.protected.php in order to have the same authentication system in the wiki and the forum :
https://www.dokuwiki.org/auth:punbb?s[]=fluxbb

The local.protected.php that I've always used :
  1. <?php
  2. define('PUN_ROOT', dirname(__FILE__).'/../../forum/');
  3. include PUN_ROOT.'include/common.php';
  4. $conf['useacl'] = 1;
  5. $conf['superuser'] = '@Administrateurs';
  6. $conf['authtype'] = 'authfluxbb';

I've simplified local.protected.php to test :
  1. <?php include 'example.php'
No images.

  1. <?php
Images appear.

When I open a direct link to the image, example : http://localhost/www-dev/dokuwiki/lib/exe/fetch.…?media=…
i have the error message "The image can't be displayed because it contains errors".
But this is not true because without include in local.protected.php they display without any problem (I've looked at this page, but didn't help).

Last test I've done : on a distant server it's the same problem.
topic: authmysq with fluxbb forum  in the forum: General Help and Support Installation and Configuration
Avatar
oli_v_ier #8
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 43501
Quote by oli_v_ier on 2014-04-13, 19:51:
Is there a way to be connected simultaneously to the wiki and the forum ?

Up :) .
topic: authmysq with fluxbb forum  in the forum: General Help and Support Installation and Configuration
Avatar
oli_v_ier #9
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 43494
Solved.

Had to put the absolute link in the dokuwiki file /conf/mysql.conf.php : define('PUN_ROOT', 'C:/wamp/www/forum/');

Is there a way to be connected simultaneously to the wiki and the forum ?
topic: authmysql avec fluxbb  in the forum: Non-English Discussion French discussion
Avatar
oli_v_ier #10
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 43492
Suite, ici : https://forum.dokuwiki.org/post/43494

Si vous pouvez aider, c'est cool :) .
topic: authmysq with fluxbb forum  in the forum: General Help and Support Installation and Configuration
Avatar
oli_v_ier #11
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 43493
I've solved the two errors, but I still loose connexion with the wiki when I clic on a link, or refresh the page.

Anyone has an idea how to solve this ?

To fix the two errors mentionned above, I've :
- changed the line 50 in /conf/mysql.conf.php (deleted all mention to usergroup, that don't exist in fluxbb) :
$conf['plugin']['authmysql']['TablesToLock']= array("pun_users", "pun_users AS u","pun_groups", "pun_groups AS g");
- changed g.id to g.g_id in the third instruction (line 106)

[Image: http://www.randonner-leger.org/forum/uploads/2_wiki_maj2_12-04-14.png]
topic: authmysq with fluxbb forum  in the forum: General Help and Support Installation and Configuration
Avatar
oli_v_ier #12
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
Subject: authmysq with fluxbb forum
Hello,

I've been trying without success during two days to implement authmysql with a fluxbb forum.

On my local server (Wamp) I've installed the version 1.5.6 of fluxBB , the admin username is oli_v_ier.
I've installed the last version of dokuwiki 2013-12-08 "Binky" , admin username : admin.

I've created the file /conf/local.protected.php , as recommended here : https://www.dokuwiki.org/plugin:authmysql

<?php
// include config for MySQL backend
require_once('mysql.conf.php');

I've changed the /conf/mysql.conf.php so it connect to the database of the forum (using the global variables of fluxbb) :

define('PUN_ROOT', '../forum/');
include PUN_ROOT.'include/common.php';
$conf['plugin']['authmysql']['server']   = $db_host;
$conf['plugin']['authmysql']['user']     = $db_username;
$conf['plugin']['authmysql']['password'] = $db_password;
$conf['plugin']['authmysql']['database'] = $db_name;

Then I've replaced the first 3 statements with these below (the structure of the fluxbb tables is in the file joined to this message)

$conf['plugin']['authmysql']['checkPass'] = "
    SELECT password AS pass
    FROM pun_users
    WHERE username='%{user}'
    LIMIT 1";

$conf['plugin']['authmysql']['getUserInfo'] = "
    SELECT
    password AS pass,
    (CASE WHEN realname IS NULL OR realname = '' THEN username ELSE realname END) AS name,
    email AS mail
    FROM pun_users
    WHERE username='%{user}'
    LIMIT 1";

$conf['plugin']['authmysql']['getGroups'] = "
    SELECT g_title as `group`
    FROM pun_groups AS g
    INNER JOIN pun_users AS u ON u.group_id = g.id
    WHERE u.username='%{user}'";

I've enabled the authentification system, with the admin pannel of the wiki :
- in "Manage plugins", I've activated the plugin
- in "Configuration Settings" : in the line Authentication backend I've selected 'authmysql' and defined oli_v_ier as superuser.

Test : ok, I'can connect to the wiki using oli_v_ier (fluxbb username), the link "Admin" appear in the upper right of the screen.

Problem : connexion lost when I change page in the wiki.

I've enabled the debug of authmysql, here's below what it tells.
I notice the two errors (note : randonnerforum1 is the name of the database), but are there linked to the connexion lost ?

[Image: http://www.randonner-leger.org/forum/uploads/2_wiki_maj_12-04-14.png]
The author has attached one file to this post:
struture_fluxbb.txt 3.6 kBytes
You have no permission to open this file.
topic: authmysql avec fluxbb  in the forum: Non-English Discussion French discussion
Avatar
oli_v_ier #13
Member since Mar 2010 · 13 posts
Group memberships: Members
Show profile · Link to this post
Subject: authmysql avec fluxbb
Bonjour à tous,

J'essaie sans succès depuis quelques jours d'implémenter authmysql avec un forum fluxbb.

Sur mon serveur local (Wamp) j'ai installé la version 1.5.6 de fluxBB , le compte administrateur c'est oli_v_ier.
J'ai installé la dernière version de dokuwiki 2013-12-08 "Binky" , compte administrateur : admin.

J'ai créé le fichier /conf/local.protected.php , comme conseillé ici : https://www.dokuwiki.org/plugin:authmysql

<?php
// include config for MySQL backend
require_once('mysql.conf.php');

J'ai paramétré le début du fichier /conf/mysql.conf.php pour qu'il se connecte à la bdd du forum (en me servant des variables globales de fluxbb) :

define('PUN_ROOT', '../forum/');
include PUN_ROOT.'include/common.php';
$conf['plugin']['authmysql']['server']   = $db_host;
$conf['plugin']['authmysql']['user']     = $db_username;
$conf['plugin']['authmysql']['password'] = $db_password;
$conf['plugin']['authmysql']['database'] = $db_name;

Puis j'ai remplacé les 3 premières instructions par celles-ci (la structure des tables de fluxbb est en fichier joint à ce message)

$conf['plugin']['authmysql']['checkPass'] = "
    SELECT password AS pass
    FROM pun_users
    WHERE username='%{user}'
    LIMIT 1";

$conf['plugin']['authmysql']['getUserInfo'] = "
    SELECT
    password AS pass,
    (CASE WHEN realname IS NULL OR realname = '' THEN username ELSE realname END) AS name,
    email AS mail
    FROM pun_users
    WHERE username='%{user}'
    LIMIT 1";

$conf['plugin']['authmysql']['getGroups'] = "
    SELECT g_title as `group`
    FROM pun_groups AS g
    INNER JOIN pun_users AS u ON u.group_id = g.id
    WHERE u.username='%{user}'";

J'ai activé ce système de connexion, via le pannel d'admin du wiki :
- dans "Manage plugins", j'ai activé le plugin
- dans "Configuration Settings" : à la ligne Authentication backend j'ai choisi 'authmysql' et défini oli_v_ier comme superuser.

Test : ok, je peux me connecter en tant qu' oli_v_ier (identifiant du forum), le lien "Admin" apparaît en haut.

Problème : perte de connexion . Quand je change de page sur le wiki (quel que soit le lien) je ne suis plus identifié.

J'ai activé la fonction débug de authmysql qui permet d'afficher toutes les requêtes sql, voici ce que ça donne (capture d'écran ci-dessous). Je note les deux erreurs (note : randonnerforum1 c'est le nom de la base), mais est-ce lié au problème de perte de connexion ?

[Image: http://www.randonner-leger.org/forum/uploads/2_wiki_maj_12-04-14.png]
Close Smaller – Larger + Reply to this post:
Special characters:
Special queries
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-12-14, 08:16:28 (UTC +01:00)