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

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
Conflicts:
	core/src/plugins/core.access/class.AbstractAccessDriver.php
  • Loading branch information
thomasCresson committed Sep 6, 2013
2 parents d4d23a1 + a3a80dd commit 0ffa80e
Show file tree
Hide file tree
Showing 912 changed files with 53,182 additions and 53,229 deletions.
13 changes: 13 additions & 0 deletions .travis.yml
@@ -0,0 +1,13 @@
language: php

php:
- 5.3
- 5.4
- 5.5

before_install:
- wget http://cs.sensiolabs.org/get/php-cs-fixer.phar

script:
- dist/scripts/tests/syntax.sh
- dist/scripts/tests/codestyle.sh
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -6,7 +6,7 @@

This is the main source code repository of AjaXplorer, containing all the PHP server and HTML5 Web GUI. It was migrated from previous Sourceforge SVN repository, which is hence deprecated.

* Latest Stable release : 5.0.0
* Latest Stable release : 5.0.3
* Latest Dev release : 4.3.4 (RC for AjaXplorer5)
* License: [AGPLv3](https://www.gnu.org/licenses/agpl.html)
* Lead developer : Charles du Jeu (cdujeu): [Github](https://github.com/cdujeu) | [Twitter](https://twitter.com/AjaXplorer)
Expand All @@ -17,6 +17,15 @@ Please DO NOT send emails to Charles, but use the forum located on http://forum.

### How to contribute / Developer Resources

#### Coding guidelines

To enforce some coding standards we are using PHP-CS-Fixer
```
wget http://cs.sensiolabs.org/get/php-cs-fixer.phar
php php-cs-fixer.phar fix -v --fixers=indentation,linefeed,trailing_spaces,visibility,short_tag,braces,php_closing_tag,controls_spaces,eof_ending ajaxplorer-core/
```
See https://github.com/fabpot/PHP-CS-Fixer#usage

#### Fixing the Core

If you think you have found a bug and a way to fix it neatly in the code, use a Pull Request to report this change back to us!
Expand Down
65 changes: 65 additions & 0 deletions core/src/conf/RELEASE_NOTE
@@ -1,10 +1,75 @@
AjaXplorer ##VERSION_NUMBER## Release Note

This is a bugfix and security release. Update is highly recommended and automatic using the in-app upgrade mechanism. Most important fixes are:

- Vulnerabilities fixed and security enforced: new algorithm used for hashing passwords, enforce tokens generation, etc. PHP Mcrypt extension is now more than ever required.
- Stabilize authentification (groups, LDAP) on the 5.X branch
- Stabilize alternative uploaders remote drivers (Jumploader)
- Many GUI bugs fixed

License : Affero GPL
Copyright : Charles du Jeu 2013
Demo : http://demo.ajaxplorer.info/
Date : ##VERSION_DATE##
Rev Number : ##REVISION##
Contributors: thomasCresson, echampet, joubertredrat, BlackLionPT

Detailed changeLog

Add X-Accel-Redirect support for Nginx (a sibiling of X-Sendfile) (details)
New ability in FormManager button: simply trigger client action. (details)
Always pass an ID for the event (not only alerts), and keep track of the last passed ID: triggers desktop notifications if active and possible. (details)
class.remote_fsAccessDriver.php: Fix some option loading error while using the function Ajxp_PLUGIN::init(repository, options) manifest.xml: Disabling the remote_fs driver by default class.JumploaderProcessor.php: - Cross session resume implementation (doesn't work with smb) - partitioning now works with FTP - upload validation process now working for FTP and FS (details)
previous commit (#69597c9010cb41b77b2e76cc2aae5b46a6eb9e57) broke the ability to upload folder tree on FS now fixed (details)
We can now use jumploader with SMB, SFTP, FS and FTP drivers (details)
Add the property "PORT" for the sftp repository creation (could not log with the wrong port number) (details)
now getting the file "jumploader_z.jar" and putting it into the plugin folder (details)
can now upload mutliple files through jumploader with FTP (details)
can now upload multiple files through Jumploader on a FTP repository (details)
Translated every single "en.php" file (into Portuguese (Portugal)) found in the plugins directory, copying the "en.php" and changing the copies name to "pt.php" plus 3 new flags in the ".gif" format and the ".png" image saying "Drop files here". Hope this is useful! (details)
Fixed a few typos in the translations (details)
Fixed a few typos in the translations (details)
Always rtrim() groupPath from /, if not /. Close #251 (details)
Optimization: getRepositoriesList was called inside foreach loop! (details)
Replace dirname() by forwardSlashDirname() when manipulating groupPath to avoid errors on Windows. (details)
Fixed some url construction problems. Add ENCFS_UID as a plugin option because it was hardcoded and set to 33. (details)
ENCFS plugin now works with Centos 6 and Debian Ubuntu (details)
Fix #268, there was a double "basegroup filtering". (details)
Throw comprehensive exception in cleanDibiDriverParameters (details)
Implement a remote search feature for users. Declare specific remote_indexation attribute in nodes to force search engine to query server, even in "local" mode. Ability to open a user at the correct page (details)
Move MAILER from global_param to param (details)
Security enforcements: > Switch password hashing from md5 to more secure hashing (backward compatible). > Do not use the server time() as the base for the tokens (secure token & remember me cookie token) as it's too predictible > Make sure the remember me cookie has httpOnly and Secure flags. (details)
New parameters LOCAL_PREFIX and ROLE_MAP for auth.remote plugin : map CMS roles to ajaxplorer Roles. Remote plugin must pass the "role" key in the user array. Implement pagination, as the plugin is finally serial based. (details)
Fix #263 (details)
Fix #253 Fix #254 (details)
Fix #227 (duplicate menus) (details)
Use "button" type to download the Jumploader applet and install it at the right place. (details)
Typo in testParameters() function (details)
A Small fix on a send header instruction to implement a header to lighttpd server version 1.4.X. More info in http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file (details)
Notification problems with ftp fixed (details)
Fix case sensitivity (details)
LDAP: enable group(s) to role(s) mapping, and group(s) to one group mapping (defining filter) Multi Auth: fix groups listing Update Conf backends: createGroup can automatically update (details)
Wrong commit (details)
Fix auth.multi updateUserObject call in user-choice mode. (details)
Fix auth.ldap groups management. Still to be tested deeply on various systems. (details)
Fix wrong extractRealId call (details)
Do not skip the group mapping recompute to make sure the upper rights are applied (details)
Should fix error on deletion when action.antivirus is active (details)
Add configurable limit for action.share plugin (details)
Use plugin Id instead of Name in class.ShareCenter.js ajxp_plugin[@name='share'] -> ajxp_plugin[@id='action.share'] (details)
Fix groups when creating user from inside subgroup (fix #269) (details)
Can now upload file larger than 2G with Jumploader. (details)
Shorter string on small screens (details)
Make sure AJXP_ADMIN_LOGIN is not taken for a groupAdmin Fix #278 in javascript (details)


-------------------------------------

License : Affero GPL
Copyright : Charles du Jeu 2013
Demo : http://demo.ajaxplorer.info/
Date : 18th July 2013
Rev Number : #97582cc1938c708acd9479f4b2d03036be78729e
Contributors: thomasCresson, josh4trunks, chusopr, mquandalle

This is a bugfix release from v5.0.1. Update is automatic using the in-app upgrade mechanism, and is recommended. Most important fixes are:
Expand Down
180 changes: 94 additions & 86 deletions core/src/core/classes/class.AJXP_Cache.php
Expand Up @@ -25,30 +25,31 @@
* @package AjaXplorer
* @subpackage Core
*/
class AJXP_Cache {
private static $instance;
class AJXP_Cache
{
private static $instance;

protected $cacheDir;
protected $cacheId;
protected $masterFile;
protected $dataCallback;
protected $idComputerCallback;
/**
* Create an AJXP_Cache instance
* @param string $pluginId
* @param string $filepath
* @param Function $dataCallback A function to generate the data cache. If no callback provided, will simply use the content of the master item as the cache data
protected $cacheDir;
protected $cacheId;
protected $masterFile;
protected $dataCallback;
protected $idComputerCallback;

/**
* Create an AJXP_Cache instance
* @param string $pluginId
* @param string $filepath
* @param Function $dataCallback A function to generate the data cache. If no callback provided, will simply use the content of the master item as the cache data
* @param string $idComputerCallback A function to generate the ID of the cache. If not provided, will generate a random hash
* @return AJXP_Cache
*/
public static function getItem($pluginId, $filepath, $dataCallback=null, $idComputerCallback = null){
if($dataCallback == null){
$dataCallback = array("AJXP_Cache", "simpleCopy");
}
return new AJXP_Cache($pluginId,$filepath, $dataCallback, $idComputerCallback);
}
* @return AJXP_Cache
*/
public static function getItem($pluginId, $filepath, $dataCallback=null, $idComputerCallback = null)
{
if ($dataCallback == null) {
$dataCallback = array("AJXP_Cache", "simpleCopy");
}
return new AJXP_Cache($pluginId,$filepath, $dataCallback, $idComputerCallback);
}

/**
* The default dataCallback
Expand All @@ -57,9 +58,10 @@ public static function getItem($pluginId, $filepath, $dataCallback=null, $idComp
* @param string $target
* @return void
*/
public static function simpleCopy($master, $target){
file_put_contents($target, file_get_contents($master));
}
public static function simpleCopy($master, $target)
{
file_put_contents($target, file_get_contents($master));
}

/**
* Clear a cache item associated with the master filepath
Expand All @@ -68,13 +70,14 @@ public static function simpleCopy($master, $target){
* @param String $filepath
* @return void
*/
public static function clearItem($pluginId, $filepath){
$inst = new AJXP_Cache($pluginId,$filepath, false);
AJXP_Logger::debug("SHOULD REMOVE ".$inst->getId());
if(file_exists($inst->getId())){
@unlink($inst->getId());
}
}
public static function clearItem($pluginId, $filepath)
{
$inst = new AJXP_Cache($pluginId,$filepath, false);
AJXP_Logger::debug("SHOULD REMOVE ".$inst->getId());
if (file_exists($inst->getId())) {
@unlink($inst->getId());
}
}

/**
* Actual Cache object. Should not be used directly, but via the factory static method getItem()
Expand All @@ -84,90 +87,95 @@ public static function clearItem($pluginId, $filepath){
* @param null $idComputerCallback
* @return void
*/
public function AJXP_Cache($pluginId, $filepath, $dataCallback, $idComputerCallback = NULL){
$this->cacheDir = (defined('AJXP_SHARED_CACHE_DIR')?AJXP_SHARED_CACHE_DIR:AJXP_CACHE_DIR);
$this->masterFile = $filepath;
$this->dataCallback = $dataCallback;
if($idComputerCallback != null){
$this->idComputerCallback = $idComputerCallback;
}
$this->cacheId = $this->buildCacheId($pluginId, $filepath);
}
public function AJXP_Cache($pluginId, $filepath, $dataCallback, $idComputerCallback = NULL)
{
$this->cacheDir = (defined('AJXP_SHARED_CACHE_DIR')?AJXP_SHARED_CACHE_DIR:AJXP_CACHE_DIR);
$this->masterFile = $filepath;
$this->dataCallback = $dataCallback;
if ($idComputerCallback != null) {
$this->idComputerCallback = $idComputerCallback;
}
$this->cacheId = $this->buildCacheId($pluginId, $filepath);
}

/**
* Load the actual data, either from the cache or from the master, and save it in the cache if necessary.
* @return string
*/
public function getData(){
if(!$this->hasCachedVersion()){
AJXP_Logger::debug("caching data", $this->dataCallback);
$result = call_user_func($this->dataCallback, $this->masterFile, $this->cacheId);
if($result !== false){
$this->touch();
}
}else{
AJXP_Logger::debug("getting from cache");
}
return file_get_contents($this->cacheId);
}
public function getData()
{
if (!$this->hasCachedVersion()) {
AJXP_Logger::debug("caching data", $this->dataCallback);
$result = call_user_func($this->dataCallback, $this->masterFile, $this->cacheId);
if ($result !== false) {
$this->touch();
}
} else {
AJXP_Logger::debug("getting from cache");
}
return file_get_contents($this->cacheId);
}

/**
* Check if the cache dir is writeable
* @return bool
*/
public function writeable(){
return is_dir($this->cacheDir) && is_writeable($this->cacheDir);
}
public function writeable()
{
return is_dir($this->cacheDir) && is_writeable($this->cacheDir);
}

/**
* The unique ID of the item
* @return string
*/
public function getId(){
return $this->cacheId;
}
public function getId()
{
return $this->cacheId;
}

/**
* Check whether a cached version of the master file exists or not
* @return bool
*/
public function hasCachedVersion(){
$modifTime = filemtime($this->masterFile);
if(file_exists($this->cacheId) && filemtime($this->cacheId) >= $modifTime){
return true;
}
return false;
}
public function hasCachedVersion()
{
$modifTime = filemtime($this->masterFile);
if (file_exists($this->cacheId) && filemtime($this->cacheId) >= $modifTime) {
return true;
}
return false;
}

/**
* Refresh the cached version modif date to the master modif date
* @return void
*/
public function touch(){
@touch($this->cacheId, filemtime($this->masterFile));
}

/**
public function touch()
{
@touch($this->cacheId, filemtime($this->masterFile));
}

/**
* Generate an ID for the cached file, either using the idComputerCallback, or a simple hash function.
* @param $pluginId
* @param $filePath
* @return string
*/
protected function buildCacheId($pluginId, $filePath){
if(!is_dir($this->cacheDir."/".$pluginId)){
protected function buildCacheId($pluginId, $filePath)
{
if (!is_dir($this->cacheDir."/".$pluginId)) {
mkdir($this->cacheDir."/".$pluginId, 0755);
}
$root = $this->cacheDir ."/".$pluginId."/";
if(isSet($this->idComputerCallback)){
$hash = call_user_func($this->idComputerCallback, $filePath);
}else{
$info = pathinfo($filePath);
$hash = md5($filePath).(!empty($info["extension"])?".".$info["extension"]:"");
}
return $root.$hash;
}


}
$root = $this->cacheDir ."/".$pluginId."/";
if (isSet($this->idComputerCallback)) {
$hash = call_user_func($this->idComputerCallback, $filePath);
} else {
$info = pathinfo($filePath);
$hash = md5($filePath).(!empty($info["extension"])?".".$info["extension"]:"");
}
return $root.$hash;
}


?>
}

0 comments on commit 0ffa80e

Please sign in to comment.