Member
Member
Barbara   15-12-2009, 22:26
#1

As I was saying in another topic I need to limit the access to a couple of albums only to some users.
I'm using the register_user plugin so everyone can choose is own username and password.

My problem is, what happens if someone forgets is username/password?
I think some sort of e-mail notification system would be handy, so if someone needs his data they will be e-mailed to him.

Or a password reset like zp does at the moment for the admin would be a start.

Member
Member
sbillard   16-12-2009, 00:03
#2

If they log into the admin page (/admin if you have mod_rewrite active) then they will have a login screen with the option to enter a cpatcha and have a password reset sent. We do NOT email passwords as this is a gross breach of basic security.

Member
Member
Barbara   16-12-2009, 00:22
#3

Glad I asked. Didn't know about this functionality, I'll just put a link to 'admin' under the form.

Btw, is there a way to select a different admin theme for the logged-in users? It's not a big deal but if there's a way to customize it I think I'll take advantage of the functionality.

Member
Member
sbillard   16-12-2009, 00:40
#4

No direct way, but you could place tests for zp_loggedin() wherever you want to make a distinction.

Member
Member
Barbara   16-12-2009, 01:00
#5

Perfect, I just need to specify a different stylesheet. I don't think this is the correct syntax, isnt it? Also where do I have to put it? I looked into admin.php and other files but I can't find which one is calling admin.css

`

`

Member
Member
sbillard   16-12-2009, 01:14
#6

Just about.

`

`

Member
Member
Barbara   16-12-2009, 01:36
#7

Thanks but when I log out it tells me

Parse error: syntax error, unexpected T_STRING, expecting '(' in /home/xxx/public_html/127/zp-core/admin-functions.php on line 92

line 92 is if zp_loggedin() {

Member
Member
sbillard   16-12-2009, 01:42
#8

Sorry, missed that if (zp_loggedin()) {

Member
Member
Barbara   16-12-2009, 01:49
#9

Thank you for the quick replies!
Ehm, sorry to bother again, is there a way to set it this for every user except me? ;p So that the admin can access the control panel with the default css and the registered users are presented with the custom version (the only right they have is view all).

Member
Member
sbillard   16-12-2009, 02:00
#10

No problem. Pretty soon we will have you capable of modifying the core .

There is a global array $_zp_current_admin which contains all the credentials of the logged on admin. You could checj $_zp_current_admin['name'] or $_zp_current_admin['user']. The first is the display name the second the user id.

Member
Member
Barbara   16-12-2009, 02:16
#11

Lol, yeah...

Ok I'm not sure if I get it but right now is set like this
`

`
Only one last thing, when I'm logged in as admin my stylesheet is custom.css whereas when I'm logged in as user my stylesheet is admin.css. Shouldn't it be the opposite?
Not a problem, I could always switch the code but I'm trying to understand.

Member
Member
sbillard   16-12-2009, 04:43
#12

The way IF statements work is that if the thing in parens is true it executes the first statement if it is false it executes the second statement. Also, the "USER" parameter is not correct. If you wish to pass parameters, what you pass is a RIGHTS mask. Then the function will return true if someone is logged in with those rights otherwise it returns false.

Administrator
Administrator
acrylian   16-12-2009, 10:08
#13

Just to ask, why do you actually need a different admin theme?

Member
Member
Barbara   16-12-2009, 12:06
#14

No particular reason, I want it to look like the rest of the site.
Thanks for the explanation, as for the rest I'm officially lost, what do I have to put in the code then?

Member
Member
sbillard   16-12-2009, 18:09
#15

`

Maybe it is time for you to do some study on PHP programming and on the Zenphoto functions guilde.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.