Skip to content

Commit

Permalink
Fixed issue #5099: DB backup button throws error on non-MySQL databases
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@9983 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Apr 10, 2011
1 parent 22fab2f commit 27c9e5b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
11 changes: 1 addition & 10 deletions admin/dumpdb.php
Expand Up @@ -24,17 +24,8 @@
Header("Content-Disposition: attachment; filename=$file_name");
Header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
echo $export;
exit;
}
else
{
$dumpdboutput= "<br />\n"
."<table class='alertbox' >\n"
."\t<tr ><td height='4'><font size='1'><strong>".$clang->gT("Export database")."</strong></font></td></tr>\n"
."\t<tr ><td height='4'>".$clang->gT("The database export is only available for MySQL databases. For other database types please use the according backup mechanism to create a database dump.")."</td></tr>"
."</table><br />";
return;
}
exit;

/**
* Creates a full dump of the current LimeSurvey database
Expand Down
13 changes: 10 additions & 3 deletions admin/html.php
Expand Up @@ -2067,7 +2067,7 @@ function replacenewline ($texttoreplace)
*/
function showadminmenu()
{
global $homedir, $scriptname, $surveyid, $setfont, $imageurl, $clang, $debug, $action, $updateavailable, $updatebuild, $updateversion, $updatelastcheck;
global $homedir, $scriptname, $surveyid, $setfont, $imageurl, $clang, $debug, $action, $updateavailable, $updatebuild, $updateversion, $updatelastcheck, $databasetype;

$adminmenu = "<div class='menubar'>\n";
if ($_SESSION['pw_notify'] && $debug<2) {
Expand Down Expand Up @@ -2125,10 +2125,17 @@ function showadminmenu()
// db backup & label editor
if($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1)
{
if ($databasetype=='mysql' || $databasetype=='mysqli')
{
$adminmenu .= "<a href=\"#\" onclick=\"window.open('{$scriptname}?action=dumpdb', '_top')\" title=\"".$clang->gTview("Backup Entire Database")."\">\n"
."<img src='{$imageurl}/backup.png' name='ExportDB' alt='". $clang->gT("Backup Entire Database")."' />"
."</a>\n"
."<img src='{$imageurl}/seperator.gif' alt='' border='0' hspace='0' />\n";
."</a>\n";
}
else
{
$adminmenu .= "<img src='{$imageurl}/backup_disabled.png' name='ExportDB' alt='". $clang->gT("The database export is only available for MySQL databases. For other database types please use the according backup mechanism to create a database dump.")."' />";
}
$adminmenu.="<img src='{$imageurl}/seperator.gif' alt='' border='0' hspace='0' />\n";
}

if($_SESSION['USER_RIGHT_MANAGE_LABEL'] == 1)
Expand Down
Binary file added images/backup_disabled.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 27c9e5b

Please sign in to comment.