This commit is contained in:
Fándly Gergő 2019-08-10 15:30:59 +03:00
parent a4b2be4d9a
commit d24a3edef4
6 changed files with 119 additions and 4 deletions

View File

@ -1,4 +1,4 @@
RewriteEngine on
RewriteRule ^([a-zA-Z_]+)\/((config|proj|res|script|style|subs|uploads|websvn)\/?([a-zA-Z_.\/]+)?)$ /$2 [L,R]
RewriteRule ^([a-zA-Z_]+)\/((config|proj|res|script|style|subs|uploads)\/([a-zA-Z_.\/]+)?)$ /$2 [L,R]
RewriteRule ^(config|mailer|proj|res|script|style|subs|uploads|websvn)\/?(.)+?$ - [L]
RewriteRule ^([a-zA-Z_]+)(\/([a-zA-Z0-9_:]+))?\/?$ index.php?view=$1&sub=$3 [L,QSA]

View File

@ -110,6 +110,10 @@ unlimited="Unlimited"
finish="Finalize!"
send_message="Send message"
smessage="Message"
projectlist="Project list"
description="Description"
path="Path"
repository="Repository"
;Errors
error[1]="Wrong username or password!"

View File

@ -3,7 +3,7 @@ cookie_message="Ez a weboldal sütiket használ, hogy a legjobb felhasználói
cookie_dismiss="Értettem!"
cookie_link="Tudj meg többet"
index="Kezdőlap"
projects="Projekter"
projects="Projektek"
repos="Repók"
blog="Blog"
about="Rólunk"
@ -110,6 +110,10 @@ unlimited="Végtelen"
finish="Véglegesítés!"
send_message="Üzenet küldése"
smessage="Üzenet"
projectlist="Projekt lista"
description="Leírás"
path="Útvonal"
repository="Repó"
;Errors
error[1]="Hibás felhasználónév vagy jelszó!"

View File

@ -99,6 +99,7 @@ $lm->loginPrepare();
<?php if($_SESSION['accesslevel']>=1): ?>
<button type="button" onclick="window.location='/userarea/blog'"><?php echo $lang['blog'] ?></button>
<?php endif; if($_SESSION['accesslevel']>=2): ?>
<button type="button" onclick="window.location='/userarea/projects'"><?php echo $lang['projects'] ?></button>
<button type="button" onclick="window.location='/userarea/orders'"><?php echo $lang['orders'] ?></button>
<button type="button" onclick="window.location='/userarea/messages'"><?php echo $lang['messages'] ?></button>
<?php endif; if($_SESSION['accesslevel']>=3): ?>

View File

@ -0,0 +1,106 @@
<?php
/**
* /subs/parts/userarea/projects.php
* @version 1.0
* @desc File for deploying projects to the main site
* @author Fándly Gergő Zoltán (gergo@systemtest.tk, systemtest.tk)
* @copy 2018 Fándly Gergő Zoltán
* License:
Systemtest.tk website's.
Copyright (C) 2018 Fándly Gergő Zoltán
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
**/
?>
<div id="projectlist">
<h2><?php echo $lang['projectlist'] ?></h2>
<table class="footable">
<thead>
<tr>
<th><?php echo $lang['id'] ?></th>
<th><?php echo $lang['name'] ?></th>
<th data-breakpoints="xs sm md"><?php echo $lang['description'] ?></th>
<th data-breakpoints="xs sm"><?php echo $lang['owner'] ?></th>
<th data-breakpoints="xs sm md"><?php echo $lang['path'] ?></th>
<th data-breakpoints="xs sm md"><?php echo $lang['repository'] ?></th>
<th><?php echo $lang['status'] ?> </th>
<th data-breakpoints="xs sm"><?php echo $lang['operations'] ?></th>
</tr>
</thead>
<tbody>
<?php
$sql=$db->prepare("SELECT p.id, p.name, p.description, u.fullname AS owner, p.path, p.repo, p.status FROM projects AS p INNER JOIN users AS u ON (u.id=p.owner) ORDER BY p.name ASC");
$sql->execute();
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
echo "
<tr>
<td>".$row['id']."</td>
<td>".$row['name']."</td>
<td>".$row['description']."</td>
<td>".$row['owner']."</td>
<td>".$row['path']."</td>
<td>".$row['repo']."</td>
<td>".$row['status']."</td>
<td>
<button type=\"button\" onclick=\"projectsEdit(".$row['id'].")\">".$lang['edit']."</button>
<button type=\"button\" onclick=\"projectsDelete(".$row['id'].", this)\">".$lang['delete']."</button>
</td>
</tr>
";
}
?>
</tbody>
</table>
<hr class="placeholder">
<button type="button" onclick="projectsNew()"><i class="fa fa-plus-circle"></i> <?php echo $lang['new'] ?></button>
</div>
<div id="editor" style="display: none">
<form method="POST" class="ajaxform" onsubmit="projectsSave()" id="projectEditor">
<input type="hidden" name="project_id" id="project_id">
<fieldset style="width: 95%">
<legend><?php echo $lang['editor'] ?></legend>
<table style="width: 100%">
<tr>
<td><?php echo $lang['name'].": " ?></td>
<td><input type="text" name="project_name" placeholder="<?php echo $lang['name']."..." ?>" required style="width: 95%"></td>
</tr>
<tr>
<td><?php echo $lang['description'].": " ?></td>
<td><textarea name="project_desc" placeholder="<?php echo $lang['description']."..." ?>" required rows="5" style="width: 95%"></textarea></td>
</tr>
<tr>
<td><?php echo $lang['path'].": " ?></td>
<td><input type="text" name="project_path" placeholder="https://..." required style="width: 95%"></td>
</tr>
<tr>
<td><?php echo $lang['repository'].": " ?></td>
<td><input type="text" name="project_repo" placeholder="https://..." required style="width: 95%"></td>
</tr>
<tr>
<td><?php echo $lang['status'].": " ?></td>
<td><input type="text" name="project_status" placeholder="<?php echo $lang['status']."..." ?>" required style="width: 95%"></td>
</tr>
<tr>
<td><?php echo $lang['image'].": " ?></td>
<td><input type="text" name="project_image" placeholder="https://..." required style="width: 95%"></td>
</tr>
</table>
<br>
<br>
<button type="submit" class="green" form="projectEditor"><i class="fa fa-save"></i> <?php echo $lang['ok'] ?></button>
<button type="button" class="red" onclick="projectsEditCancel()"><i class="fa fa-trash"></i><?php echo $lang['cancel'] ?></button>
</fieldset>
</form>
</div>

View File

@ -41,7 +41,7 @@ else{
}
if($sub!=""){
if($sub!="fileshare" && $sub!="blog" && $sub!="orders" && $sub!="messages" && $sub!="news" && $sub!="admin" && $sub!="profile"){
if($sub!="fileshare" && $sub!="blog" && $sub!="projects" && $sub!="orders" && $sub!="messages" && $sub!="news" && $sub!="admin" && $sub!="profile"){
functions::setError(500);
header("Location: /userarea");
}
@ -49,7 +49,7 @@ else{
functions::setError(500);
header("Location: /userarea");
}
if(($sub=="orders" || $sub=="messages") && $_SESSION['accesslevel']<2){
if(($sub=="projects" || $sub=="orders" || $sub=="messages") && $_SESSION['accesslevel']<2){
functions::setError(500);
header("Location: /userarea");
}