[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mass import - Real fix, I think



Hi,

On Sat, Jun 08, 2013 at 07:19:20PM +0200, Michael Banck wrote:
> Let me know whether they work and I'll upload the NMU to unstable and
> see about getting it included in stable (though it's too late for r1 I
> guess).

Thanks to Petter for the updated patch, I have now uploaded the NMU.
Final debdiff is attached.


Michael
diff -Nru gosa-2.7.4/debian/changelog gosa-2.7.4/debian/changelog
--- gosa-2.7.4/debian/changelog	2013-02-07 21:28:31.000000000 +0100
+++ gosa-2.7.4/debian/changelog	2013-06-14 11:00:02.000000000 +0200
@@ -1,3 +1,11 @@
+gosa (2.7.4-4.3) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/patches/fix-mass-ldapimport.patch: New patch, fixes LDAP mass
+    import, by Giorgio Pioda and Petter Reinholdtsen. (Closes: #698840)
+
+ -- Michael Banck <mbanck@debian.org>  Fri, 14 Jun 2013 10:59:37 +0200
+
 gosa (2.7.4-4.2) unstable; urgency=low
 
   [ Jonathan Wiltshire ]
diff -Nru gosa-2.7.4/debian/patches/fix-mass-ldapimport.patch gosa-2.7.4/debian/patches/fix-mass-ldapimport.patch
--- gosa-2.7.4/debian/patches/fix-mass-ldapimport.patch	1970-01-01 01:00:00.000000000 +0100
+++ gosa-2.7.4/debian/patches/fix-mass-ldapimport.patch	2013-06-14 10:58:23.000000000 +0200
@@ -0,0 +1,48 @@
+Index: addons/ldapmanager/class_csvimport.inc
+===================================================================
+--- gosa/ldapmanager/addons/ldapmanager/class_csvimport.inc      (revisjon 21231)
++++ gosa/ldapmanager/addons/ldapmanager/class_csvimport.inc      (arbeidskopi)
+@@ -175,17 +175,25 @@
+ 
+ 
+             /* Set all submitted vars  */
+-            if(is_array($keys))
++            if(is_array($keys)){
+               foreach($keys as $key) {
+                 if($key != "status"){
+                   $this->usertab->$key = $dat[$key];
++                  foreach($this->usertab->by_object as $pname => $plugin){
++                    if(isset($this->usertab->by_object[$pname]->$key)){
++                      $this->usertab->by_object[$pname]->$key = $dat[$key];
++                    }
++                  }
+                 }
+               }
++            }
+ 
+             /* Initialize template */
+             if($this->csvinfo['tplid']!=0){
+-              $this->usertab->adapt_from_template($this->csvinfo['arrtempls'][$this->csvinfo['tplid']]['dn']);
+-              $this->usertab->save_object();
++              $tpl_dn = $this->csvinfo['arrtempls'][$this->csvinfo['tplid']]['dn'];
++              $this->usertab->adapt_from_template($tpl_dn,array("uid","cn","givenName","sn"));
++              $tpl_base  = preg_replace("/^[^,]+,".preg_quote(get_people_ou(), '/i')."/", '', $tpl_dn);
++              $this->usertab->by_object['user']->base= $tpl_base;
+             } else {
+ 
+               /* Reset vars */
+Index: addons/ldapmanager/contentcsv.tpl
+===================================================================
+--- gosa/ldapmanager/addons/ldapmanager/contentcsv.tpl   (revisjon 21231)
++++ gosa/ldapmanager/addons/ldapmanager/contentcsv.tpl   (arbeidskopi)
+@@ -1,5 +1,3 @@
+-<font color='red'>Temporary disabled</font>
+-<!--
+ <p>
+   {t}The CSV import plug-in provides methods to generate user accounts from a file containing Comma Separated Values. The administrator can decide which columns should be transfered to which attribute. Note that you must have at least the UID, GIVENNAME and SURNAME set.{/t}
+ </p>
+@@ -122,4 +120,3 @@
+   {/if}
+ </div>
+ <input type="hidden" name="ignore">
+--->
diff -Nru gosa-2.7.4/debian/patches/series gosa-2.7.4/debian/patches/series
--- gosa-2.7.4/debian/patches/series	2012-06-19 09:57:50.000000000 +0200
+++ gosa-2.7.4/debian/patches/series	2013-06-08 18:58:37.000000000 +0200
@@ -5,3 +5,4 @@
 03_fix_class_mapping.patch
 04_fix_locale_location.patch
 no-image-warning.patch
+fix-mass-ldapimport.patch

Reply to: