$v = array(1, $name);
 #$selected_user;
 $t = array('i', 's');
 $res_owner = db_prep_query($sql_owner, $v, $t);
 # removed, because a new user may be inserted in a group with too many privileges
 $sql_group = "Insert INTO mb_user_mb_group (fkey_mb_user_id, fkey_mb_group_id) VALUES ";
 $sql_group .= "(\$1, \$2) ";
 $v = array($selected_user, 20);
 $t = array('i', 'i');
 $res_group = db_prep_query($sql_group, $v, $t);
 // CB (begin)
 // adding new GUIs for new user (copies of gui and gui1 with owner rights)
 $gui = new gui();
 $admin = new administration();
 //create new name for gui
 $gui_id1 = $admin->getGuiIdByGuiName("gui");
 $gui_id2 = $admin->getGuiIdByGuiName("gui1");
 $gui_id3 = $admin->getGuiIdByGuiName("gui2");
 $gui_id4 = $admin->getGuiIdByGuiName("gui_digitize");
 $gui_newName1 = $name . "_gui";
 $gui_newName2 = $name . "_gui1";
 $gui_newName3 = $name . "_gui2";
 $gui_newName4 = $name . "_gui_digitize";
 //check if new gui names are already taken
 while ($gui->guiExists($gui_newName1)) {
     $gui_newName1 .= "_1";
 }
 while ($gui->guiExists($gui_newName2)) {
     $gui_newName2 .= "_1";
 }
 while ($gui->guiExists($gui_newName3)) {