Coder Social home page Coder Social logo

Comments (6)

Pytal avatar Pytal commented on July 23, 2024

cc @icewind1991

from server.

joshtrichards avatar joshtrichards commented on July 23, 2024

The data/user directory gets created at account creation time. Behavior looks the same at least back as far back as I checked (v27)...

I presume you mean the files folder underneath? I'm not able to reproduce the files folder getting created merely by running the occ user:info newuser command.

from server.

Pytal avatar Pytal commented on July 23, 2024

The data/user directory gets created at account creation time. Behavior looks the same at least back as far back as I checked (v27)...

Yes, when creating in the web UI the folder is created but not through occ.

The steps to reproduce would be:

  1. Create a user occ user:add --generate-password -- bob (Do not try to access any user info through the web UI or otherwise)
  2. Run user:info <user>

from server.

Pytal avatar Pytal commented on July 23, 2024

Behaviour seems a bit strange as a data access should not create anything but since this has behaved this way for a long time maybe not worth changing @icewind1991?

from server.

joshtrichards avatar joshtrichards commented on July 23, 2024

Looks like the getStorageInfo() used by user:info calls setupFS() regardless of login status:

'storage' => $this->getStorageInfo($user),
'last_seen' => date(\DateTimeInterface::ATOM, $user->getLastLogin()), // ISO-8601
'user_directory' => $user->getHome(),
'backend' => $user->getBackendClassName()
];
$this->writeArrayInOutputFormat($input, $output, $data);
return 0;
}
/**
* @param IUser $user
* @return array
*/
protected function getStorageInfo(IUser $user): array {
\OC_Util::tearDownFS();
\OC_Util::setupFS($user->getUID());
try {
$storage = \OC_Helper::getStorageInfo('/');

Maybe?

diff --git a/core/Command/User/Info.php b/core/Command/User/Info.php
index a8fb62099e2..75060ec8e2e 100644
--- a/core/Command/User/Info.php
+++ b/core/Command/User/Info.php
@@ -74,7 +74,7 @@ class Info extends Base {
                        'enabled' => $user->isEnabled(),
                        'groups' => $groups,
                        'quota' => $user->getQuota(),
-                       'storage' => $this->getStorageInfo($user),
+                       'storage' => $user->getLastLogin() ? $this->getStorageInfo($user) : [],
                        'last_seen' => date(\DateTimeInterface::ATOM, $user->getLastLogin()), // ISO-8601
                        'user_directory' => $user->getHome(),
                        'backend' => $user->getBackendClassName()

Yes, when creating in the web UI the folder is created but not through occ.

Guess those should be made consistent too. :-)

from server.

Pytal avatar Pytal commented on July 23, 2024

Closing as discussed with @icewind1991

from server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.