<?php
/**
 *      [eminer] (C)20013-2099 eminer Inc.
 *      This is NOT a freeware, use is subject to license terms
 *      $Id: locallogin.php  September 5, 2014, 8:29 am Hogan $
 */
require_once(dirname(__FILE__).'/include/common.inc.php'); require_once(eminerINC.'/HttpClient.class.php'); require_once(eminerINC.'/userlogin.class.php'); if(empty($eb5707348)) $eb5707348 = '';   if( is_dir(dirname(__FILE__).'/install') ) { if(!file_exists(dirname(__FILE__).'/install/install_lock.txt') ) { $e0666f0ac = fopen(dirname(__FILE__).'/install/install_lock.txt', 'w') or die('安装目录无写入权限，无法进行写入锁定文件，请安装完毕删除安装目录！'); fwrite($e0666f0ac,'ok'); fclose($e0666f0ac); }  if( file_exists("install/index.php") ) { @rename("install/index.php", "install/index.php.bak"); } if( file_exists("install/module-install.php") ) { @rename("install/module-install.php", "install/module-install.php.bak"); } $e1ba7285d = "install/index.html"; if( !file_exists($e1ba7285d) ) { $e0666f0ac = @fopen($e1ba7285d,'w'); fwrite($e0666f0ac,'dir'); fclose($e0666f0ac); } }  $eb4a88417=array(); $eac1fa960 = explode('/',str_replace("\\",'/',dirname(__FILE__))); $e14879f48 = $eac1fa960[count($eac1fa960)-1]; empty($e5766469a) && $e5766469a=''; $eb4a88417 = array(); if($eb5707348=='login')  { $e2fa66dd0 = new e7eec5484($e14879f48,$e5766469a); if(!empty($eea8f538c) && !empty($pwd)) { $e9b207167 = $e2fa66dd0->ef3f82f62($eea8f538c,$pwd); if($e9b207167==1) { $e2fa66dd0->ed49f8fdc(); if (function_exists('session_register')){ @session_register('e28dd6773');@session_register('remote_host');} $_SESSION['remote_host'] = $host; $_SESSION['e28dd6773'] = $_SERVER['HTTP_HOST']; e8fa14cdd('eminerhost',$host); if($e4335285f)$e194d7982 = explode('=', $e4335285f); elseif($e5766469a)$e194d7982 = array('eb04e518a',$e5766469a); else $e194d7982 = array(session_name(), session_id()); if($eae5705b5==1)setcookie($e194d7982[0], $e194d7982[1], time() + 48*3600, "/"); $eb4a88417['status'] = 'success'; $eb4a88417['info'] = '成功登录，正在转向系统主页！';  }else if($e9b207167==-1){ $eb4a88417['status'] = 'error'; $eb4a88417['info'] = '你的用户名不存在!|eea8f538c'; }else{ $eb4a88417['status'] = 'error'; $eb4a88417['info'] = '你的密码错误!|pwd'; } }else{ $eb4a88417['status'] = 'error'; $eb4a88417['info'] = '用户和密码没填写完整!|eea8f538c'; } exit($callback . '(' . json_encode($eb4a88417) . ')'); }else if($eb5707348=='dowithdata')  { $e2fa66dd0 = new e7eec5484(); if($e52731e59=='var')array_map('unlink',glob(dirname(__FILE__)."/data/{$e2fa66dd0->eea8f538c}/var/*")); else array_map('unlink',glob(dirname(__FILE__)."/data/{$e2fa66dd0->eea8f538c}/copubnode/{$e52731e59}*")); $eb4a88417['status'] = 'success'; exit($callback . '(' . json_encode($eb4a88417) . ')'); }else if($eb5707348=='reginsert'||$eb5707348=='regupdate'){ if($eb5707348=='regupdate' && strpos($pwd,'**')!==false) $pwd = ''; $ed7df5b64= $eb5707348=='regupdate'?'修改':'注册'; if(empty($eea8f538c)||empty($uname)||empty($email)) { $eb4a88417['status'] = 'error'; $eb4a88417['info'] = "本地{$ed7df5b64}时接受数据不全，请返回检查。"; exit($callback . '(' . json_encode($eb4a88417) . ')'); } $e0039eec7=time(); $e4ed90012='0.0.0.0'; $e30ce9705=urldecode($e30ce9705); !empty($pwd) && $pwd = substr(md5($pwd), 5, 20); empty($qq) && $qq='NULL'; empty($e532c28d5) && $e532c28d5='NULL'; empty($tel) && $tel='NULL'; if($eb5707348=='regupdate'){ $ebcfef123 = '' ; !empty($pwd) && $ebcfef123 = "pwd = '$pwd',"; $ef60c382c = "UPDATE `#@__admin` SET  {$ebcfef123}uname = '$uname',typeid = '$typeid',email = '$email',e4ed90012 = '$e4ed90012',e80c42f39 = '$e80c42f39',qq = $qq,ed1befa03='$ed1befa03',ecdf740a2='$ecdf740a2',tel=$tel,e532c28d5=$e532c28d5,e997f5979 = $e0039eec7 WHERE eea8f538c='$eea8f538c'"; }else $ef60c382c = "INSERT INTO `#@__admin`(e7a72569b,eea8f538c,pwd,uname,typeid,email,e4ed90012,e80c42f39,qq,logintime,ed1befa03,ecdf740a2,tel,e532c28d5,e997f5979)
		VALUES('1','$eea8f538c','$pwd','$uname','0','$email','$e4ed90012','$e80c42f39',$qq,$e0039eec7,'$ed1befa03','$ecdf740a2',$tel,$e532c28d5,$e0039eec7); "; if($e43e5a962->ecfbde28c($ef60c382c)){ if(!e6caef775($eea8f538c , $e30ce9705)){ $eb4a88417['status'] = 'error'; $eb4a88417['info'] = '权限问题， 未能成功写入配置参数，！'; exit($callback . '(' . json_encode($eb4a88417) . ')'); }   $eb4a88417['info'] = $eb5707348=='regupdate'?'已成功修改用户资料信息！':'恭喜！您已成功注册.请用该帐号登陆，开始您愉快的采矿之旅吧。'; $eb4a88417['status'] = 'success'; }else{ $eb4a88417['status'] = 'error'; $eb4a88417['info'] = "本地{$ed7df5b64}时数据库发生故障，请返回重试。"; } exit($callback . '(' . json_encode($eb4a88417) . ')'); }else if($eb5707348=='loginout'){ $e2fa66dd0 = new e7eec5484(); $e2fa66dd0->e881529ae(); $ee70c4df1 = e17294293('','login.php?eb5707348=loginout'); if($ee70c4df1 && strpos($ee70c4df1, '已成功退出')!==false){ $eb4a88417['status'] = 'success'; $eb4a88417['info'] = '已成功退出！'; }else{ $eb4a88417['status'] = 'error'; $eb4a88417['info'] = '未能成功从远程主站退出，请返回重试。'; } exit(json_encode($eb4a88417)); } function e6caef775($eea8f538c ,$e30ce9705){ $e0df142c7 = $eb01b1557 = 0; $ed19383ed=$ea1f64765=''; if($e7001b7bd = e17294293($e30ce9705,'/sys_info.php')){ $e6eba5587 = unserialize($e7001b7bd); $ec08c2dcc=array();$eb9be7149=array(); $ed19383ed="<"."?php\r\n"; foreach($e6eba5587 as $e8ce4b16b=>$ef1965a85) { if(strpos($ef1965a85['e2b359ce0'], 'php_')===0){  $ec08c2dcc[$ef1965a85['e2b359ce0']]=$ef1965a85['val']; $ed19383ed.='$paramarr["'.$ef1965a85['e2b359ce0'].'"]="'.$ef1965a85['val']."\";\r\n"; }else { $eb9be7149[$ef1965a85['e2b359ce0']]=$ef1965a85['val']; $ea1f64765.='$paramarr["'.$ef1965a85['e2b359ce0'].'"]="'.$ef1965a85['val']."\";\r\n"; } } $ed19383ed.= "?".">"; $e8ea72651=strpos(eminerDATA,'/')!==false?eminerDATA.'/'.$eea8f538c.'/params/':eminerDATA.'params\\'; if(!is_dir($e8ea72651)) e1697d2d4($e8ea72651);   $e0666f0ac = fopen($e8ea72651.'param.js','w'); if($e0666f0ac) $eb01b1557 = fwrite($e0666f0ac,$ea1f64765); $e0666f0ac = fopen($e8ea72651.'param.php','w'); if($e0666f0ac) $e0df142c7 = fwrite($e0666f0ac,$ed19383ed); fclose($e0666f0ac); } return ($e0df142c7 && $eb01b1557 && $ed19383ed && $ea1f64765); } ?>