3 short suggestions

Anything you want added or changed in future versions of ZoneMinder? Post here and there's a chance it will get in! Search to make sure it hasn't already been requested.
Post Reply
essup
Posts: 77
Joined: Tue Jun 13, 2006 2:08 pm

3 short suggestions

Post 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)
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post 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?
Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post 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
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
essup
Posts: 77
Joined: Tue Jun 13, 2006 2:08 pm

Post 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)
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post 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
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
essup
Posts: 77
Joined: Tue Jun 13, 2006 2:08 pm

Post 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.
SyRenity
Posts: 301
Joined: Mon Jan 24, 2005 2:43 pm

Post 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.
essup
Posts: 77
Joined: Tue Jun 13, 2006 2:08 pm

Post 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.
essup
Posts: 77
Joined: Tue Jun 13, 2006 2:08 pm

Post 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.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

Thanks essup, im ure PHil will know what to do with these!
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Post Reply