diff options
26 files changed, 201 insertions, 89 deletions
diff --git a/apps/admin_audit/lib/Actions/UserManagement.php b/apps/admin_audit/lib/Actions/UserManagement.php index 45250d4e708..5cf1494df6e 100644 --- a/apps/admin_audit/lib/Actions/UserManagement.php +++ b/apps/admin_audit/lib/Actions/UserManagement.php @@ -51,6 +51,19 @@ class UserManagement extends Action { } /** + * Log assignments of users (typically user backends) + * + * @param string $uid + */ + public function assign(string $uid) { + $this->log( + 'UserID assigned: "%s"', + [ 'uid' => $uid ], + [ 'uid' ] + ); + } + + /** * Log deletion of users * * @param array $params @@ -66,6 +79,19 @@ class UserManagement extends Action { } /** + * Log unassignments of users (typically user backends, no data removed) + * + * @param string $uid + */ + public function unassign(string $uid) { + $this->log( + 'UserID unassigned: "%s"', + [ 'uid' => $uid ], + [ 'uid' ] + ); + } + + /** * Log enabling of users * * @param array $params diff --git a/apps/admin_audit/lib/AppInfo/Application.php b/apps/admin_audit/lib/AppInfo/Application.php index 5634a4a67b5..df39e3eb111 100644 --- a/apps/admin_audit/lib/AppInfo/Application.php +++ b/apps/admin_audit/lib/AppInfo/Application.php @@ -93,6 +93,8 @@ class Application extends App { /** @var IUserSession|Session $userSession */ $userSession = $this->getContainer()->getServer()->getUserSession(); $userSession->listen('\OC\User', 'postSetPassword', [$userActions, 'setPassword']); + $userSession->listen('\OC\User', 'assignedUserId', [$userActions, 'assign']); + $userSession->listen('\OC\User', 'postUnassignedUserId', [$userActions, 'unassign']); } protected function groupHooks(ILogger $logger) { diff --git a/apps/dav/lib/HookManager.php b/apps/dav/lib/HookManager.php index 57b176213e0..b1bd039c65e 100644 --- a/apps/dav/lib/HookManager.php +++ b/apps/dav/lib/HookManager.php @@ -77,14 +77,22 @@ class HookManager { 'post_createUser', $this, 'postCreateUser'); + \OC::$server->getUserManager()->listen('\OC\User', 'assignedUserId', function ($uid) { + $this->postCreateUser(['uid' => $uid]); + }); Util::connectHook('OC_User', 'pre_deleteUser', $this, 'preDeleteUser'); + \OC::$server->getUserManager()->listen('\OC\User', 'preUnassignedUserId', [$this, 'preUnassignedUserId']); Util::connectHook('OC_User', 'post_deleteUser', $this, 'postDeleteUser'); + \OC::$server->getUserManager()->listen('\OC\User', 'postUnassignedUserId', function ($uid) { + $this->postDeleteUser(['uid' => $uid]); + }); + \OC::$server->getUserManager()->listen('\OC\User', 'postUnassignedUserId', [$this, 'postUnassignedUserId']); Util::connectHook('OC_User', 'changeUser', $this, @@ -103,6 +111,10 @@ class HookManager { $this->addressBooksToDelete = $this->cardDav->getUsersOwnAddressBooks('principals/users/' . $uid); } + public function preUnassignedUserId($uid) { + $this->usersToDelete[$uid] = $this->userManager->get($uid); + } + public function postDeleteUser($params) { $uid = $params['uid']; if (isset($this->usersToDelete[$uid])){ @@ -119,6 +131,12 @@ class HookManager { } } + public function postUnassignedUserId($uid) { + if (isset($this->usersToDelete[$uid])){ + $this->syncService->deleteUser($this->usersToDelete[$uid]); + } + } + public function changeUser($params) { $user = $params['user']; $this->syncService->updateUser($user); diff --git a/apps/user_ldap/ajax/clearMappings.php b/apps/user_ldap/ajax/clearMappings.php index 01b6b7f0ef2..8e2d63e3eb2 100644 --- a/apps/user_ldap/ajax/clearMappings.php +++ b/apps/user_ldap/ajax/clearMappings.php @@ -33,13 +33,23 @@ use OCA\User_LDAP\Mapping\GroupMapping; $subject = (string)$_POST['ldap_clear_mapping']; $mapping = null; -if($subject === 'user') { - $mapping = new UserMapping(\OC::$server->getDatabaseConnection()); -} else if($subject === 'group') { - $mapping = new GroupMapping(\OC::$server->getDatabaseConnection()); -} try { - if(is_null($mapping) || !$mapping->clear()) { + if($subject === 'user') { + $mapping = new UserMapping(\OC::$server->getDatabaseConnection()); + $result = $mapping->clearCb( + function ($uid) { + \OC::$server->getUserManager()->emit('\OC\User', 'preUnassignedUserId', [$uid]); + }, + function ($uid) { + \OC::$server->getUserManager()->emit('\OC\User', 'postUnassignedUserId', [$uid]); + } + ); + } else if($subject === 'group') { + $mapping = new GroupMapping(\OC::$server->getDatabaseConnection()); + $result = $mapping->clear(); + } + + if($mapping === null || !$result) { $l = \OC::$server->getL10N('user_ldap'); throw new \Exception($l->t('Failed to clear the mappings.')); } diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 9fb37090270..2395da1ec90 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -44,6 +44,7 @@ namespace OCA\User_LDAP; use OC\HintException; +use OC\Hooks\PublicEmitter; use OCA\User_LDAP\Exceptions\ConstraintViolationException; use OCA\User_LDAP\User\IUserTools; use OCA\User_LDAP\User\Manager; @@ -52,6 +53,7 @@ use OCA\User_LDAP\Mapping\AbstractMapping; use OC\ServerNotAvailableException; use OCP\IConfig; +use OCP\IUserManager; use OCP\Util; /** @@ -95,13 +97,16 @@ class Access extends LDAPUtility implements IUserTools { private $helper; /** @var IConfig */ private $config; + /** @var IUserManager */ + private $ncUserManager; public function __construct( Connection $connection, ILDAPWrapper $ldap, Manager $userManager, Helper $helper, - IConfig $config + IConfig $config, + IUserManager $ncUserManager ) { parent::__construct($ldap); $this->connection = $connection; @@ -109,6 +114,7 @@ class Access extends LDAPUtility implements IUserTools { $this->userManager->setLdapAccess($this); $this->helper = $helper; $this->config = $config; + $this->ncUserManager = $ncUserManager; } /** @@ -605,10 +611,13 @@ class Access extends LDAPUtility implements IUserTools { // outside of core user management will still cache the user as non-existing. $originalTTL = $this->connection->ldapCacheTTL; $this->connection->setConfiguration(array('ldapCacheTTL' => 0)); - if(($isUser && $intName !== '' && !\OC::$server->getUserManager()->userExists($intName)) + if(($isUser && $intName !== '' && !$this->ncUserManager->userExists($intName)) || (!$isUser && !\OC::$server->getGroupManager()->groupExists($intName))) { if($mapper->map($fdn, $intName, $uuid)) { $this->connection->setConfiguration(array('ldapCacheTTL' => $originalTTL)); + if($this->ncUserManager instanceof PublicEmitter) { + $this->ncUserManager->emit('\OC\User', 'assignedUserId', [$intName]); + } $newlyMapped = true; return $intName; } @@ -617,6 +626,9 @@ class Access extends LDAPUtility implements IUserTools { $altName = $this->createAltInternalOwnCloudName($intName, $isUser); if(is_string($altName) && $mapper->map($fdn, $altName, $uuid)) { + if($this->ncUserManager instanceof PublicEmitter) { + $this->ncUserManager->emit('\OC\User', 'assignedUserId', [$intName]); + } $newlyMapped = true; return $altName; } @@ -738,7 +750,7 @@ class Access extends LDAPUtility implements IUserTools { //20 attempts, something else is very wrong. Avoids infinite loop. while($attempts < 20){ $altName = $name . '_' . rand(1000,9999); - if(!\OC::$server->getUserManager()->userExists($altName)) { + if(!$this->ncUserManager->userExists($altName)) { return $altName; } $attempts++; diff --git a/apps/user_ldap/lib/AccessFactory.php b/apps/user_ldap/lib/AccessFactory.php index 45ff779bb01..f03f7f74202 100644 --- a/apps/user_ldap/lib/AccessFactory.php +++ b/apps/user_ldap/lib/AccessFactory.php @@ -26,6 +26,7 @@ namespace OCA\User_LDAP; use OCA\User_LDAP\User\Manager; use OCP\IConfig; +use OCP\IUserManager; class AccessFactory { /** @var ILDAPWrapper */ @@ -36,17 +37,21 @@ class AccessFactory { protected $helper; /** @var IConfig */ protected $config; + /** @var IUserManager */ + private $ncUserManager; public function __construct( ILDAPWrapper $ldap, Manager $userManager, Helper $helper, - IConfig $config) + IConfig $config, + IUserManager $ncUserManager) { $this->ldap = $ldap; $this->userManager = $userManager; $this->helper = $helper; $this->config = $config; + $this->ncUserManager = $ncUserManager; } public function get(Connection $connection) { @@ -55,7 +60,8 @@ class AccessFactory { $this->ldap, $this->userManager, $this->helper, - $this->config + $this->config, + $this->ncUserManager ); } } diff --git a/apps/user_ldap/lib/Jobs/Sync.php b/apps/user_ldap/lib/Jobs/Sync.php index 4ef0636a2eb..0abb9331a2f 100644 --- a/apps/user_ldap/lib/Jobs/Sync.php +++ b/apps/user_ldap/lib/Jobs/Sync.php @@ -376,7 +376,8 @@ class Sync extends TimedJob { $this->ldap, $this->userManager, $this->ldapHelper, - $this->config + $this->config, + $this->ncUserManager ); } } diff --git a/apps/user_ldap/lib/Jobs/UpdateGroups.php b/apps/user_ldap/lib/Jobs/UpdateGroups.php index 2b57874c62f..c36ec80b93e 100644 --- a/apps/user_ldap/lib/Jobs/UpdateGroups.php +++ b/apps/user_ldap/lib/Jobs/UpdateGroups.php @@ -192,7 +192,7 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob { \OC::$server->getUserManager(), \OC::$server->getNotificationManager()); $connector = new Connection($ldapWrapper, $configPrefixes[0]); - $ldapAccess = new Access($connector, $ldapWrapper, $userManager, $helper, \OC::$server->getConfig()); + $ldapAccess = new Access($connector, $ldapWrapper, $userManager, $helper, \OC::$server->getConfig(), \OC::$server->getUserManager()); $groupMapper = new GroupMapping($dbc); $userMapper = new UserMapping($dbc); $ldapAccess->setGroupMapper($groupMapper); diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php index f5f56ce03d6..c7d737a7631 100644 --- a/apps/user_ldap/lib/Mapping/AbstractMapping.php +++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php @@ -279,6 +279,32 @@ abstract class AbstractMapping { } /** + * clears the mapping table one by one and executing a callback with + * each row's id (=owncloud_name col) + * + * @param callable $preCallback + * @param callable $postCallback + * @return bool true on success, false when at least one row was not + * deleted + */ + public function clearCb(Callable $preCallback, Callable $postCallback): bool { + $picker = $this->dbc->getQueryBuilder(); + $picker->select('owncloud_name') + ->from($this->getTableName()); + $cursor = $picker->execute(); + $result = true; + while($id = $cursor->fetchColumn(0)) { + $preCallback($id); + if($isUnmapped = $this->unmap($id)) { + $postCallback($id); + } + $result &= $isUnmapped; + } + $cursor->closeCursor(); + return $result; + } + + /** * returns the number of entries in the mappings table * * @return int diff --git a/apps/user_ldap/lib/Proxy.php b/apps/user_ldap/lib/Proxy.php index ab5434f9fe5..8b5ff996085 100644 --- a/apps/user_ldap/lib/Proxy.php +++ b/apps/user_ldap/lib/Proxy.php @@ -82,7 +82,7 @@ abstract class Proxy { new Manager($ocConfig, $fs, $log, $avatarM, new \OCP\Image(), $db, $coreUserManager, $coreNotificationManager); $connector = new Connection($this->ldap, $configPrefix); - $access = new Access($connector, $this->ldap, $userManager, new Helper($ocConfig), $ocConfig); + $access = new Access($connector, $this->ldap, $userManager, new Helper($ocConfig), $ocConfig, $coreUserManager); $access->setUserMapper($userMap); $access->setGroupMapper($groupMap); self::$accesses[$configPrefix] = $access; diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php index 5a2b993c334..e56e4675e39 100644 --- a/apps/user_ldap/lib/User_LDAP.php +++ b/apps/user_ldap/lib/User_LDAP.php @@ -396,7 +396,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn \OC::$server->getLogger()->info('Cleaning up after user ' . $uid, array('app' => 'user_ldap')); - $this->access->getUserMapper()->unmap($uid); + $this->access->getUserMapper()->unmap($uid); // we don't emit unassign signals here, since it is implicit to delete signals fired from core $this->access->userManager->invalidate($uid); return true; } diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php index 336b92af04f..43a34959c54 100644 --- a/apps/user_ldap/tests/AccessTest.php +++ b/apps/user_ldap/tests/AccessTest.php @@ -72,6 +72,8 @@ class AccessTest extends TestCase { private $helper; /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */ private $config; + /** @var IUserManager|\PHPUnit_Framework_MockObject_MockObject */ + private $ncUserManager; /** @var Access */ private $access; @@ -82,13 +84,15 @@ class AccessTest extends TestCase { $this->helper = $this->createMock(Helper::class); $this->config = $this->createMock(IConfig::class); $this->userMapper = $this->createMock(UserMapping::class); + $this->ncUserManager = $this->createMock(IUserManager::class); $this->access = new Access( $this->connection, $this->ldap, $this->userManager, $this->helper, - $this->config + $this->config, + $this->ncUserManager ); $this->access->setUserMapper($this->userMapper); } @@ -227,7 +231,7 @@ class AccessTest extends TestCase { list($lw, $con, $um, $helper) = $this->getConnectorAndLdapMock(); /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject $config */ $config = $this->createMock(IConfig::class); - $access = new Access($con, $lw, $um, $helper, $config); + $access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager); $lw->expects($this->exactly(1)) ->method('explodeDN') @@ -250,7 +254,7 @@ class AccessTest extends TestCase { /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject $config */ $config = $this->createMock(IConfig::class); $lw = new LDAP(); - $access = new Access($con, $lw, $um, $helper, $config); + $access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager); if(!function_exists('ldap_explode_dn')) { $this->markTestSkipped('LDAP Module not available'); @@ -431,7 +435,7 @@ class AccessTest extends TestCase { $attribute => array('count' => 1, $dnFromServer) ))); - $access = new Access($con, $lw, $um, $helper, $config); + $access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager); $values = $access->readAttribute('uid=whoever,dc=example,dc=org', $attribute); $this->assertSame($values[0], strtolower($dnFromServer)); } diff --git a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php index d3d33a82da9..54d8b49cdc8 100644 --- a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php +++ b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php @@ -235,6 +235,29 @@ abstract class AbstractMappingTest extends \Test\TestCase { } /** + * tests clear() for successful update. + */ + public function testClearCb() { + list($mapper, $data) = $this->initTest(); + + $callbackCalls = 0; + $test = $this; + + $callback = function (string $id) use ($test, &$callbackCalls) { + $test->assertTrue(trim($id) !== ''); + $callbackCalls++; + }; + + $done = $mapper->clearCb($callback, $callback); + $this->assertTrue($done); + $this->assertSame(count($data) * 2, $callbackCalls); + foreach($data as $entry) { + $name = $mapper->getNameByUUID($entry['uuid']); + $this->assertFalse($name); + } + } + + /** * tests getList() method */ public function testList() { diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index ffa5b10fc2f..2235439d956 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -141,7 +141,8 @@ class LoginController extends Controller { * * @return TemplateResponse|RedirectResponse */ - public function showLoginForm($user, $redirect_url) { + public function showLoginForm(string $user = null, string $redirect_url = null): Http\Response { + if ($this->userSession->isLoggedIn()) { return new RedirectResponse(OC_Util::getDefaultPageUrl()); } diff --git a/core/Migrations/Version14000Date20180404140050.php b/core/Migrations/Version14000Date20180404140050.php index 01d56f511ff..d7077caa149 100644 --- a/core/Migrations/Version14000Date20180404140050.php +++ b/core/Migrations/Version14000Date20180404140050.php @@ -74,7 +74,7 @@ class Version14000Date20180404140050 extends SimpleMigrationStep { $qb = $this->connection->getQueryBuilder(); $qb->update('users') - ->set('uid_lower', $qb->createFunction('LOWER(`uid`)')); + ->set('uid_lower', $qb->func()->lower('uid')); $qb->execute(); } } diff --git a/core/css/header.scss b/core/css/header.scss index b1141476a0e..8e520957889 100644 --- a/core/css/header.scss +++ b/core/css/header.scss @@ -49,7 +49,7 @@ left: 0; right: 0; z-index: 2000; - height: 45px; + height: 50px; background-color: $color-primary; box-sizing: border-box; justify-content: space-between; @@ -57,10 +57,8 @@ /* LOGO and APP NAME -------------------------------------------------------- */ #nextcloud { - padding: 5px; - padding-bottom: 0; - height: 45px; - /* header height */ + padding: 8px 12px; + height: 100%; box-sizing: border-box; opacity: 1; &:focus { @@ -82,8 +80,8 @@ position: absolute; max-width: 350px; max-height: 280px; - right: 0; - top: 44px; + right: 5px; + top: 50px; margin: 0; &:not(.popovermenu) { @@ -100,7 +98,7 @@ width: 0; position: absolute; pointer-events: none; - right: 12px; + right: 10px; } } .logo { @@ -161,13 +159,14 @@ .header-right { > div, > form { + height: 100%; position: relative; > .menutoggle { display: flex; justify-content: center; align-items: center; - width: 44px; - height: 44px; + width: 50px; + height: 100%; cursor: pointer; opacity: 0.6; padding: 0; @@ -225,14 +224,14 @@ /* NAVIGATION --------------------------------------------------------------- */ nav[role='navigation'] { display: inline-block; - width: 44px; - height: 44px; - margin-left: -44px; + width: 50px; + height: 50px; + margin-left: -50px; } .header-left #navigation { position: relative; - left: 22px; /* half the togglemenu */ + left: 25px; /* half the togglemenu */ transform: translateX(-50%); width: 160px; } @@ -340,14 +339,15 @@ nav[role='navigation'] { #settings { display: inline-block; + height: 100%; color: rgba($color-primary-text, 0.7); cursor: pointer; - margin-right: 13px; flex: 0 0 auto; /* User menu on the right */ #expand { opacity: 1; /* override icon opacity */ + padding-right: 12px; img { opacity: .7; @@ -407,6 +407,9 @@ nav[role='navigation'] { } #expanddiv { + &.menu { + right: 17px; + } a { display: inline-flex; align-items: center; @@ -439,23 +442,24 @@ nav[role='navigation'] { #appmenu { display: inline-block; width: auto; + min-width: 50px; + height: 100%; clear: both; - min-width: 88px; li { float: left; display: inline-block; position: relative; vertical-align: top !important; - height: 45px; + height: 100%; cursor: pointer; a { position: relative; display: inline-block; margin: 0; - padding: 12px; - height: 21px; + padding: 15px 15px; + height: 20px; text-align: center; vertical-align: top !important; opacity: .6; @@ -496,7 +500,6 @@ nav[role='navigation'] { border-radius: $border-radius; border-top-left-radius: 0; border-top-right-radius: 0; - margin-top: 0; color: rgba($color-main-text, .7); width: auto; left: 50%; diff --git a/core/css/mobile.scss b/core/css/mobile.scss index ebc7e094cdb..cfc8c002e17 100644 --- a/core/css/mobile.scss +++ b/core/css/mobile.scss @@ -134,10 +134,8 @@ table.multiselect thead { @media only screen and (max-width: 480px) { #header .header-right .menu { - max-width: calc(100vw - 26px); + max-width: calc(100vw - 10px); position: fixed; - right: 13px; - top: 45px; &::after { display: none !important; } @@ -158,9 +156,14 @@ table.multiselect thead { width: 0; position: absolute; pointer-events: none; - right: 13px; + right: 15px; z-index: 2001; display: none; } + + /* settings need a different offset, since they have a right padding */ + &#settings::after { + right: 27px; + } } } diff --git a/core/css/styles.scss b/core/css/styles.scss index 0b15718eefd..0bbd89f075b 100644 --- a/core/css/styles.scss +++ b/core/css/styles.scss @@ -184,17 +184,18 @@ body { padding: 3px; padding-left: 25px; padding-right: 20px; - background: transparent url('../img/actions/search-white.svg?v=1') no-repeat 6px center; + background: transparent url('../img/actions/search-white.svg?v=1') no-repeat center center; color: $color-primary-text; border: 0; border-radius: $border-radius; - margin-top: 3px; + margin-top: 9px; width: 0; cursor: pointer; -webkit-transition: all 100ms; transition: all 100ms; opacity: .6; &:focus, &:active, &:valid { + background-position-x: 6px; color: $color-primary-text; width: 155px; cursor: text; @@ -207,10 +208,11 @@ body { & ~ .icon-close-white { display: inline; position: absolute; - width: 15px; - height: 32px; - right: 3px; + width: 30px; + height: 100%; + right: 0; top: 0; + margin: 0; &, &:focus, &:active, &:hover { border: none; background-color: transparent; @@ -287,7 +289,7 @@ body { width: 100%; overflow-x: hidden; /* prevent horizontal scrollbar */ - padding-top: 45px; + padding-top: 50px; box-sizing: border-box; } diff --git a/core/js/js.js b/core/js/js.js index 26dbbdb6e63..3d5f489895d 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1553,10 +1553,6 @@ function initCore() { if(appList.length-1-appCount >= 1) { appCount--; } - // show at least one icon - if(appCount < 1) { - appCount = 1; - } $('#more-apps a').removeClass('active'); var lastShownApp; diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index a8fd9349343..6c6fa68429f 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -133,7 +133,7 @@ class AppFetcher extends Fetcher { /** * @param string $version - * @param string $filename + * @param string $fileName */ public function setVersion(string $version, string $fileName = 'apps.json') { parent::setVersion($version); diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index abc7a45e6bc..b5054bd1851 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -50,6 +50,9 @@ use OCP\UserInterface; * - preCreateUser(string $uid, string $password) * - postCreateUser(\OC\User\User $user, string $password) * - change(\OC\User\User $user) + * - assignedUserId(string $uid) + * - preUnassignedUserId(string $uid) + * - postUnassignedUserId(string $uid) * * @package OC\User */ diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 4ac8888cee1..5d8455fb5f7 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -72,6 +72,9 @@ use Symfony\Component\EventDispatcher\GenericEvent; * - postDelete(\OC\User\User $user) * - preCreateUser(string $uid, string $password) * - postCreateUser(\OC\User\User $user) + * - assignedUserId(string $uid) + * - preUnassignedUserId(string $uid) + * - postUnassignedUserId(string $uid) * - preLogin(string $user, string $password) * - postLogin(\OC\User\User $user, string $password) * - preRememberedLogin(string $uid) diff --git a/lib/public/IUserManager.php b/lib/public/IUserManager.php index 163e8b5e73f..d20b4a3fa9a 100644 --- a/lib/public/IUserManager.php +++ b/lib/public/IUserManager.php @@ -40,6 +40,9 @@ namespace OCP; * - postDelete(\OC\User\User $user) * - preCreateUser(string $uid, string $password) * - postCreateUser(\OC\User\User $user, string $password) + * - assignedUserId(string $uid) + * - preUnassignedUserId(string $uid) + * - postUnassignedUserId(string $uid) * * @package OC\User * @since 8.0.0 diff --git a/settings/ajax/navigationdetect.php b/settings/ajax/navigationdetect.php deleted file mode 100644 index 35cc25f19ff..00000000000 --- a/settings/ajax/navigationdetect.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Robin Appelman <robin@icewind.nl> - * @author Robin McCorkell <robin@mccorkell.me.uk> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ -OC_Util::checkAdminUser(); -\OC_JSON::callCheck(); - -$navigation = \OC::$server->getNavigationManager()->getAll(); - -\OC_JSON::success(['nav_entries' => $navigation]); diff --git a/settings/js/apps.js b/settings/js/apps.js index 0e5d7308e40..05514a10de2 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -597,10 +597,10 @@ OC.Settings.Apps = OC.Settings.Apps || { }, rebuildNavigation: function() { - $.getJSON(OC.filePath('settings', 'ajax', 'navigationdetect.php')).done(function(response){ - if(response.status === 'success') { + $.getJSON(OC.linkToOCS('core/navigation', 2) + 'apps?format=json').done(function(response){ + if(response.ocs.meta.status === 'ok') { var addedApps = {}; - var navEntries = response.nav_entries; + var navEntries = response.ocs.data; var container = $('#apps ul'); // remove disabled apps diff --git a/settings/routes.php b/settings/routes.php index ecf68791a27..df49f0af859 100644 --- a/settings/routes.php +++ b/settings/routes.php @@ -106,8 +106,6 @@ $this->create('settings_ajax_updateapp', '/settings/ajax/updateapp.php') ->actionInclude('settings/ajax/updateapp.php'); $this->create('settings_ajax_uninstallapp', '/settings/ajax/uninstallapp.php') ->actionInclude('settings/ajax/uninstallapp.php'); -$this->create('settings_ajax_navigationdetect', '/settings/ajax/navigationdetect.php') - ->actionInclude('settings/ajax/navigationdetect.php'); // admin $this->create('settings_ajax_excludegroups', '/settings/ajax/excludegroups.php') ->actionInclude('settings/ajax/excludegroups.php'); |