Skip to content
Snippets Groups Projects
Commit e8c6252a authored by Bart Visscher's avatar Bart Visscher
Browse files

Move lostpassword to core dir

parent dec81066
No related branches found
No related tags found
No related merge requests found
......@@ -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));
}
......@@ -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));
}
<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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment