Merge lp:~yoboy-leguesh/ubuntu-fr-doc/auth_fluxbb into lp:ubuntu-fr-doc

Proposed by YoBoY
Status: Merged
Approved by: McPeter
Approved revision: 89
Merged at revision: 86
Proposed branch: lp:~yoboy-leguesh/ubuntu-fr-doc/auth_fluxbb
Merge into: lp:ubuntu-fr-doc
Diff against target: 354 lines (+166/-28)
4 files modified
conf/local.php (+6/-5)
conf/local.protected.php.dist (+13/-5)
conf/mysql.conf.php (+147/-0)
inc/utf8.php (+0/-18)
To merge this branch: bzr merge lp:~yoboy-leguesh/ubuntu-fr-doc/auth_fluxbb
Reviewer Review Type Date Requested Status
McPeter Approve
Review via email: mp+49502@code.launchpad.net

Commit message

Désactivation des actions non autorisées sur les comptes utilisateurs --fixes #717746
Reformatage mineur du fichier de configuration
Création du fichier de configuration mysql.conf.php pour l'accès à la base de donnée fluxBB basé sur le fichier inc/auth/auth_punbb.class.php utilisé actuellement. --fixes #717708
Adaptation du fichier local.protected.php.dist d'exemple pour intégration des modifications sur l'utilisation du backend mysql.
Suppression des correctifs sur le fichier inc/utf8.php devenus inutiles

Description of the change

Désactivation des actions non autorisées sur les comptes utilisateurs --fixes #717746
Reformatage mineur du fichier de configuration
Création du fichier de configuration mysql.conf.php pour l'accès à la base de donnée fluxBB basé sur le fichier inc/auth/auth_punbb.class.php utilisé actuellement. --fixes #717708
Adaptation du fichier local.protected.php.dist d'exemple pour intégration des modifications sur l'utilisation du backend mysql.
Suppression des correctifs sur le fichier inc/utf8.php devenus inutiles

To post a comment you must log in.
Revision history for this message
McPeter (mcpeter) wrote :

Fonctionnel sur serveur de dev

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'conf/local.php'
2--- conf/local.php 2011-01-23 17:10:06 +0000
3+++ conf/local.php 2011-02-12 15:41:23 +0000
4@@ -21,15 +21,16 @@
5 $conf['is_dev'] = 0;
6
7 // gestion des connexions utilisateurs.
8-//$conf['authtype'] = 'mysql';
9-//$conf['passcrypt'] = 'sha1';
10 $conf['useacl'] = 1;
11-$conf['authtype'] = 'punbb';
12+$conf['authtype'] = 'mysql';
13+$conf['passcrypt'] = 'sha1';
14 $conf['defaultgroup']= 'Members';
15-
16-$conf['allowdebug'] = 1;
17 $conf['superuser'] = '@adminwiki';
18 $conf['manager'] = '@modowiki';
19+
20+// Configuration principale
21+$conf['disableactions']='register,profile,resendpwd,check,debug';
22+$conf['allowdebug'] = 1;
23 $conf['updatecheck'] = 0;
24 $conf['userewrite'] = 1;
25 $conf['useslash'] = 1;
26
27=== modified file 'conf/local.protected.php.dist'
28--- conf/local.protected.php.dist 2011-01-23 17:10:06 +0000
29+++ conf/local.protected.php.dist 2011-02-12 15:41:23 +0000
30@@ -11,19 +11,27 @@
31
32 $conf['is_dev'] = 1;
33
34-//Gestion des connexions utilisateurs pour le serveur de DEV.
35+/* Gestion des connexions utilisateurs pour le serveur de DEV.
36+ * Décommenter les lignes ci dessous pour utiliser une connexion
37+ * à la base de donnée du forum fluxBB.
38+ * Attention le include doit être placé après les paramètres
39+ */
40 //$conf['authtype'] = 'mysql';
41 //$conf['passcrypt'] = 'sha1';
42-//$conf['authtype']='punbb';
43-define('PUN_ROOT', '/var/www/fr/forum/htdocs/');
44+//$conf['auth']['mysql']['server'] = '';
45+//$conf['auth']['mysql']['user'] = '';
46+//$conf['auth']['mysql']['password'] = '';
47+//$conf['auth']['mysql']['database'] = '';
48+//$conf['auth']['mysql']['prefix'] = '';
49+//@include(DOKU_CONF.'mysql.conf.php');
50+$conf['authtype']='plain';
51 $conf['useacl'] =1;
52-$conf['authtype']='plain';
53 $conf['defaultgroup']= 'Members';
54
55 // Suivi des modifications non nécessaires en DEV
56 $conf['notify'] = '';
57
58 //Gestion du thème
59-$conf['template'] = 'ubuntu';
60+$conf['template'] = 'ubuntu-2010';
61 $conf['static_host'] = 'http://www-static.dev.ubuntu-fr.org';
62
63
64=== added file 'conf/mysql.conf.php'
65--- conf/mysql.conf.php 1970-01-01 00:00:00 +0000
66+++ conf/mysql.conf.php 2011-02-12 15:41:23 +0000
67@@ -0,0 +1,147 @@
68+<?php
69+/*
70+ * This is an example configuration for the mysql auth module.
71+ *
72+ * This SQL statements are optimized for following table structure.
73+ * If you use a different one you have to change them accordingly.
74+ * See comments of every statement for details.
75+ *
76+ * TABLE users
77+ * uid login pass firstname lastname email
78+ *
79+ * TABLE groups
80+ * gid name
81+ *
82+ * TABLE usergroup
83+ * uid gid
84+ *
85+ */
86+
87+/* Options to configure database access. You need to set up this
88+ * options carefully, otherwise you won't be able to access you
89+ * database.
90+ */
91+//$conf['auth']['mysql']['server'] = '';
92+//$conf['auth']['mysql']['user'] = '';
93+//$conf['auth']['mysql']['password'] = '';
94+//$conf['auth']['mysql']['database'] = '';
95+//$conf['auth']['mysql']['prefix'] = '';
96+
97+/* variable to change the prefix of the tables
98+ */
99+$db_prefix = $conf['auth']['mysql']['prefix'];
100+
101+/* This option enables debug messages in the mysql module. It is
102+ * mostly usefull for system admins.
103+ */
104+$conf['auth']['mysql']['debug'] = 0;
105+
106+/* Normally password encryption is done by DokuWiki (recommended) but for
107+ * some reasons it might be usefull to let the database do the encryption.
108+ * Set 'forwardClearPass' to '1' and the cleartext password is forwarded to
109+ * the database, otherwise the encrypted one.
110+ */
111+$conf['auth']['mysql']['forwardClearPass'] = 0;
112+
113+/* Multiple table operations will be protected by locks. This array tolds
114+ * the module which tables to lock. If you use any aliases for table names
115+ * these array must also contain these aliases. Any unamed alias will cause
116+ * a warning during operation. See the example below.
117+ */
118+$conf['auth']['mysql']['TablesToLock']= array("${db_prefix}users", "${db_prefix}users AS u", "${db_prefix}groups", "${db_prefix}groups AS g");
119+
120+/***********************************************************************/
121+/* Basic SQL statements for user authentication (required) */
122+/***********************************************************************/
123+
124+$conf['auth']['mysql']['checkPass'] = "SELECT u.password AS pass
125+ FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
126+ WHERE u.group_id = g.g_id
127+ AND u.username = '%{user}'
128+ AND g.g_title != 'Guest'";
129+
130+$conf['auth']['mysql']['getUserInfo'] = "SELECT password AS pass,
131+ realname AS name,
132+ email AS mail,
133+ id,
134+ g_title as `group`
135+ FROM ${db_prefix}users AS u,
136+ ${db_prefix}groups AS g
137+ WHERE u.group_id = g.g_id
138+ AND u.username = '%{user}'";
139+
140+$conf['auth']['mysql']['getGroups'] = "SELECT g.g_title as `group`
141+ FROM ${db_prefix}users AS u,
142+ ${db_prefix}groups AS g
143+ WHERE u.group_id = g.g_id
144+ AND u.username = '%{user}'";
145+
146+/***********************************************************************/
147+/* Additional minimum SQL statements to use the user manager */
148+/***********************************************************************/
149+
150+$conf['auth']['mysql']['getUsers'] = "SELECT DISTINCT u.username AS user
151+ FROM ${db_prefix}users AS u,
152+ ${db_prefix}groups AS g
153+ WHERE u.group_id = g.g_id";
154+$conf['auth']['mysql']['FilterLogin'] = "u.username LIKE '%{user}'";
155+$conf['auth']['mysql']['FilterName'] = "u.realname LIKE '%{name}'";
156+$conf['auth']['mysql']['FilterEmail'] = "u.email LIKE '%{email}'";
157+$conf['auth']['mysql']['FilterGroup'] = "g.g_title LIKE '%{group}'";
158+$conf['auth']['mysql']['SortOrder'] = "ORDER BY u.username";
159+
160+/***********************************************************************/
161+/* Additional SQL statements to add new users with the user manager */
162+/***********************************************************************/
163+
164+
165+$conf['auth']['mysql']['addUser'] = "INSERT INTO ${db_prefix}users
166+ (username, password, email, realname, language, registered, registration_ip, last_visit)
167+ VALUES ('%{user}', '%{pass}', '%{email}', '%{name}', 'Francais', %{time}, '%{ip}', %{time})";
168+
169+$conf['auth']['mysql']['addGroup'] = "INSERT INTO ${db_prefix}groups (g_title) VALUES ('%{group}')";
170+
171+$conf['auth']['mysql']['addUserGroup']= "UPDATE ${db_prefix}users
172+ SET group_id=%{gid}
173+ WHERE id='%{uid}'";
174+
175+$conf['auth']['mysql']['delGroup'] = "DELETE FROM ${db_prefix}groups WHERE g_id='%{gid}'";
176+
177+$conf['auth']['mysql']['getUserID'] = "SELECT id FROM ${db_prefix}users WHERE username='%{user}'";
178+
179+/***********************************************************************/
180+/* Additional SQL statements to delete users with the user manager */
181+/***********************************************************************/
182+
183+/* This statement should remove a user fom the database.
184+ * Following patterns will be replaced:
185+ * %{user} user's login name
186+ * %{uid} id of a user dataset
187+ */
188+//$conf['auth']['mysql']['delUser'] = "DELETE FROM users
189+// WHERE uid='%{uid}'";
190+
191+/* This statement should remove all connections from a user to any group
192+ * (a user quits membership of all groups).
193+ * Following patterns will be replaced:
194+ * %{uid} id of a user dataset
195+ */
196+//$conf['auth']['mysql']['delUserRefs'] = "DELETE FROM usergroup
197+// WHERE uid='%{uid}'";
198+
199+/***********************************************************************/
200+/* Additional SQL statements to modify users with the user manager */
201+/***********************************************************************/
202+
203+$conf['auth']['mysql']['updateUser'] = "UPDATE ${db_prefix}users SET";
204+$conf['auth']['mysql']['UpdateLogin'] = "username='%{user}'";
205+$conf['auth']['mysql']['UpdatePass'] = "password='%{pass}'";
206+$conf['auth']['mysql']['UpdateEmail'] = "email='%{email}'";
207+$conf['auth']['mysql']['UpdateName'] = "realname='%{name}'";
208+$conf['auth']['mysql']['UpdateTarget']= "WHERE id=%{uid}";
209+
210+$conf['auth']['mysql']['delUserGroup']= "UPDATE ${db_prefix}users SET g_id=4 WHERE id=%{uid}";
211+
212+$conf['auth']['mysql']['getGroupID'] = "SELECT g_id AS id FROM ${db_prefix}groups WHERE g_title='%{group}'";
213+
214+
215
216=== modified file 'inc/utf8.php'
217--- inc/utf8.php 2011-02-08 14:57:09 +0000
218+++ inc/utf8.php 2011-02-12 15:41:23 +0000
219@@ -90,11 +90,9 @@
220 * @see strlen()
221 * @see utf8_decode()
222 */
223- if(!defined('PUN_ROOT')){
224 function utf8_strlen($string){
225 return strlen(utf8_decode($string));
226 }
227- }
228 }
229
230 if(!function_exists('utf8_substr')){
231@@ -110,7 +108,6 @@
232 * @param integer (optional) length in UTF-8 characters from offset
233 * @return mixed string or false if failure
234 */
235- if(!defined('PUN_ROOT')){
236 function utf8_substr($str, $offset, $length = null) {
237 if(UTF8_MBSTRING){
238 if( $length === null ){
239@@ -200,7 +197,6 @@
240 if (!preg_match('#'.$offset_pattern.$length_pattern.'#us',$str,$match)) return '';
241 return $match[1];
242 }
243- }
244 }
245
246 if(!function_exists('utf8_substr_replace')){
247@@ -227,7 +223,6 @@
248 * @see ltrim()
249 * @return string
250 */
251- if(!defined('PUN_ROOT')){
252 function utf8_ltrim($str,$charlist=''){
253 if($charlist == '') return ltrim($str);
254
255@@ -236,7 +231,6 @@
256
257 return preg_replace('/^['.$charlist.']+/u','',$str);
258 }
259- }
260 }
261
262 if(!function_exists('utf8_rtrim')){
263@@ -247,7 +241,6 @@
264 * @see rtrim()
265 * @return string
266 */
267- if(!defined('PUN_ROOT')){
268 function utf8_rtrim($str,$charlist=''){
269 if($charlist == '') return rtrim($str);
270
271@@ -256,7 +249,6 @@
272
273 return preg_replace('/['.$charlist.']+$/u','',$str);
274 }
275- }
276 }
277
278 if(!function_exists('utf8_trim')){
279@@ -267,13 +259,11 @@
280 * @see trim()
281 * @return string
282 */
283- if(!defined('PUN_ROOT')){
284 function utf8_trim($str,$charlist='') {
285 if($charlist == '') return trim($str);
286
287 return utf8_ltrim(utf8_rtrim($str,$charlist),$charlist);
288 }
289- }
290 }
291
292 if(!function_exists('utf8_strtolower')){
293@@ -286,14 +276,12 @@
294 * @see strtolower()
295 * @see utf8_strtoupper()
296 */
297- if(!defined('PUN_ROOT')){
298 function utf8_strtolower($string){
299 if(UTF8_MBSTRING) return mb_strtolower($string,'utf-8');
300
301 global $UTF8_UPPER_TO_LOWER;
302 return strtr($string,$UTF8_UPPER_TO_LOWER);
303 }
304- }
305 }
306
307 if(!function_exists('utf8_strtoupper')){
308@@ -306,14 +294,12 @@
309 * @see strtoupper()
310 * @see utf8_strtoupper()
311 */
312- if(!defined('PUN_ROOT')){
313 function utf8_strtoupper($string){
314 if(UTF8_MBSTRING) return mb_strtoupper($string,'utf-8');
315
316 global $UTF8_LOWER_TO_UPPER;
317 return strtr($string,$UTF8_LOWER_TO_UPPER);
318 }
319- }
320 }
321
322 if(!function_exists('utf8_ucfirst')){
323@@ -325,7 +311,6 @@
324 * @param string
325 * @return string with first character as upper case (if applicable)
326 */
327- if(!defined('PUN_ROOT')){
328 function utf8_ucfirst($str){
329 switch ( utf8_strlen($str) ) {
330 case 0:
331@@ -337,7 +322,6 @@
332 return utf8_strtoupper($matches[1]).$matches[2];
333 }
334 }
335- }
336 }
337
338 if(!function_exists('utf8_ucwords')){
339@@ -450,7 +434,6 @@
340 * @param integer
341 * @return integer
342 */
343- if(!defined('PUN_ROOT')){
344 function utf8_strpos($haystack, $needle, $offset=0){
345 $comp = 0;
346 $length = null;
347@@ -469,7 +452,6 @@
348
349 return $length;
350 }
351- }
352 }
353
354 if(!function_exists('utf8_tohtml')){

Subscribers

People subscribed via source and target branches

to all changes: