"error", "data" => array( "message" => $l->t( "Authentication error" ) )));
exit();
}
// Get data
if( !isset( $_POST["password"] ) && !isset( $_POST["oldpassword"] )){
echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t( "You have to enter the old and the new password!" ) )));
exit();
}
// Check if the old password is correct
if( !OC_User::checkPassword( $_SESSION["user_id"], $_POST["oldpassword"] )){
echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Your old password is wrong!") )));
exit();
}
// Change password
if( OC_User::setPassword( $_SESSION["user_id"], $_POST["password"] )){
echo json_encode( array( "status" => "success", "data" => array( "message" => $l->t("Password changed") )));
}
else{
echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Unable to change password") )));
}
?>
3rdparty/stable30/sabre-dav-itip-broker'>3rdparty/stable30/sabre-dav-itip-broker
Nextcloud server, a safe home for all your data: https://github.com/nextcloud/server | www-data |
blob: 751293e1fd549fbf55658afe59cd93a95f4ba16c (
plain)