Пример #1
0
    }
    $cacheArr = array('AuthItem', 'CreditRule', 'Department', 'Ipbanned', 'Nav', 'NotifyNode', 'Role', 'Position', 'PositionCategory', 'Setting', 'UserGroup');
    foreach ($cacheArr as $cache) {
        Cache::update($cache);
    }
    Cache::load('usergroup');
    // 要注意小写
    Cache::update('Users');
    // 因为用户缓存要依赖usergroup缓存,所以放在最后单独更新
    file_put_contents(PATH_ROOT . 'data/install.lock', '');
    $configfile = CONFIG_PATH . 'config.php';
    $config = (require $configfile);
    $host = getHostInfo();
    //设置aeskey并保存
    $aeskey = substr(md5($_SERVER['SERVER_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . $host . $dbName . $dbAccount . $dbPassword . $dbPre . time()), 14, 10) . random(33);
    Setting::model()->updateSettingValueByKey('aeskey', $aeskey);
    $bindingSrc = Wx::getInstance()->getBindingSrc($aeskey, $host, true);
    include 'extInfo.php';
    exit;
} else {
    if ($option == 'tablepreCheck') {
        $dbHost = $_POST['dbHost'];
        $dbAccount = $_POST['dbAccount'];
        $dbPassword = $_POST['dbPassword'];
        $dbName = $_POST['dbName'];
        $tablePre = $_POST['tablePre'];
        if (!function_exists('mysql_connect')) {
            $ret['isSuccess'] = false;
            $ret['msg'] = 'mysql_connect' . $lang['func not exist'];
            echo json_encode($ret);
            exit;
Пример #2
0
use application\modules\main\model\Setting;
use application\modules\user\model\UserBinding;
// 程序根目录路径
define('PATH_ROOT', dirname(__FILE__) . '/../../../');
define('YII_DEBUG', true);
$defines = PATH_ROOT . '/system/defines.php';
defined('TIMESTAMP') or define('TIMESTAMP', time());
$yii = PATH_ROOT . '/library/yii.php';
$mainConfig = (require_once PATH_ROOT . '/system/config/common.php');
require_once $defines;
require_once $yii;
require_once '../../login.php';
Yii::setPathOfAlias('application', PATH_ROOT . DIRECTORY_SEPARATOR . 'system');
Yii::createApplication('application\\core\\components\\Application', $mainConfig);
$signature = Env::getRequest('signature');
$aeskey = Setting::model()->fetchSettingValueByKey('aeskey');
$userId = Env::getRequest('userid');
if (strcmp($signature, md5($aeskey . $userId)) != 0) {
    Env::iExit("签名错误");
}
if (!empty($userId)) {
    $uid = UserBinding::model()->fetchUidByValue($userId, 'wxqy');
    if ($uid) {
        dologin($uid);
        if (!Ibos::app()->user->isGuest) {
            $redirect = Env::getRequest('redirect');
            $url = base64_decode($redirect);
            $parse = parse_url($url);
            if (isset($parse['scheme'])) {
                header('Location:' . $url, true);
                exit;