diff --git a/README.md b/README.md index d12eebca..a6b94632 100644 --- a/README.md +++ b/README.md @@ -1,72 +1,38 @@ -`#html` `#css` `#js` `#php` `#master-in-software-engineering` +# PHP Local FileSystem explorer -# PHP Local FileSystem explorer +The main objective of this project is to replicate a system file explorer that allows the user to navigate, create directories and upload files in the same way as he would in his usual operating system. In order to get access to the dashboard, users need to be authenticated. Each user can only navigate through his/her personal directory which is located in root. -

- Version -

+## Index ->In this project you will have to create a system file explorer that allows the user to navigate, create directories and upload files in the same way as he would in his usual operating system. - ->The file explorer is a tool that allows you to directly view and manipulate the files and directories associated with a path, so you must take into account from which path the user starts and which path they can access. - - -## Index - -- [Requirements](#requirements) -- [Repository](#repository) +- [Table of Contents](#table-of-contents) - [Technologies used](#technologies-used) -- [Project delivery](#project-delivery) +- [Author](#author) - [Resources](#resources) -## Requirements - -- You cannot use file third-party libraries -- You will not be able to use global variables in PHP. -- You must use GIT -- You must use the PHP > v7 -- Create a clear and orderly directory structure -- Both the code and the comments must be written in English -- Use the camelCase code style to define variables and functions -- In the case of using HTML, never use inline styles -- In the case of using different programming languages ​​always define the implementation in separate terms -- Remember that it is important to divide the tasks into several sub-tasks so that in this way you can associate each particular step of the construction with a specific commit -- You should try as much as possible that the commits and the planned tasks are the same -Delete files that are not used or are not necessary to evaluate the project - -## Repository - -First of all you must fork this project into your GitHub account. +## Table of Contents -To create a fork on GitHub is as easy as clicking the “fork” button on the repository page. - -Fork on GitHub +| File / Folder | Description | +| ------------------- | ---------------------------------------------------------- | +| `assets` | CSS, Javascript, images, data, icons | +| `config` | Application configuration | +| `inc` | Snippets to share among pages | +| `public` | Files that can be directly accessed via HTTP/HTTPS | +| `package.json` | List the packages the project depends on | +| `package-lock.json` | Keep track of the exact version of every package installed | ## Technologies used -\* HTML - -\* CSS - -\* JS - -\* PHP - -## Project delivery - -To deliver this project you must follow the steps indicated in the document: - -- [Submitting a solution](https://www.notion.so/Submitting-a-solution-524dab1a71dd4b96903f26385e24cdb6) +- PHP +- Javascript +- HTML +- CSS -- You must include the project documentation in PDF format. -- You must include a presentation in PDF format explaining: - - Comparison of the original design (Wireframe) with the final result of the project - - Comparison of the use case diagram with the actions that the user can finally perform - - Comparison of the original use case diagram with the final user actions - - What lessons you’ve learned during this project - - What problems have you encountered when developing this project? - - How you have organized and distributed the tasks +## Author +- [@Gonzalo](https://github.com/gonzalogarahuetes) +- [@Jaime](https://github.com/jaimealcalde) +- [@Salvador](https://github.com/SalvaBandicoot) +- [@tam](https://github.com/tamtran2885) ## Resources diff --git a/assets/css/editing-modal.css b/assets/css/editing-modal.css new file mode 100644 index 00000000..48f28a01 --- /dev/null +++ b/assets/css/editing-modal.css @@ -0,0 +1,106 @@ +/*---------------------------------EDITING MODAL-------------------------------------*/ + +.editing__modal { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + align-items: center; + justify-content: center; + padding: 1rem; + background: rgba(0, 0, 0, 0.8); + cursor: pointer; + visibility: hidden; + opacity: 0; + transition: all 0.35s ease-in; +} +.editing__modal.is-visible { + visibility: visible; + opacity: 1; +} + +.modal-dialog { + position: relative; + max-width: 800px; + max-height: 80vh; + border-radius: 5px; + background: white; + overflow: auto; + cursor: default; +} + +.modal-dialog > * { + padding: 1rem; +} + +.modal-footer { + background: lightblue; + text-align: center; +} + +.modal__title { + color: rgba(0, 136, 169, 1); + margin-left: 1rem; +} + +.modal-header { + background: lightblue; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 1.25rem; +} + +[data-animation="slideInOutLeft"] .modal-dialog { + opacity: 0; + transform: translateX(-100%); + transition: all 0.5s var(--bounceEasing); +} + +[data-animation="slideInOutLeft"].is-visible .modal-dialog { + opacity: 1; + transform: none; + transition-delay: 0.2s; +} + +.close-modal { + padding: 0.5rem; + border-radius: 50%; + border: none; + color: white; + background-color: rgba(0, 136, 169, 1); + font-size: 0.5rem; +} + +.close-modal:hover { + background-color: rgba(0, 136, 169, 0.7); + cursor: pointer; +} + +.modal__input { + padding: 1rem; + font-size: 1.5; + border: 2px solid rgba(0, 136, 169, 1); + border-radius: 0.3rem; + margin: 0.5rem 0.5rem 0 0; +} + +.modal__input:focus { + background-color: lightblue; +} + +.modal__btn { + color: white; + padding: 1rem; + border-radius: 0.3rem; + border: none; + background-color: rgba(0, 136, 169, 1); + margin: 0.5rem 0.5rem; + cursor: pointer; +} + +.modal__btn:hover { + background-color: rgba(0, 136, 169, 0.7); +} diff --git a/assets/css/header.css b/assets/css/header.css new file mode 100644 index 00000000..fa08283c --- /dev/null +++ b/assets/css/header.css @@ -0,0 +1,46 @@ +.header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 10px 20px; + background: lightblue; +} + +.header__logout { + background-color: white; + border-radius: 1rem; + border: 1.5px solid rgba(0, 136, 169, 1); + margin-right: 1rem; + padding: 0.5rem 1rem; + text-decoration: none; + color: rgba(0, 136, 169, 1); +} + +.header__logout:hover { + background-color: rgba(0, 136, 169, 1); + border: 1.5px solid white; + color: white; + box-shadow: 5px 10px 18px rgba(0, 136, 169, 0.5); +} + +.header__search { + font-size: 16px; + padding: 0.5em 1rem; + background-color: #fff; + border: 1px solid rgba(0, 136, 169, 1); + border-radius: 1rem; + width: 200px; + margin: 15px 0; +} + +.header__search::placeholder { + color: rgba(0, 136, 169, 1); +} + +.header__search:focus { + outline: none; + background-color: rgba(0, 136, 169, 1); + border: 1.5px solid white; + color: white; + box-shadow: 5px 10px 18px rgba(0, 136, 169, 0.5); +} diff --git a/assets/css/login.css b/assets/css/login.css new file mode 100644 index 00000000..84145d9d --- /dev/null +++ b/assets/css/login.css @@ -0,0 +1,129 @@ +/*----------------------------------------LOGIN---------------------------------------*/ + +.darkbg { + display: flex; + flex-direction: column; + gap: 2rem; + text-align: center; + height: 100vh; + width: 100vw; + background-image: url("../img/dark-background-images-5561-5821-hd-wallpapers.jpg"); + background-repeat: no-repeat; + padding: 3rem; +} + +.login__div { + background-color: white; + margin: auto; + width: 35%; + padding: 2rem; + border-radius: 0.3rem; + border: 1.5px solid rgba(0, 136, 169, 1); + box-shadow: 5px 10px 18px rgba(0, 136, 169, 0.5); +} + +.login { + display: flex; + flex-direction: column; + gap: 1.3rem; + text-align: center; +} + +.login__input { + outline: none; + padding: 0.5rem; + border-radius: 0.3rem; + background-color: lightblue; + color: black; + font-size: 1.2rem; +} + +.login__input:focus { + background-color: rgba(0, 136, 169, 1); + color: white; +} + +.login__input::placeholder { + color: rgba(0, 136, 169, 1); +} + +.login__btn { + cursor: pointer; + padding: 0.5rem; + border-radius: 0.3rem; + font-size: 1.5rem; + background-color: rgba(0, 136, 169, 1); + color: white; +} + +.login__btn:hover { + background-color: rgba(0, 136, 169, 0.6); +} + +.login__title { + color: white; + font-size: 4rem; + margin: auto; + text-shadow: 0 0 7px #fff, 0 0 10px #fff, 0 0 21px #fff, + 0 0 42px rgba(0, 136, 169, 1), 0 0 82px rgba(0, 136, 169, 1), + 0 0 92px rgba(0, 136, 169, 1), 0 0 102px rgba(0, 136, 169, 1), + 0 0 151px rgba(0, 136, 169, 1); +} + +.login__subtitle { + color: white; + font-size: 2rem; +} + +.login__notlogged { + color: white; + font-size: 1.5rem; +} + +.signup { + text-decoration: none; + color: lightblue; +} + +.signup:hover { + text-shadow: 0 0 7px #fff, 0 0 10px #fff, 0 0 21px #fff, + 0 0 42px rgba(0, 136, 169, 1), 0 0 82px rgba(0, 136, 169, 1), + 0 0 92px rgba(0, 136, 169, 1), 0 0 102px rgba(0, 136, 169, 1), + 0 0 151px rgba(0, 136, 169, 1); +} + +.login__error { + margin: auto; + padding: 0.75rem; + width: 35%; + border: 1px solid rgba(241, 6, 6, 0.81); + background-color: rgba(220, 17, 1, 0.16); + box-shadow: 0px 0px 2px #ff0303; + color: #ff0303; + text-shadow: 2px 1px #00040a; + transition: 0.5s; + font-size: 1.2rem; +} + +.login__error:hover { + background-color: rgba(220, 17, 1, 0.33); + transition: 0.5s; +} + +.login__info { + margin: auto; + padding: 0.75rem; + width: 35%; + font-size: 1.2rem; + border: 1px solid rgba(36, 241, 6, 0.46); + background-color: rgba(7, 149, 66, 0.12156862745098039); + box-shadow: 0px 0px 2px #259c08; + color: #0ad406; + text-shadow: 2px 1px #00040a; + transition: 0.5s; +} + +.login__info:hover { + background-color: rgba(7, 149, 66, 0.35); + transition: 0.5s; +} diff --git a/assets/css/main.css b/assets/css/main.css new file mode 100644 index 00000000..4854cb9e --- /dev/null +++ b/assets/css/main.css @@ -0,0 +1,55 @@ +.main { + display: flex; +} + +.explorer { + width: 20%; + padding: 0px 20px; +} + +.explorer input { + font-size: 16px; + width: 150px; + margin: 15px 0; +} + +.new-folder { + color: white; + width: 150px; + padding: 9px 25px; + background-color: rgba(0, 136, 169, 1); + border: none; + border-radius: 10px; + font-size: 16px; + transition: all 0.3s ease 0s; + cursor: pointer; +} + +.new-folder:hover { + background-color: rgba(0, 136, 169, 0.8); +} + +.explorer__folders { + margin-top: 15px; +} + +.explorer__folders-root { + display: flex; + align-items: center; +} + +.display_folder-title { + margin-left: 20px; + display: flex; + align-items: center; + margin: 5px 10px; +} + +.main__anchor { + text-decoration: none; + color: rgba(0, 136, 169, 1); +} + +.main__anchor:hover { + color: rgba(0, 136, 169, 0.7); +} diff --git a/assets/css/middle.css b/assets/css/middle.css new file mode 100644 index 00000000..c79a661f --- /dev/null +++ b/assets/css/middle.css @@ -0,0 +1,64 @@ +.content { + width: 60%; + padding: 0px 5px; + margin-top: 10px; + margin-bottom: 10px; +} + +.content__guide { + width: 100%; + display: flex; + justify-content: space-between; + border-bottom: 1px solid #8b8a8b; + padding-bottom: 10px; +} + +.content__guide p { + font-size: 20px; +} + +.guide__p-right { + width: 45%; + display: grid; + grid-template-columns: 1.5fr 1.5fr 1fr; +} + +.guide_upload { + cursor: pointer; + transition: all 0.3s ease 0s; + border-radius: 10px; + background-color: #dbd0c0; + display: flex; + align-items: center; + justify-content: center; +} + +.guide_upload:hover { + opacity: 0.8; +} + +.content__folder { + border-bottom: 1px solid #8b8a8b; + padding-bottom: 5px; + display: flex; + align-items: center; + margin-top: 5px; + margin-bottom: 10px; +} + +.content__folder-title { + font-size: 20px; + text-decoration: none; + color: rgba(0, 136, 169, 1); +} + +.content__folder-title:hover { + color: rgba(0, 136, 169, 0.7); +} + +.display_folder { + display: grid; + grid-template-columns: 0.2fr 2.2fr 0.8fr 1fr; + align-items: center; + padding: 10px 0px; +} diff --git a/assets/css/modal-content.css b/assets/css/modal-content.css new file mode 100644 index 00000000..d2f02f93 --- /dev/null +++ b/assets/css/modal-content.css @@ -0,0 +1,48 @@ +.close { + color: #ffffff; + float: right; + font-size: 40px; + font-weight: bold; + max-height: 10%; + max-width: 10%; + margin-left: 4%; + margin-right: 3%; + margin-top: 2%; + margin-bottom: 0; +} + +.close:hover, +.close:focus { + color: #000; + text-decoration: none; + cursor: pointer; +} + +.modal { + display: none; /* Hidden by default */ + position: fixed; /* Stay in place */ + z-index: 1; /* Sit on top */ + margin: auto; + left: 0; + right: 0; + top: 0; + bottom: 0; + width: 95%; /* Full width */ + height: 95%; /* Full height */ + overflow: auto; /* Enable scroll if needed */ + background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */ + text-align: center; +} + +.modal-content { + width: 90%; + height: 90%; + max-width: 980px; + max-height: 980px; + margin-left: 10%; + margin-right: 10%; +} + +.modal__button3 { + background-color: red; +} diff --git a/assets/css/modal-upload.css b/assets/css/modal-upload.css new file mode 100644 index 00000000..2bad1c0c --- /dev/null +++ b/assets/css/modal-upload.css @@ -0,0 +1,52 @@ +.modal__file { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + display: none; + background: rgba(0, 0, 0, 0.8); + color: black; + transition: opacity 100ms ease-in; +} + +.modal__content-file { + max-width: 400px; + width: 90%; + position: relative; + margin: 10% auto; + padding: 20px; + border-radius: 3px; + background: #fcee6d; +} + +.modal__close-file { + position: absolute; + top: 0.5rem; + right: 0.5rem; + background-color: transparent; + border: none; + cursor: pointer; + transition: all 0.5s; +} + +.modal__close-file:hover { + transform: scale(1.5); + color: #626972; +} + +.button--small { + min-width: 4.5rem; + min-height: 2rem; + margin: 0.8rem; + background: #3498db; + border-radius: 28px; + font-family: Arial; + color: #ffffff; + text-decoration: none; +} + +.button--small:hover { + background: #3cb0fd; + text-decoration: none; +} diff --git a/assets/css/others.css b/assets/css/others.css new file mode 100644 index 00000000..263da6cc --- /dev/null +++ b/assets/css/others.css @@ -0,0 +1,21 @@ +.fileIcon { + width: 30px; + margin-right: 10px; +} + +.fileIcon-small { + width: 35px; + padding: 5px; + cursor: pointer; +} + +.fileIcon-medium { + width: 25px; + padding: 3px; + cursor: pointer; +} + +.fileIcon-large { + width: 3rem; + margin-left: 1rem; +} diff --git a/assets/css/right-bar.css b/assets/css/right-bar.css new file mode 100644 index 00000000..874f0231 --- /dev/null +++ b/assets/css/right-bar.css @@ -0,0 +1,84 @@ +.details { + padding: 0.5rem 1rem; + width: 20%; +} + +.details__header { + display: flex; + flex-wrap: wrap; + padding: 30px 20px; + border-bottom: 1px solid #8b8a8b; + align-items: center; +} + +.details__header p { + margin-right: 20px; +} + +.details__content { + margin-top: 20px; + padding: 15px; +} + +.details__content p { + margin: 5px 0px; + padding: 10px; +} + +.details__flex { + display: flex; + justify-content: space-between; +} + +.details__btn--edit { + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + padding: 0.3rem; + background-color: lightblue; + border-radius: 50%; + border: 1.5px solid rgba(0, 136, 169, 1); + margin: 0 1rem; +} + +.details__btn--edit:hover { + background-color: rgba(0, 136, 169, 1); + border: 1.5px solid lightblue; +} + +.details__btn--delete { + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + padding: 0.3rem; + background-color: lightblue; + border-radius: 50%; + border: 1.5px solid rgba(0, 136, 169, 1); +} + +.details__btn--delete:hover { + background-color: rgba(0, 136, 169, 1); + border: 1.5px solid lightblue; +} + +.details__preview { + cursor: pointer; + font-size: 1.2rem; + background-color: white; + width: 100%; + border-radius: 1rem; + border: 1.5px solid rgba(0, 136, 169, 1); + margin-right: 1rem; + padding: 0.5rem 1rem; + text-decoration: none; + color: rgba(0, 136, 169, 1); +} + +.details__preview:hover { + background-color: rgba(0, 136, 169, 1); + border: 1.5px solid white; + color: white; + box-shadow: 5px 10px 18px rgba(0, 136, 169, 0.5); +} diff --git a/assets/css/styles.css b/assets/css/styles.css new file mode 100644 index 00000000..47f9db18 --- /dev/null +++ b/assets/css/styles.css @@ -0,0 +1,24 @@ +@import url("../../assets/css/modal-content.css"); +@import url("../assets/css/login.css"); +@import url("../../assets/css/editing-modal.css"); +@import url("../../assets/css/header.css"); +@import url("../../assets/css/right-bar.css"); +@import url("../../assets/css/others.css"); +@import url("../../assets/css/middle.css"); +@import url("../../assets/css/main.css"); +@import url("../../assets/css/modal-upload.css"); + +@import url("https://fonts.googleapis.com/css2?family=Mukta&display=swap"); + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + margin: 0; + padding: 0; + overflow: scroll; + font-family: "Mukta", sans-serif; +} diff --git a/assets/data/users.json b/assets/data/users.json new file mode 100644 index 00000000..fd0ac1a4 --- /dev/null +++ b/assets/data/users.json @@ -0,0 +1,17 @@ +[ + { + "username": "ggarahuetes", + "email": "gonzaloarahuetes@gmail.com", + "password": "123123" + }, + { + "username": "username", + "email": "username@gmail.com", + "password": "123456" + }, + { + "username": "tamtran", + "email": "tamtran@gmail.com", + "password": "123456" + } +] \ No newline at end of file diff --git a/assets/icons/bug.svg b/assets/icons/bug.svg new file mode 100644 index 00000000..79fa5757 --- /dev/null +++ b/assets/icons/bug.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/cloudup.svg b/assets/icons/cloudup.svg new file mode 100644 index 00000000..66fd8c64 --- /dev/null +++ b/assets/icons/cloudup.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/delete.svg b/assets/icons/delete.svg new file mode 100644 index 00000000..5ff675fe --- /dev/null +++ b/assets/icons/delete.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/edit.svg b/assets/icons/edit.svg new file mode 100644 index 00000000..aab4339b --- /dev/null +++ b/assets/icons/edit.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/dark-background-images-5561-5821-hd-wallpapers.jpg b/assets/img/dark-background-images-5561-5821-hd-wallpapers.jpg new file mode 100644 index 00000000..a0b6914f Binary files /dev/null and b/assets/img/dark-background-images-5561-5821-hd-wallpapers.jpg differ diff --git a/assets/js/functions.js b/assets/js/functions.js new file mode 100644 index 00000000..0d60f3a6 --- /dev/null +++ b/assets/js/functions.js @@ -0,0 +1,17 @@ +// Display and close file modal +const uploadFile = document.getElementById("btn__upload"); +const modalFile = document.getElementById("modal__file"); +const modalFileClose = document.querySelector("#button-close-file"); +const closeModalFileBtn = document.querySelector("#cancel-modal-file"); + +uploadFile.addEventListener("click", openFileModal); +modalFileClose.addEventListener("click", closeFileModal); +closeModalFileBtn.addEventListener("click", closeFileModal); + +function openFileModal() { + modalFile.style.display = "block"; +} + +function closeFileModal() { + modalFile.style.display = "none"; +} diff --git a/assets/js/modal-content.js b/assets/js/modal-content.js new file mode 100644 index 00000000..5f084d9d --- /dev/null +++ b/assets/js/modal-content.js @@ -0,0 +1,14 @@ +var buttonShow = document.getElementById("btn-show"); +var buttonHidde = document.getElementById("btn-hidde"); +var modal = document.getElementById("modal"); + +buttonShow.addEventListener("click", show); +buttonHidde.addEventListener("click", hidde); + +function show() { + modal.style.display = "block"; +} + +function hidde() { + modal.style.display = "none"; +} \ No newline at end of file diff --git a/assets/js/modal_triggers.js b/assets/js/modal_triggers.js new file mode 100644 index 00000000..fae7596f --- /dev/null +++ b/assets/js/modal_triggers.js @@ -0,0 +1,32 @@ +const openEl = document.querySelector("[data-open]"); +const closeEl = document.querySelector("[data-close]"); +const isVisible = "is-visible"; + +openEl.addEventListener("click", function () { + const modalId = this.dataset.open; + document.getElementById(modalId).classList.add(isVisible); +}); + +closeEl.addEventListener("click", function () { + this.parentElement.parentElement.parentElement.classList.remove(isVisible); +}); + +document.addEventListener("click", (e) => { + if (e.target == document.querySelector(".editing__modal.is-visible")) { + document + .querySelector(".editing__modal.is-visible") + .classList.remove(isVisible); + } +}); + +document.addEventListener("keyup", (e) => { + // if we press the ESC + if ( + e.key == "Escape" && + document.querySelector(".editing__modal.is-visible") + ) { + document + .querySelector(".editing__modal.is-visible") + .classList.remove(isVisible); + } +}); diff --git a/config/app.php b/config/app.php new file mode 100644 index 00000000..c53e4a38 --- /dev/null +++ b/config/app.php @@ -0,0 +1,5 @@ + + + + + + + + <?= $title ?> + + + + + + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..ca174260 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "filesystem-explorer", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "filesystem-explorer", + "version": "1.0.0", + "license": "ISC" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..85f5d220 --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "filesystem-explorer", + "version": "1.0.0", + "description": "`#html` `#css` `#js` `#php` `#master-in-software-engineering`", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/gonzalogarahuetes/filesystem-explorer.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/gonzalogarahuetes/filesystem-explorer/issues" + }, + "homepage": "https://github.com/gonzalogarahuetes/filesystem-explorer#readme" +} diff --git a/public/landing-page.php b/public/landing-page.php new file mode 100644 index 00000000..983d2ca6 --- /dev/null +++ b/public/landing-page.php @@ -0,0 +1,44 @@ + +
+

