/**
  * Removes a group from the database.
  *
  * @param Request $request Incoming request.
  * @return string Rendered page content.
  */
 public function deleteAction(Request $request)
 {
     csrf_check_token($request);
     // Remove the group and all its relations.
     $group_id = $request->attributes->getInt('group_id');
     delete_group($group_id);
     // Redirect user to canned messages list. Use only "sortby" and
     // "sortdirection" get params for the target URL.
     $parameters = array_intersect_key($request->query->all(), array_flip(array('sortby', 'sortdirection')));
     return $this->redirect($this->generateUrl('groups', $parameters));
 }
Beispiel #2
0
     get_user_groups();
     break;
     /* Добавление группы пользователей */
 /* Добавление группы пользователей */
 case "addGroup":
     add_group($postdata);
     break;
     /* Редактирование группы пользователей */
 /* Редактирование группы пользователей */
 case "editGroup":
     edit_group($postdata);
     break;
     /* Удаление группы пользователей */
 /* Удаление группы пользователей */
 case "deleteGroup":
     delete_group($postdata);
     break;
     /* Получение всех пользователей */
 /* Получение всех пользователей */
 case "getUsers":
     get_users();
     break;
     /* Добавление пользователя */
 /* Добавление пользователя */
 case "addUser":
     add_user($postdata);
     break;
     /* Редактирование пользователя */
 /* Редактирование пользователя */
 case "editUser":
     edit_user($postdata);
Beispiel #3
0
				$texte_info_action.="<br />\n";
			}
			echo $texte_info_action;
			update_infos_action_nettoyage($id_info, $texte_info_action);
		}

		$sql="select g.* from groupes g left join j_groupes_matieres jgm on jgm.id_groupe=g.id where jgm.id_groupe is NULL;";
		$res_grp2=mysqli_query($GLOBALS["mysqli"], $sql);
		if(mysqli_num_rows($res_grp2)>0){
			$texte_info_action="<p>Un ou des groupes existent sans être associés à aucune matière.<br />C'est une anomalie.<br />En voici la liste&nbsp;:<br />\n";
			while($ligne=mysqli_fetch_object($res_grp2)) {
				$texte_info_action.="Suppression du groupe n°$ligne->id&nbsp;: $ligne->name (<em>$ligne->description</em>)&nbsp;: ";
				//$sql="DELETE from groupes WHERE id='$ligne->id';";
				//echo "$sql<br />";
				//$menage=mysql_query($sql);
				$menage=delete_group($ligne->id);
				if($menage) {
					$texte_info_action.="<span style='color:green'>SUCCES</span>";
				}
				else {
					$texte_info_action.="<span style='color:red'>ECHEC</span>";
				}
				$texte_info_action.="<br />\n";
			}
			echo $texte_info_action;
			update_infos_action_nettoyage($id_info, $texte_info_action);
		}

		// On va supprimer des tables 'j_signalement', 'j_groupes_classes','j_groupes_matieres','j_groupes_professeurs','j_eleves_groupes', 'j_groupes_visibilite', 'acces_cdt_groupes', les groupes qui ne sont pas dans la table 'groupes'
		for($i=0;$i<count($table);$i++){
			$err_no=0;
Beispiel #4
0
         show_form_one($group_id);
     } else {
         // XXX - Form for all groups
         show_form_all();
     }
     break;
 case "tree":
     $tree = group_tree(TRUE);
     print_struct($tree);
     break;
 case "add":
     add_group($group_name, $group_parent);
     // XXX - Return JSON(?) status
     break;
 case "delete":
     delete_group($group_id);
     // XXX - Return JSON(?) status
     break;
 case "reparent":
     echo "<p>Ought to reparent something.</p>";
     // XXX - Return JSON(?) status
     break;
 case "update":
     if (isset($group_id)) {
         /* Update an existing group */
         update_group_info($group_id);
     } else {
         update_group_info();
     }
     // XXX - Return JSON(?) status
     break;
