@@ -53,261 +53,261 @@ |
||
| 53 | 53 | use OCP\Util; |
| 54 | 54 | |
| 55 | 55 | class JSConfigHelper { |
| 56 | - protected IL10N $l; |
|
| 57 | - protected Defaults $defaults; |
|
| 58 | - protected IAppManager $appManager; |
|
| 59 | - protected ISession $session; |
|
| 60 | - protected ?IUser $currentUser; |
|
| 61 | - protected IConfig $config; |
|
| 62 | - protected IGroupManager $groupManager; |
|
| 63 | - protected IniGetWrapper $iniWrapper; |
|
| 64 | - protected IURLGenerator $urlGenerator; |
|
| 65 | - protected CapabilitiesManager $capabilitiesManager; |
|
| 66 | - protected IInitialStateService $initialStateService; |
|
| 56 | + protected IL10N $l; |
|
| 57 | + protected Defaults $defaults; |
|
| 58 | + protected IAppManager $appManager; |
|
| 59 | + protected ISession $session; |
|
| 60 | + protected ?IUser $currentUser; |
|
| 61 | + protected IConfig $config; |
|
| 62 | + protected IGroupManager $groupManager; |
|
| 63 | + protected IniGetWrapper $iniWrapper; |
|
| 64 | + protected IURLGenerator $urlGenerator; |
|
| 65 | + protected CapabilitiesManager $capabilitiesManager; |
|
| 66 | + protected IInitialStateService $initialStateService; |
|
| 67 | 67 | |
| 68 | - /** @var array user back-ends excluded from password verification */ |
|
| 69 | - private $excludedUserBackEnds = ['user_saml' => true, 'user_globalsiteselector' => true]; |
|
| 68 | + /** @var array user back-ends excluded from password verification */ |
|
| 69 | + private $excludedUserBackEnds = ['user_saml' => true, 'user_globalsiteselector' => true]; |
|
| 70 | 70 | |
| 71 | - public function __construct(IL10N $l, |
|
| 72 | - Defaults $defaults, |
|
| 73 | - IAppManager $appManager, |
|
| 74 | - ISession $session, |
|
| 75 | - ?IUser $currentUser, |
|
| 76 | - IConfig $config, |
|
| 77 | - IGroupManager $groupManager, |
|
| 78 | - IniGetWrapper $iniWrapper, |
|
| 79 | - IURLGenerator $urlGenerator, |
|
| 80 | - CapabilitiesManager $capabilitiesManager, |
|
| 81 | - IInitialStateService $initialStateService) { |
|
| 82 | - $this->l = $l; |
|
| 83 | - $this->defaults = $defaults; |
|
| 84 | - $this->appManager = $appManager; |
|
| 85 | - $this->session = $session; |
|
| 86 | - $this->currentUser = $currentUser; |
|
| 87 | - $this->config = $config; |
|
| 88 | - $this->groupManager = $groupManager; |
|
| 89 | - $this->iniWrapper = $iniWrapper; |
|
| 90 | - $this->urlGenerator = $urlGenerator; |
|
| 91 | - $this->capabilitiesManager = $capabilitiesManager; |
|
| 92 | - $this->initialStateService = $initialStateService; |
|
| 93 | - } |
|
| 71 | + public function __construct(IL10N $l, |
|
| 72 | + Defaults $defaults, |
|
| 73 | + IAppManager $appManager, |
|
| 74 | + ISession $session, |
|
| 75 | + ?IUser $currentUser, |
|
| 76 | + IConfig $config, |
|
| 77 | + IGroupManager $groupManager, |
|
| 78 | + IniGetWrapper $iniWrapper, |
|
| 79 | + IURLGenerator $urlGenerator, |
|
| 80 | + CapabilitiesManager $capabilitiesManager, |
|
| 81 | + IInitialStateService $initialStateService) { |
|
| 82 | + $this->l = $l; |
|
| 83 | + $this->defaults = $defaults; |
|
| 84 | + $this->appManager = $appManager; |
|
| 85 | + $this->session = $session; |
|
| 86 | + $this->currentUser = $currentUser; |
|
| 87 | + $this->config = $config; |
|
| 88 | + $this->groupManager = $groupManager; |
|
| 89 | + $this->iniWrapper = $iniWrapper; |
|
| 90 | + $this->urlGenerator = $urlGenerator; |
|
| 91 | + $this->capabilitiesManager = $capabilitiesManager; |
|
| 92 | + $this->initialStateService = $initialStateService; |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | - public function getConfig(): string { |
|
| 96 | - $userBackendAllowsPasswordConfirmation = true; |
|
| 97 | - if ($this->currentUser !== null) { |
|
| 98 | - $uid = $this->currentUser->getUID(); |
|
| 95 | + public function getConfig(): string { |
|
| 96 | + $userBackendAllowsPasswordConfirmation = true; |
|
| 97 | + if ($this->currentUser !== null) { |
|
| 98 | + $uid = $this->currentUser->getUID(); |
|
| 99 | 99 | |
| 100 | - $backend = $this->currentUser->getBackend(); |
|
| 101 | - if ($backend instanceof IPasswordConfirmationBackend) { |
|
| 102 | - $userBackendAllowsPasswordConfirmation = $backend->canConfirmPassword($uid); |
|
| 103 | - } elseif (isset($this->excludedUserBackEnds[$this->currentUser->getBackendClassName()])) { |
|
| 104 | - $userBackendAllowsPasswordConfirmation = false; |
|
| 105 | - } |
|
| 106 | - } else { |
|
| 107 | - $uid = null; |
|
| 108 | - } |
|
| 100 | + $backend = $this->currentUser->getBackend(); |
|
| 101 | + if ($backend instanceof IPasswordConfirmationBackend) { |
|
| 102 | + $userBackendAllowsPasswordConfirmation = $backend->canConfirmPassword($uid); |
|
| 103 | + } elseif (isset($this->excludedUserBackEnds[$this->currentUser->getBackendClassName()])) { |
|
| 104 | + $userBackendAllowsPasswordConfirmation = false; |
|
| 105 | + } |
|
| 106 | + } else { |
|
| 107 | + $uid = null; |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | - // Get the config |
|
| 111 | - $apps_paths = []; |
|
| 110 | + // Get the config |
|
| 111 | + $apps_paths = []; |
|
| 112 | 112 | |
| 113 | - if ($this->currentUser === null) { |
|
| 114 | - $apps = $this->appManager->getInstalledApps(); |
|
| 115 | - } else { |
|
| 116 | - $apps = $this->appManager->getEnabledAppsForUser($this->currentUser); |
|
| 117 | - } |
|
| 113 | + if ($this->currentUser === null) { |
|
| 114 | + $apps = $this->appManager->getInstalledApps(); |
|
| 115 | + } else { |
|
| 116 | + $apps = $this->appManager->getEnabledAppsForUser($this->currentUser); |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - foreach ($apps as $app) { |
|
| 120 | - try { |
|
| 121 | - $apps_paths[$app] = $this->appManager->getAppWebPath($app); |
|
| 122 | - } catch (AppPathNotFoundException $e) { |
|
| 123 | - $apps_paths[$app] = false; |
|
| 124 | - } |
|
| 125 | - } |
|
| 119 | + foreach ($apps as $app) { |
|
| 120 | + try { |
|
| 121 | + $apps_paths[$app] = $this->appManager->getAppWebPath($app); |
|
| 122 | + } catch (AppPathNotFoundException $e) { |
|
| 123 | + $apps_paths[$app] = false; |
|
| 124 | + } |
|
| 125 | + } |
|
| 126 | 126 | |
| 127 | - $enableLinkPasswordByDefault = $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'); |
|
| 128 | - $enableLinkPasswordByDefault = $enableLinkPasswordByDefault === 'yes'; |
|
| 129 | - $defaultExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes'; |
|
| 130 | - $defaultExpireDate = $enforceDefaultExpireDate = null; |
|
| 131 | - if ($defaultExpireDateEnabled) { |
|
| 132 | - $defaultExpireDate = (int)$this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
| 133 | - $enforceDefaultExpireDate = $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no') === 'yes'; |
|
| 134 | - } |
|
| 135 | - $outgoingServer2serverShareEnabled = $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes'; |
|
| 127 | + $enableLinkPasswordByDefault = $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'); |
|
| 128 | + $enableLinkPasswordByDefault = $enableLinkPasswordByDefault === 'yes'; |
|
| 129 | + $defaultExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes'; |
|
| 130 | + $defaultExpireDate = $enforceDefaultExpireDate = null; |
|
| 131 | + if ($defaultExpireDateEnabled) { |
|
| 132 | + $defaultExpireDate = (int)$this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
| 133 | + $enforceDefaultExpireDate = $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no') === 'yes'; |
|
| 134 | + } |
|
| 135 | + $outgoingServer2serverShareEnabled = $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes'; |
|
| 136 | 136 | |
| 137 | - $defaultInternalExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_internal_expire_date', 'no') === 'yes'; |
|
| 138 | - $defaultInternalExpireDate = $defaultInternalExpireDateEnforced = null; |
|
| 139 | - if ($defaultInternalExpireDateEnabled) { |
|
| 140 | - $defaultInternalExpireDate = (int)$this->config->getAppValue('core', 'shareapi_internal_expire_after_n_days', '7'); |
|
| 141 | - $defaultInternalExpireDateEnforced = $this->config->getAppValue('core', 'shareapi_enforce_internal_expire_date', 'no') === 'yes'; |
|
| 142 | - } |
|
| 137 | + $defaultInternalExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_internal_expire_date', 'no') === 'yes'; |
|
| 138 | + $defaultInternalExpireDate = $defaultInternalExpireDateEnforced = null; |
|
| 139 | + if ($defaultInternalExpireDateEnabled) { |
|
| 140 | + $defaultInternalExpireDate = (int)$this->config->getAppValue('core', 'shareapi_internal_expire_after_n_days', '7'); |
|
| 141 | + $defaultInternalExpireDateEnforced = $this->config->getAppValue('core', 'shareapi_enforce_internal_expire_date', 'no') === 'yes'; |
|
| 142 | + } |
|
| 143 | 143 | |
| 144 | - $defaultRemoteExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_remote_expire_date', 'no') === 'yes'; |
|
| 145 | - $defaultRemoteExpireDate = $defaultRemoteExpireDateEnforced = null; |
|
| 146 | - if ($defaultRemoteExpireDateEnabled) { |
|
| 147 | - $defaultRemoteExpireDate = (int)$this->config->getAppValue('core', 'shareapi_remote_expire_after_n_days', '7'); |
|
| 148 | - $defaultRemoteExpireDateEnforced = $this->config->getAppValue('core', 'shareapi_enforce_remote_expire_date', 'no') === 'yes'; |
|
| 149 | - } |
|
| 144 | + $defaultRemoteExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_remote_expire_date', 'no') === 'yes'; |
|
| 145 | + $defaultRemoteExpireDate = $defaultRemoteExpireDateEnforced = null; |
|
| 146 | + if ($defaultRemoteExpireDateEnabled) { |
|
| 147 | + $defaultRemoteExpireDate = (int)$this->config->getAppValue('core', 'shareapi_remote_expire_after_n_days', '7'); |
|
| 148 | + $defaultRemoteExpireDateEnforced = $this->config->getAppValue('core', 'shareapi_enforce_remote_expire_date', 'no') === 'yes'; |
|
| 149 | + } |
|
| 150 | 150 | |
| 151 | - $countOfDataLocation = 0; |
|
| 152 | - $dataLocation = str_replace(\OC::$SERVERROOT . '/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation); |
|
| 153 | - if ($countOfDataLocation !== 1 || $uid === null || !$this->groupManager->isAdmin($uid)) { |
|
| 154 | - $dataLocation = false; |
|
| 155 | - } |
|
| 151 | + $countOfDataLocation = 0; |
|
| 152 | + $dataLocation = str_replace(\OC::$SERVERROOT . '/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation); |
|
| 153 | + if ($countOfDataLocation !== 1 || $uid === null || !$this->groupManager->isAdmin($uid)) { |
|
| 154 | + $dataLocation = false; |
|
| 155 | + } |
|
| 156 | 156 | |
| 157 | - if ($this->currentUser instanceof IUser) { |
|
| 158 | - $lastConfirmTimestamp = $this->session->get('last-password-confirm'); |
|
| 159 | - if (!is_int($lastConfirmTimestamp)) { |
|
| 160 | - $lastConfirmTimestamp = 0; |
|
| 161 | - } |
|
| 162 | - } else { |
|
| 163 | - $lastConfirmTimestamp = 0; |
|
| 164 | - } |
|
| 157 | + if ($this->currentUser instanceof IUser) { |
|
| 158 | + $lastConfirmTimestamp = $this->session->get('last-password-confirm'); |
|
| 159 | + if (!is_int($lastConfirmTimestamp)) { |
|
| 160 | + $lastConfirmTimestamp = 0; |
|
| 161 | + } |
|
| 162 | + } else { |
|
| 163 | + $lastConfirmTimestamp = 0; |
|
| 164 | + } |
|
| 165 | 165 | |
| 166 | - $capabilities = $this->capabilitiesManager->getCapabilities(false, true); |
|
| 166 | + $capabilities = $this->capabilitiesManager->getCapabilities(false, true); |
|
| 167 | 167 | |
| 168 | - $config = [ |
|
| 169 | - 'auto_logout' => $this->config->getSystemValue('auto_logout', false), |
|
| 170 | - 'blacklist_files_regex' => FileInfo::BLACKLIST_FILES_REGEX, |
|
| 171 | - 'loglevel' => $this->config->getSystemValue('loglevel_frontend', |
|
| 172 | - $this->config->getSystemValue('loglevel', ILogger::WARN) |
|
| 173 | - ), |
|
| 174 | - 'lost_password_link' => $this->config->getSystemValue('lost_password_link', null), |
|
| 175 | - 'modRewriteWorking' => $this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true', |
|
| 176 | - 'no_unsupported_browser_warning' => $this->config->getSystemValue('no_unsupported_browser_warning', false), |
|
| 177 | - 'session_keepalive' => $this->config->getSystemValue('session_keepalive', true), |
|
| 178 | - 'session_lifetime' => min($this->config->getSystemValue('session_lifetime', $this->iniWrapper->getNumeric('session.gc_maxlifetime')), $this->iniWrapper->getNumeric('session.gc_maxlifetime')), |
|
| 179 | - 'sharing.maxAutocompleteResults' => max(0, $this->config->getSystemValueInt('sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT)), |
|
| 180 | - 'sharing.minSearchStringLength' => $this->config->getSystemValueInt('sharing.minSearchStringLength', 0), |
|
| 181 | - 'version' => implode('.', Util::getVersion()), |
|
| 182 | - 'versionstring' => \OC_Util::getVersionString() |
|
| 183 | - ]; |
|
| 168 | + $config = [ |
|
| 169 | + 'auto_logout' => $this->config->getSystemValue('auto_logout', false), |
|
| 170 | + 'blacklist_files_regex' => FileInfo::BLACKLIST_FILES_REGEX, |
|
| 171 | + 'loglevel' => $this->config->getSystemValue('loglevel_frontend', |
|
| 172 | + $this->config->getSystemValue('loglevel', ILogger::WARN) |
|
| 173 | + ), |
|
| 174 | + 'lost_password_link' => $this->config->getSystemValue('lost_password_link', null), |
|
| 175 | + 'modRewriteWorking' => $this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true', |
|
| 176 | + 'no_unsupported_browser_warning' => $this->config->getSystemValue('no_unsupported_browser_warning', false), |
|
| 177 | + 'session_keepalive' => $this->config->getSystemValue('session_keepalive', true), |
|
| 178 | + 'session_lifetime' => min($this->config->getSystemValue('session_lifetime', $this->iniWrapper->getNumeric('session.gc_maxlifetime')), $this->iniWrapper->getNumeric('session.gc_maxlifetime')), |
|
| 179 | + 'sharing.maxAutocompleteResults' => max(0, $this->config->getSystemValueInt('sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT)), |
|
| 180 | + 'sharing.minSearchStringLength' => $this->config->getSystemValueInt('sharing.minSearchStringLength', 0), |
|
| 181 | + 'version' => implode('.', Util::getVersion()), |
|
| 182 | + 'versionstring' => \OC_Util::getVersionString() |
|
| 183 | + ]; |
|
| 184 | 184 | |
| 185 | - $array = [ |
|
| 186 | - "_oc_debug" => $this->config->getSystemValue('debug', false) ? 'true' : 'false', |
|
| 187 | - "_oc_isadmin" => $uid !== null && $this->groupManager->isAdmin($uid) ? 'true' : 'false', |
|
| 188 | - "backendAllowsPasswordConfirmation" => $userBackendAllowsPasswordConfirmation ? 'true' : 'false', |
|
| 189 | - "oc_dataURL" => is_string($dataLocation) ? "\"" . $dataLocation . "\"" : 'false', |
|
| 190 | - "_oc_webroot" => "\"" . \OC::$WEBROOT . "\"", |
|
| 191 | - "_oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution |
|
| 192 | - "datepickerFormatDate" => json_encode($this->l->l('jsdate', null)), |
|
| 193 | - 'nc_lastLogin' => $lastConfirmTimestamp, |
|
| 194 | - 'nc_pageLoad' => time(), |
|
| 195 | - "dayNames" => json_encode([ |
|
| 196 | - $this->l->t('Sunday'), |
|
| 197 | - $this->l->t('Monday'), |
|
| 198 | - $this->l->t('Tuesday'), |
|
| 199 | - $this->l->t('Wednesday'), |
|
| 200 | - $this->l->t('Thursday'), |
|
| 201 | - $this->l->t('Friday'), |
|
| 202 | - $this->l->t('Saturday') |
|
| 203 | - ]), |
|
| 204 | - "dayNamesShort" => json_encode([ |
|
| 205 | - $this->l->t('Sun.'), |
|
| 206 | - $this->l->t('Mon.'), |
|
| 207 | - $this->l->t('Tue.'), |
|
| 208 | - $this->l->t('Wed.'), |
|
| 209 | - $this->l->t('Thu.'), |
|
| 210 | - $this->l->t('Fri.'), |
|
| 211 | - $this->l->t('Sat.') |
|
| 212 | - ]), |
|
| 213 | - "dayNamesMin" => json_encode([ |
|
| 214 | - $this->l->t('Su'), |
|
| 215 | - $this->l->t('Mo'), |
|
| 216 | - $this->l->t('Tu'), |
|
| 217 | - $this->l->t('We'), |
|
| 218 | - $this->l->t('Th'), |
|
| 219 | - $this->l->t('Fr'), |
|
| 220 | - $this->l->t('Sa') |
|
| 221 | - ]), |
|
| 222 | - "monthNames" => json_encode([ |
|
| 223 | - $this->l->t('January'), |
|
| 224 | - $this->l->t('February'), |
|
| 225 | - $this->l->t('March'), |
|
| 226 | - $this->l->t('April'), |
|
| 227 | - $this->l->t('May'), |
|
| 228 | - $this->l->t('June'), |
|
| 229 | - $this->l->t('July'), |
|
| 230 | - $this->l->t('August'), |
|
| 231 | - $this->l->t('September'), |
|
| 232 | - $this->l->t('October'), |
|
| 233 | - $this->l->t('November'), |
|
| 234 | - $this->l->t('December') |
|
| 235 | - ]), |
|
| 236 | - "monthNamesShort" => json_encode([ |
|
| 237 | - $this->l->t('Jan.'), |
|
| 238 | - $this->l->t('Feb.'), |
|
| 239 | - $this->l->t('Mar.'), |
|
| 240 | - $this->l->t('Apr.'), |
|
| 241 | - $this->l->t('May.'), |
|
| 242 | - $this->l->t('Jun.'), |
|
| 243 | - $this->l->t('Jul.'), |
|
| 244 | - $this->l->t('Aug.'), |
|
| 245 | - $this->l->t('Sep.'), |
|
| 246 | - $this->l->t('Oct.'), |
|
| 247 | - $this->l->t('Nov.'), |
|
| 248 | - $this->l->t('Dec.') |
|
| 249 | - ]), |
|
| 250 | - "firstDay" => json_encode($this->l->l('firstday', null)), |
|
| 251 | - "_oc_config" => json_encode($config), |
|
| 252 | - "oc_appconfig" => json_encode([ |
|
| 253 | - 'core' => [ |
|
| 254 | - 'defaultExpireDateEnabled' => $defaultExpireDateEnabled, |
|
| 255 | - 'defaultExpireDate' => $defaultExpireDate, |
|
| 256 | - 'defaultExpireDateEnforced' => $enforceDefaultExpireDate, |
|
| 257 | - 'enforcePasswordForPublicLink' => Util::isPublicLinkPasswordRequired(), |
|
| 258 | - 'enableLinkPasswordByDefault' => $enableLinkPasswordByDefault, |
|
| 259 | - 'sharingDisabledForUser' => Util::isSharingDisabledForUser(), |
|
| 260 | - 'resharingAllowed' => Share::isResharingAllowed(), |
|
| 261 | - 'remoteShareAllowed' => $outgoingServer2serverShareEnabled, |
|
| 262 | - 'federatedCloudShareDoc' => $this->urlGenerator->linkToDocs('user-sharing-federated'), |
|
| 263 | - 'allowGroupSharing' => \OC::$server->getShareManager()->allowGroupSharing(), |
|
| 264 | - 'defaultInternalExpireDateEnabled' => $defaultInternalExpireDateEnabled, |
|
| 265 | - 'defaultInternalExpireDate' => $defaultInternalExpireDate, |
|
| 266 | - 'defaultInternalExpireDateEnforced' => $defaultInternalExpireDateEnforced, |
|
| 267 | - 'defaultRemoteExpireDateEnabled' => $defaultRemoteExpireDateEnabled, |
|
| 268 | - 'defaultRemoteExpireDate' => $defaultRemoteExpireDate, |
|
| 269 | - 'defaultRemoteExpireDateEnforced' => $defaultRemoteExpireDateEnforced, |
|
| 270 | - ] |
|
| 271 | - ]), |
|
| 272 | - "_theme" => json_encode([ |
|
| 273 | - 'entity' => $this->defaults->getEntity(), |
|
| 274 | - 'name' => $this->defaults->getName(), |
|
| 275 | - 'productName' => $this->defaults->getProductName(), |
|
| 276 | - 'title' => $this->defaults->getTitle(), |
|
| 277 | - 'baseUrl' => $this->defaults->getBaseUrl(), |
|
| 278 | - 'syncClientUrl' => $this->defaults->getSyncClientUrl(), |
|
| 279 | - 'docBaseUrl' => $this->defaults->getDocBaseUrl(), |
|
| 280 | - 'docPlaceholderUrl' => $this->defaults->buildDocLinkToKey('PLACEHOLDER'), |
|
| 281 | - 'slogan' => $this->defaults->getSlogan(), |
|
| 282 | - 'logoClaim' => '', |
|
| 283 | - 'folder' => \OC_Util::getTheme(), |
|
| 284 | - ]), |
|
| 285 | - ]; |
|
| 185 | + $array = [ |
|
| 186 | + "_oc_debug" => $this->config->getSystemValue('debug', false) ? 'true' : 'false', |
|
| 187 | + "_oc_isadmin" => $uid !== null && $this->groupManager->isAdmin($uid) ? 'true' : 'false', |
|
| 188 | + "backendAllowsPasswordConfirmation" => $userBackendAllowsPasswordConfirmation ? 'true' : 'false', |
|
| 189 | + "oc_dataURL" => is_string($dataLocation) ? "\"" . $dataLocation . "\"" : 'false', |
|
| 190 | + "_oc_webroot" => "\"" . \OC::$WEBROOT . "\"", |
|
| 191 | + "_oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution |
|
| 192 | + "datepickerFormatDate" => json_encode($this->l->l('jsdate', null)), |
|
| 193 | + 'nc_lastLogin' => $lastConfirmTimestamp, |
|
| 194 | + 'nc_pageLoad' => time(), |
|
| 195 | + "dayNames" => json_encode([ |
|
| 196 | + $this->l->t('Sunday'), |
|
| 197 | + $this->l->t('Monday'), |
|
| 198 | + $this->l->t('Tuesday'), |
|
| 199 | + $this->l->t('Wednesday'), |
|
| 200 | + $this->l->t('Thursday'), |
|
| 201 | + $this->l->t('Friday'), |
|
| 202 | + $this->l->t('Saturday') |
|
| 203 | + ]), |
|
| 204 | + "dayNamesShort" => json_encode([ |
|
| 205 | + $this->l->t('Sun.'), |
|
| 206 | + $this->l->t('Mon.'), |
|
| 207 | + $this->l->t('Tue.'), |
|
| 208 | + $this->l->t('Wed.'), |
|
| 209 | + $this->l->t('Thu.'), |
|
| 210 | + $this->l->t('Fri.'), |
|
| 211 | + $this->l->t('Sat.') |
|
| 212 | + ]), |
|
| 213 | + "dayNamesMin" => json_encode([ |
|
| 214 | + $this->l->t('Su'), |
|
| 215 | + $this->l->t('Mo'), |
|
| 216 | + $this->l->t('Tu'), |
|
| 217 | + $this->l->t('We'), |
|
| 218 | + $this->l->t('Th'), |
|
| 219 | + $this->l->t('Fr'), |
|
| 220 | + $this->l->t('Sa') |
|
| 221 | + ]), |
|
| 222 | + "monthNames" => json_encode([ |
|
| 223 | + $this->l->t('January'), |
|
| 224 | + $this->l->t('February'), |
|
| 225 | + $this->l->t('March'), |
|
| 226 | + $this->l->t('April'), |
|
| 227 | + $this->l->t('May'), |
|
| 228 | + $this->l->t('June'), |
|
| 229 | + $this->l->t('July'), |
|
| 230 | + $this->l->t('August'), |
|
| 231 | + $this->l->t('September'), |
|
| 232 | + $this->l->t('October'), |
|
| 233 | + $this->l->t('November'), |
|
| 234 | + $this->l->t('December') |
|
| 235 | + ]), |
|
| 236 | + "monthNamesShort" => json_encode([ |
|
| 237 | + $this->l->t('Jan.'), |
|
| 238 | + $this->l->t('Feb.'), |
|
| 239 | + $this->l->t('Mar.'), |
|
| 240 | + $this->l->t('Apr.'), |
|
| 241 | + $this->l->t('May.'), |
|
| 242 | + $this->l->t('Jun.'), |
|
| 243 | + $this->l->t('Jul.'), |
|
| 244 | + $this->l->t('Aug.'), |
|
| 245 | + $this->l->t('Sep.'), |
|
| 246 | + $this->l->t('Oct.'), |
|
| 247 | + $this->l->t('Nov.'), |
|
| 248 | + $this->l->t('Dec.') |
|
| 249 | + ]), |
|
| 250 | + "firstDay" => json_encode($this->l->l('firstday', null)), |
|
| 251 | + "_oc_config" => json_encode($config), |
|
| 252 | + "oc_appconfig" => json_encode([ |
|
| 253 | + 'core' => [ |
|
| 254 | + 'defaultExpireDateEnabled' => $defaultExpireDateEnabled, |
|
| 255 | + 'defaultExpireDate' => $defaultExpireDate, |
|
| 256 | + 'defaultExpireDateEnforced' => $enforceDefaultExpireDate, |
|
| 257 | + 'enforcePasswordForPublicLink' => Util::isPublicLinkPasswordRequired(), |
|
| 258 | + 'enableLinkPasswordByDefault' => $enableLinkPasswordByDefault, |
|
| 259 | + 'sharingDisabledForUser' => Util::isSharingDisabledForUser(), |
|
| 260 | + 'resharingAllowed' => Share::isResharingAllowed(), |
|
| 261 | + 'remoteShareAllowed' => $outgoingServer2serverShareEnabled, |
|
| 262 | + 'federatedCloudShareDoc' => $this->urlGenerator->linkToDocs('user-sharing-federated'), |
|
| 263 | + 'allowGroupSharing' => \OC::$server->getShareManager()->allowGroupSharing(), |
|
| 264 | + 'defaultInternalExpireDateEnabled' => $defaultInternalExpireDateEnabled, |
|
| 265 | + 'defaultInternalExpireDate' => $defaultInternalExpireDate, |
|
| 266 | + 'defaultInternalExpireDateEnforced' => $defaultInternalExpireDateEnforced, |
|
| 267 | + 'defaultRemoteExpireDateEnabled' => $defaultRemoteExpireDateEnabled, |
|
| 268 | + 'defaultRemoteExpireDate' => $defaultRemoteExpireDate, |
|
| 269 | + 'defaultRemoteExpireDateEnforced' => $defaultRemoteExpireDateEnforced, |
|
| 270 | + ] |
|
| 271 | + ]), |
|
| 272 | + "_theme" => json_encode([ |
|
| 273 | + 'entity' => $this->defaults->getEntity(), |
|
| 274 | + 'name' => $this->defaults->getName(), |
|
| 275 | + 'productName' => $this->defaults->getProductName(), |
|
| 276 | + 'title' => $this->defaults->getTitle(), |
|
| 277 | + 'baseUrl' => $this->defaults->getBaseUrl(), |
|
| 278 | + 'syncClientUrl' => $this->defaults->getSyncClientUrl(), |
|
| 279 | + 'docBaseUrl' => $this->defaults->getDocBaseUrl(), |
|
| 280 | + 'docPlaceholderUrl' => $this->defaults->buildDocLinkToKey('PLACEHOLDER'), |
|
| 281 | + 'slogan' => $this->defaults->getSlogan(), |
|
| 282 | + 'logoClaim' => '', |
|
| 283 | + 'folder' => \OC_Util::getTheme(), |
|
| 284 | + ]), |
|
| 285 | + ]; |
|
| 286 | 286 | |
| 287 | - if ($this->currentUser !== null) { |
|
| 288 | - $array['oc_userconfig'] = json_encode([ |
|
| 289 | - 'avatar' => [ |
|
| 290 | - 'version' => (int)$this->config->getUserValue($uid, 'avatar', 'version', 0), |
|
| 291 | - 'generated' => $this->config->getUserValue($uid, 'avatar', 'generated', 'true') === 'true', |
|
| 292 | - ] |
|
| 293 | - ]); |
|
| 294 | - } |
|
| 287 | + if ($this->currentUser !== null) { |
|
| 288 | + $array['oc_userconfig'] = json_encode([ |
|
| 289 | + 'avatar' => [ |
|
| 290 | + 'version' => (int)$this->config->getUserValue($uid, 'avatar', 'version', 0), |
|
| 291 | + 'generated' => $this->config->getUserValue($uid, 'avatar', 'generated', 'true') === 'true', |
|
| 292 | + ] |
|
| 293 | + ]); |
|
| 294 | + } |
|
| 295 | 295 | |
| 296 | - $this->initialStateService->provideInitialState('core', 'projects_enabled', $this->config->getSystemValueBool('projects.enabled', false)); |
|
| 296 | + $this->initialStateService->provideInitialState('core', 'projects_enabled', $this->config->getSystemValueBool('projects.enabled', false)); |
|
| 297 | 297 | |
| 298 | - $this->initialStateService->provideInitialState('core', 'config', $config); |
|
| 299 | - $this->initialStateService->provideInitialState('core', 'capabilities', $capabilities); |
|
| 298 | + $this->initialStateService->provideInitialState('core', 'config', $config); |
|
| 299 | + $this->initialStateService->provideInitialState('core', 'capabilities', $capabilities); |
|
| 300 | 300 | |
| 301 | - // Allow hooks to modify the output values |
|
| 302 | - \OC_Hook::emit('\OCP\Config', 'js', ['array' => &$array]); |
|
| 301 | + // Allow hooks to modify the output values |
|
| 302 | + \OC_Hook::emit('\OCP\Config', 'js', ['array' => &$array]); |
|
| 303 | 303 | |
| 304 | - $result = ''; |
|
| 304 | + $result = ''; |
|
| 305 | 305 | |
| 306 | - // Echo it |
|
| 307 | - foreach ($array as $setting => $value) { |
|
| 308 | - $result .= 'var '. $setting . '='. $value . ';' . PHP_EOL; |
|
| 309 | - } |
|
| 306 | + // Echo it |
|
| 307 | + foreach ($array as $setting => $value) { |
|
| 308 | + $result .= 'var '. $setting . '='. $value . ';' . PHP_EOL; |
|
| 309 | + } |
|
| 310 | 310 | |
| 311 | - return $result; |
|
| 312 | - } |
|
| 311 | + return $result; |
|
| 312 | + } |
|
| 313 | 313 | } |
@@ -33,19 +33,19 @@ |
||
| 33 | 33 | use OCP\Util; |
| 34 | 34 | |
| 35 | 35 | class UnsupportedBrowserController extends Controller { |
| 36 | - public function __construct(IRequest $request) { |
|
| 37 | - parent::__construct('core', $request); |
|
| 38 | - } |
|
| 36 | + public function __construct(IRequest $request) { |
|
| 37 | + parent::__construct('core', $request); |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @PublicPage |
|
| 42 | - * @NoCSRFRequired |
|
| 43 | - * |
|
| 44 | - * @return Response |
|
| 45 | - */ |
|
| 46 | - public function index(): Response { |
|
| 47 | - Util::addScript('core', 'unsupported-browser'); |
|
| 48 | - Util::addStyle('core', 'icons'); |
|
| 49 | - return new TemplateResponse('core', 'unsupportedbrowser', [], TemplateResponse::RENDER_AS_ERROR); |
|
| 50 | - } |
|
| 40 | + /** |
|
| 41 | + * @PublicPage |
|
| 42 | + * @NoCSRFRequired |
|
| 43 | + * |
|
| 44 | + * @return Response |
|
| 45 | + */ |
|
| 46 | + public function index(): Response { |
|
| 47 | + Util::addScript('core', 'unsupported-browser'); |
|
| 48 | + Util::addStyle('core', 'icons'); |
|
| 49 | + return new TemplateResponse('core', 'unsupportedbrowser', [], TemplateResponse::RENDER_AS_ERROR); |
|
| 50 | + } |
|
| 51 | 51 | } |
@@ -39,106 +39,106 @@ discard block |
||
| 39 | 39 | /** @var Application $application */ |
| 40 | 40 | $application = \OC::$server->query(Application::class); |
| 41 | 41 | $application->registerRoutes($this, [ |
| 42 | - 'routes' => [ |
|
| 43 | - ['name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'], |
|
| 44 | - ['name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'], |
|
| 45 | - ['name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'], |
|
| 46 | - ['name' => 'ProfilePage#index', 'url' => '/u/{targetUserId}', 'verb' => 'GET'], |
|
| 47 | - ['name' => 'user#getDisplayNames', 'url' => '/displaynames', 'verb' => 'POST'], |
|
| 48 | - ['name' => 'avatar#getAvatarDark', 'url' => '/avatar/{userId}/{size}/dark', 'verb' => 'GET'], |
|
| 49 | - ['name' => 'avatar#getAvatar', 'url' => '/avatar/{userId}/{size}', 'verb' => 'GET'], |
|
| 50 | - ['name' => 'avatar#deleteAvatar', 'url' => '/avatar/', 'verb' => 'DELETE'], |
|
| 51 | - ['name' => 'avatar#postCroppedAvatar', 'url' => '/avatar/cropped', 'verb' => 'POST'], |
|
| 52 | - ['name' => 'avatar#getTmpAvatar', 'url' => '/avatar/tmp', 'verb' => 'GET'], |
|
| 53 | - ['name' => 'avatar#postAvatar', 'url' => '/avatar/', 'verb' => 'POST'], |
|
| 54 | - ['name' => 'GuestAvatar#getAvatarDark', 'url' => '/avatar/guest/{guestName}/{size}/dark', 'verb' => 'GET'], |
|
| 55 | - ['name' => 'GuestAvatar#getAvatar', 'url' => '/avatar/guest/{guestName}/{size}', 'verb' => 'GET'], |
|
| 56 | - ['name' => 'CSRFToken#index', 'url' => '/csrftoken', 'verb' => 'GET'], |
|
| 57 | - ['name' => 'login#tryLogin', 'url' => '/login', 'verb' => 'POST'], |
|
| 58 | - ['name' => 'login#confirmPassword', 'url' => '/login/confirm', 'verb' => 'POST'], |
|
| 59 | - ['name' => 'login#showLoginForm', 'url' => '/login', 'verb' => 'GET'], |
|
| 60 | - ['name' => 'login#logout', 'url' => '/logout', 'verb' => 'GET'], |
|
| 61 | - |
|
| 62 | - // Original login flow used by all clients |
|
| 63 | - ['name' => 'ClientFlowLogin#showAuthPickerPage', 'url' => '/login/flow', 'verb' => 'GET'], |
|
| 64 | - ['name' => 'ClientFlowLogin#generateAppPassword', 'url' => '/login/flow', 'verb' => 'POST'], |
|
| 65 | - ['name' => 'ClientFlowLogin#grantPage', 'url' => '/login/flow/grant', 'verb' => 'GET'], |
|
| 66 | - ['name' => 'ClientFlowLogin#apptokenRedirect', 'url' => '/login/flow/apptoken', 'verb' => 'POST'], |
|
| 67 | - |
|
| 68 | - // NG login flow used by desktop client in case of Kerberos/fancy 2fa (smart cards for example) |
|
| 69 | - ['name' => 'ClientFlowLoginV2#poll', 'url' => '/login/v2/poll', 'verb' => 'POST'], |
|
| 70 | - ['name' => 'ClientFlowLoginV2#showAuthPickerPage', 'url' => '/login/v2/flow', 'verb' => 'GET'], |
|
| 71 | - ['name' => 'ClientFlowLoginV2#landing', 'url' => '/login/v2/flow/{token}', 'verb' => 'GET'], |
|
| 72 | - ['name' => 'ClientFlowLoginV2#grantPage', 'url' => '/login/v2/grant', 'verb' => 'GET'], |
|
| 73 | - ['name' => 'ClientFlowLoginV2#generateAppPassword', 'url' => '/login/v2/grant', 'verb' => 'POST'], |
|
| 74 | - ['name' => 'ClientFlowLoginV2#init', 'url' => '/login/v2', 'verb' => 'POST'], |
|
| 75 | - ['name' => 'ClientFlowLoginV2#apptokenRedirect', 'url' => '/login/v2/apptoken', 'verb' => 'POST'], |
|
| 76 | - ['name' => 'TwoFactorChallenge#selectChallenge', 'url' => '/login/selectchallenge', 'verb' => 'GET'], |
|
| 77 | - ['name' => 'TwoFactorChallenge#showChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'GET'], |
|
| 78 | - ['name' => 'TwoFactorChallenge#solveChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'POST'], |
|
| 79 | - ['name' => 'TwoFactorChallenge#setupProviders', 'url' => 'login/setupchallenge', 'verb' => 'GET'], |
|
| 80 | - ['name' => 'TwoFactorChallenge#setupProvider', 'url' => 'login/setupchallenge/{providerId}', 'verb' => 'GET'], |
|
| 81 | - ['name' => 'TwoFactorChallenge#confirmProviderSetup', 'url' => 'login/setupchallenge/{providerId}', 'verb' => 'POST'], |
|
| 82 | - ['name' => 'OCJS#getConfig', 'url' => '/core/js/oc.js', 'verb' => 'GET'], |
|
| 83 | - ['name' => 'Preview#getPreviewByFileId', 'url' => '/core/preview', 'verb' => 'GET'], |
|
| 84 | - ['name' => 'Preview#getPreview', 'url' => '/core/preview.png', 'verb' => 'GET'], |
|
| 85 | - ['name' => 'RecommendedApps#index', 'url' => '/core/apps/recommended', 'verb' => 'GET'], |
|
| 86 | - ['name' => 'Reference#preview', 'url' => '/core/references/preview/{referenceId}', 'verb' => 'GET'], |
|
| 87 | - ['name' => 'Css#getCss', 'url' => '/css/{appName}/{fileName}', 'verb' => 'GET'], |
|
| 88 | - ['name' => 'Js#getJs', 'url' => '/js/{appName}/{fileName}', 'verb' => 'GET'], |
|
| 89 | - ['name' => 'contactsMenu#index', 'url' => '/contactsmenu/contacts', 'verb' => 'POST'], |
|
| 90 | - ['name' => 'contactsMenu#findOne', 'url' => '/contactsmenu/findOne', 'verb' => 'POST'], |
|
| 91 | - ['name' => 'WalledGarden#get', 'url' => '/204', 'verb' => 'GET'], |
|
| 92 | - ['name' => 'Search#search', 'url' => '/core/search', 'verb' => 'GET'], |
|
| 93 | - ['name' => 'Wipe#checkWipe', 'url' => '/core/wipe/check', 'verb' => 'POST'], |
|
| 94 | - ['name' => 'Wipe#wipeDone', 'url' => '/core/wipe/success', 'verb' => 'POST'], |
|
| 95 | - |
|
| 96 | - // Logins for passwordless auth |
|
| 97 | - ['name' => 'WebAuthn#startAuthentication', 'url' => 'login/webauthn/start', 'verb' => 'POST'], |
|
| 98 | - ['name' => 'WebAuthn#finishAuthentication', 'url' => 'login/webauthn/finish', 'verb' => 'POST'], |
|
| 99 | - |
|
| 100 | - // Well known requests https://tools.ietf.org/html/rfc5785 |
|
| 101 | - ['name' => 'WellKnown#handle', 'url' => '.well-known/{service}'], |
|
| 102 | - |
|
| 103 | - // Unsupported browser |
|
| 104 | - ['name' => 'UnsupportedBrowser#index', 'url' => 'unsupported'], |
|
| 105 | - ], |
|
| 106 | - 'ocs' => [ |
|
| 107 | - ['root' => '/cloud', 'name' => 'OCS#getCapabilities', 'url' => '/capabilities', 'verb' => 'GET'], |
|
| 108 | - ['root' => '', 'name' => 'OCS#getConfig', 'url' => '/config', 'verb' => 'GET'], |
|
| 109 | - ['root' => '/person', 'name' => 'OCS#personCheck', 'url' => '/check', 'verb' => 'POST'], |
|
| 110 | - ['root' => '/identityproof', 'name' => 'OCS#getIdentityProof', 'url' => '/key/{cloudId}', 'verb' => 'GET'], |
|
| 111 | - ['root' => '/core', 'name' => 'Navigation#getAppsNavigation', 'url' => '/navigation/apps', 'verb' => 'GET'], |
|
| 112 | - ['root' => '/core', 'name' => 'Navigation#getSettingsNavigation', 'url' => '/navigation/settings', 'verb' => 'GET'], |
|
| 113 | - ['root' => '/core', 'name' => 'AutoComplete#get', 'url' => '/autocomplete/get', 'verb' => 'GET'], |
|
| 114 | - ['root' => '/core', 'name' => 'WhatsNew#get', 'url' => '/whatsnew', 'verb' => 'GET'], |
|
| 115 | - ['root' => '/core', 'name' => 'WhatsNew#dismiss', 'url' => '/whatsnew', 'verb' => 'POST'], |
|
| 116 | - ['root' => '/core', 'name' => 'AppPassword#getAppPassword', 'url' => '/getapppassword', 'verb' => 'GET'], |
|
| 117 | - ['root' => '/core', 'name' => 'AppPassword#rotateAppPassword', 'url' => '/apppassword/rotate', 'verb' => 'POST'], |
|
| 118 | - ['root' => '/core', 'name' => 'AppPassword#deleteAppPassword', 'url' => '/apppassword', 'verb' => 'DELETE'], |
|
| 119 | - |
|
| 120 | - ['root' => '/hovercard', 'name' => 'HoverCard#getUser', 'url' => '/v1/{userId}', 'verb' => 'GET'], |
|
| 121 | - |
|
| 122 | - ['root' => '/collaboration', 'name' => 'CollaborationResources#searchCollections', 'url' => '/resources/collections/search/{filter}', 'verb' => 'GET'], |
|
| 123 | - ['root' => '/collaboration', 'name' => 'CollaborationResources#listCollection', 'url' => '/resources/collections/{collectionId}', 'verb' => 'GET'], |
|
| 124 | - ['root' => '/collaboration', 'name' => 'CollaborationResources#renameCollection', 'url' => '/resources/collections/{collectionId}', 'verb' => 'PUT'], |
|
| 125 | - ['root' => '/collaboration', 'name' => 'CollaborationResources#addResource', 'url' => '/resources/collections/{collectionId}', 'verb' => 'POST'], |
|
| 126 | - |
|
| 127 | - ['root' => '/collaboration', 'name' => 'CollaborationResources#removeResource', 'url' => '/resources/collections/{collectionId}', 'verb' => 'DELETE'], |
|
| 128 | - ['root' => '/collaboration', 'name' => 'CollaborationResources#getCollectionsByResource', 'url' => '/resources/{resourceType}/{resourceId}', 'verb' => 'GET'], |
|
| 129 | - ['root' => '/collaboration', 'name' => 'CollaborationResources#createCollectionOnResource', 'url' => '/resources/{baseResourceType}/{baseResourceId}', 'verb' => 'POST'], |
|
| 130 | - |
|
| 131 | - ['root' => '/references', 'name' => 'ReferenceApi#resolveOne', 'url' => '/resolve', 'verb' => 'GET'], |
|
| 132 | - ['root' => '/references', 'name' => 'ReferenceApi#extract', 'url' => '/extract', 'verb' => 'POST'], |
|
| 133 | - ['root' => '/references', 'name' => 'ReferenceApi#resolve', 'url' => '/resolve', 'verb' => 'POST'], |
|
| 134 | - |
|
| 135 | - ['root' => '/profile', 'name' => 'ProfileApi#setVisibility', 'url' => '/{targetUserId}', 'verb' => 'PUT'], |
|
| 136 | - |
|
| 137 | - // Unified search |
|
| 138 | - ['root' => '/search', 'name' => 'UnifiedSearch#getProviders', 'url' => '/providers', 'verb' => 'GET'], |
|
| 139 | - ['root' => '/search', 'name' => 'UnifiedSearch#search', 'url' => '/providers/{providerId}/search', 'verb' => 'GET'], |
|
| 140 | - |
|
| 141 | - ], |
|
| 42 | + 'routes' => [ |
|
| 43 | + ['name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'], |
|
| 44 | + ['name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'], |
|
| 45 | + ['name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'], |
|
| 46 | + ['name' => 'ProfilePage#index', 'url' => '/u/{targetUserId}', 'verb' => 'GET'], |
|
| 47 | + ['name' => 'user#getDisplayNames', 'url' => '/displaynames', 'verb' => 'POST'], |
|
| 48 | + ['name' => 'avatar#getAvatarDark', 'url' => '/avatar/{userId}/{size}/dark', 'verb' => 'GET'], |
|
| 49 | + ['name' => 'avatar#getAvatar', 'url' => '/avatar/{userId}/{size}', 'verb' => 'GET'], |
|
| 50 | + ['name' => 'avatar#deleteAvatar', 'url' => '/avatar/', 'verb' => 'DELETE'], |
|
| 51 | + ['name' => 'avatar#postCroppedAvatar', 'url' => '/avatar/cropped', 'verb' => 'POST'], |
|
| 52 | + ['name' => 'avatar#getTmpAvatar', 'url' => '/avatar/tmp', 'verb' => 'GET'], |
|
| 53 | + ['name' => 'avatar#postAvatar', 'url' => '/avatar/', 'verb' => 'POST'], |
|
| 54 | + ['name' => 'GuestAvatar#getAvatarDark', 'url' => '/avatar/guest/{guestName}/{size}/dark', 'verb' => 'GET'], |
|
| 55 | + ['name' => 'GuestAvatar#getAvatar', 'url' => '/avatar/guest/{guestName}/{size}', 'verb' => 'GET'], |
|
| 56 | + ['name' => 'CSRFToken#index', 'url' => '/csrftoken', 'verb' => 'GET'], |
|
| 57 | + ['name' => 'login#tryLogin', 'url' => '/login', 'verb' => 'POST'], |
|
| 58 | + ['name' => 'login#confirmPassword', 'url' => '/login/confirm', 'verb' => 'POST'], |
|
| 59 | + ['name' => 'login#showLoginForm', 'url' => '/login', 'verb' => 'GET'], |
|
| 60 | + ['name' => 'login#logout', 'url' => '/logout', 'verb' => 'GET'], |
|
| 61 | + |
|
| 62 | + // Original login flow used by all clients |
|
| 63 | + ['name' => 'ClientFlowLogin#showAuthPickerPage', 'url' => '/login/flow', 'verb' => 'GET'], |
|
| 64 | + ['name' => 'ClientFlowLogin#generateAppPassword', 'url' => '/login/flow', 'verb' => 'POST'], |
|
| 65 | + ['name' => 'ClientFlowLogin#grantPage', 'url' => '/login/flow/grant', 'verb' => 'GET'], |
|
| 66 | + ['name' => 'ClientFlowLogin#apptokenRedirect', 'url' => '/login/flow/apptoken', 'verb' => 'POST'], |
|
| 67 | + |
|
| 68 | + // NG login flow used by desktop client in case of Kerberos/fancy 2fa (smart cards for example) |
|
| 69 | + ['name' => 'ClientFlowLoginV2#poll', 'url' => '/login/v2/poll', 'verb' => 'POST'], |
|
| 70 | + ['name' => 'ClientFlowLoginV2#showAuthPickerPage', 'url' => '/login/v2/flow', 'verb' => 'GET'], |
|
| 71 | + ['name' => 'ClientFlowLoginV2#landing', 'url' => '/login/v2/flow/{token}', 'verb' => 'GET'], |
|
| 72 | + ['name' => 'ClientFlowLoginV2#grantPage', 'url' => '/login/v2/grant', 'verb' => 'GET'], |
|
| 73 | + ['name' => 'ClientFlowLoginV2#generateAppPassword', 'url' => '/login/v2/grant', 'verb' => 'POST'], |
|
| 74 | + ['name' => 'ClientFlowLoginV2#init', 'url' => '/login/v2', 'verb' => 'POST'], |
|
| 75 | + ['name' => 'ClientFlowLoginV2#apptokenRedirect', 'url' => '/login/v2/apptoken', 'verb' => 'POST'], |
|
| 76 | + ['name' => 'TwoFactorChallenge#selectChallenge', 'url' => '/login/selectchallenge', 'verb' => 'GET'], |
|
| 77 | + ['name' => 'TwoFactorChallenge#showChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'GET'], |
|
| 78 | + ['name' => 'TwoFactorChallenge#solveChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'POST'], |
|
| 79 | + ['name' => 'TwoFactorChallenge#setupProviders', 'url' => 'login/setupchallenge', 'verb' => 'GET'], |
|
| 80 | + ['name' => 'TwoFactorChallenge#setupProvider', 'url' => 'login/setupchallenge/{providerId}', 'verb' => 'GET'], |
|
| 81 | + ['name' => 'TwoFactorChallenge#confirmProviderSetup', 'url' => 'login/setupchallenge/{providerId}', 'verb' => 'POST'], |
|
| 82 | + ['name' => 'OCJS#getConfig', 'url' => '/core/js/oc.js', 'verb' => 'GET'], |
|
| 83 | + ['name' => 'Preview#getPreviewByFileId', 'url' => '/core/preview', 'verb' => 'GET'], |
|
| 84 | + ['name' => 'Preview#getPreview', 'url' => '/core/preview.png', 'verb' => 'GET'], |
|
| 85 | + ['name' => 'RecommendedApps#index', 'url' => '/core/apps/recommended', 'verb' => 'GET'], |
|
| 86 | + ['name' => 'Reference#preview', 'url' => '/core/references/preview/{referenceId}', 'verb' => 'GET'], |
|
| 87 | + ['name' => 'Css#getCss', 'url' => '/css/{appName}/{fileName}', 'verb' => 'GET'], |
|
| 88 | + ['name' => 'Js#getJs', 'url' => '/js/{appName}/{fileName}', 'verb' => 'GET'], |
|
| 89 | + ['name' => 'contactsMenu#index', 'url' => '/contactsmenu/contacts', 'verb' => 'POST'], |
|
| 90 | + ['name' => 'contactsMenu#findOne', 'url' => '/contactsmenu/findOne', 'verb' => 'POST'], |
|
| 91 | + ['name' => 'WalledGarden#get', 'url' => '/204', 'verb' => 'GET'], |
|
| 92 | + ['name' => 'Search#search', 'url' => '/core/search', 'verb' => 'GET'], |
|
| 93 | + ['name' => 'Wipe#checkWipe', 'url' => '/core/wipe/check', 'verb' => 'POST'], |
|
| 94 | + ['name' => 'Wipe#wipeDone', 'url' => '/core/wipe/success', 'verb' => 'POST'], |
|
| 95 | + |
|
| 96 | + // Logins for passwordless auth |
|
| 97 | + ['name' => 'WebAuthn#startAuthentication', 'url' => 'login/webauthn/start', 'verb' => 'POST'], |
|
| 98 | + ['name' => 'WebAuthn#finishAuthentication', 'url' => 'login/webauthn/finish', 'verb' => 'POST'], |
|
| 99 | + |
|
| 100 | + // Well known requests https://tools.ietf.org/html/rfc5785 |
|
| 101 | + ['name' => 'WellKnown#handle', 'url' => '.well-known/{service}'], |
|
| 102 | + |
|
| 103 | + // Unsupported browser |
|
| 104 | + ['name' => 'UnsupportedBrowser#index', 'url' => 'unsupported'], |
|
| 105 | + ], |
|
| 106 | + 'ocs' => [ |
|
| 107 | + ['root' => '/cloud', 'name' => 'OCS#getCapabilities', 'url' => '/capabilities', 'verb' => 'GET'], |
|
| 108 | + ['root' => '', 'name' => 'OCS#getConfig', 'url' => '/config', 'verb' => 'GET'], |
|
| 109 | + ['root' => '/person', 'name' => 'OCS#personCheck', 'url' => '/check', 'verb' => 'POST'], |
|
| 110 | + ['root' => '/identityproof', 'name' => 'OCS#getIdentityProof', 'url' => '/key/{cloudId}', 'verb' => 'GET'], |
|
| 111 | + ['root' => '/core', 'name' => 'Navigation#getAppsNavigation', 'url' => '/navigation/apps', 'verb' => 'GET'], |
|
| 112 | + ['root' => '/core', 'name' => 'Navigation#getSettingsNavigation', 'url' => '/navigation/settings', 'verb' => 'GET'], |
|
| 113 | + ['root' => '/core', 'name' => 'AutoComplete#get', 'url' => '/autocomplete/get', 'verb' => 'GET'], |
|
| 114 | + ['root' => '/core', 'name' => 'WhatsNew#get', 'url' => '/whatsnew', 'verb' => 'GET'], |
|
| 115 | + ['root' => '/core', 'name' => 'WhatsNew#dismiss', 'url' => '/whatsnew', 'verb' => 'POST'], |
|
| 116 | + ['root' => '/core', 'name' => 'AppPassword#getAppPassword', 'url' => '/getapppassword', 'verb' => 'GET'], |
|
| 117 | + ['root' => '/core', 'name' => 'AppPassword#rotateAppPassword', 'url' => '/apppassword/rotate', 'verb' => 'POST'], |
|
| 118 | + ['root' => '/core', 'name' => 'AppPassword#deleteAppPassword', 'url' => '/apppassword', 'verb' => 'DELETE'], |
|
| 119 | + |
|
| 120 | + ['root' => '/hovercard', 'name' => 'HoverCard#getUser', 'url' => '/v1/{userId}', 'verb' => 'GET'], |
|
| 121 | + |
|
| 122 | + ['root' => '/collaboration', 'name' => 'CollaborationResources#searchCollections', 'url' => '/resources/collections/search/{filter}', 'verb' => 'GET'], |
|
| 123 | + ['root' => '/collaboration', 'name' => 'CollaborationResources#listCollection', 'url' => '/resources/collections/{collectionId}', 'verb' => 'GET'], |
|
| 124 | + ['root' => '/collaboration', 'name' => 'CollaborationResources#renameCollection', 'url' => '/resources/collections/{collectionId}', 'verb' => 'PUT'], |
|
| 125 | + ['root' => '/collaboration', 'name' => 'CollaborationResources#addResource', 'url' => '/resources/collections/{collectionId}', 'verb' => 'POST'], |
|
| 126 | + |
|
| 127 | + ['root' => '/collaboration', 'name' => 'CollaborationResources#removeResource', 'url' => '/resources/collections/{collectionId}', 'verb' => 'DELETE'], |
|
| 128 | + ['root' => '/collaboration', 'name' => 'CollaborationResources#getCollectionsByResource', 'url' => '/resources/{resourceType}/{resourceId}', 'verb' => 'GET'], |
|
| 129 | + ['root' => '/collaboration', 'name' => 'CollaborationResources#createCollectionOnResource', 'url' => '/resources/{baseResourceType}/{baseResourceId}', 'verb' => 'POST'], |
|
| 130 | + |
|
| 131 | + ['root' => '/references', 'name' => 'ReferenceApi#resolveOne', 'url' => '/resolve', 'verb' => 'GET'], |
|
| 132 | + ['root' => '/references', 'name' => 'ReferenceApi#extract', 'url' => '/extract', 'verb' => 'POST'], |
|
| 133 | + ['root' => '/references', 'name' => 'ReferenceApi#resolve', 'url' => '/resolve', 'verb' => 'POST'], |
|
| 134 | + |
|
| 135 | + ['root' => '/profile', 'name' => 'ProfileApi#setVisibility', 'url' => '/{targetUserId}', 'verb' => 'PUT'], |
|
| 136 | + |
|
| 137 | + // Unified search |
|
| 138 | + ['root' => '/search', 'name' => 'UnifiedSearch#getProviders', 'url' => '/providers', 'verb' => 'GET'], |
|
| 139 | + ['root' => '/search', 'name' => 'UnifiedSearch#search', 'url' => '/providers/{providerId}/search', 'verb' => 'GET'], |
|
| 140 | + |
|
| 141 | + ], |
|
| 142 | 142 | ]); |
| 143 | 143 | |
| 144 | 144 | // Post installation check |
@@ -147,4 +147,4 @@ discard block |
||
| 147 | 147 | // Core ajax actions |
| 148 | 148 | // Routing |
| 149 | 149 | $this->create('core_ajax_update', '/core/ajax/update.php') |
| 150 | - ->actionInclude('core/ajax/update.php'); |
|
| 150 | + ->actionInclude('core/ajax/update.php'); |
|