A FILE MANAGER FOR THE ORGANIZED ONES

+

Create your own architecture of folders and keep track of all your stuff!

+ +
+ +
+

Not registered yet? and start!

+ Seems that you had already registered. Log in!
"; + break; + case "unregistered": + echo "
Seems that you are not registered yet!
"; + break; + case "password": + echo "
Wrong password. Who are you? 🧐
"; + break; + default: + break; + } + } + if (isset($_GET["info"]) && $_GET["info"] === "loggedout") { + echo "
Logged out successfuly. Hope you come back soon!
"; + } + ?> + + + + \ No newline at end of file diff --git a/public/login.php b/public/login.php new file mode 100644 index 00000000..fae0b032 --- /dev/null +++ b/public/login.php @@ -0,0 +1,3 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/root/Files/estamos.pdf b/public/root/Files/estamos.pdf new file mode 100644 index 00000000..4a2af40a Binary files /dev/null and b/public/root/Files/estamos.pdf differ diff --git a/public/root/Files/hola.php b/public/root/Files/hola.php new file mode 100644 index 00000000..2a643914 --- /dev/null +++ b/public/root/Files/hola.php @@ -0,0 +1,2 @@ +CSV \ No newline at end of file diff --git a/public/root/Icons/doc.svg b/public/root/Icons/doc.svg new file mode 100644 index 00000000..9448c4de --- /dev/null +++ b/public/root/Icons/doc.svg @@ -0,0 +1 @@ +DOC \ No newline at end of file diff --git a/public/root/Icons/exe.svg b/public/root/Icons/exe.svg new file mode 100644 index 00000000..cda350d0 --- /dev/null +++ b/public/root/Icons/exe.svg @@ -0,0 +1 @@ +EXE \ No newline at end of file diff --git a/public/root/Icons/folder.svg b/public/root/Icons/folder.svg new file mode 100644 index 00000000..323c1a39 --- /dev/null +++ b/public/root/Icons/folder.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/root/Icons/jpg.svg b/public/root/Icons/jpg.svg new file mode 100644 index 00000000..427aac10 --- /dev/null +++ b/public/root/Icons/jpg.svg @@ -0,0 +1 @@ +JPG \ No newline at end of file diff --git a/public/root/Icons/mp3.svg b/public/root/Icons/mp3.svg new file mode 100644 index 00000000..b6666e25 --- /dev/null +++ b/public/root/Icons/mp3.svg @@ -0,0 +1 @@ +MP3 \ No newline at end of file diff --git a/public/root/Icons/mp4.svg b/public/root/Icons/mp4.svg new file mode 100644 index 00000000..730d6ae6 --- /dev/null +++ b/public/root/Icons/mp4.svg @@ -0,0 +1 @@ +MP4 \ No newline at end of file diff --git a/public/root/Icons/odt.svg b/public/root/Icons/odt.svg new file mode 100644 index 00000000..156659ad --- /dev/null +++ b/public/root/Icons/odt.svg @@ -0,0 +1 @@ +ODT \ No newline at end of file diff --git a/public/root/Icons/pdf.svg b/public/root/Icons/pdf.svg new file mode 100644 index 00000000..ad1be4a3 --- /dev/null +++ b/public/root/Icons/pdf.svg @@ -0,0 +1 @@ +PDF \ No newline at end of file diff --git a/public/root/Icons/php.svg b/public/root/Icons/php.svg new file mode 100644 index 00000000..89dec4bf --- /dev/null +++ b/public/root/Icons/php.svg @@ -0,0 +1 @@ +PHP \ No newline at end of file diff --git a/public/root/Icons/png.svg b/public/root/Icons/png.svg new file mode 100644 index 00000000..642c79c2 --- /dev/null +++ b/public/root/Icons/png.svg @@ -0,0 +1 @@ +PNG \ No newline at end of file diff --git a/public/root/Icons/ppt.svg b/public/root/Icons/ppt.svg new file mode 100644 index 00000000..def3dbeb --- /dev/null +++ b/public/root/Icons/ppt.svg @@ -0,0 +1 @@ +PPT \ No newline at end of file diff --git a/public/root/Icons/rar.svg b/public/root/Icons/rar.svg new file mode 100644 index 00000000..4fff28dd --- /dev/null +++ b/public/root/Icons/rar.svg @@ -0,0 +1 @@ +RAR \ No newline at end of file diff --git a/public/root/Icons/svg.svg b/public/root/Icons/svg.svg new file mode 100644 index 00000000..05b6ed84 --- /dev/null +++ b/public/root/Icons/svg.svg @@ -0,0 +1 @@ +SVG \ No newline at end of file diff --git a/public/root/Icons/txt.svg b/public/root/Icons/txt.svg new file mode 100644 index 00000000..6208e3c1 --- /dev/null +++ b/public/root/Icons/txt.svg @@ -0,0 +1 @@ +TXT \ No newline at end of file diff --git a/public/root/Icons/zip.svg b/public/root/Icons/zip.svg new file mode 100644 index 00000000..e36bbffd --- /dev/null +++ b/public/root/Icons/zip.svg @@ -0,0 +1 @@ +ZIP \ No newline at end of file diff --git a/public/root/delete_file.php b/public/root/delete_file.php new file mode 100644 index 00000000..ddd36179 --- /dev/null +++ b/public/root/delete_file.php @@ -0,0 +1,8 @@ +$pathArr[$i]"; + } +} diff --git a/public/root/ggarahuetes_root/Coffee/mula/618a5daedd52c0.61940921.jpg b/public/root/ggarahuetes_root/Coffee/mula/618a5daedd52c0.61940921.jpg new file mode 100644 index 00000000..170370a1 Binary files /dev/null and b/public/root/ggarahuetes_root/Coffee/mula/618a5daedd52c0.61940921.jpg differ diff --git a/public/root/ggarahuetes_root/Coffee/mula/hdisfgds.svg b/public/root/ggarahuetes_root/Coffee/mula/hdisfgds.svg new file mode 100644 index 00000000..e69de29b diff --git a/public/root/ggarahuetes_root/Coffee/text.txt b/public/root/ggarahuetes_root/Coffee/text.txt new file mode 100644 index 00000000..e69de29b diff --git a/public/root/ggarahuetes_root/Local_FileSystem_explorer.docx b/public/root/ggarahuetes_root/Local_FileSystem_explorer.docx new file mode 100644 index 00000000..31704c9f Binary files /dev/null and b/public/root/ggarahuetes_root/Local_FileSystem_explorer.docx differ diff --git a/public/root/ggarahuetes_root/SampleCSVFile_11kb.csv b/public/root/ggarahuetes_root/SampleCSVFile_11kb.csv new file mode 100644 index 00000000..f9cf3866 --- /dev/null +++ b/public/root/ggarahuetes_root/SampleCSVFile_11kb.csv @@ -0,0 +1,100 @@ +1,"Eldon Base for stackable storage shelf, platinum",Muhammed MacIntyre,3,-213.25,38.94,35,Nunavut,Storage & Organization,0.8 +2,"1.7 Cubic Foot Compact ""Cube"" Office Refrigerators",Barry French,293,457.81,208.16,68.02,Nunavut,Appliances,0.58 +3,"Cardinal Slant-D Ring Binder, Heavy Gauge Vinyl",Barry French,293,46.71,8.69,2.99,Nunavut,Binders and Binder Accessories,0.39 +4,R380,Clay Rozendal,483,1198.97,195.99,3.99,Nunavut,Telephones and Communication,0.58 +5,Holmes HEPA Air Purifier,Carlos Soltero,515,30.94,21.78,5.94,Nunavut,Appliances,0.5 +6,G.E. Longer-Life Indoor Recessed Floodlight Bulbs,Carlos Soltero,515,4.43,6.64,4.95,Nunavut,Office Furnishings,0.37 +7,"Angle-D Binders with Locking Rings, Label Holders",Carl Jackson,613,-54.04,7.3,7.72,Nunavut,Binders and Binder Accessories,0.38 +8,"SAFCO Mobile Desk Side File, Wire Frame",Carl Jackson,613,127.70,42.76,6.22,Nunavut,Storage & Organization, +9,"SAFCO Commercial Wire Shelving, Black",Monica Federle,643,-695.26,138.14,35,Nunavut,Storage & Organization, +10,Xerox 198,Dorothy Badders,678,-226.36,4.98,8.33,Nunavut,Paper,0.38 +11,Xerox 1980,Neola Schneider,807,-166.85,4.28,6.18,Nunavut,Paper,0.4 +12,Advantus Map Pennant Flags and Round Head Tacks,Neola Schneider,807,-14.33,3.95,2,Nunavut,Rubber Bands,0.53 +13,Holmes HEPA Air Purifier,Carlos Daly,868,134.72,21.78,5.94,Nunavut,Appliances,0.5 +14,"DS/HD IBM Formatted Diskettes, 200/Pack - Staples",Carlos Daly,868,114.46,47.98,3.61,Nunavut,Computer Peripherals,0.71 +15,"Wilson Jones 1"" Hanging DublLock Ring Binders",Claudia Miner,933,-4.72,5.28,2.99,Nunavut,Binders and Binder Accessories,0.37 +16,Ultra Commercial Grade Dual Valve Door Closer,Neola Schneider,995,782.91,39.89,3.04,Nunavut,Office Furnishings,0.53 +17,"#10-4 1/8"" x 9 1/2"" Premium Diagonal Seam Envelopes",Allen Rosenblatt,998,93.80,15.74,1.39,Nunavut,Envelopes,0.4 +18,Hon 4-Shelf Metal Bookcases,Sylvia Foulston,1154,440.72,100.98,26.22,Nunavut,Bookcases,0.6 +19,"Lesro Sheffield Collection Coffee Table, End Table, Center Table, Corner Table",Sylvia Foulston,1154,-481.04,71.37,69,Nunavut,Tables,0.68 +20,g520,Jim Radford,1344,-11.68,65.99,5.26,Nunavut,Telephones and Communication,0.59 +21,LX 788,Jim Radford,1344,313.58,155.99,8.99,Nunavut,Telephones and Communication,0.58 +22,Avery 52,Carlos Soltero,1412,26.92,3.69,0.5,Nunavut,Labels,0.38 +23,Plymouth Boxed Rubber Bands by Plymouth,Carlos Soltero,1412,-5.77,4.71,0.7,Nunavut,Rubber Bands,0.8 +24,"GBC Pre-Punched Binding Paper, Plastic, White, 8-1/2"" x 11""",Carl Ludwig,1539,-172.88,15.99,13.18,Nunavut,Binders and Binder Accessories,0.37 +25,"Maxell 3.5"" DS/HD IBM-Formatted Diskettes, 10/Pack",Carl Ludwig,1539,-144.55,4.89,4.93,Nunavut,Computer Peripherals,0.66 +26,Newell 335,Don Miller,1540,5.76,2.88,0.7,Nunavut,Pens & Art Supplies,0.56 +27,SANFORD Liquid Accent Tank-Style Highlighters,Annie Cyprus,1702,4.90,2.84,0.93,Nunavut,Pens & Art Supplies,0.54 +28,Canon PC940 Copier,Carl Ludwig,1761,-547.61,449.99,49,Nunavut,Copiers and Fax,0.38 +29,"Tenex Personal Project File with Scoop Front Design, Black",Carlos Soltero,1792,-5.45,13.48,4.51,Nunavut,Storage & Organization,0.59 +30,Col-Erase Pencils with Erasers,Grant Carroll,2275,41.67,6.08,1.17,Nunavut,Pens & Art Supplies,0.56 +31,"Imation 3.5"" DS/HD IBM Formatted Diskettes, 10/Pack",Don Miller,2277,-46.03,5.98,4.38,Nunavut,Computer Peripherals,0.75 +32,"White Dual Perf Computer Printout Paper, 2700 Sheets, 1 Part, Heavyweight, 20 lbs., 14 7/8 x 11",Don Miller,2277,33.67,40.99,19.99,Nunavut,Paper,0.36 +33,Self-Adhesive Address Labels for Typewriters by Universal,Alan Barnes,2532,140.01,7.31,0.49,Nunavut,Labels,0.38 +34,Accessory37,Alan Barnes,2532,-78.96,20.99,2.5,Nunavut,Telephones and Communication,0.81 +35,Fuji 5.2GB DVD-RAM,Jack Garza,2631,252.66,40.96,1.99,Nunavut,Computer Peripherals,0.55 +36,Bevis Steel Folding Chairs,Julia West,2757,-1766.01,95.95,74.35,Nunavut,Chairs & Chairmats,0.57 +37,Avery Binder Labels,Eugene Barchas,2791,-236.27,3.89,7.01,Nunavut,Binders and Binder Accessories,0.37 +38,Hon Every-Day Chair Series Swivel Task Chairs,Eugene Barchas,2791,80.44,120.98,30,Nunavut,Chairs & Chairmats,0.64 +39,"IBM Multi-Purpose Copy Paper, 8 1/2 x 11"", Case",Eugene Barchas,2791,118.94,30.98,5.76,Nunavut,Paper,0.4 +40,Global Troy Executive Leather Low-Back Tilter,Edward Hooks,2976,3424.22,500.98,26,Nunavut,Chairs & Chairmats,0.6 +41,XtraLife ClearVue Slant-D Ring Binders by Cardinal,Brad Eason,3232,-11.83,7.84,4.71,Nunavut,Binders and Binder Accessories,0.35 +42,Computer Printout Paper with Letter-Trim Perforations,Nicole Hansen,3524,52.35,18.97,9.03,Nunavut,Paper,0.37 +43,6160,Dorothy Wardle,3908,-180.20,115.99,2.5,Nunavut,Telephones and Communication,0.57 +44,Avery 49,Aaron Bergman,4132,1.32,2.88,0.5,Nunavut,Labels,0.36 +45,Hoover Portapower Portable Vacuum,Jim Radford,4612,-375.64,4.48,49,Nunavut,Appliances,0.6 +46,Timeport L7089,Annie Cyprus,4676,-104.25,125.99,7.69,Nunavut,Telephones and Communication,0.58 +47,Avery 510,Annie Cyprus,4676,85.96,3.75,0.5,Nunavut,Labels,0.37 +48,Xerox 1881,Annie Cyprus,4676,-8.38,12.28,6.47,Nunavut,Paper,0.38 +49,LX 788,Annie Cyprus,4676,1115.69,155.99,8.99,Nunavut,Telephones and Communication,0.58 +50,"Cardinal Slant-D Ring Binder, Heavy Gauge Vinyl",Annie Cyprus,5284,-3.05,8.69,2.99,Nunavut,Binders and Binder Accessories,0.39 +51,"Memorex 4.7GB DVD-RAM, 3/Pack",Clay Rozendal,5316,514.07,31.78,1.99,Nunavut,Computer Peripherals,0.42 +52,Unpadded Memo Slips,Don Jones,5409,-7.04,3.98,2.97,Nunavut,Paper,0.35 +53,"Adams Telephone Message Book W/Dividers/Space For Phone Numbers, 5 1/4""X8 1/2"", 300/Messages",Beth Thompson,5506,4.41,5.88,3.04,Nunavut,Paper,0.36 +54,"Eldon Expressions Desk Accessory, Wood Pencil Holder, Oak",Frank Price,5569,-0.06,9.65,6.22,Nunavut,Office Furnishings,0.55 +55,Bell Sonecor JB700 Caller ID,Michelle Lonsdale,5607,-50.33,7.99,5.03,Nunavut,Telephones and Communication,0.6 +56,Avery Arch Ring Binders,Ann Chong,5894,87.68,58.1,1.49,Nunavut,Binders and Binder Accessories,0.38 +57,APC 7 Outlet Network SurgeArrest Surge Protector,Ann Chong,5894,-68.22,80.48,4.5,Nunavut,Appliances,0.55 +58,"Deflect-o RollaMat Studded, Beveled Mat for Medium Pile Carpeting",Joy Bell,5925,-354.90,92.23,39.61,Nunavut,Office Furnishings,0.67 +59,Accessory4,Joy Bell,5925,-267.01,85.99,0.99,Nunavut,Telephones and Communication,0.85 +60,Personal Creations Ink Jet Cards and Labels,Skye Norling,6016,3.63,11.48,5.43,Nunavut,Paper,0.36 +61,High Speed Automatic Electric Letter Opener,Barry Weirich,6116,-1759.58,1637.53,24.49,Nunavut,"Scissors, Rulers and Trimmers",0.81 +62,Xerox 1966,Grant Carroll,6182,-116.79,6.48,6.65,Nunavut,Paper,0.36 +63,Xerox 213,Grant Carroll,6182,-67.28,6.48,7.86,Nunavut,Paper,0.37 +64,"Boston Electric Pencil Sharpener, Model 1818, Charcoal Black",Adrian Hane,6535,-19.33,28.15,8.99,Nunavut,Pens & Art Supplies,0.57 +65,Hammermill CopyPlus Copy Paper (20Lb. and 84 Bright),Skye Norling,6884,-61.21,4.98,4.75,Nunavut,Paper,0.36 +66,"Telephone Message Books with Fax/Mobile Section, 5 1/2"" x 3 3/16""",Skye Norling,6884,119.09,6.35,1.02,Nunavut,Paper,0.39 +67,Crate-A-Files,Andrew Gjertsen,6916,-141.27,10.9,7.46,Nunavut,Storage & Organization,0.59 +68,"Angle-D Binders with Locking Rings, Label Holders",Ralph Knight,6980,-77.28,7.3,7.72,Nunavut,Binders and Binder Accessories,0.38 +69,"80 Minute CD-R Spindle, 100/Pack - Staples",Dorothy Wardle,6982,407.44,39.48,1.99,Nunavut,Computer Peripherals,0.54 +70,"Bush Westfield Collection Bookcases, Dark Cherry Finish, Fully Assembled",Dorothy Wardle,6982,-338.27,100.98,57.38,Nunavut,Bookcases,0.78 +71,12-1/2 Diameter Round Wall Clock,Dorothy Wardle,6982,52.56,19.98,10.49,Nunavut,Office Furnishings,0.49 +72,SAFCO Arco Folding Chair,Grant Carroll,7110,1902.24,276.2,24.49,Nunavut,Chairs & Chairmats, +73,"#10 White Business Envelopes,4 1/8 x 9 1/2",Barry Weirich,7430,353.20,15.67,1.39,Nunavut,Envelopes,0.38 +74,3M Office Air Cleaner,Beth Paige,7906,271.78,25.98,5.37,Nunavut,Appliances,0.5 +75,"Global Leather and Oak Executive Chair, Black",Sylvia Foulston,8391,-268.36,300.98,64.73,Nunavut,Chairs & Chairmats,0.56 +76,Xerox 1936,Nicole Hansen,8419,70.39,19.98,5.97,Nunavut,Paper,0.38 +77,Xerox 214,Nicole Hansen,8419,-86.62,6.48,7.03,Nunavut,Paper,0.37 +78,Carina Double Wide Media Storage Towers in Natural & Black,Nicole Hansen,8833,-846.73,80.98,35,Nunavut,Storage & Organization,0.81 +79,Staples General Use 3-Ring Binders,Beth Paige,8995,8.05,1.88,1.49,Nunavut,Binders and Binder Accessories,0.37 +80,Xerox 1904,Beth Paige,8995,-78.02,6.48,5.86,Northwest Territories,Paper,0.36 +81,Luxo Professional Combination Clamp-On Lamps,Beth Paige,8995,737.94,102.3,21.26,Northwest Territories,Office Furnishings,0.59 +82,Xerox 217,Beth Paige,8995,-191.28,6.48,8.19,Northwest Territories,Paper,0.37 +83,Revere Boxed Rubber Bands by Revere,Beth Paige,8995,-21.49,1.89,0.76,Northwest Territories,Rubber Bands,0.83 +84,"Acco Smartsocket Table Surge Protector, 6 Color-Coded Adapter Outlets",Sylvia Foulston,9126,884.08,62.05,3.99,Northwest Territories,Appliances,0.55 +85,"Tennsco Snap-Together Open Shelving Units, Starter Sets and Add-On Units",Bryan Davis,9127,-329.49,279.48,35,Northwest Territories,Storage & Organization,0.8 +86,Hon 4070 Series Pagoda Round Back Stacking Chairs,Joy Bell,9509,2825.15,320.98,58.95,Northwest Territories,Chairs & Chairmats,0.57 +87,Xerox 1887,Joy Bell,9509,2.13,18.97,5.21,Northwest Territories,Paper,0.37 +88,Xerox 1891,Joy Bell,9509,707.15,48.91,5.81,Northwest Territories,Paper,0.38 +89,Avery 506,Alan Barnes,9763,75.13,4.13,0.5,Northwest Territories,Labels,0.39 +90,"Bush Heritage Pine Collection 5-Shelf Bookcase, Albany Pine Finish, *Special Order",Grant Carroll,9927,-270.63,140.98,53.48,Northwest Territories,Bookcases,0.65 +91,"Lifetime Advantage Folding Chairs, 4/Carton",Grant Carroll,9927,3387.35,218.08,18.06,Northwest Territories,Chairs & Chairmats,0.57 +92,Microsoft Natural Multimedia Keyboard,Grant Carroll,9927,-82.16,50.98,6.5,Northwest Territories,Computer Peripherals,0.73 +93,"Staples Wirebound Steno Books, 6"" x 9"", 12/Pack",Delfina Latchford,10022,-3.88,10.14,2.27,Northwest Territories,Paper,0.36 +94,"GBC Pre-Punched Binding Paper, Plastic, White, 8-1/2"" x 11""",Don Jones,10437,-191.22,15.99,13.18,Northwest Territories,Binders and Binder Accessories,0.37 +95,Bevis Boat-Shaped Conference Table,Doug Bickford,10499,31.21,262.11,62.74,Northwest Territories,Tables,0.75 +96,"Linden 12"" Wall Clock With Oak Frame",Doug Bickford,10535,-44.14,33.98,19.99,Northwest Territories,Office Furnishings,0.55 +97,Newell 326,Doug Bickford,10535,-0.79,1.76,0.7,Northwest Territories,Pens & Art Supplies,0.56 +98,Prismacolor Color Pencil Set,Jamie Kunitz,10789,76.42,19.84,4.1,Northwest Territories,Pens & Art Supplies,0.44 +99,Xerox Blank Computer Paper,Anthony Johnson,10791,93.36,19.98,5.77,Northwest Territories,Paper,0.38 +100,600 Series Flip,Ralph Knight,10945,4.22,95.99,8.99,Northwest Territories,Telephones and Communication,0.57 diff --git a/public/root/ggarahuetes_root/film.mp4 b/public/root/ggarahuetes_root/film.mp4 new file mode 100644 index 00000000..3b468401 Binary files /dev/null and b/public/root/ggarahuetes_root/film.mp4 differ diff --git a/public/root/ggarahuetes_root/intro.pdf b/public/root/ggarahuetes_root/intro.pdf new file mode 100644 index 00000000..a7451051 Binary files /dev/null and b/public/root/ggarahuetes_root/intro.pdf differ diff --git a/public/root/ggarahuetes_root/pooh/jerry.txt b/public/root/ggarahuetes_root/pooh/jerry.txt new file mode 100644 index 00000000..6660f720 --- /dev/null +++ b/public/root/ggarahuetes_root/pooh/jerry.txt @@ -0,0 +1,4 @@ +xcvxvxvxc +dfgdgdgdgd +cvbvcb + diff --git a/public/root/ggarahuetes_root/pooh/rabbit/superman/pizza.php b/public/root/ggarahuetes_root/pooh/rabbit/superman/pizza.php new file mode 100644 index 00000000..706b505b --- /dev/null +++ b/public/root/ggarahuetes_root/pooh/rabbit/superman/pizza.php @@ -0,0 +1,2 @@ + +
+ + +

