Even more fixes on user management. Any designers here that want to make it good looking?
This commit is contained in:
parent
2fdf654f40
commit
f1e78be4f4
|
@ -31,7 +31,7 @@ else{
|
||||||
|
|
||||||
// Return Success story
|
// Return Success story
|
||||||
if( $success ){
|
if( $success ){
|
||||||
echo json_encode( array( "status" => "success", "data" => array( "username" => $username, "action" => $action, "groupname" => $groupname )));
|
echo json_encode( array( "status" => "success", "data" => array( "username" => $username, "action" => $action, "groupname" => $group )));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
echo json_encode( array( "status" => "error", "data" => array( "message" => "Unable to $error group $group" )));
|
echo json_encode( array( "status" => "error", "data" => array( "message" => "Unable to $error group $group" )));
|
||||||
|
|
|
@ -78,7 +78,7 @@ $(document).ready(function(){
|
||||||
$("input[x-use='creategroupfield']").val( "" );
|
$("input[x-use='creategroupfield']").val( "" );
|
||||||
|
|
||||||
// Add group option to Create User and Edit User
|
// Add group option to Create User and Edit User
|
||||||
var createuser = '<input x-gid="'+groupname+'" type="checkbox" name="groups[]" value="'+groupname+'" /><span x-gid="'+groupname+'">'+groupname+'<br /></span>';
|
var createuser = '<input x-use="createusercheckbox" x-gid="'+groupname+'" type="checkbox" name="groups[]" value="'+groupname+'" /> <span x-gid="'+groupname+'">'+groupname+'<br /></span>';
|
||||||
$("#createusergroups").append( createuser );
|
$("#createusergroups").append( createuser );
|
||||||
var changeuser = '<input x-use="togglegroup" x-gid="'+groupname+'" type="checkbox" name="groups[]" value="'+groupname+'" /> <span x-use="togglegroup" x-gid="'+groupname+'">'+groupname+'<br /></span>';
|
var changeuser = '<input x-use="togglegroup" x-gid="'+groupname+'" type="checkbox" name="groups[]" value="'+groupname+'" /> <span x-use="togglegroup" x-gid="'+groupname+'">'+groupname+'<br /></span>';
|
||||||
$("#changegroupsform").append( changeuser );
|
$("#changegroupsform").append( changeuser );
|
||||||
|
@ -91,7 +91,7 @@ $(document).ready(function(){
|
||||||
$( "input[x-gid='"+groupname+"']" ).remove();
|
$( "input[x-gid='"+groupname+"']" ).remove();
|
||||||
|
|
||||||
// remove it from user list
|
// remove it from user list
|
||||||
$( "td[x-use='usergroups']" ).each(function(index){
|
$( "div[x-use='usergroupsdiv']" ).each(function(index){
|
||||||
var content = $(this).text();
|
var content = $(this).text();
|
||||||
var list = content.split( ", " );
|
var list = content.split( ", " );
|
||||||
var newlist = [];
|
var newlist = [];
|
||||||
|
|
|
@ -134,6 +134,8 @@ class OC_GROUP_DATABASE extends OC_GROUP_BACKEND {
|
||||||
public static function removeFromGroup( $uid, $gid ){
|
public static function removeFromGroup( $uid, $gid ){
|
||||||
$query = OC_DB::prepare( "DELETE FROM `*PREFIX*group_user` WHERE `uid` = ? AND `gid` = ?" );
|
$query = OC_DB::prepare( "DELETE FROM `*PREFIX*group_user` WHERE `uid` = ? AND `gid` = ?" );
|
||||||
$result = $query->execute( array( $uid, $gid ));
|
$result = $query->execute( array( $uid, $gid ));
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue