function initRepository()
 {
     $create = $this->repository->getOption("CREATE");
     $path = $this->repository->getOption("PATH");
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     if ($recycle != "") {
         RecycleBinManager::init($path, "/" . $recycle);
     }
     if ($create == true) {
         if (!is_dir($path)) {
             @mkdir($path);
         }
         if (!is_dir($path)) {
             return new AJXP_Exception("Cannot create root path for repository. Please check repository configuration or that your folder is writeable!");
         }
         if ($recycle != "" && !is_dir($path . "/" . $recycle)) {
             @mkdir($path . "/" . $recycle);
             if (!is_dir($path . "/" . $recycle)) {
                 return new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
             }
         }
     } else {
         if (!is_dir($path)) {
             return new AJXP_Exception("Cannot find base path for your repository! Please check the configuration!");
         }
     }
 }
 public function initRepository()
 {
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     if (!function_exists('ssh2_connect')) {
         throw new Exception("You must have the php ssh2 extension active!");
     }
     ConfService::setConf("PROBE_REAL_SIZE", false);
     $path = $this->repository->getOption("PATH");
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     $this->detectStreamWrapper(true);
     $this->urlBase = "pydio://" . $this->repository->getId();
     restore_error_handler();
     if (!file_exists($this->urlBase)) {
         if ($this->repository->getOption("CREATE")) {
             $test = @mkdir($this->urlBase);
             if (!$test) {
                 throw new AJXP_Exception("Cannot create path ({$path}) for your repository! Please check the configuration.");
             }
         } else {
             throw new AJXP_Exception("Cannot find base path ({$path}) for your repository! Please check the configuration!");
         }
     }
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
 function initRepository()
 {
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     $create = $this->repository->getOption("CREATE");
     $path = $this->repository->getOption("PATH");
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     if ($create == true) {
         if (!is_dir($path)) {
             @mkdir($path);
         }
         if (!is_dir($path)) {
             throw new AJXP_Exception("Cannot create root path for repository. Please check repository configuration or that your folder is writeable!");
         }
         if ($recycle != "" && !is_dir($path . "/" . $recycle)) {
             @mkdir($path . "/" . $recycle);
             if (!is_dir($path . "/" . $recycle)) {
                 throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
             }
         }
     } else {
         if (!is_dir($path)) {
             throw new AJXP_Exception("Cannot find base path for your repository! Please check the configuration!");
         }
     }
     $wrapperData = $this->detectStreamWrapper(true);
     $this->wrapperClassName = $wrapperData["classname"];
     $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
 public function initRepository()
 {
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     $smbclientPath = $this->driverConf["SMBCLIENT"];
     define('SMB4PHP_SMBCLIENT', $smbclientPath);
     $smbtmpPath = $this->driverConf["SMB_PATH_TMP"];
     define('SMB4PHP_SMBTMP', $smbtmpPath);
     require_once $this->getBaseDir() . "/smb.php";
     $create = $this->repository->getOption("CREATE");
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     $this->detectStreamWrapper(true);
     $this->urlBase = "pydio://" . $this->repository->getId();
     if ($recycle != "" && !is_dir($this->urlBase . "/" . $recycle)) {
         @mkdir($this->urlBase . "/" . $recycle);
         if (!is_dir($this->urlBase . "/" . $recycle)) {
             throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
         }
     }
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
 public function initRepository()
 {
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     $this->detectStreamWrapper(true);
     $this->urlBase = "pydio://" . $this->repository->getId();
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
     //AJXP_PromptException::testOrPromptForCredentials("ftp_ws_credentials", $this->repository->getId());
 }
 public function initRepository()
 {
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     $wrapperData = $this->detectStreamWrapper(true);
     $this->wrapperClassName = $wrapperData["classname"];
     $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
 function initRepository()
 {
     @(include_once "HTTP/WebDAV/Client.php");
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     if (!class_exists('HTTP_WebDAV_Client_Stream')) {
         throw new Exception("You must have Pear HTTP/WebDAV/Client package installed to use this access driver!");
     }
     $create = $this->repository->getOption("CREATE");
     $path = $this->repository->getOption("PATH");
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     ConfService::setConf("PROBE_REAL_SIZE", false);
     /*
     if($create == true){
     	if(!is_dir($path)) @mkdir($path);
     	if(!is_dir($path)){
     		throw new AJXP_Exception("Cannot create root path for repository (".$this->repository->getDisplay()."). Please check repository configuration or that your folder is writeable!");
     	}
     	if($recycle!= "" && !is_dir($path."/".$recycle)){
     		@mkdir($path."/".$recycle);
     		if(!is_dir($path."/".$recycle)){
     			throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
     		}
     	}
     }else{
     	if(!is_dir($path)){
     		throw new AJXP_Exception("Cannot find base path ($path) for your repository! Please check the configuration!");
     	}
     }
     */
     $wrapperData = $this->detectStreamWrapper(true);
     $this->wrapperClassName = $wrapperData["classname"];
     $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
     if (!is_dir($this->urlBase)) {
         if (webdavAccessWrapper::$lastException) {
             throw webdavAccessWrapper::$lastException;
         }
         throw new AJXP_Exception("Cannot find base path ({$path}) for your repository! Please check the configuration!");
     }
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
 public function initRepository()
 {
     include_once "libraryLoader.php";
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     $path = $this->repository->getOption("PATH");
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     ConfService::setConf("PROBE_REAL_SIZE", false);
     $wrapperData = $this->detectStreamWrapper(true);
     $this->wrapperClassName = $wrapperData["classname"];
     $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
 public function initRepository()
 {
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     require_once $this->getBaseDir() . "/openstack-sdk-php/vendor/autoload.php";
     Bootstrap::useStreamWrappers();
     Bootstrap::setConfiguration(array('username' => $this->repository->getOption("USERNAME"), 'password' => $this->repository->getOption("PASSWORD"), 'tenantid' => $this->repository->getOption("TENANT_ID"), 'endpoint' => $this->repository->getOption("ENDPOINT"), 'openstack.swift.region' => $this->repository->getOption("REGION"), 'transport.ssl.verify' => false));
     $path = $this->repository->getOption("PATH");
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     ConfService::setConf("PROBE_REAL_SIZE", false);
     $this->detectStreamWrapper(true);
     $this->urlBase = "pydio://" . $this->repository->getId();
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
 function initRepository()
 {
     $this->connect = $this->createFTPLink();
     // Try to detect the charset encoding
     global $_SESSION;
     if (!isset($_SESSION["ftpCharset"]) || !strlen($_SESSION["ftpCharset"])) {
         $features = $this->getServerFeatures();
         if (!isset($_SESSION["AJXP_CHARSET"])) {
             $_SESSION["AJXP_CHARSET"] = "";
         }
         if ($_SESSION["AJXP_CHARSET"] == "") {
             $_SESSION["AJXP_CHARSET"] = $features["charset"];
         }
         $_SESSION["ftpCharset"] = $_SESSION["AJXP_CHARSET"];
     }
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     if (class_exists("RecycleBinManager") && $recycle != "" && $this->repository->detectStreamWrapper(true)) {
         RecycleBinManager::init("ajxp.ftp://" . $this->repository->getUniqueId(), "/" . $recycle);
     }
 }
Beispiel #11
0
 protected function initDirAndSelection($httpVars, $additionnalPathes = array(), $testRecycle = false)
 {
     $userSelection = new UserSelection();
     $userSelection->initFromHttpVars($httpVars);
     $repo = $this->accessDriver->repository;
     $repo->detectStreamWrapper();
     $wrapperData = $repo->streamData;
     $urlBase = $wrapperData["protocol"] . "://" . $repo->getId();
     $result = array();
     if ($testRecycle) {
         $recycle = $repo->getOption("RECYCLE_BIN");
         if ($recycle != "") {
             RecycleBinManager::init($urlBase, "/" . $recycle);
             $result["RECYCLE"] = RecycleBinManager::filterActions($httpVars["get_action"], $userSelection, $httpVars["dir"], $httpVars);
             // if necessary, check recycle was checked.
             // We could use a hook instead here? Maybe the full recycle system
             // could be turned into a plugin
             $sessionKey = "AJXP_SVN_" . $repo->getId() . "_RECYCLE_CHECKED";
             if (isset($_SESSION[$sessionKey])) {
                 $file = RecycleBinManager::getRelativeRecycle() . "/" . RecycleBinManager::getCacheFileName();
                 $realFile = call_user_func(array($wrapperData["classname"], "getRealFSReference"), $urlBase . $file);
                 $this->addIfNotVersionned($file, $realFile);
                 $_SESSION[$sessionKey] = true;
             }
         }
     }
     $result["DIR"] = call_user_func(array($wrapperData["classname"], "getRealFSReference"), $urlBase . AJXP_Utils::decodeSecureMagic($httpVars["dir"]));
     $result["ORIGINAL_SELECTION"] = $userSelection;
     $result["SELECTION"] = array();
     if (!$userSelection->isEmpty()) {
         $files = $userSelection->getFiles();
         foreach ($files as $selected) {
             $result["SELECTION"][] = call_user_func(array($wrapperData["classname"], "getRealFSReference"), $urlBase . $selected);
         }
     }
     foreach ($additionnalPathes as $parameter => $path) {
         $result[$parameter] = call_user_func(array($wrapperData["classname"], "getRealFSReference"), $urlBase . $path);
     }
     return $result;
 }
 function initRepository()
 {
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     if (!function_exists('ssh2_connect')) {
         throw new Exception("You must have the php ssh2 extension active!");
     }
     $path = $this->repository->getOption("PATH");
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     $wrapperData = $this->detectStreamWrapper(true);
     $this->wrapperClassName = $wrapperData["classname"];
     $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
     if (!is_dir($this->urlBase)) {
         throw new AJXP_Exception("Cannot find base path ({$path}) for your repository! Please check the configuration!");
     }
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
Beispiel #13
0
 public function initRepository()
 {
     require_once $this->getBaseDir() . "/aS3StreamWrapper/lib/wrapper/aS3StreamWrapper.class.php";
     if (!in_array("s3", stream_get_wrappers())) {
         $wrapper = new aS3StreamWrapper();
         $wrapper->register(array('protocol' => 's3', 'acl' => AmazonS3::ACL_OWNER_FULL_CONTROL, 'key' => $this->repository->getOption("API_KEY"), 'secretKey' => $this->repository->getOption("SECRET_KEY"), 'region' => $this->repository->getOption("REGION")));
     }
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     $path = $this->repository->getOption("PATH");
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     ConfService::setConf("PROBE_REAL_SIZE", false);
     $wrapperData = $this->detectStreamWrapper(true);
     $this->wrapperClassName = $wrapperData["classname"];
     $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
Beispiel #14
0
 public function initRepository()
 {
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     if ($this->getFilteredOption("PROBE_REAL_SIZE", $this->repository->getId()) == true) {
         // PASS IT TO THE WRAPPER
         ConfService::setConf("PROBE_REAL_SIZE", $this->getFilteredOption("PROBE_REAL_SIZE", $this->repository->getId()));
     }
     $create = $this->repository->getOption("CREATE");
     $path = $this->repository->getOption("PATH");
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     $chmod = $this->repository->getOption("CHMOD_VALUE");
     $wrapperData = $this->detectStreamWrapper(true);
     $this->wrapperClassName = $wrapperData["classname"];
     $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
     if ($create == true) {
         if (!is_dir($path)) {
             @mkdir($path, 0755, true);
         }
         if (!is_dir($path)) {
             throw new AJXP_Exception("Cannot create root path for repository (" . $this->repository->getDisplay() . "). Please check repository configuration or that your folder is writeable!");
         }
         if ($recycle != "" && !is_dir($path . "/" . $recycle)) {
             @mkdir($path . "/" . $recycle);
             if (!is_dir($path . "/" . $recycle)) {
                 throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
             }
         }
         $dataTemplate = $this->repository->getOption("DATA_TEMPLATE");
         if (!empty($dataTemplate) && is_dir($dataTemplate) && !is_file($path . "/.ajxp_template")) {
             $errs = array();
             $succ = array();
             $repoData = array('base_url' => $this->urlBase, 'wrapper_name' => $this->wrapperClassName, 'chmod' => $chmod, 'recycle' => $recycle);
             $this->dircopy($dataTemplate, $path, $succ, $errs, false, false, $repoData, $repoData);
             touch($path . "/.ajxp_template");
         }
     } else {
         if (!is_dir($path)) {
             throw new AJXP_Exception("Cannot find base path for your repository! Please check the configuration!");
         }
     }
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }
 public function initRepository()
 {
     $this->detectStreamWrapper(true);
     if (is_array($this->pluginConf)) {
         $this->driverConf = $this->pluginConf;
     } else {
         $this->driverConf = array();
     }
     $recycle = $this->repository->getOption("RECYCLE_BIN");
     ConfService::setConf("PROBE_REAL_SIZE", false);
     $this->urlBase = "pydio://" . $this->repository->getId();
     if ($recycle != "" && !is_dir($this->urlBase . "/" . $recycle . "/")) {
         @mkdir($this->urlBase . "/" . $recycle . "/", 0777, true);
         if (!is_dir($this->urlBase . "/" . $recycle . "/")) {
             throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
         } else {
             $this->setHiddenAttribute(new AJXP_Node($this->urlBase . "/" . $recycle . "/"));
         }
     }
     if ($recycle != "") {
         RecycleBinManager::init($this->urlBase, "/" . $recycle);
     }
 }