Welcome,

+ Logout +
+
+
+
method="post" class="new-"> + + +
+
+
+ +

/

+
+ +
+ +

/trash

+
+
+
+
+
+

Name

+
+

Size

+

Modified

+ +
+
+
+ +

/ / trash" ?>

+
+
+ +
+ + +
+ +
+ +

" . ($name ? $name : '') . "

+ + +
+
+
+

Type:

+

" . ($type ? $type : '') . "

+
+
+

Size:

+

" . ($size ? $size : '') . "

+
+
+

Modified:

+

" . ($modified ? $modified : '') . "

+
+
+

Created:

+

" . ($created ? $created : '') . "

+
+
+ + "; + } + + if (isset($_SESSION["fileInfoTrash"]) && isset($_SESSION["fileInfoTrash"])) { + $currentUserPathTrash = $_SESSION["fileInfoTrash"]["path"]; + $nameTrash = $_SESSION["fileInfoTrash"]["name"]; + $typeTrash = strtoupper($_SESSION["fileInfoTrash"]["type"]); + $sizeTrash = $_SESSION["fileInfoTrash"]["size"]; + $modifiedTrash = $_SESSION["fileInfoTrash"]["modified"]; + $createdTrash = $_SESSION["fileInfoTrash"]["created"]; + $shortNameTrash = $_SESSION["fileInfoTrash"]["shortName"]; + echo " +
+
+ +

