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

Commit 2f39042

Browse files
committed
Merge branch 'namespaces' into develop
Conflicts: core/src/core/classes/class.AJXP_ShutdownScheduler.php core/src/core/classes/class.AJXP_Utils.php core/src/core/classes/class.AuthService.php core/src/core/classes/class.ConfService.php core/src/core/classes/class.HTMLWriter.php core/src/core/classes/guzzle/vendor/composer/autoload_psr4.php core/src/core/classes/guzzle/vendor/composer/autoload_real.php core/src/core/classes/guzzle/vendor/composer/installed.json core/src/core/classes/guzzle/vendor/gimler/guzzle-description-loader/.travis.yml core/src/core/classes/guzzle/vendor/gimler/guzzle-description-loader/composer.json core/src/core/classes/guzzle/vendor/gimler/guzzle-description-loader/composer.lock core/src/core/classes/guzzle/vendor/guzzlehttp/guzzle/CHANGELOG.md core/src/core/classes/guzzle/vendor/guzzlehttp/guzzle/LICENSE core/src/core/classes/guzzle/vendor/guzzlehttp/guzzle/composer.json core/src/core/classes/guzzle/vendor/guzzlehttp/guzzle/src/Client.php core/src/core/classes/guzzle/vendor/guzzlehttp/guzzle/src/ClientInterface.php core/src/core/classes/guzzle/vendor/guzzlehttp/guzzle/src/Event/Emitter.php core/src/core/classes/guzzle/vendor/guzzlehttp/guzzle/src/Message/AbstractMessage.php core/src/core/classes/guzzle/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php core/src/core/classes/guzzle/vendor/react/promise/.gitignore core/src/core/classes/guzzle/vendor/react/promise/.travis.yml core/src/core/classes/guzzle/vendor/react/promise/CHANGELOG.md core/src/core/classes/guzzle/vendor/react/promise/LICENSE core/src/core/classes/guzzle/vendor/react/promise/README.md core/src/core/classes/guzzle/vendor/react/promise/composer.json core/src/core/classes/guzzle/vendor/react/promise/phpunit.xml.dist core/src/core/classes/guzzle/vendor/react/promise/src/FulfilledPromise.php core/src/core/classes/guzzle/vendor/react/promise/src/LazyPromise.php core/src/core/classes/guzzle/vendor/react/promise/src/Promise.php core/src/core/classes/guzzle/vendor/react/promise/src/RejectedPromise.php core/src/core/classes/guzzle/vendor/react/promise/src/UnhandledRejectionException.php core/src/core/classes/guzzle/vendor/react/promise/src/functions.php core/src/core/classes/guzzle/vendor/symfony/config/CHANGELOG.md core/src/core/classes/guzzle/vendor/symfony/config/ConfigCache.php core/src/core/classes/guzzle/vendor/symfony/config/ConfigCacheInterface.php core/src/core/classes/guzzle/vendor/symfony/config/Definition/ArrayNode.php core/src/core/classes/guzzle/vendor/symfony/config/Definition/BaseNode.php core/src/core/classes/guzzle/vendor/symfony/config/Definition/Builder/ArrayNodeDefinition.php core/src/core/classes/guzzle/vendor/symfony/config/Definition/Builder/BooleanNodeDefinition.php core/src/core/classes/guzzle/vendor/symfony/config/Definition/Builder/EnumNodeDefinition.php core/src/core/classes/guzzle/vendor/symfony/config/Definition/Builder/NumericNodeDefinition.php core/src/core/classes/guzzle/vendor/symfony/config/Definition/PrototypedArrayNode.php core/src/core/classes/guzzle/vendor/symfony/config/Definition/VariableNode.php core/src/core/classes/guzzle/vendor/symfony/config/Loader/FileLoader.php core/src/core/classes/guzzle/vendor/symfony/config/README.md core/src/core/classes/guzzle/vendor/symfony/config/Resource/DirectoryResource.php core/src/core/classes/guzzle/vendor/symfony/config/Resource/FileExistenceResource.php core/src/core/classes/guzzle/vendor/symfony/config/Resource/FileResource.php core/src/core/classes/guzzle/vendor/symfony/config/Resource/ResourceInterface.php core/src/core/classes/guzzle/vendor/symfony/config/ResourceCheckerInterface.php core/src/core/classes/guzzle/vendor/symfony/config/Tests/Definition/Builder/EnumNodeDefinitionTest.php core/src/core/classes/guzzle/vendor/symfony/config/Tests/Definition/Builder/NumericNodeDefinitionTest.php core/src/core/classes/guzzle/vendor/symfony/config/Tests/Definition/Builder/TreeBuilderTest.php core/src/core/classes/guzzle/vendor/symfony/config/Tests/Resource/DirectoryResourceTest.php core/src/core/classes/guzzle/vendor/symfony/config/Tests/Resource/FileResourceTest.php core/src/core/classes/guzzle/vendor/symfony/config/Tests/Resource/ResourceStub.php core/src/core/classes/guzzle/vendor/symfony/config/Tests/Util/XmlUtilsTest.php core/src/core/classes/guzzle/vendor/symfony/config/composer.json core/src/core/classes/guzzle/vendor/symfony/filesystem/CHANGELOG.md core/src/core/classes/guzzle/vendor/symfony/filesystem/Exception/IOExceptionInterface.php core/src/core/classes/guzzle/vendor/symfony/filesystem/Filesystem.php core/src/core/classes/guzzle/vendor/symfony/filesystem/LockHandler.php core/src/core/classes/guzzle/vendor/symfony/filesystem/README.md core/src/core/classes/guzzle/vendor/symfony/filesystem/Tests/FilesystemTest.php core/src/core/classes/guzzle/vendor/symfony/filesystem/Tests/FilesystemTestCase.php core/src/core/classes/guzzle/vendor/symfony/filesystem/composer.json core/src/core/classes/guzzle/vendor/symfony/yaml/CHANGELOG.md core/src/core/classes/guzzle/vendor/symfony/yaml/Dumper.php core/src/core/classes/guzzle/vendor/symfony/yaml/Escaper.php core/src/core/classes/guzzle/vendor/symfony/yaml/Exception/ParseException.php core/src/core/classes/guzzle/vendor/symfony/yaml/Inline.php core/src/core/classes/guzzle/vendor/symfony/yaml/Parser.php core/src/core/classes/guzzle/vendor/symfony/yaml/README.md core/src/core/classes/guzzle/vendor/symfony/yaml/Tests/DumperTest.php core/src/core/classes/guzzle/vendor/symfony/yaml/Tests/Fixtures/YtsSpecificationExamples.yml core/src/core/classes/guzzle/vendor/symfony/yaml/Tests/InlineTest.php core/src/core/classes/guzzle/vendor/symfony/yaml/Tests/ParseExceptionTest.php core/src/core/classes/guzzle/vendor/symfony/yaml/Tests/ParserTest.php core/src/core/classes/guzzle/vendor/symfony/yaml/Tests/YamlTest.php core/src/core/classes/guzzle/vendor/symfony/yaml/Unescaper.php core/src/core/classes/guzzle/vendor/symfony/yaml/Yaml.php core/src/core/classes/guzzle/vendor/symfony/yaml/composer.json core/src/core/src/lib/pclzip.lib.php core/src/core/src/pydio/Tests/PHP_APC.php core/src/plugins/access.ajxp_conf/ajxp_confActions.xml core/src/plugins/access.ajxp_conf/class.ajxp_confAccessDriver.php core/src/plugins/access.ajxp_home/HomePagePlugin.php core/src/plugins/access.ajxp_home/manifest.xml core/src/plugins/access.ajxp_home/res/home.css core/src/plugins/access.ajxp_home/res/home.less core/src/plugins/access.ajxp_home/res/i18n/ca.php core/src/plugins/access.ajxp_home/res/i18n/de.php core/src/plugins/access.ajxp_home/res/i18n/en.php core/src/plugins/access.ajxp_home/res/i18n/es.php core/src/plugins/access.ajxp_home/res/i18n/fr.php core/src/plugins/access.ajxp_home/res/i18n/hu.php core/src/plugins/access.ajxp_home/res/i18n/it.php core/src/plugins/access.ajxp_home/res/i18n/nl.php core/src/plugins/access.ajxp_home/res/i18n/pt.php core/src/plugins/access.ajxp_home/res/i18n/ru.php core/src/plugins/access.ajxp_home/res/i18n/si.php core/src/plugins/access.fs/class.fsAccessDriver.php core/src/plugins/access.fs/fsActions.xml core/src/plugins/access.fs/manifest.xml core/src/plugins/access.s3/S3Client.php core/src/plugins/access.s3/class.s3AccessDriver.php core/src/plugins/access.s3/class.s3AccessWrapper.php core/src/plugins/access.sftp_psl/i18n/conf/de.php core/src/plugins/access.sftp_psl/i18n/conf/en.php core/src/plugins/access.sftp_psl/i18n/conf/fr.php core/src/plugins/access.sftp_psl/i18n/conf/it.php core/src/plugins/action.powerfs/class.PowerFSController.php core/src/plugins/action.powerfs/i18n/conf/fr.php core/src/plugins/action.powerfs/i18n/conf/it.php core/src/plugins/action.powerfs/i18n/conf/pt.php core/src/plugins/action.scheduler/i18n/it.php core/src/plugins/action.share/res/i18n/ca.php core/src/plugins/action.share/res/i18n/de.php core/src/plugins/action.share/res/i18n/en.php core/src/plugins/action.share/res/i18n/es.php core/src/plugins/action.share/res/i18n/fr.php core/src/plugins/action.share/res/i18n/it.php core/src/plugins/action.share/res/i18n/pt.php core/src/plugins/action.share/res/i18n/ru.php core/src/plugins/action.share/res/react/model/ShareModel.js core/src/plugins/action.updater/class.AjaXplorerUpgrader.php core/src/plugins/action.updater/i18n/fr.php core/src/plugins/action.updater/i18n/it.php core/src/plugins/auth.ldap/LdapAuthDriver.php core/src/plugins/auth.phpbb/i18n/conf/fr.php core/src/plugins/auth.phpbb/i18n/conf/it.php core/src/plugins/auth.smb/class.smbAuthDriver.php core/src/plugins/authfront.cas/i18n/conf/fr.php core/src/plugins/authfront.otp/manifest.xml core/src/plugins/boot.conf/i18n/conf/de.php core/src/plugins/boot.conf/i18n/conf/en.php core/src/plugins/boot.conf/i18n/conf/fr.php core/src/plugins/boot.conf/i18n/conf/it.php core/src/plugins/core.access/src/MetaStreamWrapper.php core/src/plugins/core.access/src/Model/UserSelection.php core/src/plugins/core.ajaxplorer/i18n/it.php core/src/plugins/core.ajaxplorer/i18n/ja.php core/src/plugins/core.cache/AbstractCacheDriver.php core/src/plugins/core.conf/AbstractConfDriver.php core/src/plugins/core.mailer/class.AjxpMailer.php core/src/plugins/core.notifications/NotificationCenter.php core/src/plugins/editor.imagick/IMagickPreviewer.php core/src/plugins/editor.imagick/class.IMagickPreviewer.js core/src/plugins/editor.webodf/i18n/it.php core/src/plugins/feed.sql/SqlFeedStore.php core/src/plugins/gui.ajax/package.json core/src/plugins/gui.ajax/res/js/ui/prototype/class.FilesList.js core/src/plugins/gui.ajax/res/js/ui/prototype/class.SearchEngine.js core/src/plugins/gui.ajax/res/js/ui/reactjs/jsx/ReactPydioComponents.js core/src/plugins/gui.ajax/res/js/vendor/nodejs/export.js core/src/plugins/gui.ajax/res/themes/orbit/css/allz.css core/src/plugins/gui.ajax/res/themes/orbit/css/components/complete.less core/src/plugins/gui.ajax/res/themes/orbit/css/fonts/mdi-subset.css core/src/plugins/gui.ajax/res/themes/orbit/css/pydio.css core/src/plugins/index.elasticsearch/ElasticSearchIndexer.php core/src/plugins/meta.git/GitManager.php core/src/plugins/meta.svn/i18n/si.php core/src/plugins/meta.syncable/ChangesTracker.php core/src/plugins/uploader.http/class.HttpDownloader.php
2 parents 32bf85d + fd9f14b commit 2f39042

