Closed JessyJP closed 5 months ago
&& false
is where it will go.
I would just put a comment to say why it's disabled ( I think i did) but for any reason, you might want to resit that later.I mean, most people use a dedicated network and probably don't bother changing the password.
is
type functions, but in this case, I am not so sure it's a bad idea.
isLoggedOn()
- doesn't have to necessarily imply security. The IP still needs to be logged which comes back to the idea about a logger https://github.com/quelea-projection/Quelea/issues/597. true
which will work but then who will add the device?isLoggedOn() || checkPasswordDisabled(String ip) ...
or
isLoggedOn() || logRemoteActicity(String ip, String action/handlerID) ...
something like this :?
private boolean checkPasswordDisabled(){
boolean isDisabledState = (QueleaApp.get().getPass().len() == 0) || QueleaApp.get().getSomeCheckboxForDisableedAuthenticationValue();
if (isDisabledState) {
addDevice(ip);
}
return isDisabledState;
}
or
private logRemoteActicity(String ip, String action/handlerID){
boolean isDisabledState = (QueleaApp.get().getPass().len() == 0) || QueleaApp.get().getSomeCheckboxForDisableedAuthenticationValue();
if (isDisabledState && (//is not in the device list)) {
addDevice(ip);
}
addToRemoteHandlerLog(ip, action);// Some function to track who did what
return isDisabledState;
}
validateLogin()
or something.Well either way works for me, but then with option 2, all login checks would have to be replaced. Ok, "replace all" in notepadd++ would do but yeah that's the other reason. Also the adding of the device occurs only if that very specific condition is met. Either way you are the main chef and you say what goes in or out of the source soup.
1 We don't need the boolean found variable. Directly return when we find the IP. It's more efficient and we skip the rest of the check on long IP lists. 2 Second, we can introduce an unconditional authentication case. When the case is met we add the device for the next check and return.
remote.control.require.authentication
, then:(QueleaProperties.get().getRemoteControlPassword().length() == 0)
could be:(!QueleaProperties.get().getRemoteControlRequireAuthentication() || QueleaProperties.get().getRemoteControlPassword().length() == 0)
&& false) {//The empty password check disabled by default
I feel the first commit is a must! I think in that case the second commit makes sense given the first. I mean it's a presentation software so at least we should be able to remove the password even it's via notepad at the very least.
Weird I can't open the preference pannel in debug mode and the database doesn't show!
---------- Another option
Now if it's really really important to not have an empty password we can add a checkbox next to the password edit field. The checkbox will be connected to
remote.control.require.authentication
Then haveboolean getRemoteControlRequireAuthentication()
andsetRemoteControlRequireAuthentication(boolean isRequired)
. I can do a third commit with the checkbox but I think it's silly to add extra stuff, so as is, is fine.---------- Also
Also '
&& false) {//The empty password check disabled by default
' becomes&& getRemoteControlRequireAuthentication() ) {//The empty password check is only enabled when authentication is required
Could do it like that too. In that case, enable/disable actually works on the empty check rather than the authentication itself. That's still a valid way of doing it.