" . ($nameTrash ? $nameTrash : '') . "

+ +
+
+
+

Type:

+

" . ($typeTrash ? $typeTrash : '') . "

+
+
+

Size:

+

" . ($sizeTrash ? $sizeTrash : '') . "

+
+
+

Modified:

+

" . ($modifiedTrash ? $modifiedTrash : '') . "

+
+
+

Created:

+

" . ($createdTrash ? $createdTrash : '') . "

+
+
+ +
"; + } + unset($_SESSION["fileInfoTrash"]); + unset($_SESSION["fileInfo"]); + unset($_SESSION["showing-trash"]); + ?> + + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/public/root/new_folder.php b/public/root/new_folder.php new file mode 100644 index 00000000..c055240f --- /dev/null +++ b/public/root/new_folder.php @@ -0,0 +1,4 @@ + +
+ + +

Welcome,

+ Logout +
+
+
+
+ method="post" + class="new-" + > + + +
+
+
+ +

/

+ / + +
+ +
+
+
+
+

Name

+
+

Size

+

Modified

+ +
+
+
+ +

/

+
+
+ +
+
+
+ +
+ + + +
+ + + \ No newline at end of file diff --git a/public/root/select-file-rightbar.php b/public/root/select-file-rightbar.php new file mode 100644 index 00000000..a9031dc7 --- /dev/null +++ b/public/root/select-file-rightbar.php @@ -0,0 +1,113 @@ + +
+ + +