Beispiel #5
0
			<label>Department</label>
			<select name="campaign">';
    $s['source_campaign'] = $user->getCampaign();
    include 'partials/options/_campaigns.php';
    echo '
			</select>
			
			
			<input type="submit" value="New List">
			</form>';
}
if ($_REQUEST['group']) {
    show_list($_REQUEST['group']);
}
if ($_REQUEST['groups_KEY'] && $_REQUEST['delete']) {
    delete_group($_REQUEST['groups_KEY']);
}
if ($_REQUEST['Group_Name']) {
    $groups_KEY = save_new_group($_REQUEST);
    echo $groups_KEY . ' created';
}
$campaign_manager_KEY = $_REQUEST['campaign_manager_KEY'];
if ($campaign_manager_KEY) {
    $campaign_manager_KEY_sql = ' and campaign_manager_KEY = ' . $campaign_manager_KEY;
}
if ($_REQUEST['campaign']) {
    $campaign_sql = ' and campaign = "' . $_REQUEST['campaign'] . '"';
}
$sql = 'select * from groups where parent_KEY = ' . SALSA_GROUP_LIST_PARENT . $campaign_manager_KEY_sql . $campaign_sql;
$R = $db->Execute($sql) or die($db->errorMsg());
$lists = $R->GetArray();
                                 $resultat_prof = mysqli_query($GLOBALS["mysqli"], $sql);
                                 $nb_grp_maj++;
                             } else {
                                 // Le prof est déjà affecté au groupe.
                             }
                         }
                     }
                 }
             } else {
                 // On supprime le groupe:
                 //$id_groupe=$checkmat[$i];
                 $id_groupe = $id_grp[$i];
                 if ($id_groupe != "") {
                     //echo "Suppression... \$id_groupe=$id_groupe<br />";
                     if (test_before_group_deletion($id_groupe)) {
                         if (!delete_group($id_groupe)) {
                             $msg .= "Erreur lors de la suppression du groupe.<br />";
                         } else {
                             $msg .= "Groupe n°{$id_groupe} supprimé.<br />";
                         }
                     } else {
                         $msg .= "Des notes sons saisies pour ce groupe. La suppression du groupe n°{$id_groupe} n'est pas possible.<br />";
                     }
                 }
             }
         }
     }
 }
 if ($nb_nouveaux_groupes > 0) {
     $msg .= "{$nb_nouveaux_groupes} enseignement(s) ajouté(s).<br />";
 }
