Move lostpassword to core dir
This commit is contained in:
parent
dec8106665
commit
e8c6252a4c
6 changed files with 12 additions and 12 deletions
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$RUNTIME_NOAPPS = TRUE; //no apps
|
$RUNTIME_NOAPPS = TRUE; //no apps
|
||||||
require_once('../lib/base.php');
|
require_once('../../lib/base.php');
|
||||||
|
|
||||||
// Someone lost their password:
|
// Someone lost their password:
|
||||||
if (isset($_POST['user'])) {
|
if (isset($_POST['user'])) {
|
||||||
|
@ -16,17 +16,17 @@ if (isset($_POST['user'])) {
|
||||||
OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', $token);
|
OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', $token);
|
||||||
$email = OC_Preferences::getValue($_POST['user'], 'lostpassword', 'email', '');
|
$email = OC_Preferences::getValue($_POST['user'], 'lostpassword', 'email', '');
|
||||||
if (!empty($email)) {
|
if (!empty($email)) {
|
||||||
$link = OC_Helper::linkTo('lostpassword', 'resetpassword.php', null, true).'?user='.$_POST['user'].'&token='.$token;
|
$link = OC_Helper::linkTo('core/lostpassword', 'resetpassword.php', null, true).'?user='.$_POST['user'].'&token='.$token;
|
||||||
$tmpl = new OC_Template('lostpassword', 'email');
|
$tmpl = new OC_Template('core/lostpassword', 'email');
|
||||||
$tmpl->assign('link', $link);
|
$tmpl->assign('link', $link);
|
||||||
$msg = $tmpl->fetchPage();
|
$msg = $tmpl->fetchPage();
|
||||||
$l = new OC_L10N('core');
|
$l = new OC_L10N('core');
|
||||||
mail($email, $l->t('Owncloud password reset'), $msg);
|
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 {
|
} else {
|
||||||
OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => true, 'requested' => false));
|
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => true, 'requested' => false));
|
||||||
}
|
}
|
||||||
} else {
|
} 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
|
$RUNTIME_NOAPPS = TRUE; //no apps
|
||||||
require_once('../lib/base.php');
|
require_once('../../lib/base.php');
|
||||||
|
|
||||||
// Someone wants to reset their password:
|
// Someone wants to reset their password:
|
||||||
if(isset($_GET['token']) && isset($_GET['user']) && OC_Preferences::getValue($_GET['user'], 'owncloud', 'lostpassword') === $_GET['token']) {
|
if(isset($_GET['token']) && isset($_GET['user']) && OC_Preferences::getValue($_GET['user'], 'owncloud', 'lostpassword') === $_GET['token']) {
|
||||||
if (isset($_POST['password'])) {
|
if (isset($_POST['password'])) {
|
||||||
if (OC_User::setPassword($_GET['user'], $_POST['password'])) {
|
if (OC_User::setPassword($_GET['user'], $_POST['password'])) {
|
||||||
OC_Preferences::deleteKey($_GET['user'], 'owncloud', 'lostpassword');
|
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 {
|
} else {
|
||||||
OC_Template::printGuestPage('lostpassword', 'resetpassword', array('success' => false));
|
OC_Template::printGuestPage('core/lostpassword', 'resetpassword', array('success' => false));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
OC_Template::printGuestPage('lostpassword', 'resetpassword', array('success' => false));
|
OC_Template::printGuestPage('core/lostpassword', 'resetpassword', array('success' => false));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Someone lost their password
|
// 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));
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
<form action="index.php" method="post">
|
<form action="index.php" method="post">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<?php if($_['error']): ?>
|
<?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; ?>
|
<?php endif; ?>
|
||||||
<p class="infield">
|
<p class="infield">
|
||||||
<label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label>
|
<label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label>
|
||||||
|
|
Loading…
Reference in a new issue