Code

Added download button
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 Aug 2006 09:23:02 +0000 (09:23 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 Aug 2006 09:23:02 +0000 (09:23 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4391 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/applications/class_applicationGeneric.inc
plugins/admin/applications/generic.tpl

index d58ac6e7cb75a1d3a6b65e13ef707ec7a5826d30..92da9a56b5aa783276265f1c6f52dcc7ec01bca0 100644 (file)
@@ -110,6 +110,18 @@ class application extends plugin
 
     $smarty= get_smarty();
 
+    if(isset($_POST['download'])){
+      header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+      header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
+      header("Cache-Control: no-cache");
+      header("Pragma: no-cache");
+      header("Cache-Control: post-check=0, pre-check=0");
+      header("Content-type: application/octet-stream");
+      header( "Content-disposition: attachment; filename=".$this->cn.".gotoLogonScript" );
+      echo $this->gotoLogonScript;
+      exit();
+    }
+
     /* Do we represent a valid group? */
     if (!$this->is_account && $this->parent == NULL){
       $display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\">&nbsp;<b>".
index 4877a8802f81a2dd28ffa30ad176e8a825b67605..c8a54ac1e96c3e19d35ddd6b73d0d7d9cfea8f70 100644 (file)
@@ -99,7 +99,8 @@
                        <h2><img src="images/fai_script.png" alt="{t}Script{/t}" align="middle">&nbsp;{t}Script{/t}</h2>
                        <textarea name="gotoLogonScript" style='width:99%;height:220px;' {$gotoLogonScriptACL}>{$gotoLogonScript}</textarea>
                        <input type="file" name="ScriptFile" value="{t}Import{/t}" {$gotoLogonScriptACL}>
-                       <input type="submit" name="upLoad" value="{t}Upload{/t}" {$gotoLogonScriptACL}>
+                       <input type="submit" name="upLoad" value="{t}Upload{/t}" {$gotoLogonScriptACL}>
+                       <input type='submit' name='download' value='{t}Download{/t}'>
                </td>
        </tr>
 </table>