[debian-edu-commits] debian-edu/pkg-team/ 10/32: Imported Upstream version 2.7.3

Mike Gabriel sunweaver at debian.org
Tue Apr 1 16:52:04 UTC 2014


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch master
in repository gosa.

commit 85ee3ba1247146924110b401b99b980370871d18
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Tue Apr 1 15:14:26 2014 +0200

    Imported Upstream version 2.7.3
---
 gosa-core/Changelog                                | 14 +++++++++++
 gosa-core/html/getFAIstatus.php                    |  2 ++
 gosa-core/html/main.php                            |  5 ++--
 gosa-core/include/class_configRegistry.inc         |  3 +--
 gosa-core/include/class_listing.inc                |  6 +++--
 gosa-core/include/class_sortableListing.inc        |  4 ++--
 ...class_cvsExporter.inc => class_csvExporter.inc} |  2 +-
 gosa-core/include/functions.inc                    | 27 +++++++++++++---------
 .../include/smartyAddons/function.factory.php      |  2 +-
 gosa-core/include/utils/class_tests.inc            | 17 ++++++++++++--
 gosa-core/plugins/admin/ogroups/class_ogroup.inc   |  4 ++--
 gosa-core/plugins/personal/generic/class_user.inc  |  3 ++-
 .../plugins/personal/posix/class_posixAccount.inc  | 16 ++++++-------
 13 files changed, 70 insertions(+), 35 deletions(-)

diff --git a/gosa-core/Changelog b/gosa-core/Changelog
index 1b0aec6..b7e23a9 100644
--- a/gosa-core/Changelog
+++ b/gosa-core/Changelog
@@ -1,6 +1,19 @@
 GOsa2 changelog
 ===============
 
+* gosa 2.7.3
+  - Fixed some listing problems.
+  - Made DHCP plugin overview show all hosts.
+  - Fixed problems with $ in samba-hash-, check-, pre- and posthooks.
+  - Fixed problem with password changes beeing forced on login for newly created user.
+  - This fixed a bug where properties stored in gosa.conf did not take effect.
+  - Fixed group membership adaption when creating a user using a template.
+  - Added checks to ensure that valid hostnames/fqdns are created.
+  - Fixed removal of FAI profiles, hooks, scripts.
+  - Re-added statusbar to fai management plugin.
+  - Fixed progressbar reload in fai installation status plugin.
+  - Fixed several opsi plugin bugs.
+
 * gosa 2.7.2
   - Updated bundeled smarty to 3.1.4.
   - Introduced sortable listing to ACL and posix dialogs.
@@ -11,6 +24,7 @@ GOsa2 changelog
   - Updated samba password hashing and its error handling.
   - Updated Kolab tab, to use a sortable list for mynetworks entries.
   - Updated cleansing of FAI object in ldap, thanks to psc.
+  - Fixed removal of FAI-template and profile entries.
 
 * gosa 2.7.1
   - Updated passwordHook behaviour
