Added lot of junk laying around on harvie.cz
[mirrors/Programs.git] / php / encfs / php-encfs.php
CommitLineData
8de51304
H
1<?php
2/*
3 Harvie 2oo9 - http://blog.harvie.cz/
4
5 This simple script allows you to encrypt you webpages/etc.
6 using EncFS (you need to have EncFS installed of course).
7
8 You need write permissions to mountpoint for www server
9 and maybe add www server's user to the fuse group:
10
11 gpasswd fuse -a www-data
12 or
13 gpasswd fuse -a http
14
15 If you want this script to mount EncFS to be accessible by
16 other users, you can add user_allow_other to /etc/fuse.conf
17*/
18
19if(trim($_SERVER['HTTPS']) == '') {
20 die('<h1>Error: Cannot use EncFS without TLS!</h1>Use https:// instead of http://');
21}
22
23function encfs_mount($what, $where, $password, $arguments='') {
24 system('/bin/echo '.escapeshellarg($password).' | /usr/bin/encfs -S '.escapeshellarg($what).' '.escapeshellarg($where)." $arguments".' 2>&1');
25 flush();
26}
27
28function encfs_unmount($where) {
29 system('/usr/bin/fusermount -zu '.escapeshellarg($where).' 2>&1');
30 flush();
31}
32
This page took 0.107822 seconds and 4 git commands to generate.