-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanageimport.php
40 lines (35 loc) · 1.11 KB
/
manageimport.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
require("init.php");
$action = getArrayVal($_GET, "action");
$mainclasses = array("desktop" => "desktop",
"profil" => "profil",
"admin" => "admin_active"
);
$template->assign("mainclasses", $mainclasses);
//check if the user is admin
if (!$userpermissions["admin"]["add"])
{
$errtxt = $langfile["nopermission"];
$noperm = $langfile["accessdenied"];
$template->assign("errortext", "$errtxt<br>$noperm");
$template->display("error.tpl");
}
//basecamp import
if ($action == "basecamp")
{
// create new file object
$myfile = new datei();
// create new importer object
$importer = new importer();
// upload the file
$up = $myfile->upload("importfile", "files/" . CL_CONFIG . "/ics", 0);
if ($up)
{
$importer->importBasecampXmlFile(CL_ROOT . "/files/" . CL_CONFIG . "/ics/$up");
}
//delete the imported file
unlink(CL_ROOT . "/files/" . CL_CONFIG . "/ics/$up");
$loc = $url . "admin.php?action=system&mode=imported&msg=$importer->msgCount&peop=$importer->peopleCount&pro=$importer->projectCount&tsk=$importer->taskCount";
header("Location: $loc");
}
?>