From e8c6252a4ce1151b11f1faa8e602c06aae4294d8 Mon Sep 17 00:00:00 2001
From: Bart Visscher <bartv@thisnet.nl>
Date: Mon, 3 Oct 2011 20:41:52 +0200
Subject: [PATCH] Move lostpassword to core dir

---
 {lostpassword => core/lostpassword}/index.php        | 12 ++++++------
 .../lostpassword}/resetpassword.php                  | 10 +++++-----
 .../lostpassword}/templates/email.php                |  0
 .../lostpassword}/templates/lostpassword.php         |  0
 .../lostpassword}/templates/resetpassword.php        |  0
 core/templates/login.php                             |  2 +-
 6 files changed, 12 insertions(+), 12 deletions(-)
 rename {lostpassword => core/lostpassword}/index.php (56%)
 rename {lostpassword => core/lostpassword}/resetpassword.php (59%)
 rename {lostpassword => core/lostpassword}/templates/email.php (100%)
 rename {lostpassword => core/lostpassword}/templates/lostpassword.php (100%)
 rename {lostpassword => core/lostpassword}/templates/resetpassword.php (100%)

diff --git a/lostpassword/index.php b/core/lostpassword/index.php
similarity index 56%
rename from lostpassword/index.php
rename to core/lostpassword/index.php
index 6d629a7108..de0d393ec7 100644
--- a/lostpassword/index.php
+++ b/core/lostpassword/index.php
@@ -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));
 }
diff --git a/lostpassword/resetpassword.php b/core/lostpassword/resetpassword.php
similarity index 59%
rename from lostpassword/resetpassword.php
rename to core/lostpassword/resetpassword.php
index 1a6a74e5ff..1c78d72094 100644
--- a/lostpassword/resetpassword.php
+++ b/core/lostpassword/resetpassword.php
@@ -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));
 }
diff --git a/lostpassword/templates/email.php b/core/lostpassword/templates/email.php
similarity index 100%
rename from lostpassword/templates/email.php
rename to core/lostpassword/templates/email.php
diff --git a/lostpassword/templates/lostpassword.php b/core/lostpassword/templates/lostpassword.php
similarity index 100%
rename from lostpassword/templates/lostpassword.php
rename to core/lostpassword/templates/lostpassword.php
diff --git a/lostpassword/templates/resetpassword.php b/core/lostpassword/templates/resetpassword.php
similarity index 100%
rename from lostpassword/templates/resetpassword.php
rename to core/lostpassword/templates/resetpassword.php
diff --git a/core/templates/login.php b/core/templates/login.php
index 46b44c24d7..aff0afac20 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -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>
-- 
GitLab