summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorJakob Sack <mail@jakobsack.de>2011-03-01 23:20:16 +0100
committerJakob Sack <mail@jakobsack.de>2011-03-01 23:20:16 +0100
commit132695ceb1d7ab0e4bfbb141e9e9639111dd25b5 (patch)
treef53fabcefd89a1e5bbeda9a2c2d2fff6683139d4 /settings
parent1fd39a52fa750878e7d70fba63c099f252095762 (diff)
downloadnextcloud-server-132695ceb1d7ab0e4bfbb141e9e9639111dd25b5.tar.gz
nextcloud-server-132695ceb1d7ab0e4bfbb141e9e9639111dd25b5.zip
Start of the refactoring. Commit is quite big because I forgot to use git right from the beginning. Sorry.
Diffstat (limited to 'settings')
-rw-r--r--settings/appinfo.php6
-rw-r--r--settings/index.php66
-rw-r--r--settings/templates/_c/.gitkeep0
-rw-r--r--settings/templates/index.tmpl19
4 files changed, 51 insertions, 40 deletions
diff --git a/settings/appinfo.php b/settings/appinfo.php
new file mode 100644
index 00000000000..232aaa0f0e7
--- /dev/null
+++ b/settings/appinfo.php
@@ -0,0 +1,6 @@
+<?php
+
+OC_UTIL::addApplication( array( "id" => "settings", "name" => "Settings" ));
+OC_UTIL::addNavigationEntry( array( "app" => "settings", "file" => "index.php", "name" => "Settings" ));
+
+?>
diff --git a/settings/index.php b/settings/index.php
index 66fc20565a4..6d37180fcd1 100644
--- a/settings/index.php
+++ b/settings/index.php
@@ -1,47 +1,33 @@
<?php
-/**
-* ownCloud
-*
-* @author Frank Karlitschek
-* @copyright 2010 Frank Karlitschek karlitschek@kde.org
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
-* License as published by the Free Software Foundation; either
-* version 3 of the License, or any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
-*
-* You should have received a copy of the GNU Affero General Public
-* License along with this library. If not, see <http://www.gnu.org/licenses/>.
-*
-*/
-
-$CONFIG_ERROR='';
-
-require_once('../inc/lib_base.php');
-
-
-OC_UTIL::showheader();
-
-$FIRSTRUN=false;
-
-OC_CONFIG::addForm('User Settings','/inc/templates/configform.php');
-if(OC_USER::ingroup($_SESSION['username'],'admin')){
- OC_CONFIG::addForm('System Settings','/inc/templates/adminform.php');
- OC_CONFIG::addForm('User Management','/inc/templates/userform.php');
- OC_CONFIG::addForm('Plugin Management','/inc/templates/pluginform.php');
+require_once('../lib/base.php');
+oc_require( 'template.php' );
+if( !OC_USER::isLoggedIn()){
+ header( "Location: ".OC_UTIL::linkto( "index.php" ));
+ exit();
}
-echo('<div class="center">');
-OC_CONFIG::showSettings();
-echo('</div>');
-
+$settings = array();
+
+// Do the work ...
+if( $_POST["submit"] )
+{
+ if( $_POST["newpassword"] != $_POST["newpasswordconfirm"] ){
+ // Say "Passwords not equal"
+ }
+ else{
+ if( OC_USER::checkPassword( $_SESSION["username"], $_POST["password"] )){
+ // Set password
+ OC_USER::setPassord( $_SESSION["username"], $_POST["newpassword"] );
+ }
+ else{
+ // Say "old password bad"
+ }
+ }
+}
-OC_UTIL::showfooter();
+$tmpl = new OC_TEMPLATE( "settings", "index", "user" );
+$tmpl->assign( "settings", $settings );
+$tmpl->printPage();
?>
diff --git a/settings/templates/_c/.gitkeep b/settings/templates/_c/.gitkeep
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/settings/templates/_c/.gitkeep
diff --git a/settings/templates/index.tmpl b/settings/templates/index.tmpl
new file mode 100644
index 00000000000..b700ced4e3a
--- /dev/null
+++ b/settings/templates/index.tmpl
@@ -0,0 +1,19 @@
+<h1>Settings</h1>
+
+<form action="" type="">
+ <p>
+ <span>New password:</span>
+ <input type="password" name="newpassword" value="">
+ </p>
+ <p>
+ <span>Confirm new password:</span>
+ <input type="password" name="newpasswordconfirm" value="">
+ </p>
+ <p>
+ <span>Old password:</span>
+ <input type="password" name="password" value="">
+ </p>
+ <p>
+ <input type="submit" name="submit" value="Send">
+ </p>
+</form>