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

Commit bc5d1fa

Browse files
committed
Code smells and other unused imports
1 parent 10ee151 commit bc5d1fa

File tree

9 files changed

+12
-67
lines changed

9 files changed

+12
-67
lines changed

core/src/core/src/pydio/Core/Http/Server.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use Psr\Http\Message\ServerRequestInterface;
2525
use Pydio\Core\Exception\PydioException;
2626

27-
use Pydio\Core\Http\Message\PromptMessage;
2827
use Pydio\Core\Http\Message\UserMessage;
2928
use Pydio\Core\Http\Middleware\ITopLevelMiddleware;
3029
use Pydio\Core\Http\Middleware\SapiMiddleware;

core/src/core/src/pydio/Tests/AbstractTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
*/
2121
namespace Pydio\Tests;
2222

23+
use Pydio\Access\Core\Model\Repository;
24+
use Pydio\Core\Model\RepositoryInterface;
25+
2326
defined('AJXP_EXEC') or die( 'Access not allowed');
2427

2528
global $MAIN_testsArray;
@@ -72,7 +75,7 @@ public function doTest() { return FALSE; }
7275

7376
/**
7477
* Perform the test on a given repository object, should be overwritten in concrete classes
75-
* @param \Pydio\Access\Core\Model\Repository $repository
78+
* @param Repository|RepositoryInterface $repository
7679
* @return Boolean
7780
*/
7881
public function doRepositoryTest($repository) { return FALSE; }

core/src/phpdoc.dist.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<directory>core/src/pydio</directory>
1111
<directory>plugins</directory>
1212
<ignore>*phpseclib*</ignore>
13-
<ignore>*vendor/composer*</ignore>
13+
<ignore>*vendor*</ignore>
1414
<ignore>*vendor/phpmailer*</ignore>
1515
<ignore>*lib/class.phpmailer-lite.php</ignore>
1616
<ignore>*openstack-sdk-php*</ignore>

core/src/plugins/access.ajxp_conf/src/UsersManager.php

Lines changed: 2 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,8 @@ public function listNodes(ServerRequestInterface $requestInterface, $rootPath, $
907907
}
908908
if(isSet($allUserIds) && count($allUserIds)){
909909
$connections = $logger->usersLastConnection($allUserIds);
910+
}else{
911+
$connections = [];
910912
}
911913

912914
ksort($userArray);
@@ -921,68 +923,6 @@ public function listNodes(ServerRequestInterface $requestInterface, $rootPath, $
921923
$this->appendBookmarkMeta($bmKey, $meta);
922924
$nodesList->addBranch(new AJXP_Node($nodeKey, $meta));
923925

924-
/*
925-
$repos = ConfService::getConfStorageImpl()->listRepositories($userObject);
926-
$isAdmin = $userObject->isAdmin();
927-
$userId = $userObject->getId();
928-
$icon = "user".($userId=="guest"?"_guest":($isAdmin?"_admin":""));
929-
$iconClass = "icon-user";
930-
if ($userObject->hasParent()) {
931-
$icon = "user_child";
932-
$iconClass = "icon-angle-right";
933-
}
934-
if ($isAdmin) {
935-
$rightsString = $messages["ajxp_conf.63"];
936-
} else {
937-
$r = array();
938-
foreach ($repos as $repoId => $repository) {
939-
if($repository->getAccessType() == "ajxp_shared") continue;
940-
if(!$userObject->canRead($repoId) && !$userObject->canWrite($repoId)) continue;
941-
$rs = ($userObject->canRead($repoId) ? "r" : "");
942-
$rs .= ($userObject->canWrite($repoId) ? "w" : "");
943-
$r[] = $repository->getDisplay()." (".$rs.")";
944-
}
945-
$rightsString = implode(", ", $r);
946-
}
947-
$nodeLabel = UsersService::getUserPersonalParameter("USER_DISPLAY_NAME", $userObject, "core.conf", $userId);
948-
$scheme = UsersService::getAuthScheme($userId);
949-
$nodeKey = $fullBasePath. "/" .$userId;
950-
$roles = array_filter(array_keys($userObject->getRoles()), array($this, "filterReservedRoles"));
951-
$mergedRole = $userObject->mergedRole->getDataArray(true);
952-
$meta = [];
953-
if($format !== "json"){
954-
$mergedRole = json_encode($mergedRole);
955-
$currentRoles = implode(", ", $roles);
956-
$jsonKey = $nodeKey;
957-
}else{
958-
$currentRoles = $roles;
959-
$meta["personal_role_id"] = "/AJXP_USR_/".$userId;
960-
$jsonKey = $userId;
961-
}
962-
$meta = array_merge($meta, [
963-
"text" => $nodeLabel,
964-
"is_file" => true,
965-
"isAdmin" => $messages[($isAdmin?"ajxp_conf.14":"ajxp_conf.15")],
966-
"icon" => $icon.".png",
967-
"icon_class" => $iconClass,
968-
"object_id" => $userId,
969-
"auth_scheme" => ($scheme != null? $scheme : ""),
970-
"rights_summary" => $rightsString,
971-
"ajxp_roles" => $currentRoles,
972-
"ajxp_mime" => "user".(($userId!="guest"&&$userId!=$this->context->getUser()->getId())?"_editable":""),
973-
"json_merged_role" => $mergedRole
974-
]);
975-
if($userObject->hasParent()) {
976-
$meta["shared_user"] = "true";
977-
}
978-
if(isSet($connections) && isSet($connections[$userObject->getId()]) && !empty($connections[$userObject->getId()])) {
979-
$meta["last_connection"] = strtotime($connections[$userObject->getId()]);
980-
$meta["last_connection_readable"] = StatHelper::relativeDate($meta["last_connection"], $messages);
981-
}
982-
983-
$this->appendBookmarkMeta($nodeKey, $meta);
984-
$nodesList->addBranch(new AJXP_Node($jsonKey, $meta));
985-
*/
986926
}
987927
return $nodesList;
988928
}

