public function deleteAction() { $id = mysql_real_escape_string($this->request->getParam("id")); $userId = current_user()->id; $project = load_project_where("id = '{$id}' and owner_id = '{$userId}'"); if ($project) { delete_project($project->id); $this->flash->setSuccess("Delete successfull!"); } $this->redirect_to(project_list_path()); }
$PId = $_POST['PId']; $Position = $_POST['Position']; $SpH = $_POST['SpH']; AddEmpPro($EId, $PId, $Position, $SpH); include 'view/project.php'; break; case 'add_project': $DId = $_POST['DId']; $Name = $_POST['Name']; $Info = $_POST['Info']; add_project($DId, $Name, $Info); include 'view/project.php'; break; case 'delete_project': $PId = $_POST['PId']; delete_project($PId); include 'view/project.php'; break; case 'show_employee': include 'view/list.php'; break; case 'delete_employee': $EId = $_POST['EId']; delete_employee($EId); include 'view/list.php'; break; case 'show_chamcong': include '/view/chamcong.php'; break; default: include 'view/dashboard.php';
private static function deleteOldProjects($dev, $github_repos) { if (count($github_repos) == 0) { return; } Makiavelo::info("-- Checking for non-active repos"); $saved_projects = list_project(null, null, 'owner_id = ' . $dev->id); foreach ($saved_projects as $sproj) { $found = false; foreach ($github_repos as $repo) { if ($sproj->name == $repo->name) { $found = true; break; } } if (!$found) { Makiavelo::info(" Deleting project: " . $sproj->name . " - " . $sproj->id); delete_project($sproj->id); } } }
echo ui_print_success_message (__('Successfully reactivated'), '', true, 'h3', true); audit_db ($config['id_user'], $REMOTE_ADDR, "Project activated", "User ".$config['id_user']." activated project #".$id_project); project_tracking ($id_project, PROJECT_ACTIVATED); } // Delete if ($delete_project) { if (!$project_permission['manage']) { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Forbidden", "User ".$config['id_user']." try to delete project #$id_project"); require ("general/noaccess.php"); exit; } $id_owner = get_db_value ('id_owner', 'tproject', 'id', $id_project); delete_project ($id_project); echo ui_print_success_message (__('Successfully deleted'), '', true, 'h3', true); } if ($view_disabled) { echo '<h2>'.__('Projects').'</h2>'; echo '<h4>'.__('Archived projects'); echo integria_help ("archieved_projects", true); echo '</h4>'; } $table = new stdClass; $table->class = 'search-table'; $table->style = array (); $table->data = array (); $table->data[0][0] = '<b>'.__('Search').'</b>';
//print_r($projects); } else { $projects = array(); } if (isset($_GET['search-users']) && !empty($_GET['user-keyword'])) { $users = get_searched_users($_GET['user-keyword']); //print_r($projects); } else { $users = array(); } //print_r($projects); if (isset($_POST['delete_user']) && !empty($_POST['delete_user'])) { $delete_users = delete_user($_POST['selectedusers']); } if (isset($_POST['delete_project']) && !empty($_POST['delete_project'])) { $delete_projects = delete_project($_POST['selectedprojects']); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Admin Panel</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet">
function Draw_Page($Page_Type) { // Read only pages - these pages don't strictly require user authentication. // Therefore, to enable permit-all page viewing, comment out the call // to rejectIfNotAuthenticated() in the relevant case block. Note, some of // these pages will replace sensitive info such as telephone/email with // the string 'PROTECTED' // ************************************************************************ switch ($Page_Type) { case "default": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/start_page.php'; startPage(); break; case "View_Service_Endpoint": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/view_service_endpoint.php'; view_endpoint(); break; case "Service_Groups": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service_group/view_all.php'; showAllServiceGroups(); break; case "Service_Group": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service_group/view_sgroup.php'; showServiceGroup(); break; case "Site": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/site/view_site.php'; view_site(); break; case "NGI": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/ngi/view_ngi.php'; view_ngi(); break; case "Service": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/view_service.php'; view_se(); break; case "Services": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/view_all.php'; drawSEs(); break; case "NGIs": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/ngi/view_ngis.php'; view_ngis(); break; case "Sites": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/site/view_all.php'; showAllSites(); break; case "Projects": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/project/view_all.php'; show_all_projects(); break; case "Project": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/project/view_project.php'; show_project(); break; case "Scope_Help": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/scope_help.php'; show_help(); break; case "Site_Geo_xml": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/sitesForGoogleMapXML.php'; show_xml(); break; case "Error_Redirect": //rejectIfNotAuthenticated(); show_view('error.php', $_REQUEST['error']); break; case "Static_HTML": //rejectIfNotAuthenticated(); Draw_Static_HTML(); break; case "Search": //rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/search.php'; search(); break; // CrUD Pages - These pages MUST have authentication enabled so // the calls to rejectIfNotAuthenticated() must be used. // ********************************************************************* // CrUD Pages - These pages MUST have authentication enabled so // the calls to rejectIfNotAuthenticated() must be used. // ********************************************************************* case "Revoke_Role": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/political_role/revoke_request.php'; view_revoke_request(); break; case "Accept_Role_Request": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/political_role/accept_request.php'; view_accept_request(); break; case "Deny_Role_Request": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/political_role/deny_request.php'; view_deny_request(); break; case "Role_Requests": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/political_role/view_requests.php'; view_requests(); break; case "Request_Role": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/political_role/request_role.php'; request_role(); break; case "Edit_Site": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/site/edit_site.php'; edit_site(); break; case "Edit_Service": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/edit_service.php'; edit_service(); break; case "SE_Downtimes": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/se_downtimes.php'; se_downtimes(); break; case "Add_Service": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/add_service.php'; add_service(); break; case "Add_Service_Endpoint": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/add_service_endpoint.php'; add_service_endpoint(); break; case "Delete_Service": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/delete_service.php'; delete(); break; case "Edit_User": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/user/edit_user.php'; edit_user(); break; case "User": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/user/view_user.php'; view_user(); break; case "Downtime": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/downtime/view_downtime.php'; view(); break; case "My_Sites": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/my_sites.php'; my_sites(); break; case "Edit_NGI": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/ngi/edit_ngi.php'; edit_ngi(); break; case "Edit_Service_Group": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service_group/edit_service_group.php'; edit_service_group(); break; case "Add_Service_Group_SEs": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service_group/add_ses.php'; add_ses(); break; case "Search_SEs": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service_group/search_ses.php'; search_ses(); break; case "Remove_Service_Group_SEs": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service_group/remove_ses.php'; remove_ses(); break; case "Add_Site": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/site/add_site.php'; add_site(); break; case "SGroup_Downtimes": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service_group/view_sgroup_downtimes.php'; view_sgroup_downtimes(); break; case "Add_Service_Group": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service_group/add_service_group.php'; add_service_group(); break; case "Site_Downtimes": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/site/site_downtimes.php'; site_downtimes(); break; case "Register": rejectIfNotAuthenticated('Access denied - ' . 'you need to be pre-authenticated before you can register a new account'); require_once __DIR__ . '/controllers/user/register.php'; register(); break; case "Add_Downtime": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/downtime/add_downtime.php'; //require_once __DIR__.'/controllers/downtime/add_downtime_old.php'; add(); break; case "Edit_Downtime": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/downtime/edit_downtime.php'; //require_once __DIR__.'/controllers/downtime/edit_downtime_old.php'; edit(); break; case "End_Downtime": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/downtime/end_downtime.php'; endDt(); break; case "Downtime_view_endpoint_tree": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/downtime/view_endpoint_tree.php'; getServiceandEndpointList(); break; case "Edit_Downtime_view_endpoint_tree": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/downtime/view_endpoint_tree.php'; editDowntimePopulateEndpointTree(); break; case "Downtime_View_Services": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/downtime/view_services.php'; getSitesServices(); break; case "Delete_Site": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/site/delete_site.php'; delete(); break; case "Delete_Downtime": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/downtime/delete_downtime.php'; delete(); break; case "Downtimes_Overview": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/downtime/downtimes_overview.php'; view(); break; case "Delete_Service_Group": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service_group/delete_service_group.php'; delete(); break; case "Delete_User": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/user/delete_user.php'; delete(); break; case "Edit_Certification_Status": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/site/edit_cert_status.php'; edit(); break; case "Retrieve_Account": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/user/retrieve_account.php'; retrieve(); break; case "Remove_Project_NGIs": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/project/remove_ngis.php'; remove_ngis_project(); break; case "Add_Project_NGIs": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/project/add_ngis.php'; add_ngis_to_project(); break; case "Edit_Project": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/project/edit_project.php'; edit_project(); break; case "Delete_Project": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/project/delete_project.php'; delete_project(); break; case "Admin_Move_Site": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/move_site.php'; move_site(); break; case "Admin_Move_SEP": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/move_service_end_point.php'; move_service_end_point(); break; case "Admin_Service_Types": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/view_service_types.php'; show_all(); break; case "Admin_Service_Type": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/view_service_type.php'; view_service_type(); break; case "Admin_Edit_Service_Type": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/edit_service_type.php'; edit_type(); break; case "Admin_Add_Service_Type": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/add_service_type.php'; add_type(); break; case "Admin_Delete_Service_Type": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/delete_service_type.php'; delete_service_type(); break; case "Admin_Delete_Service_Type_Denied": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/delete_service_type_denied.php'; deny_delete_type(); break; case "Admin_Add_NGI": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/add_ngi.php'; add_ngi(); break; case "Admin_Users": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/users.php'; show_users(); break; case "Admin_Edit_User_DN": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/edit_user_dn.php'; edit_dn(); break; // case "Admin_Change_User_Admin_Status": // rejectIfNotAuthenticated(); // require_once __DIR__.'/controllers/admin/edit_user_isadmin.php'; // make_admin(); // break; // case "Admin_Change_User_Admin_Status": // rejectIfNotAuthenticated(); // require_once __DIR__.'/controllers/admin/edit_user_isadmin.php'; // make_admin(); // break; case "Admin_Add_Project": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/add_project.php'; add_project(); break; case "Admin_Scopes": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/scopes.php'; show_scopes(); break; case "Admin_Remove_Scope": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/delete_scope.php'; remove_scope(); break; case "Admin_Add_Scope": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/add_scope.php'; add_scope(); break; case "Admin_Scope": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/scope.php'; view_scope(); break; case "Admin_Edit_Scope": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/edit_scope.php'; edit_scope(); break; case "Admin_Delete_NGI": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/admin/delete_ngi.php'; delete_ngi(); break; case "User_Validate_DN_Change": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/user/retrieve_account_user_validate.php'; validate_dn_change(); break; case "Add_Site_Property": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/site/add_site_property.php'; add_site_property(); break; case "Add_Service_Property": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/add_service_property.php'; add_service_property(); break; case "Add_Endpoint_Property": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/add_endpoint_property.php'; add_endpoint_property(); break; case "Delete_Site_Property": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/site/delete_site_property.php'; delete(); break; case "Delete_Service_Property": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/delete_service_property.php'; delete(); break; case "Delete_Endpoint_Property": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/delete_endpoint_property.php'; delete(); break; case "Edit_Site_Property": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/site/edit_site_property.php'; edit_property(); break; case "Edit_Service_Property": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/edit_service_property.php'; edit_property(); break; case "Edit_Endpoint_Property": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/edit_endpoint_property.php'; edit_property(); break; case "Add_Service_Group_Property": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service_group/add_service_group_property.php'; add_service_group_property(); break; case "Edit_Service_Group_Property": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service_group/edit_service_group_property.php'; edit_property(); break; case "Delete_Service_Group_Property": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service_group/delete_service_group_property.php'; delete(); break; case "Delete_Service_Endpoint": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/delete_service_endpoint.php'; delete_endpoint(); break; case "Edit_Service_Endpoint": rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/service/edit_service_endpoint.php'; edit_endpoint(); break; default: // require auth by default rejectIfNotAuthenticated(); require_once __DIR__ . '/controllers/start_page.php'; startPage(); break; } }
?> <div id="body" class="section"> <div class="content-box"> <h2> <?php echo $title; ?> ... </h2> <?php if (isset($_POST['project']) && isset($_POST['submit'])) { if (isset($_POST['delete_confirmation'])) { if ($_POST['delete_confirmation'] == "Delete") { foreach ($_POST['project'] as $project_name) { $result = delete_project($project_name); echo "<p>" . $result . "</p>"; } } } else { //list of files to be deleted ?> <h3> Are you sure you want to delete the project<?php echo count($_POST['project']) > 1 ? 's' : ''; ?> below? You won't be able to recover <?php echo count($_POST['project']) > 1 ? 'them' : 'it'; ?> .</h3> <ul> <?php
$projects = get_project_list($user); // make a function that returns all the projects of the user // I m now using this $page_url = url('http://localhost:8888/getData.php?req=getProjectList&data%5BuserId%5D='.$user); // $projects = getUserProjects($user); echo json_encode($projects, JSON_NUMERIC_CHECK); break; case 'getProjectEditIframe': $project = $_GET['project']; $iframe = "project_edit.php?project={$project}"; // make a function that returns an iframe of a project edition // maybe adding in parameters the login and password ? // $iframe = getEditIframe($project); echo $iframe; break; case 'getProjectDisplayIframe': $project = $_GET['project']; $iframe = "project_display.php?project={$project}"; // make a function that returns an iframe of a project display like in preview.html // $iframe = getDisplayIframe($project); echo $iframe; break; case 'deleteProject': $project = $_GET['project']; $result = delete_project($project); removeDir("project/{$_POST['data']['id']}"); // make a function that delete project // maybe adding in parameters the login and password ? // $result = deleteProject($project); echo $result; break; }
$description = $project[0]['description']; $category = $project[0]['category']; $target_funds = $project[0]['target_funds']; $start_date = $project[0]['start_date']; $end_date = $project[0]['end_date']; $img_url = $project[0]['img_url']; } else { if (isset($req_params['publish'])) { $project_title = htmlspecialchars($req_params['title']); $project_owner = htmlspecialchars($req_params['owner']); publish_project($project_title, $project_owner); } else { if (isset($_POST['submit']) && $_POST['submit'] == "Delete") { $prev_title = $_POST['prev_title']; print_r($prev_title); $deleted_project = delete_project($prev_title); if ($deleted_project) { $success = "Deleted your project!"; header('Location: http://localhost:8080/crowdsourcer/views/my_projects.php'); } else { $error = "Error occured. Please try again!"; } } else { } } } } } ?> <!DOCTYPE html> <html lang="en">
if (empty($deleteProject)) { $_SESSION['delete-project-message'] = "No project with that ID exists."; header("Location: load.php"); exit; } if ($deleteProject['user_id'] != $_SESSION['user_id']) { $_SESSION['delete-project-message'] = "You do not have access to that project."; header("Location: load.php"); exit; } if ($deleteProject['project_id'] == $activeProject['project_id']) { $_SESSION['delete-project-message'] = "Unable to delete active project. Switch to a different project to delete this one."; header("Location: load.php"); exit; } delete_project($deleteProject['project_id']); $_SESSION['delete-project-message'] = "Project deleted successfully."; header("Location: load.php"); exit; } $message = null; if (isset($_SESSION['delete-project-message'])) { $message = $_SESSION['delete-project-message']; unset($_SESSION['delete-project-message']); } ?> <!DOCTYPE html> <html> <head> <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
login($_POST['email'], $_POST['password']); } else { if ($function === 'logout') { logout(); } else { if ($function === 'signup') { signup($_POST['email']); } else { if ($function === 'verify-account') { verify_account($_POST['username'], $_POST['password'], $_POST['verify_code']); } else { if ($function === 'create-project') { create_project(); } else { if ($function == 'delete-project') { delete_project($_POST['project_url_name']); } else { if ($function == 'save-project-name') { save_project_name($_POST['project_id'], $_POST['new_value']); } else { if ($function == 'save-project-image') { save_project_image($_POST['project_id'], $_POST['new_value']); } else { if ($function == 'save-project-spec') { save_project_spec($_POST['project_id'], $_POST['new_value']); } else { echo "There was a hole."; } } } }
} require "templates/testimony.php"; } else { if ($page == "testimony_invite") { if (logged_in()) { //check if the user has submitted data in the form if (isset($_POST['email'])) { testimony_invite($_POST['email']); } require "templates/admin/testimony_invite.php"; } else { header("location:index.php?page=login&redirect=testimony_invite"); } } else { if ($page == "delete_project" && isset($_GET['id'])) { if (delete_project($_GET['id'])) { header("location:index.php#portfolio"); } } else { if ($page == "register" && isset($_GET['invite']) && logged_in() == false) { $pdo = pdo(); $invite = $_GET['invite']; //check if the user has submitted data in the form if (isset($_POST['username']) && isset($_POST['password'])) { $invite = $_GET['invite']; $statement = $pdo->prepare("SELECT * FROM register_invite_links WHERE invite LIKE '{$invite}'"); $statement->execute(); $status = $statement->fetch(); $status = $status['status']; $rowcount = $statement->rowCount(); if ($rowcount >= 1) {
<?php include 'libraries/initial.inc.php'; include 'libraries/project.lib.php'; if (isset($_GET['p'])) { $p = $_GET['p']; } else { $p = 0; } if (isset($_GET['o'])) { $o = $_GET['o']; } if (isset($o)) { if ($o == 'delete') { delete_project($p); success('successfully delete the project'); } if ($o == 'create') { if (isset($_POST['name'])) { $uid = $_SESSION["user"]["uid"]; $name = $_POST['name']; $priority = $_POST['priority']; $start = time_db($_POST['start']); $end = time_db($_POST['end']); $description = $_POST['description']; $tid = create_task($p, $uid, $name, $priority, $start, $end, $description); goto_url("task.php?t={$tid}"); } else { error('empty task name'); } }