Table of Contents

OTP

Background

Enable System To Send OTPs

OTP For User Registration

OTP For Click To Connect

Some Technical Items

Expiry of the OTP

protected $valid_minutes = 2; //The time that an OTP will be valid (in minutes)

Disconnecting Temp Connection

if($otp == $q_r->value){
    $success = true;
    $this->{'PermanentUserOtps'}->patchEntity($q_r, ['status' => 'otp_confirmed']);
    $this->{'PermanentUserOtps'}->save($q_r);
    $user_id = $q_r->permanent_user_id;
    $q_pu = $this->{'PermanentUsers'}->find()->where(['PermanentUsers.id' =>$user_id])->first();
        if($q_pu){
		$this->{'PermanentUsers'}->patchEntity($q_pu, ['active' => 1]);
		$this->{'PermanentUsers'}->save($q_pu);
	} 								
	$this->response = $this->response->withHeader('Location', "http://1.0.0.0");      			
        return $this->response;
 
}else{

We are still looking for a similar way to disconnect users on a Mikrotik based Hotspot.