@@ -269,14 +269,11 @@ public function saveEmailConfig($data)
269
269
270
270
/**
271
271
* Returns registry data of setup
272
- * .
273
- * @see Tinebase_Application_Json_Abstract
274
- *
275
- * @return mixed array 'variable name' => 'data'
276
- *
277
- * @todo add 'titlePostfix' => Tinebase_Config::getInstance()->getConfig(Tinebase_Config::PAGETITLEPOSTFIX, NULL, '')->value here?
272
+ *
273
+ * @return array
274
+ * @throws Tinebase_Exception_InvalidArgument
278
275
*/
279
- public function getRegistryData ()
276
+ public function getRegistryData (): array
280
277
{
281
278
// anonymous registry
282
279
$ registryData = array (
@@ -289,18 +286,23 @@ public function getRegistryData()
289
286
// NOTE: if assetHash is not available we have a serious problem - please don't generate one!
290
287
'assetHash ' => Tinebase_Frontend_Http_SinglePageApplication::getAssetHash (),
291
288
),
292
- 'authenticationData ' => $ this ->loadAuthenticationData (),
293
289
);
294
290
295
- // authenticated or non existent config
291
+ // authenticated or non- existent config
296
292
if (! Setup_Core::configFileExists () || Setup_Core::isRegistered (Setup_Core::USER )) {
297
293
$ registryData = array_merge ($ registryData , $ this ->checkConfig ());
298
294
$ registryData = array_merge ($ registryData , array (
295
+ 'authenticationData ' => Setup_Core::isRegistered (Setup_Core::USER )
296
+ ? $ this ->loadAuthenticationData () : [],
299
297
'rights ' => ['admin ' ],
300
- 'acceptedTermsVersion ' => (! empty ($ registryData ['checkDB ' ]) && $ this ->_controller ->isInstalled ('Tinebase ' )) ? Setup_Controller::getInstance ()->getAcceptedTerms () : 0 ,
298
+ 'acceptedTermsVersion ' => (! empty ($ registryData ['checkDB ' ]) &&
299
+ $ this ->_controller ->isInstalled ('' ))
300
+ ? Setup_Controller::getInstance ()->getAcceptedTerms () : 0 ,
301
301
'setupChecks ' => $ this ->envCheck (),
302
302
'configData ' => $ this ->loadConfig (),
303
- 'emailData ' => (! empty ($ registryData ['checkDB ' ]) && $ this ->_controller ->isInstalled ('Tinebase ' )) ? $ this ->getEmailConfig () : array (),
303
+ 'emailData ' => (! empty ($ registryData ['checkDB ' ])
304
+ && $ this ->_controller ->isInstalled () && Setup_Core::isRegistered (Setup_Core::USER ))
305
+ ? $ this ->getEmailConfig () : array (),
304
306
));
305
307
}
306
308
@@ -313,11 +315,11 @@ public function getRegistryData()
313
315
314
316
return $ registryData ;
315
317
}
316
-
318
+
317
319
/**
318
320
* Returns registry data of all applications current user has access to
319
321
* @see Tinebase_Application_Json_Abstract
320
- *
322
+ *
321
323
* @return mixed array 'variable name' => 'data'
322
324
*
323
325
* TODO DRY: most of this already is part of Tinebase_Frontend_Json::_getAnonymousRegistryData
@@ -328,7 +330,7 @@ public function getAllRegistryData()
328
330
Setup_Controller::getInstance ()->clearCache ();
329
331
330
332
$ registryData ['Setup ' ] = $ this ->getRegistryData ();
331
-
333
+
332
334
// setup also need some core tinebase regdata
333
335
$ locale = Tinebase_Core::get ('locale ' );
334
336
$ symbols = Zend_Locale::getTranslationList ('symbols ' , $ locale );
@@ -338,7 +340,7 @@ public function getAllRegistryData()
338
340
'timeZone ' => Setup_Core::getUserTimezone (),
339
341
'jsonKey ' => Setup_Core::get ('jsonKey ' ),
340
342
'locale ' => array (
341
- 'locale ' => $ locale ->toString (),
343
+ 'locale ' => $ locale ->toString (),
342
344
'language ' => Zend_Locale::getTranslation ($ locale ->getLanguage (), 'language ' , $ locale ),
343
345
'region ' => Zend_Locale::getTranslation ($ locale ->getRegion (), 'country ' , $ locale ),
344
346
),
0 commit comments