Page 1 of 1

3 short suggestions

Posted: Mon Aug 14, 2006 2:36 pm
by essup
- Logout button on main page of ZM (clicking on <user> and logoff isn't the way most users will interact, they close the windows that's all - and a security bug, because you can relogin in to ZM without knowing the password)

- Having the possibility to insert a proxy hostname and proxy port, otherwise zm will always think he is already up-to-date
root@ZoneMinder:~# cat /tmp/zmupdate.log
08/14/2006 13:13:01.050848 zmupdate[2019].INF [Checking for updates]
08/14/2006 13:13:01.249985 zmupdate[2019].ERR [Error check failed: '500 Can't connect to www.zoneminder.com:80 (connect: Connection refused)']
(This is due to security permissions from our admin)

- Browser adjustment: The windows for firefox are always ~15px too short)

Posted: Mon Aug 14, 2006 3:22 pm
by zoneminder
Some god points here. For now if you want to adjust the window sizes you can edit zm_html_config.php and alter the jws (Javascript Window Size) array to enlarge the size of any windows that are too small. On my machine with FF the windows are fine though, which ones are you finding that are too small?

Posted: Mon Aug 14, 2006 3:23 pm
by jameswilson
1, are you sure cos if i close the browser and open a newone it wants a password again

2, this is a linux setting not a zm setting, you can set linux to use a proxy but i have only done this through the gui, but there will be a command line way

3, Is this only in the settings window or in the console window too

Posted: Wed Aug 16, 2006 7:15 am
by essup
zoneminder wrote:Some god points here. For now if you want to adjust the window sizes you can edit zm_html_config.php and alter the jws (Javascript Window Size) array to enlarge the size of any windows that are too small. On my machine with FF the windows are fine though, which ones are you finding that are too small?
Well, actually only the windows for logout and all subwindows in 'options'. (Tested with FF and Iexplore)
jameswilson wrote:1, are you sure cos if i close the browser and open a newone it wants a password again

2, this is a linux setting not a zm setting, you can set linux to use a proxy but i have only done this through the gui, but there will be a command line way

3, Is this only in the settings window or in the console window too
1. I use Firefox and i use tabbed-browsing. Even if i close the tab and open a new firefox windows, there is no login screen. Iexplore seems not to be affected.

2.
export http_proxy=proxy
export ftp_proxy=proxy
You mean that? How could i have downloaded ZM without this proxy settings? Think about it ...

3. Mainly just the 'options' with its sub-windows and the 'logout'-screen are affected. (Both, FF and Iexplore)

Posted: Wed Aug 16, 2006 8:48 am
by jameswilson
lol yes i mean it on 2
your browser will be set for proxy or yes you wouldnt be able to download or post, but you can setup the proxy for everything, i just cant remember how i did it will have alook into it and post back

Posted: Wed Aug 16, 2006 10:04 am
by essup
jameswilson wrote:lol yes i mean it on 2
your browser will be set for proxy or yes you wouldnt be able to download or post, but you can setup the proxy for everything, i just cant remember how i did it will have alook into it and post back
It's not the browser which sends the request for updates to zoneminder.com, it's the perl script /usr/local/bin/zmupdate.pl on line 142. But this perl script don't give a sh!# about ftp_proxy and http_proxy variables.

Posted: Wed Aug 16, 2006 11:20 am
by SyRenity
Hi.
1. I use Firefox and i use tabbed-browsing. Even if i close the tab and open a new firefox windows, there is no login screen. Iexplore seems not to be affected.
Firefox shares the login information across all tabs, meaning once you logged in, you could access ZM from any other tab. It's not something unique to ZM, but rather every web login I know acts with Firefox the same way.

If you will close the Firefox completely and re-open it, then ZM will ask you for access details.

Posted: Tue Aug 22, 2006 8:26 am
by essup
I changed zmupdate.pl to check for the http_proxy environment variable and uses that proxy if it is set.

Code: Select all

--- zmupdate.pl.old	2006-08-22 10:23:14.000000000 +0200
+++ zmupdate.pl	2006-08-22 10:23:02.000000000 +0200
@@ -73,6 +73,7 @@
 my $version = '';
 my $db_user = ZM_DB_USER;
 my $db_pass = ZM_DB_PASS;
+my $proxy = '';
 sub Usage
 {
     print( "
@@ -139,6 +140,11 @@
 			my $ua = LWP::UserAgent->new;
 			$ua->agent( "ZoneMinder Update Agent/".ZM_VERSION );
 
+			if( $ENV{'http_proxy'} ne '' ) {
+				$ua->env_proxy();
+				print( "Using proxy: ".$ENV{'http_proxy'}."\n" );
+			}
+
 			my $req = HTTP::Request->new( GET=>'http://www.zoneminder.com/version' );
 			my $res = $ua->request($req);
 
Note: I'm not a perl coder and i don't know if this patch could break at some circumstances. I did just test the code and it works for me.

Posted: Tue Aug 22, 2006 8:33 am
by essup
I also changed the console, so now there's a logout button on it. But this one is not recommended, because it's quite ugly, but nevertheless it also works for me.

Code: Select all

--- old/zm_html_view_console.php	2006-08-22 10:30:53.000000000 +0200
+++ new/zm_html_view_console.php	2006-08-22 10:30:46.000000000 +0200
@@ -406,5 +406,12 @@
 </tr>
 </table>
 </form>
+<p><table align="right" border="0" cellspacing="0" cellpadding="5" width="10%">
+<form name="logout_form" method="post" action="<?= $PHP_SELF ?>">
+<input type="hidden" name="view" value="login">
+<input type="hidden" name="action" value="logout">
+<tr><td align="center"><input type="submit" value="<?= $zmSlangLogout ?>" class="form"></td></tr>
+</form>
+</table>
 </body>
 </html>
I just hacked this thing together.

Posted: Tue Aug 22, 2006 8:35 am
by jameswilson
Thanks essup, im ure PHil will know what to do with these!