Fix changing password in personal page (not complete)

This commit is contained in:
Michael Gapczynski 2011-08-27 17:40:41 -04:00
parent eee7d8da50
commit 98ca6c4a16
2 changed files with 24 additions and 18 deletions

View File

@ -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

View File

@ -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(){