Code

Updated device handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 16 Sep 2010 12:26:52 +0000 (12:26 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 16 Sep 2010 12:26:52 +0000 (12:26 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19707 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Device/Device.tpl
gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc

index d07dfeecf7248a3298ee5585aba3f4ce87dd1e41..486b389098c9bcb31465ef605f6dc4aeddb2ae97 100644 (file)
@@ -43,7 +43,7 @@
                     <td><LABEL for='owner'>{t}Owner{/t}</LABEL></td>
                     <td>
                         <input type="text" name="owner" value="{$owner_name}" 
-                            title="{$owner}" disabled style="width:120%;">
+                            title="{$owner}" disabled style="width:120px;">
 
                         {image path="images/lists/edit.png" action="editOwner" acl=$ownerACL}
                         {if $owner!=""}
@@ -61,7 +61,7 @@
                     <td><LABEL for='manager'>{t}Manager{/t}</LABEL></td>
                     <td>
                         <input type="text" name="manager" value="{$manager_name}" 
-                            title="{$manager}" disabled style="width:120%;">
+                            title="{$manager}" disabled style="width:120px;">
 
                         {image path="images/lists/edit.png" action="editManager" acl=$managerACL}
                         {if $manager!=""}
                 </tr>
                 <tr>
                     <td><LABEL for='deviceUUID'>{t}Device UUID{/t}</LABEL></td>
-                    <td> <input type="text" name="deviceUUID" value="{$deviceUUID}"></td>
+                    <td> 
+                        <input type="text" name="deviceUUID" value="{$deviceUUID}">
+                        {image path="images/lists/reload.png" action="reloadUUID"}
+                    </td>
                 </tr>
                 <tr>
                     <td><LABEL for='deviceStatus'>{t}Status{/t}</LABEL></td>
index f336a2738c244a276f3d1d108e6700461b2511ff..3c8634267eea5adb82f2e4b50bb20717bfc22184 100644 (file)
@@ -40,6 +40,15 @@ class Device extends plugin
         $this->orig_dn = $this->dn;
     }
 
+    
+    function genFakeUuid()
+    {
+        $strfmt = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
+        for($i=0;$i<strlen($strfmt);$i++)
+            if($strfmt[$i] == 'x') $strfmt[$i] = dechex(rand(0,15));
+        return($strfmt);
+    }
+
 
     function execute()
     {
@@ -47,7 +56,6 @@ class Device extends plugin
 
         if($this->dialog instanceOf singleUserSelect) return($this->dialog->execute());
 
-
         $smarty = get_smarty();
 
         // Assign ACL settings 
@@ -120,7 +128,8 @@ class Device extends plugin
         if(isset($_POST['add_users_cancel'])){
             $this->dialog = NULL;
         }
-        
+       
+        if(isset($_POST['reloadUUID']))  $this->deviceUUID = $this->genFakeUuid();
     }