Beispiel #7
0
//view only your computers
if ($_SESSION['OCS']['RESTRICTION']['GUI'] == 'YES') {
    $mycomputers = computer_list_by_tag();
    if ($mycomputers == "ERROR") {
        msg_error($l->g(893));
        require_once FOOTER_HTML;
        die;
    }
}
//View for all profils?
if (isset($protectedPost['CONFIRM_CHECK']) and $protectedPost['CONFIRM_CHECK'] != "") {
    $result = group_4_all($protectedPost['CONFIRM_CHECK']);
}
//if delete group
if ($protectedPost['SUP_PROF'] != "") {
    $result = delete_group($protectedPost['SUP_PROF']);
    if ($result['RESULT'] == "ERROR") {
        msg_error($result['LBL']);
    }
    $tab_options['CACHE'] = 'RESET';
}
$form_name = 'groups';
echo open_form($form_name);
//view all groups
if ($_SESSION['OCS']['CONFIGURATION']['GROUPS'] == "YES") {
    $def_onglets['DYNA'] = $l->g(810);
    //Dynamic group
    $def_onglets['STAT'] = $l->g(809);
    //Static group centraux
    if ($_SESSION['OCS']["use_redistribution"] == 1) {
        $def_onglets['SERV'] = mb_strtoupper($l->g(651));
Beispiel #8
0
function delete_torrent($ID, $GroupID=0) {
	global $DB, $Cache, $LoggedUser;
	if(!$GroupID) {
		$DB->query("SELECT GroupID, UserID FROM torrents WHERE ID='$ID'");
		list($GroupID, $UploaderID) = $DB->next_record();
	}
	if(empty($UserID)) {
		$DB->query("SELECT UserID FROM torrents WHERE ID='$ID'");
		list($UserID) = $DB->next_record();
	}

	$RecentUploads = $Cache->get_value('recent_uploads_'.$UserID);
	if(is_array($RecentUploads)) {
		foreach($RecentUploads as $Key => $Recent) {
			if($Recent['ID'] == $GroupID) {
				$Cache->delete_value('recent_uploads_'.$UserID);
			}
		}
	}
	
	
	
	$DB->query("UPDATE torrents SET flags=1 WHERE ID = '$ID'"); // Let xbtt delete the torrent
	$Cache->decrement('stats_torrent_count');

	$DB->query("SELECT COUNT(ID) FROM torrents WHERE GroupID='$GroupID' AND flags <> 1");
	list($Count) = $DB->next_record();

	if($Count == 0) {
		delete_group($GroupID);
	} else {
		update_hash($GroupID);
		//Artists
		$DB->query("SELECT ArtistID
				FROM torrents_artists 
				WHERE GroupID = ".$GroupID);
		$ArtistIDs = $DB->collect('ArtistID');
		foreach($ArtistIDs as $ArtistID) {
			$Cache->delete_value('artist_'.$ArtistID);
		}
	}

	// Torrent notifications
	$DB->query("SELECT UserID FROM users_notify_torrents WHERE TorrentID='$ID'");
	while(list($UserID) = $DB->next_record()) {
		$Cache->delete_value('notifications_new_'.$UserID);
	}
	$DB->query("DELETE FROM users_notify_torrents WHERE TorrentID='$ID'");
	
	$Cache->delete_value('torrent_download_'.$ID);
	$Cache->delete_value('torrent_group_'.$GroupID);
}
Beispiel #9
0
        }
        //$i++;
    }
}
if (isset($_GET['suppr_groupe'])) {
    check_token();
    if (!preg_match('/^[0-9]*$/', $_GET['suppr_groupe'])) {
        $msg .= "Le groupe n°" . $_GET['suppr_groupe'] . " n'existe pas.<br />\n";
    } else {
        if (test_before_group_deletion($_GET['suppr_groupe'])) {
            $sql = "SELECT 1=1 FROM cn_cahier_notes ccn, cn_conteneurs cc, cn_devoirs cd, cn_notes_devoirs cnd WHERE ccn.id_cahier_notes=cc.id_racine AND cc.id=cd.id_conteneur AND cd.id=cnd.id_devoir AND ccn.id_groupe='" . $_GET['suppr_groupe'] . "';";
            $test = mysqli_query($GLOBALS["mysqli"], $sql);
            if (mysqli_num_rows($test) > 0) {
                $msg .= "Le groupe n°" . $_GET['suppr_groupe'] . " ne peut pas être supprimé car des notes de devoirs ont été saisies.<br />\n";
            } else {
                $delete = delete_group($_GET['suppr_groupe']);
                if ($delete) {
                    $msg .= "Le groupe n°" . $_GET['suppr_groupe'] . " a été supprimé.<br />\n";
                } else {
                    $msg .= "Erreur lors de la suppression du groupe n°" . $_GET['suppr_groupe'] . ".<br />\n";
                }
            }
        } else {
            $msg .= "Le groupe n°" . $_GET['suppr_groupe'] . " ne peut pas être supprimé car des bulletins ne sont pas vides.<br />\n";
        }
    }
}
if (isset($_POST['add_groupes_classes'])) {
    check_token();
    $nb_reg = 0;
    $matiere = isset($_POST['matiere']) ? $_POST['matiere'] : array();
Beispiel #10
0
<h2>Group Management</h2> <p> Adding/Modifying and deleting groups ... </p>

<form action="<? print $PHP_SELF; ?>" method="post">

<?
$sessionToken = $_SESSION["token"];

if (($action == 1) && ($sessionToken == $formToken)) {
    $totalUsers = trim ($totalUsers, ",");
    add_new_group($groupname, $totalUsers);
    $sessionToken  = $sessionToken + 1;
    $_SESSION["token"] = $sessionToken;

}
elseif (($action == 2) && ($sessionToken == $formToken)) {
    delete_group($groupname);
    $sessionToken  = $sessionToken + 1;
    $_SESSION["token"] = $sessionToken;

}
elseif (($action == 3) && ($sessionToken == $formToken)) {
    $totalUsers = trim ($totalUsers, ",");
    update_group($groupname, $totalUsers, $id);
    $sessionToken  = $sessionToken + 1;
    $_SESSION["token"] = $sessionToken;

}

?>

<fieldset>
Beispiel #11
0
 check_token();
 $msg = null;
 //if ($_GET['action'] == "delete_group") {
 if ($_GET['action'] == "delete_group" && isset($_GET['confirm_delete_group']) && $_GET['confirm_delete_group'] == "y") {
     if (!is_numeric($_GET['id_groupe'])) {
         $_GET['id_groupe'] = 0;
     }
     $verify = test_before_group_deletion($_GET['id_groupe']);
     if ($verify) {
         //================================
         // MODIF: boireaus
         $sql = "SELECT * FROM groupes WHERE id='" . $_GET['id_groupe'] . "'";
         $req_grp = mysqli_query($GLOBALS["mysqli"], $sql);
         $ligne_grp = mysqli_fetch_object($req_grp);
         //================================
         $delete = delete_group($_GET['id_groupe']);
         if ($delete == true) {
             //================================
             // MODIF: boireaus
             //$msg .= "Le groupe " . $_GET['id_groupe'] . " a été supprimé.";
             //$sql="SELECT * FROM groupes WHERE id='".$_GET['id_groupe']."'";
             //$req_grp=mysql_query($sql);
             //$ligne_grp=mysql_fetch_object($req_grp);
             // Le groupe n'existe déjà plus
             $msg .= "Le groupe {$ligne_grp->name} (" . $_GET['id_groupe'] . ") a été supprimé.";
             //================================
         } else {
             $msg .= "Une erreur a empêché la suppression du groupe.";
         }
     } else {
         $msg .= "Des données existantes bloquent la suppression du groupe. Aucune note ni appréciation du bulletin ne doit avoir été saisie pour les élèves de ce groupe pour permettre la suppression du groupe.";
Beispiel #12
0
            manage_ads();
            break;
        case 'manage_admin_login':
            manage_admin_login();
            break;
        case 'edit_user':
            edit_user();
            break;
        case 'delete_user':
            delete_user();
            break;
        case 'edit_group':
            edit_group();
            break;
        case 'delete_group':
            delete_group();
            break;
        case 'edit_page':
            edit_page();
            break;
        case 'delete_page':
            delete_page();
            break;
    }
    ?>
            </div>
            <div class="float-clear"></div>
            <?php 
}
?>
        </div>
Beispiel #13
0
         } else {
             $uname = "";
         }
         $uexpense = $user_expenses['users'][$memberlist[$i]['user_id']]['groups'][$groupdetails['group_id']]['group_total'];
         $upaid = $user_paid_expenses['users'][$memberlist[$i]['user_id']]['groups'][$groupdetails['group_id']]['group_total'];
         $listarray[$i]['link'] = "http://" . $_SERVER['HTTP_HOST'] . DIR . "profile.php?uid=" . $memberlist[$i][user_id];
         //$listarray[$i]['name'] = $memberlist[$i]['realname'] . $uname;
         $listarray[$i]['name'] = format_name($user, $memberlist[$i]['username'], $memberlist[$i]['realname']);
         $listarray[$i]['balance'] = number_format($upaid - $uexpense, DECIMALS, DSEP, TSEP);
         if ($upaid - $uexpense > 1 || $upaid - $uexpense < -1) {
             $candeletegroup = false;
             $nonzero[] = $listarray[$i]['name'] . " ( " . $listarray[$i]['balance'] . " )";
         }
     }
     if ($candeletegroup) {
         if (delete_group($groupdetails['group_id'])) {
             $delresult = "Group \"" . $groupdetails['name'] . "\" successfully deleted";
         } else {
             $delresult = "Errors occured while trying to delete group \"" . $groupdetails['name'] . "\".";
         }
     }
     break;
 case "showgroup":
     $showgroup = true;
     $ask_add = true;
     $ask_event = true;
     $ask_delmember = true;
     $ask_delgroup = true;
     $show_log = true;
     break;
 case "addmembers":
