summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-sysadm/2010-December/001250.html
blob: 5a3bb8cac3c66324617a3ed2878d46aa171a26d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> [Mageia-sysadm] [632] allow to use email on log on transifex
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B632%5D%20allow%20to%20use%20email%20on%20log%20on%20transifex&In-Reply-To=%3C20101215212426.A4D8140328%40valstar.mageia.org%3E">
   <META NAME="robots" CONTENT="index,nofollow">
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <LINK REL="Previous"  HREF="001249.html">
   <LINK REL="Next"  HREF="001251.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[Mageia-sysadm] [632] allow to use email on log on transifex</H1>
    <B>root at mageia.org</B> 
    <A HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B632%5D%20allow%20to%20use%20email%20on%20log%20on%20transifex&In-Reply-To=%3C20101215212426.A4D8140328%40valstar.mageia.org%3E"
       TITLE="[Mageia-sysadm] [632] allow to use email on log on transifex">root at mageia.org
       </A><BR>
    <I>Wed Dec 15 22:24:26 CET 2010</I>
    <P><UL>
        <LI>Previous message: <A HREF="001249.html">[Mageia-sysadm] [631] - fix again, not a good day for me :/
</A></li>
        <LI>Next message: <A HREF="001251.html">[Mageia-sysadm] MeetBot's Inigo_Montoya is not avaible for	#mageia-tr
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#1250">[ date ]</a>
              <a href="thread.html#1250">[ thread ]</a>
              <a href="subject.html#1250">[ subject ]</a>
              <a href="author.html#1250">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>Revision: 632
Author:   misc
Date:     2010-12-15 22:24:26 +0100 (Wed, 15 Dec 2010)
Log Message:
-----------
allow to use email on log on transifex

Modified Paths:
--------------
    puppet/modules/transifex/manifests/init.pp
    puppet/modules/transifex/templates/45-ldap.conf

Added Paths:
-----------
    puppet/modules/transifex/files/
    puppet/modules/transifex/files/custom_backend.py

Added: puppet/modules/transifex/files/custom_backend.py
===================================================================
--- puppet/modules/transifex/files/custom_backend.py	                        (rev 0)
+++ puppet/modules/transifex/files/custom_backend.py	2010-12-15 21:24:26 UTC (rev 632)
@@ -0,0 +1,9 @@
+
+from django_auth_ldap.backend import LDAPBackend,_LDAPUser 
+
+class ForceUidLDAPBackend(LDAPBackend):
+    def ldap_to_django_username(self, username):
+        # force uid if someone give a email
+        return _LDAPUser(self, username=username).attrs['uid'][0]
+
+

Modified: puppet/modules/transifex/manifests/init.pp
===================================================================
--- puppet/modules/transifex/manifests/init.pp	2010-12-15 16:15:46 UTC (rev 631)
+++ puppet/modules/transifex/manifests/init.pp	2010-12-15 21:24:26 UTC (rev 632)
@@ -74,6 +74,16 @@
     notify =&gt; Service['apache']
   }
 
+  file { &quot;custom_backend.py&quot;:
+    path =&gt; &quot;/usr/local/lib/custom_backend.py&quot;,
+    ensure =&gt; present,
+    owner =&gt; root,
+    group =&gt; root,
+    mode =&gt; 644,
+    source =&gt; &quot;<A HREF="puppet:///modules/transifex/custom_backend.py">puppet:///modules/transifex/custom_backend.py</A>&quot;,
+    notify =&gt; Service['apache']
+  }
+
   subversion::snapshot { $templates_dir:
     source =&gt; &quot;<A HREF="svn://svn.mageia.org/svn/web/templates/transifex/trunk">svn://svn.mageia.org/svn/web/templates/transifex/trunk</A>&quot;
   }
@@ -81,7 +91,7 @@
   apache::vhost_django_app { &quot;transifex.$domain&quot;:
     module =&gt; &quot;transifex&quot;,
     use_ssl =&gt; true,
-    module_path =&gt; [&quot;/usr/share/transifex&quot;,&quot;/usr/share&quot;] 
+    module_path =&gt; [&quot;/usr/share/transifex&quot;,&quot;/usr/share&quot;,&quot;/usr/local/lib/&quot;] 
   }
 
   apache::vhost_redirect_ssl { &quot;transifex.$domain&quot;: }

Modified: puppet/modules/transifex/templates/45-ldap.conf
===================================================================
--- puppet/modules/transifex/templates/45-ldap.conf	2010-12-15 16:15:46 UTC (rev 631)
+++ puppet/modules/transifex/templates/45-ldap.conf	2010-12-15 21:24:26 UTC (rev 632)
@@ -1,5 +1,5 @@
 AUTHENTICATION_BACKENDS = (
-    'django_auth_ldap.backend.LDAPBackend',
+    'custom_backend.ForceUidLDAPBackend',
     'django.contrib.auth.backends.ModelBackend',
 )
 
@@ -23,7 +23,7 @@
 AUTH_LDAP_BIND_PASSWORD = &quot;&lt;%= ldap_password %&gt;&quot;
 
 AUTH_LDAP_USER_SEARCH = LDAPSearch(&quot;ou=People,&lt;%= dc_suffix %&gt; &quot;,
-    ldap.SCOPE_SUBTREE, &quot;(uid=%(user)s)&quot;)
+    ldap.SCOPE_SUBTREE, &quot;(|(uid=%(user)s)(mail=%(user)s))&quot;)
 
 # Set up the basic group parameters.
 AUTH_LDAP_GROUP_SEARCH = LDAPSearch(&quot;ou=Group,&lt;%= dc_suffix %&gt;&quot;,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: &lt;/pipermail/mageia-sysadm/attachments/20101215/6212bd03/attachment.html&gt;
</PRE>


<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="001249.html">[Mageia-sysadm] [631] - fix again, not a good day for me :/
</A></li>
	<LI>Next message: <A HREF="001251.html">[Mageia-sysadm] MeetBot's Inigo_Montoya is not avaible for	#mageia-tr
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#1250">[ date ]</a>
              <a href="thread.html#1250">[ thread ]</a>
              <a href="subject.html#1250">[ subject ]</a>
              <a href="author.html#1250">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="https://www.mageia.org/mailman/listinfo/mageia-sysadm">More information about the Mageia-sysadm
mailing list</a><br>
</body></html>