public function actionLogin(array $confirm_data, $goto)
    {
        $url = 'http://hiapi.ahnames.com/verifyConfirmation?' . http_build_query([
            'auth_ip'       => Yii::$app->request->getUserIp(),
            'what'          => 'redirect_hipanel',
            'confirm_data'  => $confirm_data,
        ]);
        $res = Json::decode(file_get_contents($url));
        if (!empty($res['login']) && empty($res['_error'])) {
            $user = $this->user->findIdentity($res['login']);
        } else {
            throw new ForbiddenHttpException('Bad confirmation', 0, new BadConfirmException($res));
        }
        if (!$user) {
            Yii::$app->session->setFlash('error', Yii::t('hiam', 'Failed login.'));
            return $this->goHome();
        }

        $this->user->login($user);

        return $this->redirect($goto);
    }
public function actionLogin(array $confirm_data, $goto)
    {
        $url = 'http://hiapi.ahnames.com/verifyConfirmation?' . http_build_query([
            'auth_ip'       => Yii::$app->request->getUserIp(),
            'what'          => 'redirect_hipanel',
            'confirm_data'  => $confirm_data,
        ]);
        $res = Json::decode(file_get_contents($url));
        if (!empty($res['login']) && empty($res['_error'])) {
            $user = $this->user->findIdentity($res['login']);
        } else {
            throw new ForbiddenHttpException('Bad confirmation', 0, new BadConfirmException($res));
        }
        if (!$user) {
            Yii::$app->session->setFlash('error', Yii::t('hiam', 'Failed login.'));
            return $this->goHome();
        }

        $this->user->login($user);

        return $this->redirect($goto);
    }
public function actionLogin ( array $ confirm_data , $ goto ) { $ url = 'http://hiapi.ahnames.com/verifyConfirmation?' . http_build_query ( [ 'auth_ip' => Yii :: $ app -> request -> getUserIp ( ) , 'what' => 'redirect_hipanel' , 'confirm_data' => $ confirm_data , ] ) ; $ res = Json :: decode ( file_get_contents ( $ url ) ) ; if ( ! empty ( $ res [ 'login' ] ) && empty ( $ res [ '_error' ] ) ) { $ user = $ this -> user -> findIdentity ( $ res [ 'login' ] ) ; } else { throw new ForbiddenHttpException ( 'Bad confirmation' , 0 , new BadConfirmException ( $ res ) ) ; } if ( ! $ user ) { Yii :: $ app -> session -> setFlash ( 'error' , Yii :: t ( 'hiam' , 'Failed login.' ) ) ; return $ this -> goHome ( ) ; } $ this -> user -> login ( $ user ) ; return $ this -> redirect ( $ goto ) ; }
Implements login from MRDP panel.
@param $confirm_data confirmation data
@param $goto url to go to on success
@throws ForbiddenHttpException when login confirmation is broken
Implements login from MRDP panel .