Beispiel #14
0
 }
 */
 //======================
 if (empty($tab_classe)) {
     $error = true;
     $msg .= "Vous devez sélectionner au moins une classe.<br />\n";
 }
 if (!$error) {
     // pas d'erreur : on continue avec la mise à jour du groupe
     $create = update_group($id_groupe, $reg_nom_groupe, $reg_nom_complet, $reg_matiere, $tab_classe, $tab_professeurs, $tab_eleves);
     if (!$create) {
         $msg .= "Erreur lors de la mise à jour du groupe.";
     } else {
         for ($i = 0; $i < count($tab_grp); $i++) {
             if ($tab_grp[$i] != $id_groupe) {
                 $suppr = delete_group($tab_grp[$i]);
                 /*
                 $sql="DELETE FROM groupes WHERE id='".$tab_grp[$i]."';";
                 //echo "$sql<br />";
                 $suppr=mysql_query($sql);
                 
                 $sql="DELETE FROM j_eleves_groupes WHERE id_groupe='".$tab_grp[$i]."';";
                 //echo "$sql<br />";
                 $suppr=mysql_query($sql);
                 
                 $sql="DELETE FROM j_groupes_classes WHERE id_groupe='".$tab_grp[$i]."';";
                 //echo "$sql<br />";
                 $suppr=mysql_query($sql);
                 
                 $sql="DELETE FROM j_groupes_matieres WHERE id_groupe='".$tab_grp[$i]."';";
                 //echo "$sql<br />";
Beispiel #15
0
<?php

if (!defined("_BASE_URL")) {
    die("Pirate reconnu !");
}
if (!empty($_SESSION['user_ID']) && !empty($_SESSION['team_ID'])) {
    if (!empty($_GET['group_ID']) && !empty($_GET['delete'])) {
        if ($_GET['delete'] == "wait") {
            require_once 'model/user/get-simple-group.php';
            $group = get_simple_group($_GET['group_ID']);
            include_once 'view/group/delete-group.php';
        } else {
            if ($_GET['delete'] == "ok") {
                require_once 'model/user/delete-group.php';
                $group = delete_group($_GET['group_ID']);
                if ($group) {
                    header('Location: ?module=group&notif=deleted');
                } else {
                    header('Location: ?module=group&notif=notdeleted');
                }
            } else {
                header('Location: ?module=group');
            }
        }
    } else {
        header('Location: ?module=group');
    }
} else {
    header('Location: ?module=auth');
}
Beispiel #16
0
    session_start();
}
if (!check_session_user() || !check_admin_user()) {
    header('Location: index.php?error=Invalid User');
} else {
    $op = "";
    if (isset($_POST['op'])) {
        $op = $_POST['op'];
    } elseif (isset($_GET['op'])) {
        $op = $_GET['op'];
    }
    if (strlen($op) > 0) {
        if ($op == "delete") {
            if (isset($_GET['id'])) {
                $name = $_GET['id'];
                $err = delete_group($name);
                if (strlen($err) > 0) {
                    header('Location: error.php?msg=' . urlencode($err));
                } else {
                    header('Location: group_list.php');
                }
            } else {
                header('Location: error.php?msg=No id');
            }
        } elseif ($op == "add") {
            $name = $_POST['name'];
            $desc = $_POST['description'];
            $err = insert_group($name, $desc);
            if (strlen($err) > 0) {
                header('Location: error.php?msg=' . urlencode($err));
            } else {
Beispiel #17
0
	VALUES
	($ArtistID, '1', '1', '$Title', '$Year', '".sqltime()."', '', '', '$SearchText')");
$GroupID = $DB->inserted_id();

$DB->query("INSERT INTO torrents_artists 
	(GroupID, ArtistID, AliasID, Importance, UserID) VALUES 
	('$GroupID', '$ArtistID', '$AliasID', '1', '$LoggedUser[ID]')");

$DB->query("UPDATE torrents SET
	GroupID='$GroupID'
	WHERE ID='$TorrentID'");

// Delete old group if needed
$DB->query("SELECT ID FROM torrents WHERE GroupID='$OldGroupID'");
if($DB->record_count() == 0) {
	delete_group($OldGroupID);
} else {
	update_hash($OldGroupID);
}

update_hash($GroupID);

$Cache->delete_value('torrent_download_'.$TorrentID);
$Cache->delete_value('artist_'.$ArtistID);
$Cache->delete_value('artist_'.$OldArtistID);

write_log("Torrent $TorrentID was edited by " . $LoggedUser['Username']);

header("Location: torrents.php?id=$GroupID");
?>
Beispiel #18
0
            printfooter();
            exit;
        }
    } elseif ($submit == "Modify Group") {
        if ($test = modify_group($db, $groupid, $groupname)) {
            echo "</caption>\n</table>\n";
            echo "<table align='center'><caption>{$test}</caption></table>";
            group_form($groupid, $groupname);
            printfooter();
            exit;
        }
    } elseif ($_POST) {
        while (list($key, $val) = each($_POST)) {
            if (substr($key, 0, 3) == "del") {
                $delarray = explode("_", $key);
                delete_group($db, $delarray[1]);
            }
            if (substr($key, 0, 3) == "mod") {
                $modarray = explode("_", $key);
                echo "</caption>\n</table>\n";
                group_form($modarray[1], get_cell($db, "groups", "name", "id", $modarray[1]));
                printfooter();
                exit;
            }
        }
    }
    echo "</caption>\n";
    // print form needed for 'delete' buttons
    ?>
<form name='form' method='post' action='<?php 
    echo $PHP_SELF;
Beispiel #19
0
		$socialview = true;
		$socialview_param = '&amp;socialview';
	} else {
		$socialview = false;
		$socialview_param = '';
	}
	
	if (isset($_GET['deletecategory'])) {
		$id = $_GET['id'];
		delete_category($id);
		Session::Messages($langGroupCategoryDeleted, 'alert-success');
		redirect_to_home_page("modules/group/index.php");
	}
	elseif (isset($_GET['deletegroup'])) {
			$id = $_GET['id'];
            delete_group($id);
            Session::Messages($langGroupDeleted, 'alert-success');
            redirect_to_home_page("modules/group/index.php");
    }

    if (isset($_GET['group'])) {
		$group_name = $_POST['name'];
		$group_desc = $_POST['description'];
		$v = new Valitron\Validator($_POST);
			$v->rule('required', array('maxStudent'));
			$v->rule('numeric', array('maxStudent'));
			$v->rule('required', array('name'));
        if($v->validate()) {
            if (preg_match('/^[0-9]/', $_POST['maxStudent'])) {
                $group_max = intval($_POST['maxStudent']);
            } else {
Beispiel #20
0
function bpi_route_command($cmd)
{
    print "<p class='gohome'><a href='index.php'>BPI Home</a></p>";
    switch ($cmd) {
        ///////////////////////////ADD GROUP////////////////////////////
        case 'add':
            //and new group form
            //do stuff
            print "<div class='container'>";
            if (isset($_POST['addSubmitted'])) {
                $config = process_post($_POST);
                if (isset($config)) {
                    append_file($config);
                }
                print "<p><a href='index.php?cmd=add'>Add More Groups</a></p>";
            } else {
                empty_form();
            }
            print "</div>\n";
            break;
            ///////////////////////////DELETE GROUP////////////////////////////
        ///////////////////////////DELETE GROUP////////////////////////////
        case 'delete':
            //delete stuff
            if (isset($_GET['arg'])) {
                //add javascript confirmation of group deletion
                $arg = htmlentities(trim($_GET['arg']));
                delete_group($arg);
            } else {
                print "<p class='error'>Error: No BPI Group specifies to delete.</p>";
            }
            break;
            ///////////////////////////EDIT GROUP////////////////////////////
        ///////////////////////////EDIT GROUP////////////////////////////
        case 'edit':
            print "<div class='container'>";
            //edit existing groups
            if (isset($_GET['arg'])) {
                //add javascript confirmation of group deletion
                $arg = htmlentities(trim($_GET['arg']));
                $config = get_config_array($arg);
                if (isset($_POST['editSubmitted'])) {
                    $config = process_post($_POST);
                    //process the form data, make sure it comes back valid
                    if (isset($config)) {
                        edit_group($arg, $config);
                    }
                } else {
                    loaded_form($config);
                }
            } else {
                print "<p class='error'>Error: No BPI Group specifies to delete.</p>";
            }
            print "</div>\n";
            break;
        case 'fixconfig':
            include 'config_functions/fix_config.php';
            break;
        default:
            //default to view page if value is bad
            send_home();
            break;
    }
    //end SWITCH
}
Beispiel #21
0
		else {
			echo "<span style='color:red;'>Erreur</span><br />\n";
		}

		echo "</p>\n";

		echo "<p>Fin de la suppression.</p>\n";

	}
	else {
		$lig_grp=mysqli_fetch_object($res_grp);
		$current_group=get_group($lig_grp->id_groupe);

		echo "<p>Suppression du groupe n°".$current_group['id']." associé à la matière '$matiere': \n";

		if(delete_group($current_group['id'])==true) {
			echo "<span style='color:green;'>OK</span></p>\n";

			echo "<form action=\"".$_SERVER['PHP_SELF']."#suite\" name='suite' method=\"post\">\n";
			echo "<input type=\"hidden\" name=\"matiere\" value=\"$matiere\" />\n";
			echo "<input type=\"hidden\" name=\"confirmation_suppr\" value=\"y\" />\n";

			echo "<script type='text/javascript'>
	setTimeout(\"document.forms['suite'].submit();\", 1000);
</script>\n";

			echo "<noscript>\n";
			echo "<div id='fixe'><input type=\"submit\" name=\"ok\" value=\"Suite du nettoyage\" /></div>\n";
			echo "</noscript>\n";

			echo "</form>\n";
Beispiel #22
0
"><?php 
echo $NewName;
?>
</a></li></ul>
			<input type="submit" value="Confirm" />
		</form>
	</div>
	</div>
<?
	show_footer();
} else {
	$DB->query("UPDATE torrents SET GroupID='$NewGroupID' WHERE GroupID='$GroupID'");
	$DB->query("UPDATE wiki_torrents SET PageID='$NewGroupID' WHERE PageID='$GroupID'");
	$DB->query("UPDATE torrents_comments SET GroupID='$NewGroupID' WHERE GroupID='$GroupID'");
	
	delete_group($GroupID);
	
	$GroupID=$NewGroupID;
	
	//Collages
	$DB->query("SELECT CollageID FROM collages_torrents WHERE GroupID='$OldGroupID'"); //Select all collages that contain edited group
	while(list($CollageID) = $DB->next_record()) {
		$DB->query("UPDATE IGNORE collages_torrents SET GroupID='$NewGroupID' WHERE GroupID='$OldGroupID' AND CollageID='$CollageID'"); //Change collage groupid to new ID
		$DB->query("DELETE FROM collages_torrents WHERE GroupID='$OldGroupID' AND CollageID='$CollageID'");
		$Cache->delete_value('collage_'.$CollageID);
	}
	
	
	$DB->query("SELECT ID FROM torrents WHERE GroupID='$OldGroupID'");
	while(list($TorrentID) = $DB->next_record()) {
		$Cache->delete_value('torrent_download_'.$TorrentID);
Beispiel #23
0
*/
try {
    switch ($_POST['act']) {
        case 'newGroup':
            $result['gid'] = add_group($_POST['tokens'], (int) $_POST['type']);
            break;
        case 'copyGroup':
            $old_groups = get_groups_by_sentence((int) $_POST['sentence_id'], (int) $_SESSION['user_id']);
            $new_group_id = copy_group((int) $_POST['gid'], (int) $_SESSION['user_id']);
            $new_groups = get_groups_by_sentence((int) $_POST['sentence_id'], (int) $_SESSION['user_id']);
            $result['new_groups'] = array();
            $result['new_groups']['simple'] = arr_diff($new_groups['simple'], $old_groups['simple']);
            $result['new_groups']['complex'] = arr_diff($new_groups['complex'], $old_groups['complex']);
            break;
        case 'deleteGroup':
            delete_group($_POST['gid']);
            break;
        case 'setGroupHead':
            set_group_head($_POST['gid'], $_POST['head_id']);
            break;
        case 'setGroupType':
            set_group_type($_POST['gid'], $_POST['type']);
            break;
        case 'getGroupsTable':
            // Решил это вынести в аякс, потому что перерисовывать такую
            // табличку на клиенте - сложно, не используя шаблонизатор.
            // TODO: проверка, свое ли спрашивает пользователь
            require_once 'Smarty.class.php';
            $smarty = new Smarty();
            $smarty->template_dir = $config['smarty']['template_dir'];
            $smarty->compile_dir = $config['smarty']['compile_dir'];