Skip to content
Snippets Groups Projects
Commit 98ca6c4a authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Fix changing password in personal page (not complete)

parent eee7d8da
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' ))
exit();
}
$username = $_POST["username"];
$username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser();
$password = $_POST["password"];
// Return Success story
......
......@@ -6,23 +6,29 @@
$(document).ready(function(){
$("#passwordbutton").click( function(){
// Serialize the data
var post = $( "#passwordform" ).serialize();
$('#passwordchanged').hide();
$('#passworderror').hide();
// Ajax foo
$.post( 'ajax/changepassword.php', post, function(data){
if( data.status == "success" ){
$('#pass1').val('');
$('#pass2').val('');
$('#passwordchanged').show();
}
else{
$('#passworderror').html( data.data.message );
$('#passworderror').show();
}
});
return false;
if ($('#pass1').val() != '' && $('#pass2').val() != '') {
// Serialize the data
var post = $( "#passwordform" ).serialize();
$('#passwordchanged').hide();
$('#passworderror').hide();
// Ajax foo
$.post( 'ajax/changepassword.php', post, function(data){
if( data.status == "success" ){
$('#pass1').val('');
$('#pass2').val('');
$('#passwordchanged').show();
}
else{
$('#passworderror').html( data.data.message );
$('#passworderror').show();
}
});
return false;
} else {
$('passworderror').show();
return false;
}
});
$("#languageinput").change( function(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment