Edit main page layout

Forum for questions and support relating to the 1.28.x releases only.
iitywygms
Posts: 118
Joined: Thu Nov 08, 2012 5:19 am

Edit main page layout

Post by iitywygms » Thu Sep 24, 2015 2:27 pm

Is it possible to have the default main web page show only specific items?

I would like a user to be only able to see the monitor name and the events for that day.
I know I can disable a user from being able to change them, but I would like to completely hide them.

Reason is one of my cameras requires a username and password in the source path, and that information is seen on the main page.

Is it possible to hide everything else like the source and function?

User avatar
asker
Posts: 1419
Joined: Sun Mar 01, 2015 12:12 pm

Re: Edit main page layout

Post by asker » Thu Sep 24, 2015 2:55 pm

Sure. Edit console.php
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

iitywygms
Posts: 118
Joined: Thu Nov 08, 2012 5:19 am

Re: Edit main page layout

Post by iitywygms » Thu Sep 24, 2015 4:57 pm

asker wrote:Sure. Edit console.php
Okay thanks. I need to learn how to edit php files.
Off to google I go.

bbunge
Posts: 2706
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Edit main page layout

Post by bbunge » Thu Sep 24, 2015 5:35 pm

Do not have to do edit. Just restrict what monitors and functions a user can see in the user options.

iitywygms
Posts: 118
Joined: Thu Nov 08, 2012 5:19 am

Re: Edit main page layout

Post by iitywygms » Thu Sep 24, 2015 8:01 pm

bbunge wrote:Do not have to do edit. Just restrict what monitors and functions a user can see in the user options.
?
I can change the options so they cannot modify the settings, but they can still see them.
I want to make it so they cannot see the source path. Am I missing something?

User avatar
asker
Posts: 1419
Joined: Sun Mar 01, 2015 12:12 pm

Re: Edit main page layout

Post by asker » Thu Sep 24, 2015 8:57 pm

No, you haven't misunderstood anything.

You have to modify console.php to not display the columns you are not interested in. Changing restrictions will not do what you want.

This is the section you should investigate:
https://github.com/ZoneMinder/ZoneMinde ... e.php#L232

Note that I don't recommend you just remove them. Instead wrap them around

Code: Select all

<?php ?>
code where you check if the user viewing is admin, then show it, else not, because you will still want to see and edit them as admin

This would likely be the quickest fix for you. The correct way to do this would be to tie it into the "canView" logic that is implemented in ZM but that is more complex and therefore not recommended since you really only want to hack your own version (keep a copy though as it will get overwritten when you update)
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

iitywygms
Posts: 118
Joined: Thu Nov 08, 2012 5:19 am

Re: Edit main page layout

Post by iitywygms » Thu Sep 24, 2015 11:08 pm

Okay, I will give it a shot.
Need to be sure to keep a backup, I can see things going bad here.

Thanks for the help.

User avatar
asker
Posts: 1419
Joined: Sun Mar 01, 2015 12:12 pm

Re: Edit main page layout

Post by asker » Fri Sep 25, 2015 12:53 am

BTW I re read why you want to hide columns. Bbunge is right - if all you want to do is disable a person from seeing the password for your cameras all you need to do is make sure that person only has view rights for the monitor. If you do that the source column is not clickable and they should not be able to see the password as the password should only show up if you click on the source column. The source column should only show the IP or hostname.
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

iitywygms
Posts: 118
Joined: Thu Nov 08, 2012 5:19 am

Re: Edit main page layout

Post by iitywygms » Fri Sep 25, 2015 3:47 pm

asker wrote:BTW I re read why you want to hide columns. Bbunge is right - if all you want to do is disable a person from seeing the password for your cameras all you need to do is make sure that person only has view rights for the monitor. If you do that the source column is not clickable and they should not be able to see the password as the password should only show up if you click on the source column. The source column should only show the IP or hostname.

For this one particular camera, the source path requires the user name and password in the source path.
rtsp://user:password@192.168.2.1
So it shows under the source colum as

user:password@192.168.2.1

I want to hide that information. So it seems the only way to do this is to edit the php file.

User avatar
asker
Posts: 1419
Joined: Sun Mar 01, 2015 12:12 pm

Re: Edit main page layout

Post by asker » Fri Sep 25, 2015 4:11 pm

Something is not right. All my cameras have that sort of URL.
Can you post screenshots of various tabs on how you have configured the camera? (masking out IP/password)
iitywygms wrote:
asker wrote:BTW I re read why you want to hide columns. Bbunge is right - if all you want to do is disable a person from seeing the password for your cameras all you need to do is make sure that person only has view rights for the monitor. If you do that the source column is not clickable and they should not be able to see the password as the password should only show up if you click on the source column. The source column should only show the IP or hostname.

For this one particular camera, the source path requires the user name and password in the source path.
rtsp://user:password@192.168.2.1
So it shows under the source colum as

user:password@192.168.2.1

I want to hide that information. So it seems the only way to do this is to edit the php file.
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

iitywygms
Posts: 118
Joined: Thu Nov 08, 2012 5:19 am

Re: Edit main page layout

Post by iitywygms » Fri Sep 25, 2015 5:01 pm

I chopped out
username:password@

Image
Image
Image

User avatar
asker
Posts: 1419
Joined: Sun Mar 01, 2015 12:12 pm

Re: Edit main page layout

Post by asker » Fri Sep 25, 2015 5:32 pm

Ah you're right. If you select FFMPEG as source type, it shows the complete path which includes passwords. Ouch.
Did you try "remote" instead of FFMPEG to see if your camera works? I switched from FFMPEG to remote to avoid the smudging problem of ffmpeg a few months after I first found zone minder
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

bbunge
Posts: 2706
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Edit main page layout

Post by bbunge » Fri Sep 25, 2015 5:41 pm

No, FFMPEG should not, and dosen't in my setup, show the entire source parh. I have used FFMPEG with and without user/passwords and it does not show anything but the entry after the "/" after the IP address. Something must be goofy with the install...

Ah, just noticed there is nothing after the IP address in his source. Something we are not seeing? Most cameras need an entry like: /live2.sdp after the IP address.

bb

iitywygms
Posts: 118
Joined: Thu Nov 08, 2012 5:19 am

Re: Edit main page layout

Post by iitywygms » Fri Sep 25, 2015 5:50 pm

asker wrote:Ah you're right. If you select FFMPEG as source type, it shows the complete path which includes passwords. Ouch.
Did you try "remote" instead of FFMPEG to see if your camera works? I switched from FFMPEG to remote to avoid the smudging problem of ffmpeg a few months after I first found zone minder
I have yet to get remote to work with any of my cameras. Always get rtsp source not available error.
Maybe I am setting up "remote" incorrectly?

I have tried many of the "howtos" scattered around the web and here on the forums but none have ever worked for me.
bbunge wrote:No, FFMPEG should not, and dosen't in my setup, show the entire source parh. I have used FFMPEG with and without user/passwords and it does not show anything but the entry after the "/" after the IP address. Something must be goofy with the install...

Ah, just noticed there is nothing after the IP address in his source. Something we are not seeing? Most cameras need an entry like: /live2.sdp after the IP address.

bb
I have been running zm like this for 2-3 years.
I have 4 cameras that use rtsp. The bottom 4 on my main screen. 3 of the cameras show 11, which is after the / And those 3 work without a username or password in the source path.
The latest camera "garage" requires a username and password in the path.
maybe I have something all wrong but it works? :?:
Last edited by iitywygms on Fri Sep 25, 2015 5:51 pm, edited 1 time in total.

User avatar
asker
Posts: 1419
Joined: Sun Mar 01, 2015 12:12 pm

Re: Edit main page layout

Post by asker » Fri Sep 25, 2015 5:50 pm

True - I just tried it - if you add "rtsp://" to the source URL the user-name/password are removed in the display. I am on .106
bbunge was this true with 1.28.1 as well?
bbunge wrote:No, FFMPEG should not, and dosen't in my setup, show the entire source parh. I have used FFMPEG with and without user/passwords and it does not show anything but the entry after the "/" after the IP address. Something must be goofy with the install...

Ah, just noticed there is nothing after the IP address in his source. Something we are not seeing? Most cameras need an entry like: /live2.sdp after the IP address.

bb
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests