--- /dev/null
+<?php
+/**
+ * Passwd application interface.
+ *
+ * This file brings in all of the dependencies that every PASSWD script will
+ * need, and sets up objects that all scripts use.
+ *
+ * Copyright 2002-2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.horde.org/licenses/gpl.php.
+ *
+ * @author Eric Rostetter <eric.rostetter@physics.utexas.edu>
+ * @author Ben Klang <ben@alkaloid.net>
+ * @package Passwd
+ */
+
+if (!defined('PASSWD_BASE')) {
+ define('PASSWD_BASE', dirname(__FILE__). '/..');
+}
+
+if (!defined('HORDE_BASE')) {
+ /* If horde does not live directly under the app directory, the HORDE_BASE
+ * constant should be defined in config/horde.local.php. */
+ if (file_exists(PASSWD_BASE. '/config/horde.local.php')) {
+ include PASSWD_BASE . '/config/horde.local.php';
+ } else {
+ define('HORDE_BASE', PASSWD_BASE . '/..');
+ }
+}
+
+/* Load the Horde Framework core (needed to autoload
+ * Horde_Registry_Application::). */
+require_once HORDE_BASE . '/lib/core.php';
+
+class Passwd_Application extends Horde_Registry_Application
+{
+ /**
+ * Initialization function.
+ *
+ * Global variables defined:
+ */
+ protected function _init()
+ {
+
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php class Passwd_Exception extends Horde_Exception {}
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- * Passwd base inclusion file.
- *
- * This file brings in all of the dependencies that every PASSWD script will
- * need, and sets up objects that all scripts use.
- *
- * $Horde: passwd/lib/base.php,v 1.33.2.7 2009/10/19 23:34:20 jan Exp $
- *
- * Copyright 2002-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.horde.org/licenses/gpl.php.
- *
- * @author Eric Rostetter <eric.rostetter@physics.utexas.edu>
- * @package Passwd
- */
-
-// Check for a prior definition of HORDE_BASE (perhaps by an
-// auto_prepend_file definition for site customization).
-if (!defined('HORDE_BASE')) {
- @define('HORDE_BASE', dirname(__FILE__) . '/../..');
-}
-
-// Load the Horde Framework core, and set up inclusion paths.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Registry.
-$registry = &Registry::singleton();
-if (is_a(($pushed = $registry->pushApp('passwd', !defined('AUTH_HANDLER'))), 'PEAR_Error')) {
- if ($pushed->getCode() == 'permission_denied') {
- Horde::authenticationFailureRedirect();
- }
- Horde::fatal($pushed, __FILE__, __LINE__, false);
-}
-$conf = &$GLOBALS['conf'];
-@define('PASSWD_TEMPLATES', $registry->get('templates'));
-
-// Notification system.
-$notification = &Notification::singleton();
-$notification->attach('status');
-
-// Find the base file path of Passwd
-@define('PASSWD_BASE', dirname(__FILE__) . '/..');
-
-// Passwd base library.
-require_once PASSWD_BASE . '/lib/Passwd.php';
-
-// Start compression.
-if (!Util::nonInputVar('no_compress')) {
- Horde::compressOutput();
-}
-
-// Horde libraries.
-require_once 'Horde/Help.php';
-require_once 'Horde/Secret.php';
* @package Passwd
*/
-@define('PASSWD_BASE', dirname(__FILE__));
-require_once PASSWD_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
require PASSWD_BASE . '/config/backends.php';
// Get the backend details.
-$backend_key = Util::getFormData('backend', false);
+$backend_key = Horde_Util::getFormData('backend', false);
if (!isset($backends[$backend_key])) {
$backend_key = null;
}
}
// Has the user submitted the form yet?
- $submit = Util::getFormData('submit', false);
+ $submit = Horde_Util::getFormData('submit', false);
if (!$submit) {
// No so we don't need to do anything in this loop.
break;
// Get the username.
if ($conf['user']['change'] === true) {
- $userid = Util::getFormData('userid');
+ $userid = Horde_Util::getFormData('userid');
} else {
if ($conf['hooks']['default_username']) {
$userid = Horde::callHook('_passwd_hook_default_username',
}
// We must be passed the old (current) password, or its an error.
- $old_password = Util::getFormData('oldpassword', false);
+ $old_password = Horde_Util::getFormData('oldpassword', false);
if (!$old_password) {
$notification->push(_("You must give your current password"),
'horde.warning');
}
// See if they entered the new password and verified it.
- $new_password0 = Util::getFormData('newpassword0', false);
- $new_password1 = Util::getFormData('newpassword1', false);
+ $new_password0 = Horde_Util::getFormData('newpassword0', false);
+ $new_password1 = Horde_Util::getFormData('newpassword1', false);
if (!$new_password0) {
$notification->push(_("You must give your new password"), 'horde.warning');
break;
array($backend_userid, $old_password, $new_password0),
'passwd');
- $return_to = Util::getFormData('return_to');
+ $return_to = Horde_Util::getFormData('return_to');
if (!empty($return_to)) {
header('Location: ' . $return_to);
exit;