Welcome,

+ Logout +
+
+
+
+ method="post" + class="new-" + > + + +
+
+
+ +

/

+
+ +
+
+
+
+

Name

+
+

Size

+

Modified

+ +
+
+
+ +

+

/

+ / + +

+
+
+ +
+
+
+ + + +
+ + + +
+ + + \ No newline at end of file diff --git a/public/root/select-file.php b/public/root/select-file.php new file mode 100644 index 00000000..bd47ff19 --- /dev/null +++ b/public/root/select-file.php @@ -0,0 +1,8 @@ + $file, "name" => $dirName, "type" => "Folder", "size" => $size, "modified" => $modified, "created" => $created, "shortName" => $dirName); + } else { + $fileInfo = getFileInfo($file); + } + $_SESSION["fileInfo"] = $fileInfo; + header("Location: ./index.php"); +} + +function selectFileTrash($file) +{ + session_start(); + $explodeSlash = explode("/", $file); + $modified = date("F d Y", filemtime($file)); + $created = date("F d Y", filectime($file)); + + if (is_dir($file)) { + $size = convertBytes(folderSize($file)); + $dirName = $explodeSlash[count($explodeSlash) - 1]; + + $fileInfo = array("path" => $file, "name" => $dirName, "type" => "Folder", "size" => $size, "modified" => $modified, "created" => $created, "shortName" => $dirName); + } else { + $fileInfo = getFileInfo($file); + } + $_SESSION["fileInfoTrash"] = $fileInfo; + header("Location: ./index.php"); +} + +function getFileInfo($file) +{ + $explodeDot = explode(".", $file); + $explodeSlash = explode("/", $file); + $doubleExplode = explode("/", $explodeDot[count($explodeDot) - 2]); + $modified = date("F d Y", filemtime($file)); + $created = date("F d Y", filectime($file)); + $type = $explodeDot[count($explodeDot) - 1]; + $shortName = $doubleExplode[count($doubleExplode) - 1]; + $name = $explodeSlash[count($explodeSlash) - 1]; + $bytes = filesize($file); + $size = convertBytes($bytes); + + $fileInfo = array("path" => $file, "name" => $name, "type" => $type, "size" => $size, "modified" => $modified, "created" => $created, "shortName" => $shortName); + + return $fileInfo; +} + +function folderSize($dir) +{ + $size = 0; + + foreach (glob(rtrim($dir, '/') . '/*', GLOB_NOSORT) as $each) { + $size += is_file($each) ? filesize($each) : folderSize($each); + } + + return $size; +} + +function convertBytes($bytes) +{ + if ($bytes < 1024) { + $size = $bytes . " bytes"; + } elseif (1024 <= $bytes && $bytes < 1048576) { + $size = number_format($bytes / 1024, 2) . " Kb"; + } else { + $size = number_format($bytes / 1048576, 2) . " Mb"; + } + return $size; +} + +function fileToTrash($file) +{ + session_start(); + + $explodePath = explode("root", __DIR__); + $explodeSlash = explode("/", $file); + $fileName = $explodeSlash[count($explodeSlash) - 1]; + + if (is_dir($file)) { + foreach (glob($file) as $f) { + fileToTrash($f); + } + $newPath = $explodePath[0] . "trash\\" . $fileName; + } else { + // $folderName = dirname($file); + // $arrPath = explode($_SESSION["username"] . "_root/", $folderName); + // if ($folderName !== $_SESSION["username"] . "_root") { + // $newPath = $explodePath[0] . "trash" . "\\" . $arrPath[count($arrPath) - 1] . "\\" . $fileName; + // } else { + // $newPath = $explodePath[0] . "trash" . "\\" . $fileName; + // } + $newPath = $explodePath[0] . "trash" . "\\" . $fileName; + } + rename($file, $newPath); + header("Location: ./index.php"); + + if (isset($_SESSION["fileInfo"])) unset($_SESSION["fileInfo"]); +} + +function deleteFile($file) +{ + if (is_dir($file)) { + foreach (glob($file) as $f) { + deleteFile($f); + } + rmdir($file); + } else { + unlink($file); + } + + session_start(); + + header("Location: ./index.php"); + + if (isset($_SESSION["fileInfo"])) unset($_SESSION["fileInfo"]); +} + +function editFile($file, $newName,) +{ + session_start(); + $explodeDot = explode(".", $file); + $extension = "." . $explodeDot[count($explodeDot) - 1]; + $wholePath = dirname($file); + $explodeRoot = explode($_SESSION["username"] . "_root/", $wholePath); + + $newCompleteName = "./" . $_SESSION["username"] . "_root/" . $explodeRoot[1] . "/" . $newName . $extension; + + rename($file, $newCompleteName); + + $_SESSION["fileInfo"] = getFileInfo($newCompleteName); + + $_SESSION["fileInfo"]["path"] = $_SESSION["username"] . "_root/" . $explodeRoot[1] . "/" . $newName . $extension; + $_SESSION["fileInfo"]["shortName"] = $newName; + $_SESSION["fileInfo"]["name"] = $newName . $extension; + header("Location: ./index.php"); +} + +function listFolderFiles($basePath) +{ + $items = scandir($basePath); + unset($items[array_search('.', $items, true)]); + unset($items[array_search('..', $items, true)]); + // prevent empty ordered elements + if (count($items) < 1) return; + foreach ($items as $item) { + $fileExtension = explode(".", $item); + $fileActualExt = strtolower(end($fileExtension)); + if (is_dir($basePath . '/' . $item)) { + echo "

$item

"; + } else { + echo "

$item

"; + } + } +} + +function displayInfoParentFolder($basePath) +{ + if (is_dir($basePath)) { + $dirContent = scandir($basePath); + foreach ($dirContent as $v) { + $fileExtension = explode(".", $v); + $fileActualExt = strtolower(end($fileExtension)); + $sizeOfFile = get_folder_size($basePath . "/" . $v); + $timeModified = date("F d Y", filemtime($basePath . "/" . $v)); + if (is_dir($basePath . "/" . $v)) { + if ($v !== '.' && $v !== '..') { + echo " +
+ +

$v

+

$sizeOfFile

+

$timeModified

+
"; + } + } else { + echo " +
+ +

$v

+

$sizeOfFile

+

$timeModified

+
"; + } + } + } else { + $arrayPath = explode("/", $basePath); + $fileName = $arrayPath[count($arrayPath) - 1]; + $fileExtension = explode(".", $basePath); + $fileActualExt = strtolower(end($fileExtension)); + $sizeOfFile = convertBytes(filesize($basePath)); + $timeModified = date("F d Y", filemtime($basePath)); + echo " +
+ +

$fileName

+

$sizeOfFile

+

$timeModified

+
"; + } +} +function listFolderDetails($basePath) +{ + if (is_file($basePath)) { + $fileExtension = explode(".", $basePath); + $fileActualExt = strtolower(end($fileExtension)); + $sizeOfFile = filesize($basePath); + $timeModified = date("F d Y", filemtime($basePath)); + $name = basename($basePath); + echo " +
+ +

$name

+

$sizeOfFile

+

$timeModified

+
"; + } + if (is_dir($basePath)) { + $dirContent = scandir($basePath); + foreach ($dirContent as $v) { + $fileExtension = explode(".", $v); + $fileActualExt = strtolower(end($fileExtension)); + $sizeOfFile = get_folder_size($basePath . "/" . $v); + $timeModified = date("F d Y", filemtime($basePath . "/" . $v)); + if (!is_file($basePath . "/" . $v)) { + if (!($v == '.')) { + if (!($v == '..')) { + echo " +
+ +

$v

+

$sizeOfFile

+

$timeModified

+
"; + } + } + } + if (is_file($basePath . "/" . $v)) { + echo " +
+ +

$v

+

$sizeOfFile

+

$timeModified

+
"; + } + } + } +} + +function get_folder_size($folder) +{ + $total_size = 0; + if (is_file($folder)) { + $total_size = $total_size + filesize($folder); + } + if (is_dir($folder)) { + $files = scandir($folder); + foreach ($files as $file) { + if ($file === '.' or $file === '..') { + continue; + } else { + $path = $folder . '/' . $file; + $total_size = $total_size + filesize($path); + get_folder_size($path); + } + } + } + return $total_size; +} + +// Upload files +function upload($realPath) +{ + if (isset($_POST['submit'])) { + $file = $_FILES['fileUpload']; + + $fileName = $_FILES['fileUpload']['name']; + $fileType = $_FILES['fileUpload']['type']; + $fileTempDir = $_FILES['fileUpload']['tmp_name']; + $fileSize = $_FILES['fileUpload']['size']; + $fileError = $_FILES['fileUpload']['error']; + + $fileExt = explode('.', $fileName); + $fileActualExt = strtolower(end($fileExt)); + + $allowedFileType = array('jpg', 'jpeg', 'png', 'pdf', 'odt', 'txt', 'svg', 'mp3', 'mp4', 'csv'); + + if (in_array($fileActualExt, $allowedFileType)) { + if ($fileError === 0) { + if ($fileSize < 1000000) { + $fileNewName = uniqid('', true) . '.' . $fileActualExt; + $fileDestination = $realPath . "/" . $fileNewName; + move_uploaded_file($fileTempDir, $fileDestination); + header('Location: ./index.php?uploadsuccess'); + } else { + echo "Error while uploading file / file size is too big"; + } + } else { + echo "Error while uploading file"; + } + } else { + echo "Can not upload file of this type"; + } + } +} + +// Display Path +function displayPath($getFile) +{ + $arrayPath = array(); + $breakFullPath = explode("/", $getFile); + $currentIndex = ""; + for ($i = 0; $i < count($breakFullPath); $i++) { + $currentIndex = $currentIndex . $breakFullPath[$i] . "/"; + array_push($arrayPath, $currentIndex); + } + // print_r($arrayPath); + $arrayActual = array_slice($arrayPath, 2); + + foreach ($arrayActual as $index => $c) { + $n = basename($c); + echo "" . $n . "/" . " " . ""; + } +} + +// Display details of folder/file on right bar +function displayDetails($basePath) +{ + if (is_file($basePath)) { + $fileExtension = explode(".", $basePath); + $fileActualExt = strtolower(end($fileExtension)); + + $getFileName = explode("/", $basePath); + $fileActualName = end($getFileName); + + $sizeOfFile = filesize($basePath); + + $timeModified = date("F d Y", filemtime($basePath)); + echo " +
+ +

$fileActualName

+ + +
+
+
+

Type:

+

$fileActualExt

+
+
+

Size:

+

$sizeOfFile

+
+
+

Modified:

+

$timeModified

+
+
+

Created:

+

NN

+
+
"; + } + if (is_dir($basePath)) { + $getFileName = explode("/", $basePath); + $fileActualName = end($getFileName); + + $sizeOfFile = get_folder_size($basePath); + $timeModified = date("F d Y", filemtime($basePath)); + echo " +
+ +

$fileActualName

+ + +
+
+
+

Type:

+

Folder

+
+
+

Size:

+

$sizeOfFile

+
+
+

Modified:

+

$timeModified

+
+
+

Created:

+

NN

+
+
"; + } +} + +function showTrash() +{ + + $_SESSION["showing-trash"] = true; + + $trashContent = scandir("../trash"); + foreach ($trashContent as $v) { + $fileExtension = explode(".", $v); + $fileActualExt = strtolower(end($fileExtension)); + $sizeOfFile = get_folder_size("../trash/" . $v); + $timeModified = date("F d Y", filemtime("../trash/" . $v)); + if (is_dir("../trash/" . $v)) { + if ($v !== '.' && $v !== '..') { + echo " +
+ +

$v

+

$sizeOfFile

+

$timeModified

+
"; + } + } else { + echo " +
+ +

$v

+

$sizeOfFile

+

$timeModified

+
"; + } + } +} + diff --git a/public/root/username_root/coco/6189b7e0d1c554.26479465.jpg b/public/root/username_root/coco/6189b7e0d1c554.26479465.jpg new file mode 100644 index 00000000..7e666268 Binary files /dev/null and b/public/root/username_root/coco/6189b7e0d1c554.26479465.jpg differ diff --git a/public/root/username_root/totoro_small.txt b/public/root/username_root/totoro_small.txt new file mode 100644 index 00000000..4c07f2cf --- /dev/null +++ b/public/root/username_root/totoro_small.txt @@ -0,0 +1,8 @@ +sdkbfjkdsfjkdsf + +dsfsdfdsfs + +sdfdsfsdf + +sdfdsfsdf + diff --git a/public/root/visualice-files.php b/public/root/visualice-files.php new file mode 100644 index 00000000..95430a9d --- /dev/null +++ b/public/root/visualice-files.php @@ -0,0 +1,131 @@ + + × + "; + + if(isset($type)){ + + switch ($type) { + case "mp4": + case "mp3": + echo " + + "; + break; + + case "jpg": + case "png": + case "svg": + echo " + + "; + break; + + case "ogg": + echo " + + "; + break; + + case "zip": + $zip = zip_open("$name"); + if ($zip) { + while ($zip_entry = zip_read($zip)) { + echo "File content:\n"; + $buf = zip_entry_read($zip_entry); + echo "$buf\n
"; + zip_entry_close($zip_entry); + } + zip_close($zip); + } + break; + + case "pdf": + echo " + + + + "; + break; + + case "csv": + define('CSV', '$name'); + $readCsv = array_map('str_getcsv', file(CSV)); + echo ""; + foreach ($readCsv as $itemCsv) { + echo ''; + foreach ($itemCsv as $elementoItemCSV) { + echo ''; + } + echo ''; + } + echo "
'; + echo $elementoItemCSV; + echo '
"; + break; + + case "doc": + case "docx": + case "odt": + case "ppt": + case "pptx": + echo " +

The office file cannot be previsualized Download

+ "; + break; + + case "exe": + echo " +

This file cannot be previsualized Download

+ "; + break; + + case "php": + ini_set('highlight.comment', '#CCCCCC; font-weight: bold;'); + highlight_file($name); + break; + + case "rar": + echo " +

This file cannot be previsualized Download

+ "; + break; + + case "txt": + $archivo = file_get_contents("$name"); + $archivo = ucfirst($archivo); + $archivo = nl2br($archivo); + echo " + Archivo de texto archivo.txt: +

+

$archivo

+ "; + break; + + default: + echo " +

You can't show this file Download

+ "; + } + } + + echo " + + "; +} \ No newline at end of file diff --git a/public/session_control.php b/public/session_control.php new file mode 100644 index 00000000..d77c1476 --- /dev/null +++ b/public/session_control.php @@ -0,0 +1,173 @@ + $username, + "email" => $email, + "password" => $password, + ]; + + $jsonData = json_encode($usersData, JSON_PRETTY_PRINT); + + file_put_contents($usersJsonFile, $jsonData); //this line equals: + //fopen($usersJsonFile, "w"); + //fwrite($usersJsonFile, $jsonData); + //fclose($usersJsonFile); + + $_SESSION["username"] = $username; + mkdir("./root/" . $username . "_root", 0777); + header("Location: ./root"); +} + +function checkSignUp($username, $password, $reppass, $email, $usersJsonFile) +{ + $jsonData = file_get_contents($usersJsonFile); + + $usersData = json_decode($jsonData, true); + + //case user already registered + + foreach ($usersData as $user) { + if (array_search($username, $user) !== false) { + $error = "registered"; + } + } + + //email not valid + + if (!filter_var($email, FILTER_VALIDATE_EMAIL) && !isset($error)) $error = "email"; + + //case short password or username + + if (strlen($password) < 6 || strlen($username) < 6) $error = "short"; + + //case passwords unmatch + + if ($password !== $reppass && !isset($error)) $error = "unmatch"; + + //no errors + + if (!isset($error)) $error = ""; + + return $error; +} diff --git a/public/signup-page.php b/public/signup-page.php new file mode 100644 index 00000000..4c0ffacd --- /dev/null +++ b/public/signup-page.php @@ -0,0 +1,44 @@ + + +
+

A FILE MANAGER FOR THE ORGANIZED ONES

+

Create your own architecture of folders and keep track of all your stuff!

+ +
+ +
+ Both passwords must match
"; + break; + case "email": + echo "
Your email looks weird, try a valid one instead
"; + break; + case "short": + echo "
Username or password is less than six characters long. Please, don't be lazy
"; + break; + default: + break; + } + } + ?> + + + + + \ No newline at end of file diff --git a/public/signup.php b/public/signup.php new file mode 100644 index 00000000..5a70755d --- /dev/null +++ b/public/signup.php @@ -0,0 +1,4 @@ +