Subversion Repositories oidplus

Rev

Rev 1156 | Rev 1266 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1156 Rev 1201
Line 18... Line 18...
18
 */
18
 */
19
 
19
 
20
use ViaThinkSoft\OIDplus\OIDplus;
20
use ViaThinkSoft\OIDplus\OIDplus;
21
use ViaThinkSoft\OIDplus\OIDplusGui;
21
use ViaThinkSoft\OIDplus\OIDplusGui;
22
use ViaThinkSoft\OIDplus\OIDplusException;
22
use ViaThinkSoft\OIDplus\OIDplusException;
-
 
23
use ViaThinkSoft\OIDplus\OIDplusHtmlException;
23
 
24
 
24
header('Content-Type:text/html; charset=UTF-8');
25
header('Content-Type:text/html; charset=UTF-8');
25
 
26
 
26
require_once __DIR__ . '/../../../../includes/oidplus.inc.php';
27
require_once __DIR__ . '/../../../../includes/oidplus.inc.php';
27
 
28
 
Line 34... Line 35...
34
if (OIDplus::baseConfig()->getValue('DISABLE_PLUGIN_ViaThinkSoft\OIDplus\OIDplusPageAdminNostalgia', false)) {
35
if (OIDplus::baseConfig()->getValue('DISABLE_PLUGIN_ViaThinkSoft\OIDplus\OIDplusPageAdminNostalgia', false)) {
35
        throw new OIDplusException(_L('This plugin was disabled by the system administrator!'));
36
        throw new OIDplusException(_L('This plugin was disabled by the system administrator!'));
36
}
37
}
37
 
38
 
38
if (!OIDplus::authUtils()->isAdminLoggedIn()) {
39
if (!OIDplus::authUtils()->isAdminLoggedIn()) {
39
        throw new OIDplusException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')));
40
        throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')));
40
}
41
}
41
 
42
 
42
if (!class_exists('ZipArchive')) {
43
if (!class_exists('ZipArchive')) {
43
        throw new OIDplusException(_L('The PHP extension "ZipArchive" needs to be installed to create a ZIP archive with an included database. Otherwise, you can just download the plain program without data.'));
44
        throw new OIDplusException(_L('The PHP extension "ZipArchive" needs to be installed to create a ZIP archive with an included database. Otherwise, you can just download the plain program without data.'));
44
}
45
}
Line 97... Line 98...
97
 
98
 
98
$tmp_file = OIDplus::localpath().'userdata/dos_export.zip';
99
$tmp_file = OIDplus::localpath().'userdata/dos_export.zip';
99
 
100
 
100
$zip = new ZipArchive();
101
$zip = new ZipArchive();
101
if ($zip->open($tmp_file, ZipArchive::CREATE)!== true) {
102
if ($zip->open($tmp_file, ZipArchive::CREATE)!== true) {
102
        throw new OIDplusException("cannot open <$tmp_file>");
103
        throw new OIDplusException(_L("Cannot open file %1", $tmp_file));
103
}
104
}
104
 
105
 
105
/**
106
/**
106
 * @param string $command
107
 * @param string $command
107
 * @param string $data
108
 * @param string $data