コード例 #1
0
<?php

if (isset($_COOKIE['loggedIn']) && $_COOKIE['loggedIn'] == true) {
    require_once 'backend/classes/dbClass.php';
    $userId = $_COOKIE['userId'];
    $loggedIn = $_COOKIE['loggedIn'];
    if (!dbClass::getPasswordById($userId)) {
        header('Location: index.html');
    }
} else {
    header('Location: index.html');
}
$url = 'http://' . $_SERVER['SERVER_NAME'];
?>
<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

	<title>Exertis Library</title>


	<!-- Include our stylesheet -->
	<link href="assets/css/styles.css" rel="stylesheet"/>

</head>
<body>
        <div class="overlay"></div>
        
        
コード例 #2
0
<?php

require_once '../../classes/dbClass.php';
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $query = dbClass::getPasswordById($id);
    if ($query) {
        include '../header.php';
        require_once '../../helpers/security.php';
        require_once '../../helpers/php_file_tree_edit.php';
        ?>
<link rel="stylesheet" href="../../../assets/css/filetree.css" type="text/css" >

<div class='panel'>
    <h2>Edit <?php 
        echo $query['name'];
        ?>
's permissions</h2>
    
    <a href='index.php' class='btn'>View Folder permissions</a>
    <br><br>
    
    <form method='post' id="form">
        <input type='hidden' name='id' value='<?php 
        echo $_GET['id'];
        ?>
' />
        <div class="form-field">
            <input type="text" name="name" class="form-input" value="<?php 
        echo $query['name'];
        ?>
コード例 #3
0
<?php

require_once '../../classes/dbClass.php';
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    if (dbClass::getPasswordById($id)) {
        if (dbClass::deletePassword($id)) {
            header('location: index.php');
        } else {
            header('location: index.php');
        }
    } else {
        header('location: index.php');
    }
} else {
    header('location: index.php');
}
コード例 #4
0
<?php

require_once '../../classes/dbClass.php';
require_once '../../helpers/security.php';
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $values = dbClass::getPasswordById($id);
    $folders = dbClass::getAccessableFiles($values['id']);
    if (dbClass::savePassword($values['name'], $values['password'])) {
        $pwdId = dbClass::getLastPasswordId()['id'];
        foreach ($folders as $fl) {
            $filename = array_pop(explode('/', $fl['file']));
            if (dbClass::query('INSERT INTO files (password_id, file) VALUES ("' . $pwdId . '", "' . $filename . '")')) {
                header('Location: index.php');
            } else {
                header('Location: index.php');
            }
        }
    } else {
        header('Location: index.php');
    }
    var_dump($values);
}