* 'none' - Do not start a session
* 'readonly' - Start session readonly
* [DEFAULT] - Start read/write session
+ * 'user' - (string) Set authentication to this user.
* </pre>
*
* @return Horde_Registry_Application The application object.
'authentication' => null,
'nocompress' => false,
'nologintasks' => false,
- 'session_control' => null
+ 'session_control' => null,
+ 'user' => null
), $args);
// Registry.
Horde::compressOutput();
}
+ if ($args['user']) {
+ Horde_Auth::setAuth($args['user'], array());
+ }
+
$appob->init();
return $appob;
*
* Global variables defined:
* $kronolith_shares - TODO
- *
- * When calling Horde_Registry::appInit(), the following parameters are
- * also supported:
- * <pre>
- * 'user' - (string) Set authentication to this user.
- * </pre>
*/
protected function _init()
{
- if (isset($this->initParams['user'])) {
- Horde_Auth::setAuth($this->initParams['user'], array());
- }
-
/* For now, autoloading the Content_* classes depend on there being a
* registry entry for the 'content' application that contains at least
* the fileroot entry. */
* $copymove_source_options - TODO
* $copymoveSources - TODO
* $turba_shares - TODO
- *
- * When calling Horde_Registry::appInit(), the following parameters are
- * also supported:
- * <pre>
- * 'user' - (string) Set authentication to this user.
- * </pre>
*/
protected function _init()
{
- if (isset($this->initParams['user'])) {
- Horde_Auth::setAuth($this->initParams['user'], array());
- }
-
// Turba source and attribute configuration.
include TURBA_BASE . '/config/attributes.php';
include TURBA_BASE . '/config/sources.php';
*/
// Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../lib/base.local.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
}
// Registry.
-$registry = Horde_Registry::singleton();
-
-// Set user.
-Horde_Auth::setAuth($user, array());
+Horde_Registry::appInit('turba', array('authentication' => 'none', 'user' => $user));
// Import data.
$result = $registry->call('contacts/import',