Fix changing password in personal page (not complete)
This commit is contained in:
parent
eee7d8da50
commit
98ca6c4a16
|
@ -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(){
|
||||
|
|
Loading…
Reference in New Issue