Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
ENCFS plugin now works with Centos 6 and Debian Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasCresson committed Jul 31, 2013
1 parent b237fb4 commit f753300
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/src/plugins/cypher.encfs/class.EncfsMounter.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,18 @@ public function switchAction($actionName, $httpVars, $fileVars){
}

//$repo = ConfService::getRepository();
$dir = $this->getWorkingPath().ltrim(AJXP_Utils::decodeSecureMagic($httpVars["dir"]), "/");
$workingP = rtrim($this->getWorkingPath(), "/");
$dir = $workingP.AJXP_Utils::decodeSecureMagic($httpVars["dir"]);

if(dirname($dir) != rtrim($this->getWorkingPath(), "/")){
if(dirname($dir) != $workingP){
throw new Exception("Please cypher only folders at the root of your repository");
}

$pass = $httpVars["pass"];
$raw = dirname($dir).DIRECTORY_SEPARATOR."ENCFS_RAW_".basename($dir);
if(!strstr($dir, "ENCFS_CLEAR_") && !is_dir($raw)){
// NEW FOLDER SCENARIO
$clear = dirname($dir).DIRECTORY_SEPARATOR."ENCFS_CLEAR_".basename($dir);

mkdir($raw);
$result = self::initEncFolder($raw, $xmlTemplate, $this->getFilteredOption("ENCFS_XML_PASSWORD"), $pass);
if($result){
Expand Down Expand Up @@ -248,4 +249,4 @@ public static function umountFolder($clear){
}
if(!empty($error)) throw new Exception($error);
}
}
}

0 comments on commit f753300

Please sign in to comment.