function saveTOTP($get) { $user = $get['user']; $secret = $get['secret']; $hash = $get['hash']; $code = $get['code']; $u = new UserFunctions($user); $r = $u->validateUser($user, $hash, $secret); if ($r === false) { return array('status' => false, 'error' => "Couldn't validate cookie information", 'human_error' => 'Application error'); } return $u->saveTOTP($code); }