Move lostpassword to core dir

This commit is contained in:
Bart Visscher 2011-10-03 20:41:52 +02:00
parent dec8106665
commit e8c6252a4c
6 changed files with 12 additions and 12 deletions

View File

@ -7,7 +7,7 @@
*/
$RUNTIME_NOAPPS = TRUE; //no apps
require_once('../lib/base.php');
require_once('../../lib/base.php');
// Someone lost their password:
if (isset($_POST['user'])) {
@ -16,17 +16,17 @@ if (isset($_POST['user'])) {
OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', $token);
$email = OC_Preferences::getValue($_POST['user'], 'lostpassword', 'email', '');
if (!empty($email)) {
$link = OC_Helper::linkTo('lostpassword', 'resetpassword.php', null, true).'?user='.$_POST['user'].'&token='.$token;
$tmpl = new OC_Template('lostpassword', 'email');
$link = OC_Helper::linkTo('core/lostpassword', 'resetpassword.php', null, true).'?user='.$_POST['user'].'&token='.$token;
$tmpl = new OC_Template('core/lostpassword', 'email');
$tmpl->assign('link', $link);
$msg = $tmpl->fetchPage();
$l = new OC_L10N('core');
mail($email, $l->t('Owncloud password reset'), $msg);
}
OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => false, 'requested' => true));
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => true));
} else {
OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => true, 'requested' => false));
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => true, 'requested' => false));
}
} else {
OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
}

View File

@ -7,21 +7,21 @@
*/
$RUNTIME_NOAPPS = TRUE; //no apps
require_once('../lib/base.php');
require_once('../../lib/base.php');
// Someone wants to reset their password:
if(isset($_GET['token']) && isset($_GET['user']) && OC_Preferences::getValue($_GET['user'], 'owncloud', 'lostpassword') === $_GET['token']) {
if (isset($_POST['password'])) {
if (OC_User::setPassword($_GET['user'], $_POST['password'])) {
OC_Preferences::deleteKey($_GET['user'], 'owncloud', 'lostpassword');
OC_Template::printGuestPage('lostpassword', 'resetpassword', array('success' => true));
OC_Template::printGuestPage('core/lostpassword', 'resetpassword', array('success' => true));
} else {
OC_Template::printGuestPage('lostpassword', 'resetpassword', array('success' => false));
OC_Template::printGuestPage('core/lostpassword', 'resetpassword', array('success' => false));
}
} else {
OC_Template::printGuestPage('lostpassword', 'resetpassword', array('success' => false));
OC_Template::printGuestPage('core/lostpassword', 'resetpassword', array('success' => false));
}
} else {
// Someone lost their password
OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
}

View File

@ -1,7 +1,7 @@
<form action="index.php" method="post">
<fieldset>
<?php if($_['error']): ?>
<a href="./lostpassword/"><?php echo $l->t('Lost your password?'); ?></a>
<a href="./core/lostpassword/"><?php echo $l->t('Lost your password?'); ?></a>
<?php endif; ?>
<p class="infield">
<label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label>