diff --git a/gosa-core/html/getFAIstatus.php b/gosa-core/html/getFAIstatus.php
index 042908d..65fd9d9 100644
--- a/gosa-core/html/getFAIstatus.php
+++ b/gosa-core/html/getFAIstatus.php
@@ -42,6 +42,8 @@ if(!isset($_GET['mac'])){
 
 $config = session::global_get("config");
 $o =  new gosaSupportDaemon();
+header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
+header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Datum in der Vergangenheit
 $res = $o->get_entries_by_mac(explode(",", $_GET['mac']));
 foreach($res as $entry){
 	echo $entry['MACADDRESS']."|".$entry['PROGRESS']."\n";
diff --git a/gosa-core/html/main.php b/gosa-core/html/main.php
index cd49ee4..ca65004 100644
--- a/gosa-core/html/main.php
+++ b/gosa-core/html/main.php
@@ -3,7 +3,7 @@
  * This code is part of GOsa (http://www.gosa-project.org)
  * Copyright (C) 2003-2008 GONICUS GmbH
  *
- * ID: $$Id: main.php 20959 2011-07-27 07:43:19Z hickert $$
+ * ID: $$Id: main.php 21044 2011-11-07 10:01:32Z hickert $$
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -272,7 +272,8 @@ $remove_lock= FALSE;
 
 /* Check if we have changed the selected plugin 
 */
-if($old_plugin_dir != $plugin_dir && $old_plugin_dir != ""){
+if(($old_plugin_dir != $plugin_dir && $old_plugin_dir != "") || 
+    (isset($_GET['reset']) && $_GET['reset'] == 1)){
   if (is_file("$old_plugin_dir/main.inc")){
     $cleanup = $remove_lock = TRUE;
     require ("$old_plugin_dir/main.inc");
diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc
index b84fe08..734f09b 100644
--- a/gosa-core/include/class_configRegistry.inc
+++ b/gosa-core/include/class_configRegistry.inc
@@ -225,7 +225,6 @@ class configRegistry{
      */
     function getDisabledPlugins()
     {
-        return(array());
         return($this->pluginsDeactivated);
     }
 
@@ -337,7 +336,7 @@ class configRegistry{
                             
                             if(!in_array_strict($name, array('CLASS','NAME'))){
                                 $class= $info['CLASS'];    
-                                $this->fileStoredProperties[$class][strtolower($name)] = $value;
+                                $this->fileStoredProperties[strtolower($class)][strtolower($name)] = $value;
                             }
                         }
                     }
diff --git a/gosa-core/include/class_listing.inc b/gosa-core/include/class_listing.inc
index 76768b0..2cc8cc9 100644
--- a/gosa-core/include/class_listing.inc
+++ b/gosa-core/include/class_listing.inc
@@ -3,7 +3,7 @@
  * This code is part of GOsa (http://www.gosa-project.org)
  * Copyright (C) 2003-2008 GONICUS GmbH
  *
- * ID: $$Id: class_listing.inc 20952 2011-07-27 06:38:29Z hickert $$
+ * ID: $$Id: class_listing.inc 21080 2011-11-25 09:49:44Z hickert $$
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -473,11 +473,13 @@ class listing {
         // Add the footer if requested
         if ($this->showFooter) {
             $result.= "<div class='nlistFooter'><div style='padding:3px'>";
-
             foreach ($this->objectTypes as $objectType) {
                 if (isset($this->objectTypeCount[$objectType['label']])) {
                     $label= _($objectType['label']);
                     $result.= image($objectType['image'], null, $label)." ".$this->objectTypeCount[$objectType['label']]."  ";
+                }elseif (isset($this->objectTypeCount[$objectType['objectClass']])) {
+                    $label= _($objectType['label']);
+                    $result.= image($objectType['image'], null, $label)." ".$this->objectTypeCount[$objectType['objectClass']]."  ";
                 }
             }
 
diff --git a/gosa-core/include/class_sortableListing.inc b/gosa-core/include/class_sortableListing.inc
index 0d015cb..ea89166 100644
--- a/gosa-core/include/class_sortableListing.inc
+++ b/gosa-core/include/class_sortableListing.inc
@@ -3,7 +3,7 @@
  * This code is part of GOsa (http://www.gosa-project.org)
  * Copyright (C) 2003-2010 GONICUS GmbH
  *
- * ID: $$Id: class_sortableListing.inc 20952 2011-07-27 06:38:29Z hickert $$
+ * ID: $$Id: class_sortableListing.inc 21055 2011-11-09 07:53:36Z hickert $$
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -42,7 +42,7 @@ class sortableListing {
     private $deleteable= false;
     private $editable= false;
     private $colorAlternate= false;
-    private $instantDelete= true;
+    private $instantDelete= false;
     private $action;
     private $mapping;
     private $current_mapping;
diff --git a/gosa-core/include/exporter/class_cvsExporter.inc b/gosa-core/include/exporter/class_csvExporter.inc
similarity index 92%
rename from gosa-core/include/exporter/class_cvsExporter.inc
rename to gosa-core/include/exporter/class_csvExporter.inc
index 5c7b076..7f6b62e 100644
--- a/gosa-core/include/exporter/class_cvsExporter.inc
+++ b/gosa-core/include/exporter/class_csvExporter.inc
@@ -27,7 +27,7 @@ class csvExporter
     foreach ($entries as $row) {
       foreach ($columns as $index) {
         if (isset($row["_sort$index"])){
-          $this->result.= trim($row["_sort$index"]).";";
+          $this->result.= trim(utf8_encode(html_entity_decode($row["_sort$index"]))).";";
         } else {
           $this->result.= ";";
         }
diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc
index 030d194..85d5e9b 100644
--- a/gosa-core/include/functions.inc
+++ b/gosa-core/include/functions.inc
@@ -24,8 +24,8 @@
  * Common functions and named definitions. */
 
 /* Define globals for revision comparing */
-$svn_path = '$HeadURL: https://oss.gonicus.de/repositories/gosa/tags/2.7.2/gosa-core/include/functions.inc $';
-$svn_revision = '$Revision: 21008 $';
+$svn_path = '$HeadURL: https://oss.gonicus.de/repositories/gosa/tags/2.7.3/gosa-core/include/functions.inc $';
+$svn_revision = '$Revision: 21092 $';
 
 /* Configuration file location */
 if(!isset($_SERVER['CONFIG_DIR'])){
@@ -2861,7 +2861,7 @@ function change_password ($dn, $password, $mode=FALSE, $hash= "", $old_password
     // Fetch the current object data, to be able to detect the current hashing method
     //  and to be able to rollback changes once has an error occured.
     $ldap = $config->get_ldap_link();
-    $ldap->cat ($dn, array("shadowLastChange", "userPassword","sambaNTPassword","sambaLMPassword", "uid"));
+    $ldap->cat ($dn, array("shadowLastChange", "userPassword","sambaNTPassword","sambaLMPassword", "uid", "objectClass"));
     $attrs = $ldap->fetch ();
     $initialAttrs = $attrs;
 
@@ -2879,7 +2879,9 @@ function change_password ($dn, $password, $mode=FALSE, $hash= "", $old_password
         // If we've still no valid hashing method detected, then try to extract if from the userPassword attribute.
         elseif(isset($attrs['userPassword'][0]) && preg_match ("/^{([^}]+)}(.+)/", $attrs['userPassword'][0], $matches)){
             $test = passwordMethod::get_method($attrs['userPassword'][0],$dn);
-            $hash = $test->get_hash_name();
+            if($test){
+                $hash = $test->get_hash_name();
+            }
         }
 
         // No current password was found and no hash is enforced, so we've to use the config default here.
@@ -2910,11 +2912,6 @@ function change_password ($dn, $password, $mode=FALSE, $hash= "", $old_password
             if(!count($attrs) || !is_array($attrs)){
                 msg_dialog::display(_("Error"),_("Cannot generate SAMBA hash!"),ERROR_DIALOG);
                 return(FALSE);    
-            }else{
-                $shadow = (isset($attrs["shadowLastChange"][0]))?(int)(date("U") / 86400):0;
-                if ($shadow != 0){
-                    $attrs['shadowLastChange']= $shadow;
-                }
             }
         }
 
@@ -2922,6 +2919,11 @@ function change_password ($dn, $password, $mode=FALSE, $hash= "", $old_password
         $ldap->cd($dn);
         $attrs['userPassword']= $newpass;
 
+        // For posixUsers - Set the last changed value.
+        if(in_array_strict("shadowAccount", $initialAttrs['objectClass'])){
+            $attrs['shadowLastChange'] = (int)(date("U") / 86400);
+        }
+
         // Prepare a special attribute list, which will be used for event hook calls
         $attrsEvent = array();
         foreach($initialAttrs as $name => $value){
@@ -3086,12 +3088,15 @@ function generate_smb_nt_hash($password)
       return ("");
     }
   } else {
+      $password = addcslashes($password, '$'); // <- Escape $ twice for transport from PHP to console-process.
+      $password = addcslashes($password, '$'); 
+      $password = addcslashes($password, '$'); // <- And again once, to be able to use it as parameter for the perl script.
 	  $tmp = $config->get_cfg_value("core",'sambaHashHook');
       $tmp = preg_replace("/%userPassword/", escapeshellarg($password), $tmp);
       $tmp = preg_replace("/%password/", escapeshellarg($password), $tmp);
 	  @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $tmp, "Execute");
 
-	  exec($tmp, $ar);
+ 	  exec($tmp, $ar);
 	  flush();
 	  reset($ar);
 	  $hash= current($ar);
@@ -3763,7 +3768,7 @@ function fillReplacements($str, $attrs, $shellArg = FALSE, $default = "")
         $value  = substr($attrs[$name], $start, $end);
 
         // Use values which are valid for shell execution?
-        if($shellArg) $value = escapeshellarg($value);
+        if($shellArg) $value = escapeshellcmd($value);
 
         // Replace the placeholder within the string.
         $str = preg_replace("/".preg_quote($match[0],'/')."/", $value, $str);
diff --git a/gosa-core/include/smartyAddons/function.factory.php b/gosa-core/include/smartyAddons/function.factory.php
index 10b15ff..423173d 100644
--- a/gosa-core/include/smartyAddons/function.factory.php
+++ b/gosa-core/include/smartyAddons/function.factory.php
@@ -21,7 +21,7 @@ function smarty_function_factory($params, &$smarty)
         case 'password' :
 
             // Maxlength has a default of 40 characters
-            $maxlengthReady = (empty($maxlength))?'maxlength="40"': $maxlengthReady; 
+            $maxlengthReady = (empty($maxlength))?'': $maxlengthReady; 
             $str .= "<input {$nameReady} {$idReady} {$valueReady} {$maxlengthReady}
             {$titleReady} {$onfocusReady} {$onkeyupReady} {$disabled} type='password'
             onkeypress=\"
diff --git a/gosa-core/include/utils/class_tests.inc b/gosa-core/include/utils/class_tests.inc
index 2bfbf0d..7facf09 100644
--- a/gosa-core/include/utils/class_tests.inc
+++ b/gosa-core/include/utils/class_tests.inc
@@ -46,9 +46,22 @@ class tests {
 
 
   /*! \brief Test if the given string contains characters allowed in a DNS name */
-  public static function is_dns_name($str)
+  public static function is_dns_name($str, &$reason = "", &$regex = "")
   {
-    return(preg_match("/^[a-z0-9\.\-_]*$/i",$str));
+    $regex = "[a-z0-9\.\-]";
+    if(preg_match("/\./", $str) && strlen($str) >= 255){
+        $reason = 1;
+        return(FALSE);
+    }
+    if(strlen(preg_replace("/\..*$/", "", $str)) > 63){
+        $reason = 2;
+        return(FALSE);
+    }    
+    if(!preg_match("/^{$regex}*$/i",$str)){
+        $reason = 3;
+        return(FALSE);
+    }
+    return(TRUE);
   }
 
 
diff --git a/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/gosa-core/plugins/admin/ogroups/class_ogroup.inc
index 0290e72..5fd372c 100644
--- a/gosa-core/plugins/admin/ogroups/class_ogroup.inc
+++ b/gosa-core/plugins/admin/ogroups/class_ogroup.inc
@@ -3,7 +3,7 @@
  * This code is part of GOsa (http://www.gosa-project.org)
  * Copyright (C) 2003-2008 GONICUS GmbH
  *
- * ID: $$Id: class_ogroup.inc 20952 2011-07-27 06:38:29Z hickert $$
+ * ID: $$Id: class_ogroup.inc 21052 2011-11-09 07:33:13Z hickert $$
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -150,7 +150,7 @@ class ogroup extends plugin
         // Prepare lists
         $this->memberListing = new sortableListing();
         $this->memberListing->setDeleteable(true);
-        $this->memberListing->setInstantDelete(true);
+        $this->memberListing->setInstantDelete(false);
         $this->memberListing->setEditable(false);
         $this->memberListing->setWidth("100%");
         $this->memberListing->setHeight("300px");
diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc
index 1b8e4a3..7d22009 100644
--- a/gosa-core/plugins/personal/generic/class_user.inc
+++ b/gosa-core/plugins/personal/generic/class_user.inc
@@ -3,7 +3,7 @@
  * This code is part of GOsa (http://www.gosa-project.org)
  * Copyright (C) 2003-2008 GONICUS GmbH
  *
- * ID: $$Id: class_user.inc 20952 2011-07-27 06:38:29Z hickert $$
+ * ID: $$Id: class_user.inc 21057 2011-11-09 07:59:17Z hickert $$
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -250,6 +250,7 @@ class user extends plugin
     }
     $this->gosaLoginRestrictionWidget= new sortableListing($this->gosaLoginRestriction);
     $this->gosaLoginRestrictionWidget->setDeleteable(true);
+    $this->gosaLoginRestrictionWidget->setInstantDelete(true);
     $this->gosaLoginRestrictionWidget->setColspecs(array('*'));
     $this->gosaLoginRestrictionWidget->setWidth("100%");
     $this->gosaLoginRestrictionWidget->setHeight("70px");
diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc
index 5549dfa..1275ce1 100644
--- a/gosa-core/plugins/personal/posix/class_posixAccount.inc
+++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc
@@ -3,7 +3,7 @@
  * This code is part of GOsa (http://www.gosa-project.org)
  * Copyright (C) 2003-2008 GONICUS GmbH
  *
- * ID: $$Id: class_posixAccount.inc 20971 2011-08-17 06:13:23Z hickert $$
+ * ID: $$Id: class_posixAccount.inc 21101 2012-01-16 07:53:16Z hickert $$
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -660,9 +660,10 @@ class posixAccount extends plugin
     }
     if ($this->mustchangepassword){
       $this->shadowLastChange= (int)(date("U") / 86400) - $this->shadowMax - 1;
-    } else {
-#      $this->shadowLastChange= (int)(date("U") / 86400);
+    } elseif($this->shadowLastChange == 0) {
+      $this->shadowLastChange= array();
     }
+
     if (!$this->activate_shadowWarning){
       $this->shadowWarning= "0";
     }
@@ -1106,14 +1107,11 @@ class posixAccount extends plugin
     $ldap->cd($this->config->current['BASE']);
     $ldap->search("(&(objectClass=posixGroup)(memberUid=".$this->attrs["uid"][0]."))", array("description", "cn"));
 
+    $groups = array();
     while ($this->attrs= $ldap->fetch()){
-      if (!isset($this->attrs["description"][0])){
-        $entry= $this->attrs["cn"][0];
-      } else {
-        $entry= $this->attrs["cn"][0]." [".$this->attrs["description"][0]."]";
-      }
-      $this->groupMembership[$ldap->getDN()]= $entry;
+      $groups[] = $ldap->getDN();
     }
+    $this->addGroup($groups);
 
     /* Fix primary group settings */
     $ldap->cd($this->config->current['BASE']);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/gosa.git



More information about the debian-edu-commits mailing list