@@ -117,49 +117,30 @@ private function logAdminVisit(array $serverParams, string $name, SuccessFailure
117117 if (ini_get ('browscap ' )) {
118118 //call browscap
119119 $ browser = get_browser ($ _SERVER ['HTTP_USER_AGENT ' ]);
120-
121- //map browscap to AdminLogin
122- $ adminLogin = (new AdminLogin ())
123- ->setAdminIp ($ this ->locationService ->obfuscateIpAddress ($ ipAddress ))
124- ->setContinent ($ continent )
125- ->setCountry ($ country )
126- ->setOrganization ($ organization )
127- ->setDeviceType ($ browser ->device_type ?? null )
128- ->setDeviceBrand ($ browser ->device_name ?? null )
129- ->setDeviceModel (null )
130- ->setIsMobile (
131- isset ($ browser ->ismobiledevice ) && $ browser ->ismobiledevice ? YesNoEnum::Yes : YesNoEnum::No
132- )
133- ->setOsName ($ browser ->platform_description ?? null )
134- ->setOsVersion ($ browser ->platform_version ?? null )
135- ->setOsPlatform ($ browser ->platform ?? null )
136- ->setClientType ($ browser ->browser_type ?? null )
137- ->setClientName ($ browser ->browser ?? null )
138- ->setClientEngine ($ browser ->renderingengine_name ?? null )
139- ->setClientVersion (null )
140- ->setLoginStatus ($ status )
141- ->setIdentity ($ name );
142- } else {
143- $ adminLogin = (new AdminLogin ())
144- ->setAdminIp ($ this ->locationService ->obfuscateIpAddress ($ ipAddress ))
145- ->setContinent ($ continent )
146- ->setCountry ($ country )
147- ->setOrganization ($ organization )
148- ->setDeviceType (null )
149- ->setDeviceBrand (null )
150- ->setDeviceModel (null )
151- ->setIsMobile (YesNoEnum::No)
152- ->setOsName (null )
153- ->setOsVersion (null )
154- ->setOsPlatform (null )
155- ->setClientType (null )
156- ->setClientName (null )
157- ->setClientEngine (null )
158- ->setClientVersion (null )
159- ->setLoginStatus ($ status )
160- ->setIdentity ($ name );
161120 }
162121
122+ //map browscap to AdminLogin
123+ $ adminLogin = (new AdminLogin ())
124+ ->setAdminIp ($ this ->locationService ->obfuscateIpAddress ($ ipAddress ))
125+ ->setContinent ($ continent )
126+ ->setCountry ($ country )
127+ ->setOrganization ($ organization )
128+ ->setDeviceType ($ browser ->device_type ?? null )
129+ ->setDeviceBrand ($ browser ->device_name ?? null )
130+ ->setDeviceModel (null )
131+ ->setIsMobile (
132+ isset ($ browser ->ismobiledevice ) && $ browser ->ismobiledevice ? YesNoEnum::Yes : YesNoEnum::No
133+ )
134+ ->setOsName ($ browser ->platform_description ?? null )
135+ ->setOsVersion ($ browser ->platform_version ?? null )
136+ ->setOsPlatform ($ browser ->platform ?? null )
137+ ->setClientType ($ browser ->browser_type ?? null )
138+ ->setClientName ($ browser ->browser ?? null )
139+ ->setClientEngine ($ browser ->renderingengine_name ?? null )
140+ ->setClientVersion (null )
141+ ->setLoginStatus ($ status )
142+ ->setIdentity ($ name );
143+
163144 $ this ->adminLoginRepository ->saveResource ($ adminLogin );
164145
165146 return $ adminLogin ;
0 commit comments