--- /dev/null
+<?php
+/**
+ * Copyright (c) 2010 Frank Karlitschek karlitschek@kde.org
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+*/
+
+$RUNTIME_NOAPPS = TRUE; //no apps
+require_once('../../lib/base.php');
+
+// Someone lost their password:
+if (isset($_POST['user'])) {
+ if (OC_User::userExists($_POST['user'])) {
+ $token = sha1($_POST['user']+uniqId());
+ OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', $token);
+ $email = OC_Preferences::getValue($_POST['user'], 'lostpassword', 'email', '');
+ if (!empty($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('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => true));
+ } else {
+ OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => true, 'requested' => false));
+ }
+} else {
+ OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
+}
--- /dev/null
+<?php
+/**
+ * Copyright (c) 2010 Frank Karlitschek karlitschek@kde.org
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+*/
+
+$RUNTIME_NOAPPS = TRUE; //no apps
+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('core/lostpassword', 'resetpassword', array('success' => true));
+ } else {
+ OC_Template::printGuestPage('core/lostpassword', 'resetpassword', array('success' => false));
+ }
+ } else {
+ OC_Template::printGuestPage('core/lostpassword', 'resetpassword', array('success' => false));
+ }
+} else {
+ // Someone lost their password
+ OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
+}
--- /dev/null
+<?php echo str_replace('{link}', $_['link'], $l->t('Use the following link to reset your password: {link}')) ?>
--- /dev/null
+<form action="index.php" method="post">
+ <fieldset>
+ <?php echo $l->t('You will receive a link to reset your password via Email.'); ?>
+ <?php if ($_['requested']): ?>
+ <?php echo $l->t('Requested'); ?>
+ <?php else: ?>
+ <?php if ($_['error']): ?>
+ <?php echo $l->t('Login failed!'); ?>
+ <?php endif; ?>
+ <p class="infield">
+ <label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label>
+ <input type="text" name="user" id="user" value="" autocomplete="off" required autofocus />
+ </p>
+ <input type="submit" id="submit" value="<?php echo $l->t('Request reset'); ?>" />
+ <?php endif; ?>
+ </fieldset>
+</form>
--- /dev/null
+<form action="<?php echo 'resetpassword.php?'.$_SERVER['QUERY_STRING']; ?>" method="post">
+ <fieldset>
+ <?php if($_['success']): ?>
+ <h1><?php echo $l->t('Your password was reset'); ?></h1>
+ <p><a href="<?php echo OC::$WEBROOT ?>/"><?php echo $l->t('To login page'); ?></a></p>
+ <?php else: ?>
+ <p class="infield">
+ <label for="password" class="infield"><?php echo $l->t( 'New password' ); ?></label>
+ <input type="password" name="password" id="password" value="" required />
+ </p>
+ <input type="submit" id="submit" value="<?php echo $l->t('Reset password'); ?>" />
+ <?php endif; ?>
+ </fieldset>
+</form>
<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>
+++ /dev/null
-<?php
-/**
- * Copyright (c) 2010 Frank Karlitschek karlitschek@kde.org
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
-*/
-
-$RUNTIME_NOAPPS = TRUE; //no apps
-require_once('../lib/base.php');
-
-// Someone lost their password:
-if (isset($_POST['user'])) {
- if (OC_User::userExists($_POST['user'])) {
- $token = sha1($_POST['user']+uniqId());
- 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');
- $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));
- } else {
- OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => true, 'requested' => false));
- }
-} else {
- OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
-}
+++ /dev/null
-<?php
-/**
- * Copyright (c) 2010 Frank Karlitschek karlitschek@kde.org
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
-*/
-
-$RUNTIME_NOAPPS = TRUE; //no apps
-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));
- } else {
- OC_Template::printGuestPage('lostpassword', 'resetpassword', array('success' => false));
- }
- } else {
- OC_Template::printGuestPage('lostpassword', 'resetpassword', array('success' => false));
- }
-} else {
- // Someone lost their password
- OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
-}
+++ /dev/null
-<?php echo str_replace('{link}', $_['link'], $l->t('Use the following link to reset your password: {link}')) ?>
+++ /dev/null
-<form action="index.php" method="post">
- <fieldset>
- <?php echo $l->t('You will receive a link to reset your password via Email.'); ?>
- <?php if ($_['requested']): ?>
- <?php echo $l->t('Requested'); ?>
- <?php else: ?>
- <?php if ($_['error']): ?>
- <?php echo $l->t('Login failed!'); ?>
- <?php endif; ?>
- <p class="infield">
- <label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label>
- <input type="text" name="user" id="user" value="" autocomplete="off" required autofocus />
- </p>
- <input type="submit" id="submit" value="<?php echo $l->t('Request reset'); ?>" />
- <?php endif; ?>
- </fieldset>
-</form>
+++ /dev/null
-<form action="<?php echo 'resetpassword.php?'.$_SERVER['QUERY_STRING']; ?>" method="post">
- <fieldset>
- <?php if($_['success']): ?>
- <h1><?php echo $l->t('Your password was reset'); ?></h1>
- <p><a href="<?php echo OC::$WEBROOT ?>/"><?php echo $l->t('To login page'); ?></a></p>
- <?php else: ?>
- <p class="infield">
- <label for="password" class="infield"><?php echo $l->t( 'New password' ); ?></label>
- <input type="password" name="password" id="password" value="" required />
- </p>
- <input type="submit" id="submit" value="<?php echo $l->t('Reset password'); ?>" />
- <?php endif; ?>
- </fieldset>
-</form>