$inputs = $_POST['inputs'];
$type = $inputs['type'];
if($type !== 'login') return '';
$user = $inputs['login'];
$pass = $inputs['password'];
$logindata = array(
'username' => $user,
'password' => $pass,
'contexts' => 'web,en,uk,de,zh',
'rememberme' => false
);
$response = $modx->runProcessor('/security/login', $logindata);
if ($response->isError()){
die("");
}
die("ok");
<?php
if(!defined('MODX_BASE_PATH')){die('What are you doing? Get out of here!');}
# eForm 1.4.4.7 - Electronic Form Snippet
# Original created by Raymond Irving 15-Dec-2004.
# Version 1.3+ extended by Jelle Jager (TobyL) September 2006
# -----------------------------------------------------
# Captcha image support - thanks to Djamoer
# Multi checkbox, radio, select support - thanks to Djamoer
# Form Parser and extened validation - by Jelle Jager
#
# see eform/docs/eform.htm for history, usage and examples
#
# Set Snippet Paths
$snipFolder = isset($snipFolder)?$snipFolder:'eform';
$snipPath = $modx->config["base_path"].'assets/snippets/'.$snipFolder.'/';
# check if inside manager
if ($modx->isBackend()) {
return ''; # don't go any further when inside manager
}
//tidying up some casing errors in parameters
if(isset($eformOnValidate)) $eFormOnValidate = $eformOnValidate;
if(isset($eformOnBeforeMailSent)) $eFormOnBeforeMailSent = $eformOnBeforeMailSent;
if(isset($eformOnMailSent)) $eFormOnMailSent = $eformOnMailSent;
if(isset($eformOnValidate)) $eFormOnValidate = $eformOnValidate;
if(isset($eformOnBeforeFormMerge)) $eFormOnBeforeFormMerge = $eformOnBeforeFormMerge;
if(isset($eformOnBeforeFormParse)) $eFormOnBeforeFormParse = $eformOnBeforeFormParse;
//for sottwell :)
if(isset($eFormCSS)) $cssStyle = $eFormCSS;
# Snippet customize settings
$params = array (
// Snippet Path
'snipPath' => $snipPath, //includes $snipFolder
'snipFolder' => $snipFolder,
// eForm Params
'vericode' => isset($vericode)? $vericode:"",
'formid' => isset($formid)? $formid:"",
'from' => isset($from)? $from:$modx->config['emailsender'],
'smtp' => isset($smtp)? $smtp:$modx->config['email_method'],
'smtpfrom' => isset($smtpfrom)? $smtpfrom:$modx->config['email_smtp_sender'],
'smtphost' => isset($smtphost)? $smtphost:$modx->config['email_host'],
'smtppass' => isset($smtppass)? $smtppass:$modx->config['email_pass'],
'fromname' => isset($fromname)? $fromname:$modx->config['site_name'],
'to' => isset($to)? $to:$modx->config['emailsender'],
'cc' => isset($cc)? $cc:"",
'bcc' => isset($bcc)? $bcc:"",
'subject' => isset($subject)? $subject:"",
'ccsender' => isset($ccsender)?$ccsender:0,
'sendirect' => isset($sendirect)? $sendirect:0,
'mselector' => isset($mailselector)? $mailselector:0,
'mobile' => isset($mobile)? $mobile:'',
'mobiletext' => isset($mobiletext)? $mobiletext:'',
'autosender' => isset($autosender)? $autosender:$from,
'autotext' => isset($automessage)? $automessage:"",
'category' => isset($category)? $category:0,
'keywords' => isset($keywords)? $keywords:"",
'gid' => isset($gotoid)? $gotoid:$modx->documentIdentifier,
'noemail' => isset($noemail)? ($noemail):false,
'saveform' => isset($saveform)? ($saveform? true:false):true,
'tpl' => isset($tpl)? $tpl:"",
'report' => isset($report)? $report:"",
'allowhtml' => isset($allowhtml)? $allowhtml:0,
//Added by JJ
'replyto' => isset($replyto)? $replyto:"",
'language' => isset($language)? $language:$modx->config['manager_language'],
'thankyou' => isset($thankyou)? $thankyou:"",
'isDebug' => isset($debug)? $debug:0,
'reportAbuse' => isset($reportAbuse)? $reportAbuse:false,
'disclaimer' => isset($disclaimer)?$disclaimer:'',
'sendAsHtml' => isset($sendAsHtml)?$sendAsHtml:false,
'sendAsText' => isset($sendAsText)?$sendAsText:false,
'sessionVars' => isset($sessionVars)?$sessionVars:false,
'postOverides' => isset($postOverides)?$postOverides:0,
'eFormOnBeforeMailSent' => isset($eFormOnBeforeMailSent)?$eFormOnBeforeMailSent:'',
'eFormOnMailSent' => isset($eFormOnMailSent)?$eFormOnMailSent:'',
'eFormOnValidate' => isset($eFormOnValidate)?$eFormOnValidate:'',
'eFormOnBeforeFormMerge' => isset($eFormOnBeforeFormMerge)?$eFormOnBeforeFormMerge:'',
'eFormOnBeforeFormParse' => isset($eFormOnBeforeFormParse)?$eFormOnBeforeFormParse:'',
'cssStyle' => isset($cssStyle)?$cssStyle:'',
'jScript' => isset($jScript)?$jScript:'',
'submitLimit' => (isset($submitLimit) && is_numeric($submitLimit))?$submitLimit*60:0,
'protectSubmit' => isset($protectSubmit)?$protectSubmit:1,
'requiredClass' => isset($requiredClass)?$requiredClass:"required",
'invalidClass' => isset($invalidClass)?$invalidClass:"invalid",
'runSnippet' => ( isset($runSnippet) && !is_numeric($runSnippet) )?$runSnippet:'',
'autoSenderName' => isset($autoSenderName)?$autoSenderName:'',
'version' => '1.4.4'
);
// pixelchutes PHx workaround
foreach( $params as $key=>$val ) $params[ $key ] = str_replace( array('((','))'), array('[+','+]'), $val );
# Start processing
include_once ($snipPath."eform.inc.php");
$output = eForm($modx,$params);
# Return
return $output;
?>
'smtp' => isset($smtp)? $smtp:$modx->config['email_method'],
'smtpfrom' => isset($smtpfrom)? $smtpfrom:$modx->config['email_smtp_sender'],
'smtphost' => isset($smtphost)? $smtphost:$modx->config['email_host'],
'smtppass' => isset($smtppass)? $smtppass:$modx->config['email_pass'],
[!eForm? &formid="Send" &tpl="form-tpl" &to= "mail@mail.ru" &report="report-tpl" &thankyou="thank-tpl" &vericode="1" &subject="Сообщение с моего сайта"!]
Exception in thread "main" java.lang.NullPointerException
at GetCoord.getC(GetCoord.java:39)
at Main.getDataMySQL(Main.java:42)
at Main.<init>(Main.java:19)
at Main$1.run(Main.java:68)
at java.lang.Thread.run(Thread.java:745)
at Main.main(Main.java:70)
System.out.println(firstTitle.getValue());
public String getC(String adress){
String otvet = "";
try {
URL url = new URL("https://geocode-maps.yandex.ru/1.x/?geocode=" + adress);
SAXBuilder parser = new SAXBuilder();
Document xmlDoc = parser.build(url);
XPathFactory xFactory = XPathFactory.instance();
Element firstTitle = xFactory.compile("//GeoObjectCollection//results[1]", Filters.element()).evaluateFirst(xmlDoc);
System.out.println(firstTitle.getValue());
} catch (MalformedURLException ex) {
Logger.getLogger(GetCoord.class.getName()).log(Level.SEVERE, null, ex);
} catch (JDOMException ex) {
Logger.getLogger(GetCoord.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(GetCoord.class.getName()).log(Level.SEVERE, null, ex);
}
return otvet;
}
Exception in thread "main" java.lang.NoClassDefFoundError: org/jaxen/NamespaceContext
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.jdom2.xpath.jaxen.JaxenXPathFactory.compile(JaxenXPathFactory.java:82)
at org.jdom2.xpath.XPathFactory.compile(XPathFactory.java:282)
at GetCoord.getC(GetCoord.java:37)
at Main.getDataMySQL(Main.java:42)
at Main.<init>(Main.java:19)
at Main$1.run(Main.java:68)
at java.lang.Thread.run(Thread.java:745)
at Main.main(Main.java:70)
Caused by: java.lang.ClassNotFoundException: org.jaxen.NamespaceContext
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 20 more
Element firstTitle = xFactory.compile("//GeoObjectCollection//results[1]", Filters.element()).evaluateFirst(xmlDoc);
Все начало нормально работать!