pari: branch 2.0 r3825 - /branches/2.0/config/backup.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Sep 16 14:29:16 CDT 2008


Author: pari
Date: Tue Sep 16 14:29:16 2008
New Revision: 3825

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3825
Log:

 Fix for:  AA50-2270 – IE7 popup blocker issue with downloading backup files



Modified:
    branches/2.0/config/backup.html

Modified: branches/2.0/config/backup.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/backup.html?view=diff&rev=3825&r1=3824&r2=3825
==============================================================================
--- branches/2.0/config/backup.html (original)
+++ branches/2.0/config/backup.html Tue Sep 16 14:29:16 2008
@@ -46,16 +46,6 @@
 	}
 </style>
 <script>
-/*
-WARNING: The 'Download bkp file' feature uses 'ln -s bkpfile /.../bkps/filename' and then points the browser to filename,
-	this is not safe as your config files might be available over the network to every one
-	depending on how your asterisk http bind address is configured.
-	May be one day we will have something like a 'basic http authentication' implemented in the asterisk webserver 
-
-Note: for opensource asterisk 1.4 (including AsteriskNOW versions with Asterisk 1.4) 
-      you can only download backup - there is no upload/restore
-*/
-
 var bkpPath = ( parent.sessionData.PLATFORM.isAA50 ) ? ASTGUI.paths.ConfigBkp_AA50 : ASTGUI.paths.ConfigBkp ;
 var upload_Filename = ""; // will be updated by upload_form.html
 var starteduploading = 0;
@@ -185,7 +175,18 @@
 function dld_bkp( filename ){
 	parent.ASTGUI.systemCmd( "mkdir -p "+ ASTGUI.paths.ConfigBkp_dldPath + " ; /bin/rm " + ASTGUI.paths.ConfigBkp_dldPath + "* ", function(){
 		parent.ASTGUI.systemCmd( "/bin/ln -s "+ bkpPath + filename + " " + ASTGUI.paths.ConfigBkp_dldPath + filename , function(){
-			window.location.href = "private/bkps/" + filename ;
+			var location_dir = window.location.href ;
+			location_dir = location_dir.rChop('backup.html') ;
+			var download_link =  location_dir + "private/bkps/" + filename ;
+			var save_text = ( jQuery.browser.msie ) ? "'Save Target As...'" : "'Save Link As..'" ;
+
+			ASTGUI.feedback( { msg:'Download using the <i>Download File</i> link', showfor:2 });
+			_$('backup_download_Link_url').innerHTML = '<center><A href="' + download_link + '"><b>Download File</b></A>'
+								+ "<BR>Right Click on the above link and download using the " + save_text + " option</center>" ;
+			$('#backup_download_Link').show();
+			//var dld_window = window.open ("", "mywindow","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=200");
+			//dld_window.document.write('<BR><center><A href="' + download_link + '"><b>Download From Unit</b></A></center>');
+
 		});
 	});
 }
@@ -304,6 +305,12 @@
 	<span class='refresh_icon' onclick="window.location.reload();" >&nbsp;<img src="images/refresh.png" title=" Refresh " border=0 >&nbsp;</span>
 </div>
 <div style='display:none;' id='nocf'> You need a&nbsp;&nbsp;<b>CompactFlash&reg;</b>&nbsp;&nbsp;to use this feature </div>
+
+<div id='backup_download_Link' style='display:none; background: #FFFFFF; border-style : solid; border-width: 1px ; border-color: #bdc7e7; border-style: solid ; margin:20px ; padding: 10px ;' >
+ <span style="float:right; font-size: 85%;" onclick="$('#backup_download_Link').hide();"><a href='#'>close</a></span>
+ <div id='backup_download_Link_url'></div>
+</div>
+
 <div id='thispageContent' style='text-align:center;'>
 	<div class='lite_Heading'>Manage Configuration Backups</div>
 	<center>




More information about the asterisk-gui-commits mailing list