Location: PHPKode > projects > WorkOrder TS > workorder-ts/include/workorder_function_isuserauthenticated.inc.php
<?PHP function _L00CR($SSID=NULL,$inc_dir,$_JC60Q=Null,$CONF) { require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';$_jjQIo=NULL;$IsCustomerLogin=Null;$_IlJtQ=Null;$SSID=mysql_real_escape_string($SSID);$_JofOj=explode("/",$_JC60Q);$_JofCJ=count($_JofOj);$_Jo8LC=false;for ( $x=0;$_JofCJ > $x AND $_Jo8LC==false;$x++) { $_JotIL="pro";if ( $_JofOj[$x]==$_JotIL AND $_Jo8LC==false ) { for ( $_IljlI=0;($_JofCJ-3) !=$_IljlI;$_IljlI++) { if ( $_JofOj[$_IljlI] !="" ) { $_Jo8J0=$_Jo8J0.'/'.$_JofOj[$_IljlI];$_Jo8LC=true;} } } } if ( empty($_Jo8J0)==false ) { $_JC60Q=$_Jo8J0.'/';} if( empty($SSID)==FALSE ) { $sql="select * from ".$CONF['TableNameUsersLogin']." where Login_ssid = '$SSID'";$res=mysql_query($sql,$conn) or die("Unable to validate User Error 1231dsf<Br>$sql");$_jjQIo=mysql_num_rows($res);} if( empty($SSID)==FALSE && $_jjQIo !=1 ) { if( $_jjQIo !=1 ) { $sql="select * from ".$CONF['TableNameCustomersLogin']." where Login_ssid = '$SSID'";$res=mysql_query($sql,$conn) or die("Unable to validate Customer Error 1231dsf<Br>$sql");$_jjQIo=mysql_num_rows($res);if( $_jjQIo==1 ) { $IsCustomerLogin=1;} } }elseif( empty($SSID)==FALSE ) if( $_jjQIo !=1 ) { $_jJjo6=$_SERVER['SCRIPT_FILENAME'];$_jJIIo=$_SERVER['PHP_SELF'];$_jJJJL=str_replace($_jJjo6,"",$_jJIIo);die("Please report this message to WorkOrder TS support ..... use from login.php ".$_SERVER['PHP_SELF']);if( ereg("include/pro",$_SERVER['PHP_SELF'] )==False ) { $_Ilo8J='./'.$_SERVER['SCRIPT_NAME'];} elseif( ereg("/cg1/mirko/",$_SERVER['PHP_SELF'] )==True ) { $_Ilo8J='../../'.$_SERVER['SCRIPT_NAME'];} else { $_Ilo8J='../../'.$_SERVER['SCRIPT_NAME'];} $_IlC1t=$_SERVER['QUERY_STRING'];$TargetQueryPass=str_replace('&','--',$_IlC1t);die('   <html>    <head>    <meta http-equiv="refresh" content="1; url='.$_JC60Q.'login.php?TargetURLPass='.$_Ilo8J.'&TargetQueryPass='.$TargetQueryPass.'">     </head>     <body>    Login Error    </body>    </html>');} $row=@mysql_fetch_array($res);$_jjlJl=$row['Login_time'];$_jjoOJ=strtotime($_jjlJl);$_jjQij=$CONF['AuthenticationTimeoutMin'];$_jjICL=strtotime("-$_jjQij minutes");$_jJ0fL=$_jjoOJ-$_jjICL;if( $_jJ0fL >=0 ) { $_JC6j0=$_SERVER['REMOTE_ADDR'];$_JCfIi=$row['Login_ip'];$_JCfo6=explode('-',$_JCfIi);$_JC8OC=count($_JCfo6);for ( $x=0;$x <=$_JC8OC;$x++) { $_JCt1j=$_JCfo6[$x];if( $_JC6j0==$_JCt1j ) { require $inc_dir.'config-user.inc.php';require $inc_dir.'conn-string-user.inc.php';$_JCtIf=time();$_JCto1=date("Y-m-d H:i:s",$_JCtIf);if( $IsCustomerLogin !=1 ) { $sql="update ".$CONF['TableNameUsersLogin']." set Login_time='$_JCto1' where Login_ssid='$SSID'";} else { $sql="update ".$CONF['TableNameCustomersLogin']." set Login_time='$_JCto1' where Login_ssid='$SSID'";} $res=mysql_query($sql,$conn) or die("Failed to refresh user timeout: 32fdg4e<br>$sql");return "OK";} } $_IlJtQ='FAILED';} if( $_jJ0fL < 0 ) { $_IlJtQ='FAILED';} if( $_IlJtQ=='FAILED' ) { if( file_exists('SkipLogin')==true ) { return 'OK';} else { return 'FAILED';} } } function _L01LO($SSID,$inc_dir,$_JCtCC,$CONF) { require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';$sql="select ".$CONF['TableNameUsers'].".User_rights,".$CONF['TableNameUsersLogin'].".Login_ssid    from ".$CONF['TableNameUsers'].",".$CONF['TableNameUsersLogin']." WHERE ".$CONF['TableNameUsers'].".User_ID = ".$CONF['TableNameUsersLogin'].".Login_USER_ID AND ".$CONF['TableNameUsersLogin'].".Login_ssid='$SSID'";$res=mysql_query($sql,$conn) or die("Unable to validate User Error 123dg1dsf<Br>$sql");$row=mysql_fetch_array($res);$_jJO6Q=stripslashes($row['User_rights']);$_JCOOO=explode('-',$_jJO6Q);if( isset($_JCOOO[$_JCtCC])==False ) { $_JCOOO[$_JCtCC]=0;} if ( $_JCOOO[$_JCtCC]==1 ) { return True;} else { return False;} } function _L01CF( $inc_dir,$CONF,$_JCoti ) { $_JCC0Q=False;include $inc_dir.'config-guest.inc.php';include $inc_dir.'conn-string-guest.inc.php';$sql="SELECT DISTINCT Login_USER_ID FROM {$CONF['TableNameUsersLogin']}";$res=mysql_query($sql);$_JCCL1=mysql_num_rows($res);if( $_JCoti >=$_JCCL1 ) { return True;} else { return False;} } function _L0Q1E( $inc_dir,$CONF ) { $_IlJtQ='<ul>';include $inc_dir.'config-guest.inc.php';include $inc_dir.'conn-string-guest.inc.php';$sql="SELECT User_name,Login_ip, Login_time FROM {$CONF['TableNameUsersLogin']},{$CONF['TableNameUsers']} WHERE User_ID = Login_USER_ID";$res=mysql_query($sql);while( $row=mysql_fetch_array($res) ) { $_IlJtQ.="<li>User {$row['User_name']} was last active at {$row['Login_time']} from IP {$row['Login_ip']} </li>";} $_IlJtQ.='</ul>';return $_IlJtQ;} function _L0O0D($inc_dir,$SSID,$CONF) { require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';$_jtCt0=0;$sql="select Login_CUST_ID from ".$CONF['TableNameCustomersLogin']." where Login_ssid = '$SSID'";$res=mysql_query($sql,$conn) or die("Unable to validate Customer Error 1231dsvd<Br>$sql");$_jjQIo=mysql_num_rows($res);$row=mysql_fetch_array($res);$_jtCt0=$row['Login_CUST_ID'];return $_jtCt0;} function _L0OPO($inc_dir,$SSID,$CONF) { require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';$sql="select * from ".$CONF['TableNameCustomersLogin']." where Login_ssid = '$SSID'";$res=mysql_query($sql,$conn) or die("Unable to validate Customer Error 1231dsvc<Br>$sql");$_jjQIo=mysql_num_rows($res);if( $_jjQIo >=1 ) { return True;} return False;} function _L0OEF($inc_dir,$_jtCt0,$TicketID,$CONF) { require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';$_JCijC=Null;$sql="select Customer_ID from ".$CONF['TableNameTicket']." where ID = '$TicketID'";$res=mysql_query($sql,$conn) or die("Unable to validate Customer Ticket Ownership Error 1sxfr<Br>$sql");$row=mysql_fetch_array($res);$_JCijC=$row['Customer_ID'];if( $_JCijC==$_jtCt0 && $_JCijC !=Null ) { return True;} return False;} ?>
Return current item: WorkOrder TS