File tree

3,615 files changed

+106310
-191530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,615 files changed

+106310
-191530
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
This is the main source code repository of Pydio (formerly AjaXplorer), containing all the PHP server and HTML5 Web GUI.
1010

11-
* Latest Stable release : 6.4.1
11+
* Latest Stable release : 6.4.2
1212
* Latest Dev release : 6.3.1 (was RC for Pydio 6.4)
1313
* License: [AGPLv3](https://www.gnu.org/licenses/agpl.html)
1414
* Lead developer : Charles du Jeu (cdujeu): [Github](https://github.com/cdujeu) | [Twitter](https://twitter.com/Pydio)
@@ -20,6 +20,31 @@ Please DO NOT send emails to Charles, but use the forum located on https://pydio
2020

2121
### How to contribute / Developer Resources
2222

23+
#### Setting up your dev environment
24+
25+
Pydio 7 requires **PHP5.6** and upper.
26+
27+
The web root of the application is located in ***core/src/***. Create a virtual host to point to this folder, set up your webserver to use index.php as default page. This is generally done by default.
28+
29+
Pydio uses Composer and NPM to manage dependencies respectively in PHP and JS. It uses Grunt to build javascript sources. In order to start Pydio locally after a fresh `git clone`, you will first have to run these tools in both the core and in many plugins.
30+
31+
- First install Composer (see https://getcomposer.org) and NPM (https://docs.npmjs.com/getting-started/installing-node)
32+
- Install Grunt globally by running `npm install -g grunt-cli``
33+
- Inside the core folder (under webroot, i.e. core/src/core/ from root of git repository), run `composer install`
34+
- For each plugin that contains a composer.json file, run `composer install` as well.
35+
- For each plugin tat contains a package.json file, run
36+
- `npm install`
37+
- `grunt`
38+
39+
On a unix-based machine, this can be achieved by the following command (from the webroot directory):
40+
```
41+
find . -maxdepth 5 -name Gruntfile.js -execdir bash -c "npm install && grunt" \;
42+
find . -maxdepth 5 -name composer.json -execdir composer install \;
43+
```
44+
45+
You should be good to go. When modifying JS files that require transpilation, there is generally a `grunt watch` task available to automatically run grunt on each file change.
46+
47+
2348
#### Coding guidelines
2449

2550
To enforce some coding standards, please run scripts in

core/src/.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
/plugins/access.ajxp_user/build
2+
/plugins/core.mq/vendor
3+
/plugins/action.scheduler/vendor
4+
/plugins/access.s3/aws-v3.phar
5+
/plugins/access.s3/aws.phar
6+
/plugins/index.elasticsearch/vendor
17
/plugins/access.ajxp_home/res/build
28
/plugins/access.inbox/res/build
39
/plugins/core.mailer/js/build
410
/plugins/gui.ajax/res/js/ui/reactjs/build/
11+
/plugins/core.tasks/vendor
512
.idea/
613
data/cache/*
714
data/files/*
@@ -15,4 +22,5 @@ node_modules/
1522
.jshintignore
1623
.jshintrc
1724
/plugins/gui.ajax/res/mui/mui-sources
18-
.validate.json
25+
.validate.json
26+
composer.lock

core/src/.htaccess

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ RewriteEngine on
88
RewriteBase /
99
RewriteCond %{REQUEST_FILENAME} !-f
1010
RewriteCond %{REQUEST_FILENAME} !-d
11-
RewriteRule ^shares ./dav.php [L]
12-
RewriteRule ^api ./rest.php [L]
13-
RewriteRule ^ocs/ ./opencollab.php [L]
14-
RewriteRule ^ocs-provider/ ./opencollab.php [L]
15-
RewriteRule ^user ./index.php?get_action=user_access_point [L]
16-
RewriteCond %{REQUEST_URI} !^/index
17-
RewriteCond %{REQUEST_URI} !^/plugins
18-
RewriteCond %{REQUEST_URI} ^/dashboard|^/settings|^/welcome|^/ws-
1911
RewriteRule (.*) index.php [L]
2012

2113
#Following lines seem to be necessary if PHP is working
@@ -29,8 +21,8 @@ RewriteRule (.*) index.php [L]
2921
# to make sure that authorization is transmitted.
3022
# Just remove the # at the beginning of the line
3123

32-
#SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
24+
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
3325

3426
</IfModule>
3527

36-
AddType application/json .json
28+
AddType application/json .json

core/src/base.conf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Affero General Public License
1717
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
1818
*
19-
* The latest code can be found at <http://pyd.io/>.
19+
* The latest code can be found at <https://pydio.com>.
2020
*
2121
* This is the main configuration file for configuring the core of the application.
2222
* In a standard usage, you should not have to change any variables.

core/src/cmd.php

Lines changed: 14 additions & 221 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*
3-
* Copyright 2007-2013 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
3+
* Copyright 2007-2016 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
44
* This file is part of Pydio.
55
*
66
* Pydio is free software: you can redistribute it and/or modify
@@ -16,235 +16,28 @@
1616
* You should have received a copy of the GNU Affero General Public License
1717
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
1818
*
19-
* The latest code can be found at <http://pyd.io/>.
19+
* The latest code can be found at <https://pydio.com>.
2020
*
2121
* Description : Command line access of the framework.
2222
*/
2323
if (php_sapi_name() !== "cli") {
2424
die("This is the command line version of the framework, you are not allowed to access this page");
2525
}
26+
include_once ("base.conf.php");
27+
use Pydio\Core\Services\ConfService;
28+
use Pydio\Core\Services\AuthService;
29+
use Symfony\Component\Console\Application;
30+
use Pydio\Core\Http\Cli\Command;
2631

27-
include_once("base.conf.php");
28-
29-
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
30-
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
31-
header("Cache-Control: no-cache, must-revalidate");
32-
header("Pragma: no-cache");
33-
//set_error_handler(array("AJXP_XMLWriter", "catchError"), E_ALL & ~E_NOTICE );
34-
//set_exception_handler(array("AJXP_XMLWriter", "catchException"));
32+
ConfService::$useSession = false;
33+
AuthService::$useSession = false;
3534

3635
ConfService::init();
3736
ConfService::start();
3837

39-
$confStorageDriver = ConfService::getConfStorageImpl();
40-
require_once($confStorageDriver->getUserClassFileName());
41-
//session_name("AjaXplorer");
42-
//session_start();
43-
44-
45-
$optArgs = array();
46-
$options = array();
47-
$regex = '/^-(-?)([a-zA-z0-9_]*)=(.*)/';
48-
foreach ($argv as $key => $argument) {
49-
//echo("$key => $argument \n");
50-
if (preg_match($regex, $argument, $matches)) {
51-
if ($matches[1] == "-") {
52-
$optArgs[trim($matches[2])] = SystemTextEncoding::toUTF8(trim($matches[3]));
53-
} else {
54-
$options[trim($matches[2])] = SystemTextEncoding::toUTF8(trim($matches[3]));
55-
}
56-
}
57-
}
58-
59-
$optUser = $options["u"];
60-
if (!empty($optUser)) {
61-
62-
if (isSet($options["p"])) {
63-
$optPass = $options["p"];
64-
} else {
65-
// Consider "u" is a crypted version of u:p
66-
$optToken = $options["t"];
67-
$cKey = ConfService::getCoreConf("AJXP_CLI_SECRET_KEY", "conf");
68-
if(empty($cKey)) $cKey = "\1CDAFx¨op#";
69-
$optUser = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($optToken.$cKey), base64_decode($optUser), MCRYPT_MODE_ECB), "\0");
70-
$env = getenv("AJXP_SAFE_CREDENTIALS");
71-
if(!empty($env)){
72-
$array = AJXP_Safe::getCredentialsFromEncodedString($env);
73-
if(isSet($array["user"]) && $array["user"] == $optUser){
74-
unset($optToken);
75-
$optPass = $array["password"];
76-
}
77-
}
78-
}
79-
if (strpos($optUser,",") !== false) {
80-
$originalOptUser = $optUser;
81-
$nextUsers = explode(",", $optUser);
82-
$optUser = array_shift($nextUsers);
83-
$nextUsers = implode(",",$nextUsers);
84-
} else if (strpos($optUser, "queue:") === 0) {
85-
$optUserQueue = substr($optUser, strlen("queue:"));
86-
$optUser = false;
87-
//echo("QUEUE : ".$optUserQueue);
88-
if (is_file($optUserQueue)) {
89-
$lines = file($optUserQueue);
90-
if (count($lines) && !empty($lines[0])) {
91-
$allUsers = explode(",", $lines[0]);
92-
$optUser = array_shift($allUsers);
93-
file_put_contents($optUserQueue, implode(",", $allUsers));
94-
}
95-
}
96-
if ($optUser === false) {
97-
if (is_file($optUserQueue)) {
98-
unlink($optUserQueue);
99-
}
100-
die("No more users inside queue");
101-
}
102-
}
103-
}
10438

