403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.217.154
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /inetpub/wwwroot/icd/msc/sources/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /inetpub/wwwroot/icd/msc/sources/applyonline.php
<?php
	include_once 'lib/lib.php';
	//require_once('lib/recaptchalib.php');
	//require_once('sources/formautomation.php');

	require_once 'swiftmailer/lib/swift_required.php';

	function sendSmtpMail($emailSubject, $emailBody, $recipient){		
		//$notify["apostolos.georgiadis@gmail.com"] = "Apostolos Georgiadis";
		$notify["anpol@ihu.gr"] = "Anastasios Politis";

		//$notify["defstat@ihu.gr"] = "Dimitris Efstathiou";
		//$notify["evi@ihu.gr"] = "MSc Secretary";

		$eml = Swift_Message::newInstance()
  			->setSubject($emailSubject)
		  	->setFrom(array('msc.informatics.teicm.gr@gmail.com' => 'Telecoms MSc International Hellenic University'))
		  	//->setReplyTo(array($ReplyEmail => $ReplayName))
  			->setTo($recipient)
			->setBcc($notify)
  			->setBody($emailBody)
  			->addPart($emailBody, 'text/html');
  			// Optionally add any attachments
  			//->attach(Swift_Attachment::fromPath('my-document.pdf'));

		$gmail_smtp = "smtp.gmail.com";

		$transport = Swift_SmtpTransport::newInstance($gmail_smtp, 465, 'ssl')
			->setUsername("msc.informatics.teicm.gr@gmail.com")
  			->setPassword("zzni fozw cujq apea")
			->setTimeout(10);
			->setAuthMode("Login");


		// Create the Mailer using your created Transport
		$mailer = Swift_Mailer::newInstance($transport);


		try{
			$numSent = $mailer->send($eml);
		}catch(Exception $ex){
			$numSent = 0;
			//echo 'Caught exception: ',  $ex->getMessage(), "\n";
			//echo "Warning: Could not send notification email\n";
		}
		//var_dump($transport);
		//var_dump($mailer);
		//var_dump($numSent);


		$emailRes = ($numSent > 0);
		return $emailRes;
	}


	function application_save($fields, &$lastid){
		$remoteip = $_SERVER['REMOTE_ADDR'];
		$remoteaddress = gethostbyname($remoteip);
		$submittedon = Utils::dateStr();

		$query = "INSERT INTO `msc_Applications` (`RemoteIP`, `RemoteAddress`, `SubmittedOn`, `docType`, `docSubject`, `docSender`, `docRecipient`, `docComments`, ";
		$query .= $fields->getSQLNamesList();
		$query .= ") VALUES (";

		$query .= DBUtils::getSQLString($remoteip);
		$query .= "," . DBUtils::getSQLString($remoteaddress);
		$query .= ",'{$submittedon}'";
		$query .= ", 0";
		$query .= ", ''";
		$query .= ", ''";
		$query .= ", ''";
		$query .= ", ''";
		$query .= ", ";

		$query .= $fields->getSQLValuesList();

		$query .= ")";

		//var_dump($query);
		return DBUtils::execute_query_auto($query,  $lastid);
}

	function showInvalidField(){
		echo " <span style=\"color: #DF4000\">*</span>";
	}

	$mCtrl = new Controller("applyonline", "@[PAGE_TITLE]");
	//$mCtrl->addToHead("");

	//$mCtrl->addSideBarBlock("δοκιμή", "δοκιμή", 300);

	include_once 'sources/applyonline_fields.php';

	//var_dump($_POST);
	$clearPressed = key_exists("butClear", $_POST);
	$recoverPressed = key_exists("butRecover", $_POST);
	$buttonPressed = key_exists("butSubmit", $_POST);

	if ($clearPressed){
		$fields->clearSession("application");
	}

	if ($buttonPressed){
		$fields->getValues();
		$fields->saveToSession("application");
		$fields->saveToSession("application_backup");
	}elseif ($recoverPressed){
		$fields->loadFromSession("application_backup");
	}else{
		$fields->loadFromSession("application");
	}

	$showError = FALSE;

	if ($buttonPressed){
		$fields->checkValidity();
		$showError = ($fields->numOfInvalid > 0);
	}	
	
	# was there a reCAPTCHA response?
	if ($fields->isValid("Surname") && $fields->isValid("Email")){ // && $fields->isValid("ShortResume")){		
		if (key_exists("g-recaptcha-response", $_POST)){
			if ($_POST["g-recaptcha-response"]) {
			}else{
				$showError = "Δεν συμπληρώσατε το πεδίο ασφαλείας";
			}
		}else{
			$showError = "Δεν συμπληρώσατε το πεδίο ασφαλείας";
		}
	}

	
	if ($showError){
		$errMsg = "";
		if ($fields->numOfInvalid > 1){
			$errMsg = $mCtrl->str("WARNING_MULTIPLE_ERRORS");
			$errMsg = str_replace("@{NumOfErrors}", $fields->numOfInvalid, $errMsg);
		}else if ($fields->numOfInvalid == 1){
			$errMsg = $mCtrl->str("WARNING_SINGLE_ERROR");
			$fldLabel = $fields->invalidsArray[0]->getLabel($mCtrl);
			$errMsg = str_replace("@{ErrorField}", $fldLabel, $errMsg);
		}else{
			$errMsg = $showError;
		}
		$mCtrl->setFlashWarning($errMsg);
	}


	/*
	$cs = $fields->getSQLCreateTable("msc_Applications");
	Utils::prline("<pre>");
	Utils::prline($cs);
	Utils::prline("</pre>");
	 */

	//var_dump($_POST);

	//$fields->printAll();

	//$mCtrl->addSideBarBlock("δοκιμή", "δοκιμή", 300);

	# the response from reCAPTCHA
	$resp = null;
	# the error code from reCAPTCHA, if any
	$error = null;

	# was there a reCAPTCHA response?
	$captchaOK = FALSE;
	if (!$showError){
		if (key_exists("g-recaptcha-response", $_POST)){
			$g_recaptcha_response = $_POST["g-recaptcha-response"];
			if ($g_recaptcha_response) {
					$captcha_result =  Utils::checkRecaptchaResponse($g_recaptcha_response);
					
			        if ($captcha_result) {
			                //echo "You got it!";
							$captchaOK = TRUE;
			        } else {
			                # set the error code so that we can display it
			                $error = $resp->error;
							$errMsg = $mCtrl->str("ERROR_SECURITYCODE_WRONG");
							$mCtrl->setFlashWarning($errMsg);
			        }
			}else{
				$errMsg = $mCtrl->str("ERROR_SECURITYCODE_EMPTY");
				$mCtrl->setFlashWarning($errMsg);
			}
		}
	}
	$captchaOK = TRUE;

	$mCtrl->printHeaders();
	$mCtrl->clearFlashWarning();

	//var_dump($buttonPressed);
	//var_dump($captchaOK);
	//var_dump($showError);

	if ($buttonPressed && $captchaOK && !$showError){

	/*
		echo "<pre>";
		//var_dump($EmailAdmin);
		var_dump($Subject);
		var_dump($Body);
		var_dump($Headers);
		echo "</pre>";
	 */

	 $ApplicationID = -1;
	 $res = application_save($fields, $ApplicationID);
	 if ($res === TRUE){

		$emailSender = "ICD MSc Webmaster <tolis@agvm.org>";
		$emailRecipientAddress = $fields->fieldsHash["Email"]->Value;
		$emailRecipient = $fields->fieldsHash["Surname"]->Value . " " . $fields->fieldsHash["Forname"]->Value . " <" . $emailRecipientAddress . ">";

		$emailSubject = $mCtrl->str("CONFIRMATION_EMAIL_SUBJECT");
		$emailBody = $mCtrl->str("CONFIRMATION_EMAIL_BODY");
		$emailBody = str_replace(array("@{ApplicationID}", "@{Email}", "@{Surname}", "@{Forname}"), array($ApplicationID, $emailRecipientAddress, $fields->fieldsHash["Surname"]->Value, $fields->fieldsHash["Forname"]->Value), $emailBody);

		$recipient = array($emailRecipientAddress => $fields->fieldsHash["Surname"]->Value . " " . $fields->fieldsHash["Forname"]->Value);

		$tries = 0;
		$emailRes = 0;
		
		while ( ($emailRes == 0) &&  ($tries < 10) ){
			$emailRes = sendSmtpMail($emailSubject, $emailBody, $recipient);
			if ($emailRes == 0){
				sleep(1);
			}
		}

		if ($emailRes == 0){
			echo "Warning: Could not send notification email\n";
		}
		
		//var_dump($emailRes);

		$fields->clearSession("application");
	 	$succMsg = $mCtrl->str("SUCCESS_MESSAGE");
		$succMsg = str_replace(array("@{ApplicationID}", "@{Email}", "@{Surname}", "@{Forname}"), array($ApplicationID, $emailRecipientAddress, $fields->fieldsHash["Surname"]->Value, $fields->fieldsHash["Forname"]->Value), $succMsg);
	 	echo "<p><div style=\"\">{$succMsg}</div></p>";
	 }else{
	 	echo("<p><div class=textb>ERROR submitting the online application</div></p>");
	 }


		/*
      if (Utils::UTF8_mail($EmailFrom, $myemail, $Subject, $Body)) {
        //mail($myemail2, $Subject, $Body, $Headers);
        //mail($myemail3, $Subject, $Body, $Headers);




      } else {

      }
		 * */

	}else{
		//Render main content
		$mCtrl->includeSource();
		//echo "this feature will be available soon";
	}
	$mCtrl->Close();
?>

Youez - 2016 - github.com/yon3zu
LinuXploit