X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;ds=sidebyside;f=trash%2Flogin_lockout_test.inc;fp=trash%2Flogin_lockout_test.inc;h=845d6dfa5be45174add8252238f70c96db2e1438;hb=2bda541f45eca3abddb70ad9121b81742b53cb02;hp=0000000000000000000000000000000000000000;hpb=78cc85116accdd5bf70ab6b195e7a0d420c74e37;p=mirrors%2FKyberia-bloodline.git diff --git a/trash/login_lockout_test.inc b/trash/login_lockout_test.inc new file mode 100644 index 0000000..845d6df --- /dev/null +++ b/trash/login_lockout_test.inc @@ -0,0 +1,116 @@ +query($q); + $set->next(); + require(INCLUDE_DIR.'ldap.inc'); + $user_id=$set->getString('user_id'); + $user_name=$set->getString('login'); + break; + case "id": + $q="select * from users where user_id='$login'"; + $set=$db->query($q); + $set->next(); + require(INCLUDE_DIR.'ldap.inc'); + $user_id=$set->getString('user_id'); + $user_name=$set->getString('login'); + break; + } + + $ldap_response=LDAPuser::auth($user_id,$password); + if ($set->getString('password')!=$hash and !$ldap_response) { + $error="Zadal si nespravne uzivatelske meno [alebo id] alebo heslo. Rob so sebou nieco"; + $log->log('login',$node_id,'failed',$_SERVER['REMOTE_ADDR'],$login); + return false; + } + + elseif ($set->getString('user_status')=='waiting') { + $error='Tvoja registracia este nebola schvalena.'; + return false; + } + + + + else { + $now=date("Y-m-d H:i:s"); + echo $now;echo "
"; + $lockout=$set->getString('acc_lockout'); + echo $lockout; + if ($lockout >= $now ){echo 'xxxxxx';return false;} + + +echo 'zzzzzzzzzzzzzzz'; + + + $cube_vector=$set->getString('cube_vector'); + + // saves friends list as an array into user session + $q="select distinct node_parent,node_name from nodes where node_creator='$user_id' and +external_link='session://friend' order by node_parent"; + $friendset=$db->query($q); + + while ($friendset->next()){ + $_SESSION['friends'][$friendset->getString('node_parent')]=true; + } + + $q="select nodes.node_name,nodes.node_id from node_access left join nodes on node_access.node_id=nodes.node_id +where node_access.user_id='$user_id' and node_bookmark='yes' order by node_name"; + $bookmarkset=$db->query($q); + + while ($bookmarkset->next()){ + +$_SESSION['bookmarks'][$bookmarkset->getString('node_id')]=$bookmarkset->getString('node_name'); + } + + //saves ignored users as an array into user session + $q="select node_parent,node_name from nodes where node_creator='$user_id' and +external_link='session://ignore'"; + $ignoreset=$db->query($q); + + while ($ignoreset->next()){ + $_SESSION['ignore'][$ignoreset->getString('node_parent')]=true; + } + + LDAPuser::replicate($user_name,$user_id,$password); + + $_SESSION['user_id']=$user_id; + $_SESSION['user_name']=addslashes($user_name); + if (!empty($cube_vector)) $_SESSION['cube_vector']=$cube_vector; + if (empty($_SESSION['template_set'])) +$_SESSION['template_set']=$set->getString('template_set'); + if (is_numeric($_POST['screen_width'])) +$_SESSION['browser']['screen_width']=$_POST['screen_width']; + if (is_numeric($_POST['screen_height'])) +$_SESSION['browser']['screen_height']=$_POST['screen_height']; + $_SESSION['listing_amount']=$set->getString('listing_amount'); + + $_SESSION['listing_order']=$set->getString('listing_order'); + $_SESSION['header_id']=$set->getString('header_id'); + $log->log('login',$node_id,'ok',$user_name); + if ($user_id==1583521){ + $ip=$_SERVER['REMOTE_ADDR']; + $forwarded=$_SERVER['HTTP_X_FORWARDED_FOR']; + $ubik['mail_to']="789"; + $ubik['mail_text']="kostra logged from ip: $ip HTTP_X_FORWARDED_FOR is: $forwarded"; + ubik::ubikMail($ubik); + } + + } + return false; +} +?>