* All rights reserved. * * Based on other FusionForge code. * * This file is part of FusionForge. FusionForge is free software; * you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * FusionForge is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with FusionForge; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ require_once '../env.inc.php'; require_once $gfwww.'include/pre.php'; require_once $gfcommon.'include/account.php'; require_once $gfwww.'admin/admin_utils.php'; session_require_global_perm ('forge_admin'); $user_id = getIntFromRequest('user_id'); $u =& user_get_object($user_id); if (!$u || !is_object($u)) { exit_error('Error','Could Not Get User'); } elseif ($u->isError()) { exit_error('Error',$u->getErrorMessage()); } if (getStringFromRequest('submit')) { if (!form_key_is_valid(getStringFromRequest('form_key'))) { exit_form_double_submit(); } $passwd = getStringFromRequest('passwd'); $passwd2 = getStringFromRequest('passwd2'); if (strlen($passwd)<6) { form_release_key(getStringFromRequest('form_key')); exit_error( _('Error'), _('You must supply valid password (at least 6 chars)') ); } if ($passwd != $passwd2) { form_release_key(getStringFromRequest('form_key')); exit_error( _('Error'), _('New passwords do not match.') ); } if (!$u->setPasswd($passwd)) { form_release_key(getStringFromRequest('form_key')); exit_error( _('Error'), 'Could not change password: '.$u->getErrorMessage() ); } site_admin_header(array('title'=>_('Site Admin: Successfully Changed User Password'))); printf(_('
You have changed the password of %2$s (%3$s).
'), forge_get_config('forge_name'), $u->getUnixName(), $u->getRealName()); printf(''._("Go back to %s.").'
', ''._("the Full User List").''); } else { // Show change form site_admin_header(array('title'=>_('Site Admin: Change User Password'))); ?>