Bug 20302 - [PATCH] upper/lowercase für Benutzertemplates
[PATCH] upper/lowercase für Benutzertemplates
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Domain management (Generic)
UCS 2.4
Other Linux
: P5 normal (vote)
: UCS 2.4-2
Assigned To: Alexander Kläser
Stefan Gohmann
:
Depends on:
Blocks: 20767 20781
  Show dependency treegraph
 
Reported: 2010-10-07 20:34 CEST by Stefan Gohmann
Modified: 2011-04-04 15:48 CEST (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
gohmann: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2010-10-07 20:34:44 CEST
Aus dem Forum: http://forum.univention.de/viewtopic.php?f=23&t=1125&p=3732

--- /usr/share/pyshared/univention/admin/__init__.py.orig       2010-10-04
11:47:38.000000000 +0200
+++ /usr/share/pyshared/univention/admin/__init__.py    2010-10-04 11:54:23.000000000
+0200
@@ -125,6 +125,19 @@ class property:
                                        except SyntaxError:
                                                return object[key]
                                return object[key]
+                       elif object.has_key(key[:-2]) and object[key[:-2]] and \
+                           (key[-2:-1] == ':') and (key[-1:] in ('L', 'U')):
+                               val = object[key[:-2]]
+                               if key[-1:] == 'L':
+                                       val = val.lower()
+                               if key[-1:] == 'U':
+                                       val = val.upper()
+                               if ext:
+                                       try:
+                                               return eval('val%s' % ext)
+                                       except SyntaxError:
+                                               return val
+                               return val
                        elif key == 'dn' and object.dn:
                                return object.dn
                        return ''

Dieser Patch erlaubt Sachen wie:

<firstname:L>[0:1].<lastname:L>@domain.de

Wäre schön, wenn das im nächsten UCS auftauchte! (Wir benutzen das jetzt mal, um uns enorm Zeit=Geld zu sparen… die eMail-Adressen müssen ja ausschließlich aus Kleinbuchstaben bestehen, da Kolab sonst noch mehr kaputt ist.)
Comment 1 Alexander Kläser univentionstaff 2010-11-24 09:59:07 CET
Danke für den Patch. Die Änderung wurde übernommen, jedoch mit ":lower" und ":upper" als Kommandos, da diese intuitiv besser verständlich sind.
Comment 2 Stefan Gohmann univentionstaff 2011-03-25 07:30:26 CET
funktioniert
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2011-04-04 15:48:34 CEST
UCS 2.4-2 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer
neueren Version von UCS erneut auftreten, so sollte der Bug dupliziert werden:
"Clone This Bug".