function getName() { $tmpname = (int) basename($this->myPath); if ($tmpname > 0) { $user = $_SESSION["userid"]; if (chkproject($user, $tmpname)) { $name = $this->proObj->getProject($tmpname); $name = $name["name"]; if ($name and $tmpname) { return $name . "-" . $tmpname; } } } else { return basename($this->myPath); } }
$POST_MAX_SIZE = $POST_MAX_SIZE . "B"; $id = getArrayVal($_GET, "id"); $thisfile = getArrayVal($_GET, "file"); $mode = getArrayVal($_GET, "mode"); $action = getArrayVal($_GET, "action"); $name = getArrayVal($_POST, "name"); $desc = getArrayVal($_POST, "desc"); $tags = getArrayVal($_POST, "tags"); $title = getArrayVal($_POST, "title"); $upfolder = getArrayVal($_POST, "upfolder"); $project = array('ID' => $id); $template->assign("project", $project); $template->assign("mode", $mode); $classes = array("overview" => "overview", "msgs" => "msgs", "tasks" => "tasks", "miles" => "miles", "files" => "files_active", "users" => "users", "tracker" => "tracking"); $template->assign("classes", $classes); if (!chkproject($userid, $id)) { $errtxt = $langfile["notyourproject"]; $noperm = $langfile["accessdenied"]; $template->assign("errortext", "{$errtxt}<br>{$noperm}"); $template->display("error.tpl"); die; } if ($action == "uploadAsync") { if (!$userpermissions["files"]["add"]) { $errtxt = $langfile["nopermission"]; $noperm = $langfile["accessdenied"]; $template->assign("errortext", "<h2>{$errtxt}</h2><br>{$noperm}"); $template->display("error.tpl"); die; } //if a folder for upload is set
function limitResult(array $result, $userid) { $finresult = array(); $userid = (int) $userid; foreach ($result as $res) { if ($res["type"] != "project" and $res["type"] != "user") { if (chkproject($userid, $res["project"])) { array_push($finresult, $res); } } else { if (chkproject($userid, $res["ID"])) { array_push($finresult, $res); } } } return $finresult; }
} elseif ($action == "showproject") { if (!chkproject($userid, $id)) { $errtxt = $langfile["notyourproject"]; $noperm = $langfile["accessdenied"]; $template->assign("mode", "error"); $template->assign("errortext", "{$errtxt}<br>{$noperm}"); $template->display("error.tpl"); die; } $mainclasses = array("desktop" => "desktop", "profil" => "profil", "admin" => "admin"); $template->assign("mainclasses", $mainclasses); $proj = (object) new project(); $alluser = $user->getAllUsers(10000); $users = array(); foreach ($alluser as $all) { if (!chkproject($all['ID'], $id)) { array_push($users, $all); } } SmartyPaginate::disconnect(); $members = $proj->getProjectMembers($id, 14); $pro = $proj->getProject($id); $projectname = $pro['name']; $title = $langfile['members']; $template->assign("title", $title); $template->assign("projectname", $projectname); SmartyPaginate::assign($template); $template->assign("members", $members); $template->assign("users", $users); $template->display("projectmembers.tpl"); } elseif ($action == "onlinelist") {
} elseif ($action == "massassign") { $projects = $_POST['projects']; $user = $_POST['id']; $allprojects = $project->getProjects(1, 10000); $allpro = array(); foreach ($allprojects as $pro) { array_push($allpro, $pro[ID]); } if (!empty($allpro) and !empty($projects)) { $diff = array_diff($allpro, $projects); } elseif (empty($projects)) { $diff = $allpro; } if (!empty($projects)) { foreach ($projects as $pro) { if (!chkproject($user, $pro)) { if ($settings["mailnotify"]) { $usr = (object) new user(); $tuser = $usr->getProfile($user); if (!empty($tuser["email"])) { $userlang = readLangfile($tuser['locale']); $subject = $userlang["projectassignedsubject"] . ' (' . $userlang['by'] . ' ' . $username . ')'; $mailcontent = $userlang["hello"] . ",<br /><br/>" . $userlang["projectassignedtext"] . " <a href = \"" . $url . "manageproject.php?action=showproject&id={$pro}\">" . $url . "manageproject.php?action=showproject&id={$pro}</a>"; // send email $themail = new emailer($settings); $themail->send_mail($tuser["email"], $subject, $mailcontent); } } $project->assign($user, $pro); } }