2010-03-10 15:03:40 +03:00
|
|
|
<?php
|
|
|
|
|
2011-03-02 01:20:16 +03:00
|
|
|
require_once('../lib/base.php');
|
2011-04-16 12:12:53 +04:00
|
|
|
require( 'template.php' );
|
2011-03-02 01:20:16 +03:00
|
|
|
if( !OC_USER::isLoggedIn()){
|
2011-03-03 01:58:46 +03:00
|
|
|
header( "Location: ".OC_HELPER::linkTo( "index.php" ));
|
2011-03-02 01:20:16 +03:00
|
|
|
exit();
|
2010-08-12 19:30:20 +04:00
|
|
|
}
|
|
|
|
|
2011-03-02 01:20:16 +03:00
|
|
|
$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
|
|
|
|
2011-03-02 01:20:16 +03:00
|
|
|
$tmpl = new OC_TEMPLATE( "settings", "index", "user" );
|
|
|
|
$tmpl->assign( "settings", $settings );
|
|
|
|
$tmpl->printPage();
|
2010-03-10 15:03:40 +03:00
|
|
|
|
|
|
|
?>
|