<?php require_once "models/config.php"; if (!securePage($_SERVER['PHP_SELF'])) { die; } require_once "models/header.php"; $isAdmin = $loggedInUser->checkPermission(array(2)); //Forms posted if (!empty($_POST)) { $deletions = $_POST['delete']; if ($deletion_count = deleteProject($deletions)) { $successes[] = lang("ACCOUNT_DELETIONS_SUCCESSFUL", array($deletion_count)); } else { $errors[] = lang("SQL_ERROR"); } } //$connection = mysqli_connect("devdb.fulgentcorp.com","2013teamb","29G8l!06J82ofpPw","2013teamb"); //$query = "SELECT p1.ProjectName FROM "."Project AS p1, "."ProjectUser AS p2 WHERE p1.ProjectID = p2.ProjectID AND p2.UserID = $loggedInUser->user_id"; //$query = "SELECT p1.ProjectName FROM "."Project AS p1, "."ProjectUser AS p2 WHERE p1.ProjectID = p2.ProjectID AND p2.UserID = $loggedInUser->user_id"; $result = fetchAllProjects(); //Left Nav bar echo "\r\n<body>\r\n<div id='wrapper'>\r\n<div id='top'><div id='logo'></div></div>\r\n<div id='content'>\r\n\r\n<div id='left-nav'>"; include "left-nav.php"; //Main Content echo "\r\n</div>\r\n<div id='main'>\r\n<h2>View Projects</h2>\r\n\r\n\r\n<h1 style='font-size:xx-medium;'>List of all projects you are apart of:</h1>\r\n"; echo "\r\n<form name='delete' action='" . $_SERVER['PHP_SELF'] . "' method='post'>\r\n<table class='admin'>\r\n<tr>\r\n<th>Delete</th><th>Project Name</th>\r\n</tr>"; //Cycle through users foreach ($result as $v1) { echo "\r\n\t<tr>"; if ($loggedInUser->user_id == $v1['Creator'] || $isAdmin) {
case 'update_task_state': if (isset($_POST["id_task"])) { error_log('update task » ' . $_POST["id_task"] . " " . isset($_POST["is_complete"])); updateTask($_POST["id_task"], isset($_POST["is_complete"])); } break; case 'clear_completed': if (isset($_POST["id_project"])) { error_log('clear_completed task » ' . $_POST["id_project"]); clearArchives($_POST["id_project"]); } break; case 'delete_project': if (isset($_POST["id_project"])) { error_log('delete_project task » ' . $_POST["id_project"]); if (deleteProject($_POST["id_project"])) { error_log("project deleted"); deselectProject(); header("HTTP/1.1 302 Redirect"); header("location:home.php"); } } break; case 'delete_category': if (isset($_POST["id_category"])) { error_log('delete_category task » ' . $_POST["id_category"]); if (deleteCategory($_POST["id_category"])) { error_log("category deleted"); //deselectProject(); header("HTTP/1.1 302 Redirect"); header("location:home.php");
<?php require_once dirname(__FILE__) . "/../include/master.inc.php"; if (!isLogin()) { redirect("login.php"); } $user = getUserInfo(); $error = ""; if (isset($_GET['action']) && $_GET['action'] == 'delete') { if (!deleteProject((int) $_GET['id'], $user['id'])) { $error = '<div ng-show="authMsg" class="alert alert-danger text-center ng-binding">You can\'t do this operation. There are maps assigned to this project.</div>'; } } if (isAdmin($user)) { $projects = getProjectsByUserId($user['id']); } else { $projects = getMyProjects($user['id']); } $PAGE = "PROJECT_VIEW"; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>View Projects</title> <?php require_once dirname(__FILE__) . "/../include/header.tpl.php"; ?>
if (authorize($_POST['email'])) { } else { redirect(sitepath()); } } else { if (isset($_POST["register"])) { createAccount($_POST['email'], $_POST['name']); } else { if (checkAuth()) { } else { redirect(sitepath()); } } } if (isset($_POST["projectToDelete"])) { deleteProject($_POST["projectToDelete"]); } ?> <html> <head> <?php head(); ?> <script type="text/javascript" src="project.js"></script> </head> <body> <?php topbar(); ?> <div id='main'>
/** * Suppression d'un projet * @param $db database * @param $prjidprj identifiant du projet à supprimer */ static function delete($db, $prjidprj) { //TODO Savoir s'il faut aussi supprimer les règles de gestion et les CDU deleteProject($db, $prjidprj); }
} break; case "POST": $results = addProject($data); break; case "PATCH": if (isset($path[1]) && trim($path[1]) !== "") { $data["projectID"] = $path[1]; } $results = editProject($data); break; case "DELETE": if (isset($path[1]) && trim($path[1]) !== "") { $data["projectID"] = $path[1]; } $results = deleteProject($data); break; default: $results["meta"] = methodNotAllowed($method, $path); } break; case "pictures": switch ($method) { case "GET": if (isset($path[1]) && trim($path[1]) !== "") { $data["projectID"] = $path[1]; } $results = getPictures($data); break; case "POST": if (isset($path[1]) && trim($path[1]) !== "") {
listProject(); break; case "create": $path = '../' . $DIR_projectsData . $projectName . '/RENDER_DATA/'; clear($path); $path = '../' . $DIR_projectsData . $projectName . '/'; clear($path); echo json_encode(array("code" => 0)); break; case "save": $pathToFile = $backPath . $DIR_projectsData . $projectName . '.vejs'; if (is_file($pathToFile)) { if ($_POST['forceSave'] == 'true') { saveProject($pathToFile, $fileContent); echo json_encode(array("code" => 0)); } else { echo json_encode(array("code" => 1, "info" => "The file already exist")); } } else { saveProject($pathToFile, $fileContent); echo json_encode(array("code" => 0)); } break; case "delete": $path = '../' . $DIR_projectsData . $projectName . '/'; $pathToFile = $backPath . $DIR_projectsData . $projectName . '.vejs'; echo deleteProject($path, $pathToFile); break; default: echo json_encode(array('code' => -1, "info" => "There are missing args")); }
manageProject($username, $finalFilePath, $description, $projectTitle); $projectArray = getProjectsListByUsername($username); } } else { $error = "Only .rar and .zip file types are allowed"; } } else { $error = "A file with the same project title already exists. Try different project title"; } } else { $description = ""; } if (isset($_GET['filePathToDelete'])) { $filePathToDelete = $_GET['filePathToDelete']; unlink($filePathToDelete); deleteProject($filePathToDelete); redirect_to("../userProject"); } } else { redirect_to("home"); } ?> <script type="text/javascript" language="javascript" src="js/userProject.js"></script> <script type="text/javascript" language="javascript"> function resetAdminArea(){ <?php if (isset($_SESSION['selectedUsername'])) { unset($_SESSION['selectedUsername']); }
$text = 'Your Ideathread "' . $project_title . '" has been removed.'; addNotification($sent_to, $text, $_SESSION['uid'], $url); deleteIdea($_POST['ideathread_id']); $response['result'] = 'OK'; echo json_encode($response); break; case 'delete-project': require_once DIR_APP . 'users.php'; require_once DIR_APP . 'projects.php'; $project_title = getProjectTitle($_POST['project_id']); //$author = getUserNameById($_SESSION['uid']); $url = ''; $sent_to = getProjectAuthor($_POST['project_id']); $text = 'Your Project "' . $project_title . '" has been removed.'; addNotification($sent_to, $text, $_SESSION['uid'], $url); deleteProject($_POST['project_id']); $response['result'] = 'OK'; echo json_encode($response); break; case 'delete-blogpost': require_once DIR_APP . 'users.php'; require_once DIR_APP . 'projects.php'; $project_title = getBlogPostTitle($_POST['post_id']); //$author = getUserNameById($_SESSION['uid']); $url = ''; $sent_to = getBlogPostAuthor($_POST['post_id']); $text = 'Your Blog Post "' . $project_title . '" has been removed.'; addNotification($sent_to, $text, $_SESSION['uid'], $url); deleteBlogPost($_POST['post_id']); $response['result'] = 'OK'; echo json_encode($response);
/** * Delete a project */ function deleteProject($user, $project) { $path = $user . "/" . $project; $dir = @opendir($path); if (!$dir) { return false; } while ($dir_file = readdir($dir)) { if ($dir_file == '.' || $dir_file == '..') { continue; } $file_path = $path . "/" . $dir_file; if (is_dir($file_path)) { $res = deleteProject($user, $project . "/" . $dir_file); if (!$res) { return false; } } else { $res = @unlink($file_path); if (!$res) { return false; } } } closedir($dir); $res = @rmdir($path); if (!$res) { return false; } return true; }
// ya break; case "REGISTRATION": verifyRegistration(); // ya break; case "SCHEDULE": setSchedule(); // ya break; case "NEWPROJECT": createProject(); // ya break; case "DELETEPROJECT": deleteProject(); // ya break; case "ADDUSER": addUser(); break; case "GETPROJECTS": getProjects(); // ya break; case "GETPROJECTINFO": getProjectInfo(); break; case "GETTASKS": getTasks(); break;
<?php include "../universal/config.php"; //---saveProject---// if (isset($_POST["saveProject"])) { include "saveProject.php"; $result = saveProject($_POST["q"], $_POST["projectName"], $_POST["shoot"], $_POST["video"], $_POST["photo"], $_POST["copy"], $_POST["shootDate"], $_POST["dueDate"], $_POST["notes"]); echo $result; } //---deleteProject---// if (isset($_POST["deleteProject"])) { include "deleteProject.php"; $result = deleteProject($_POST["projectName"]); echo $result; }