Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/private/User/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ public function prepareUserLogin($firstTimeLogin = false) {
\OC::$server->getLogger()->warning(
'Skeleton not created due to missing write permission'
);
} catch(\OC\HintException $hintEx) {
// only if Skeleton no existing Dir
\OC::$server->getLogger()->error($hintEx->getMessage());
}

// trigger any other initialization
Expand Down Expand Up @@ -842,7 +845,7 @@ public function logout() {
try {
$this->tokenProvider->invalidateToken($this->session->getId());
} catch (SessionNotAvailableException $ex) {

}
}
$this->setUser(null);
Expand Down
13 changes: 9 additions & 4 deletions lib/private/legacy/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,16 @@ public static function getUserQuota($userId) {
*
* @param String $userId
* @param \OCP\Files\Folder $userDirectory
* @throws \OC\HintException
*/
public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) {

$skeletonDirectory = \OCP\Config::getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton');

if (!is_dir($skeletonDirectory)) {
throw new \OC\HintException('The skeleton folder '.$skeletonDirectory.' is not accessible');
}

if (!empty($skeletonDirectory)) {
\OCP\Util::writeLog(
'files_skeleton',
Expand Down Expand Up @@ -458,8 +463,8 @@ public static function getVersionString() {
}

/**
* @description get the current installed edition of ownCloud.
* There is the community edition that returns "Community" and
* @description get the current installed edition of ownCloud.
* There is the community edition that returns "Community" and
* the enterprise edition that returns "Enterprise".
* @return string
*/
Expand Down Expand Up @@ -569,7 +574,7 @@ public static function addVendorScript($application, $file = null, $prepend = fa
*
* @param string $application application id
* @param string $languageCode language code, defaults to the current language
* @param bool $prepend prepend the Script to the beginning of the list
* @param bool $prepend prepend the Script to the beginning of the list
*/
public static function addTranslations($application, $languageCode = null, $prepend = false) {
if (is_null($languageCode)) {
Expand Down Expand Up @@ -614,7 +619,7 @@ public static function addVendorStyle($application, $file = null, $prepend = fal
*
* @param string $application application id
* @param bool $prepend prepend the file to the beginning of the list
* @param string $path
* @param string $path
* @param string $type (script or style)
* @return void
*/
Expand Down
13 changes: 13 additions & 0 deletions tests/lib/UtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,19 @@ public function testCheckDataDirectoryValidity() {
$this->assertNotEmpty($errors);
}

/**
* @expectedException \OC\HintException
* @expectedExceptionMessage The skeleton folder /not/existing/Directory is not accessible
*/
public function testCopySkeletonDirectory() {
$config = \OC::$server->getConfig();
$config->setSystemValue('skeletondirectory', '/not/existing/Directory');
$userFolder = $this->createMock('\OCP\Files\Folder');
\OC_Util::copySkeleton($config, $userFolder);

$config->deleteSystemValue('skeletondirectory');
}

protected function setUp() {
parent::setUp();

Expand Down