Added rudimentary transport support to get_threaded_children
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / eventz / configure_node_name.inc
1 <?php
2 function configure_node_name() {
3 global $db,$error,$node;
4 $node_id=$node['node_id'];
5 $user_id=$_SESSION['user_id'];
6
7 if (($node['node_permission']=='owner') || ($node['node_permission']=='master')) {
8 $node_name = mysql_real_escape_string($_POST['node_name']);
9 $test=$node_name.'[Locked_OUT]';
10
11 if(!empty($node_id)) {
12 if($node_id == $user_id) {
13 $node_name=strip_tags($node_name);
14
15 //$validation = strpos($node_name, "'");
16 //if ($validation) {$error="Nepouzivaj ten otrasny znak '. co si myslis ze ludi to bude bavit pisat ti takto postu?";return false;}
17
18 $node_name=strtr($node_name, "öûõü³¿ñæê\9càáäåèéìíïòóôøùú\9a\9d\9e¾ýÀÁÄÅÈÉÌÍÏÒÓÔØÙÚ\8a\8d\8e¼ÝÄ","ououlzncesraalceeidnooruustzlyRAALCEEIDNOORUUSTZLYA"); //prec z diakritikou. ldap ju nezere
19
20 if (strpos($node_name,'[Locked_OUT]')!=NULL){$error='Nemozes pouzit dany suffix';return false;}
21 $set=$db->query("select * from users where login='$node_name'");
22 if($set->getNumRows()>0) {
23 $error="user $node_name is already here";
24 return false;
25 }else{
26 $q="update users set login='$node_name' where user_id='$node_id'";
27 $db->query($q);
28 $_SESSION['user_name']=$node_name;}
29 }
30 $q="update nodes set node_name='$node_name' where node_id='$node_id'";
31 $db->query($q);
32 }
33 }else{
34 $error=$error_messages['EVENT_PERMISSION_ERROR'];
35 return false;
36 }
37 return true;
38 }
39 ?>
This page took 0.505947 seconds and 4 git commands to generate.