nextcloud/settings/index.php

34 lines
748 B
PHP
Raw Normal View History

2010-03-10 15:03:40 +03:00
<?php
require_once('../lib/base.php');
oc_require( 'template.php' );
if( !OC_USER::isLoggedIn()){
header( "Location: ".OC_UTIL::linkto( "index.php" ));
exit();
}
$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"
}
}
}
2010-03-10 15:03:40 +03:00
$tmpl = new OC_TEMPLATE( "settings", "index", "user" );
$tmpl->assign( "settings", $settings );
$tmpl->printPage();
2010-03-10 15:03:40 +03:00
?>