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 105... Line 106...
105
 
106
 
106
$tmp_file = OIDplus::localpath().'userdata/windows_export.zip';
107
$tmp_file = OIDplus::localpath().'userdata/windows_export.zip';
107
 
108
 
108
$zip = new ZipArchive();
109
$zip = new ZipArchive();
109
if ($zip->open($tmp_file, ZipArchive::CREATE)!== true) {
110
if ($zip->open($tmp_file, ZipArchive::CREATE)!== true) {
110
        throw new OIDplusException("cannot open <$tmp_file>");
111
        throw new OIDplusException(_L("Cannot open file %1", $tmp_file));
111
}
112
}
112
 
113
 
113
$cont = '';
114
$cont = '';
114
 
115
 
115
foreach ($dos_ids as $oid => $dos_id) {
116
foreach ($dos_ids as $oid => $dos_id) {