core/src/plugins/access.ftp/FtpAccessWrapper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ protected function rawListEntryToStat($entry, $filterStatPerms = false)
512512
$vinfo = preg_split("/[\s]+/", $entry);
513513
Logger::debug(__CLASS__,__FUNCTION__,"RAW LIST", $entry);
514514
$statValue = array();
515+
$fileperms = '';
515516
if ($vinfo[0] !== "total") {
516517
$fileperms = $vinfo[0];
517518
$info['num'] = $vinfo[1];

core/src/plugins/access.sftp_psl/SftpPSLAccessWrapper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use Pydio\Access\Driver\StreamProvider\FS\FsAccessWrapper;
2929
use Pydio\Auth\Core\MemorySafe;
3030

31+
use Pydio\Core\Exception\PydioException;
3132
use Pydio\Core\Utils\ApplicationState;
3233
use Pydio\Core\Utils\Vars\InputFilter;
3334
use Pydio\Core\Utils\Vars\UrlUtils;

core/src/plugins/authfront.cas/CasAuthFrontend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ private function setPTGStorage()
408408
$db_database = "mysql:" . "dbname=" . $dbconfig->sqlDriver["database"] . ";host=" . $dbconfig->sqlDriver["host"];
409409
$db_table = "ajxp_cas_pgt";
410410
Logger::info(__CLASS__, __FUNCTION__, $db_database);
411-
phpCAS::setPGTStorageDB($db_database, $db_username, $db_password, $db_table, "");
411+
phpCAS::setPGTStorageDb($db_database, $db_username, $db_password, $db_table, "");
412412
}
413413
}
414414
break;

core/src/plugins/authfront.otp/OtpAuthFrontend.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ public function oath_hotp($key, $counter)
310310
*/
311311
public function oath_truncate($hash, $length = 6)
312312
{
313+
$hmac_result = [];
313314
// Convert to dec
314315
foreach (str_split($hash, 2) as $hex) {
315316
$hmac_result[] = hexdec($hex);

core/src/plugins/core.access/src/Model/AJXP_Node.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function __construct($url, $metadata = [])
122122
*/
123123
public function __sleep()
124124
{
125-
$t = array_diff(array_keys(get_class_vars("AJXP_Node")), ["_accessDriver", "_repository", "_metaStore"]);
125+
$t = array_diff(array_keys(get_class_vars("Pydio\\Access\\Core\\Model\\AJXP_Node")), ["_accessDriver", "_repository", "_metaStore"]);
126126
return $t;
127127
}
128128

0 commit comments

Comments
 (0)