* 'none' - Do not start a session
* 'readonly' - Start session readonly
* [DEFAULT] - Start read/write session
- * 'user' - (string) Set authentication to this user.
- * DEFAULT: null
+ * 'user_admin' - (boolean) Set authentication to an admin user?
+ * DEFAULT: false
* </pre>
*
* @return Horde_Registry_Application The application object.
'nocompress' => false,
'nologintasks' => false,
'session_control' => null,
- 'user' => null
+ 'user_admin' => null
), $args);
// Registry.
Horde::compressOutput();
}
- if ($args['user']) {
- Horde_Auth::setAuth($args['user'], array());
+ if ($args['user_admin'] && !empty($conf['auth']['admins'])) {
+ Horde_Auth::setAuth(reset($conf['auth']['admins']), array());
}
$appob->init();
// Do CLI checks and environment setup first.
require_once dirname(__FILE__) . '/../lib/Application.php';
-Horde_Registry::appInit('kronolith', array('authentication' => 'none', 'cli' => true, 'user' => $conf['auth']['admins'] ? $conf['auth']['admins'][0] : array()));
+Horde_Registry::appInit('kronolith', array('authentication' => 'none', 'cli' => true, 'user_admin' => true));
// Read command line parameters.
$cli = Horde_Cli::singleton();
// Do CLI checks and environment setup first.
require_once dirname(__FILE__) . '/../lib/Application.php';
-Horde_Registry::appInit('turba', array('authentication' => 'none', 'cli' => true, 'user' => $conf['auth']['admins'] ? $conf['auth']['admins'][0] : null));
+Horde_Registry::appInit('turba', array('authentication' => 'none', 'cli' => true, 'user_admin' => true));
require_once TURBA_BASE . '/lib/Object/Group.php';
// Do CLI checks and environment setup first.
require_once dirname(__FILE__) . '/../lib/Application.php';
-Horde_Registry::appInit('turba', array('authentication' => 'none', 'cli' => true, 'user' => $conf['auth']['admins'] ? $conf['auth']['admins'][0] : null));
+Horde_Registry::appInit('turba', array('authentication' => 'none', 'cli' => true, 'user_admin' => true));
require_once TURBA_BASE . '/lib/Object/Group.php';
// Do CLI checks and environment setup first.
require_once dirname(__FILE__) . '/../lib/Application.php';
-Horde_Registry::appInit('turba', array('authentication' => 'none', 'cli' => true, 'user' => $user));
+Horde_Registry::appInit('turba', array('authentication' => 'none', 'cli' => true));
// Read command line parameters.
$cli = Horde_Cli::singleton();
$source = $argv[1];
$user = $argv[2];
+Horde_Auth::setAuth($user, array());
+
// Read standard input.
$vcard = $cli->readStdin();
if (empty($vcard)) {
// Load Horde and Turba enviroments
require_once dirname(__FILE__) . '/../lib/Application.php';
-Horde_Registry::appInit('turba', array('authentication' => 'none', 'cli' => true, 'user' => $conf['auth']['admins'] ? $conf['auth']['admins'][0] : null));
+Horde_Registry::appInit('turba', array('authentication' => 'none', 'cli' => true, 'user_admin' => true));
$CLI = Horde_Cli::singleton();
$CLI->writeln('This script will turn all entries in the SQL address book into a globally shared address book.');