105-
106-
$optStatusFile = $options["s"] OR false;
107-
$optAction = $options["a"];
108-
$optRepoId = $options["r"] OR false;
109-
if (strpos($optRepoId,",") !== false) {
110-
$nextRepositories = explode(",", $optRepoId);
111-
$optRepoId = array_shift($nextRepositories);
112-
$nextRepositories = implode(",", $nextRepositories);
113-
}
114-
115-
//echo("REPOSITORY : ".$optRepoId." USER : ".$optUser."\n");
116-
117-
$optDetectUser = $options["detect_user"] OR false;
118-
$detectedUser = false;
119-
120-
if ($optRepoId !== false) {
121-
$repository = ConfService::getRepositoryById($optRepoId);
122-
if ($repository == null) {
123-
$repository = ConfService::getRepositoryByAlias($optRepoId);
124-
if ($repository != null) {
125-
$optRepoId =($repository->isWriteable()?$repository->getUniqueId():$repository->getId());
126-
}
127-
}
128-
if ($optDetectUser != false) {
129-
$path = $repository->getOption("PATH", true);
130-
if (strpos($path, "AJXP_USER") !== false) {
131-
$path = str_replace(
132-
array("AJXP_INSTALL_PATH", "AJXP_DATA_PATH", "/"),
133-
array(AJXP_INSTALL_PATH, AJXP_DATA_PATH, DIRECTORY_SEPARATOR),
134-
$path
135-
);
136-
$parts = explode("AJXP_USER", $path);
137-
if(count($parts) == 1) $parts[1] = "";
138-
$first = str_replace("\\", "\\\\", $parts[0]);
139-
$last = str_replace("\\", "\\\\", $parts[1]);
140-
if (preg_match("/$first(.*)$last.*/", $optDetectUser, $matches)) {
141-
$detectedUser = $matches[1];
142-
}
143-
}
144-
}
145-
try{
146-
ConfService::switchRootDir($optRepoId, true);
147-
}catch(AJXP_Exception $e){}
148-
} else {
149-
if ($optStatusFile) {
150-
file_put_contents($optStatusFile, "ERROR:You must pass a -r argument specifying either a repository id or alias");
151-
}
152-
die("You must pass a -r argument specifying either a repository id or alias");
153-
}
154-
155-
if (AuthService::usersEnabled() && !empty($optUser)) {
156-
$seed = AuthService::generateSeed();
157-
if ($seed != -1) {
158-
$optPass = md5(md5($optPass).$seed);
159-
}
160-
$loggingResult = AuthService::logUser($optUser, $optPass, isSet($optToken), false, $seed);
161-
// Check that current user can access current repository, try to switch otherwise.
162-
$loggedUser = AuthService::getLoggedUser();
163-
if ($loggedUser != null && $detectedUser !== false && $loggedUser->isAdmin()) {
164-
AuthService::disconnect();
165-
AuthService::logUser($detectedUser, "empty", true, false, "");
166-
$loggedUser = AuthService::getLoggedUser();
167-
}
168-
169-
if ($loggedUser != null) {
170-
ConfService::switchRootDir($optRepoId, true);
171-
/*
172-
$res = ConfService::switchUserToActiveRepository($loggedUser, $optRepoId);
173-
if (!$res) {
174-
AuthService::disconnect();
175-
$requireAuth = true;
176-
}
177-
*/
178-
}
179-
if (isset($loggingResult) && $loggingResult != 1) {
180-
AJXP_XMLWriter::header();
181-
AJXP_XMLWriter::loggingResult($loggingResult, false, false, "");
182-
AJXP_XMLWriter::close();
183-
if ($optStatusFile) {
184-
file_put_contents($optStatusFile, "ERROR:No user logged");
185-
}
186-
}
187-
} else {
188-
AJXP_Logger::debug(ConfService::getCurrentRepositoryId());
189-
}
190-
191-
//Set language
192-
$loggedUser = AuthService::getLoggedUser();
193-
if($loggedUser != null && $loggedUser->getPref("lang") != "") ConfService::setLanguage($loggedUser->getPref("lang"));
194-
else if(isSet($_COOKIE["AJXP_lang"])) ConfService::setLanguage($_COOKIE["AJXP_lang"]);
195-
$mess = ConfService::getMessages();
196-
197-
// THIS FIRST DRIVERS DO NOT NEED ID CHECK
198-
//$ajxpDriver = AJXP_PluginsService::findPlugin("gui", "ajax");
199-
$authDriver = ConfService::getAuthDriverImpl();
200-
// DRIVERS BELOW NEED IDENTIFICATION CHECK
201-
if (!AuthService::usersEnabled() || ConfService::getCoreConf("ALLOW_GUEST_BROWSING", "auth") || AuthService::getLoggedUser()!=null) {
202-
$confDriver = ConfService::getConfStorageImpl();
203-
$loadRepo = ConfService::getRepository();
204-
$Driver = ConfService::loadDriverForRepository($loadRepo);
205-
}
206-
AJXP_PluginsService::getInstance()->initActivePlugins();
207-
require_once(AJXP_BIN_FOLDER."/class.AJXP_Controller.php");
208-
$xmlResult = AJXP_Controller::findActionAndApply($optAction, $optArgs, array());
209-
if ($xmlResult !== false && $xmlResult != "") {
210-
AJXP_XMLWriter::header();
211-
print($xmlResult);
212-
AJXP_XMLWriter::close();
213-
} else if (isset($requireAuth) && AJXP_Controller::$lastActionNeedsAuth) {
214-
AJXP_XMLWriter::header();
215-
AJXP_XMLWriter::requireAuth();
216-
AJXP_XMLWriter::close();
217-
}
218-
//echo("NEXT REPO ".$nextRepositories." (".$options["r"].")\n");
219-
//echo("NEXT USERS ".$nextUsers." ( ".$originalOptUser." )\n");
220-
if (!empty($nextUsers) || !empty($nextRepositories) || !empty($optUserQueue) ) {
221-
222-
if (!empty($nextUsers)) {
223-
sleep(1);
224-
$process = AJXP_Controller::applyActionInBackground($options["r"], $optAction, $optArgs, $nextUsers, $optStatusFile);
225-
if ($process != null && is_a($process, "UnixProcess") && isSet($optStatusFile)) {
226-
file_put_contents($optStatusFile, "RUNNING:".$process->getPid());
227-
}
228-
}
229-
if (!empty($optUserQueue)) {
230-
sleep(1);
231-
//echo("Should go to next with $optUserQueue");
232-
$process = AJXP_Controller::applyActionInBackground($options["r"], $optAction, $optArgs, "queue:".$optUserQueue, $optStatusFile);
233-
if ($process != null && is_a($process, "UnixProcess") && isSet($optStatusFile)) {
234-
file_put_contents($optStatusFile, "RUNNING:".$process->getPid());
235-
}
236-
}
237-
if (!empty($nextRepositories)) {
238-
sleep(1);
239-
$process = AJXP_Controller::applyActionInBackground($nextRepositories, $optAction, $optArgs, $originalOptUser, $optStatusFile);
240-
if ($process != null && is_a($process, "UnixProcess") && isSet($optStatusFile)) {
241-
file_put_contents($optStatusFile, "RUNNING:".$process->getPid());
242-
}
243-
}
244-
245-
} else if (isSet($optStatusFile)) {
246-
247-
$status = explode(":", file_get_contents($optStatusFile));
248-
file_put_contents($optStatusFile, "FINISHED".(in_array("QUEUED", $status)?":QUEUED":""));
249-
250-
}
39+
$input = new \Pydio\Core\Http\Cli\FreeArgvOptions();
40+
$application = new Application();
41+
$application->add(new Command());
42+
$application->setDefaultCommand("pydio");
43+
$application->run($input);

core/src/conf/bootstrap_conf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Affero General Public License
1717
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
1818
*
19-
* The latest code can be found at <http://pyd.io/>.
19+
* The latest code can be found at <https://pydio.com>.
2020
*
2121
* These configuration must be set at the very root loading of the framework
2222
*/

0 commit comments

Comments
 (0)