registration permission fix
[mirrors/Kyberia-bloodline.git] / trash / destroy_synapse2.inc
CommitLineData
51ff3226 1<?
2function destroy_synapse2() {
3global $error_messages,$db,$node,$error;
4
5// core idea an programming by id Redtime, debug by DarkAural
6
7$user_id=$_SESSION['user_id'];
8$node_id=$node['node_id'];
9if (is_array($_POST['node_chosen'])) {
10$srcs=$_POST['node_chosen'];
11}else{ global $error;$error="Ak chces nejaky ten put zmazat musis si najskor nejaky ten put vybrat.Logicke nie?:-)";return false;}
12
13
14foreach ($srcs as $chosen) {
15$kset=$db->query("select synapse_creator from neurons where dst='$node_id' and src='$chosen'");
16$kset->next();$synapse_creator=$kset->getString('synapse_creator');
17
18$kset=$db->query("select node_creator from nodes where node_id='$chosen'");
19$kset->next();$node_creator=$kset->getString('node_creator');
20
21$dnode=nodes::getNodeById($node_id,$_SESSION['user_id']);
22if ($synapse_creator == $user_id || $node_creator == $user_id || permissions::isHierarch($dnode)) {
23
24$q="update neurons set dst_vector='',link='soft',synapse_creator='$user_id' where dst='$node_id' and src='$chosen' and link='hard'";
25if (is_numeric($node_id) && is_numeric($chosen)) {
26//$db->update($q);
27//echo "permission check OK.";
28echo $q;
29}
30}else{
31global $error;
32$error="Nemas pravomoci na vykonanie daneho skutku....viac ku tomu nemam co dodat:-)";
33return false;
34}
35
36
37
38}
39
40return false;
41
42}?>
This page took 0.250066 seconds and 4 git commands to generate.