Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1] 2   Go Down

Author Topic: Category Permissions/Access  (Read 14111 times)

0 Members and 1 Guest are viewing this topic.

jleonard

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Category Permissions/Access
« on: May 08, 2012, 03:03:10 pm »

I apologize if this has already been answered, but I could not find a thread addressing this issue.  I have at least 50 albums, so for me to change access permissions "by album" (via creating a password), is extremely tedious.  Is there a way for me to create a password for an entire category?  If not, is there a way to "batch" create a password for all of these albums?
Logged

jleonard

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Category Permissions/Access
« Reply #1 on: May 08, 2012, 03:07:51 pm »

Actually, it's over a 100 albums.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category Permissions/Access
« Reply #2 on: May 08, 2012, 03:29:57 pm »

Is there a way for me to create a password for an entire category?
That not possible.


is there a way to "batch" create a password for all of these albums?
Set the password for one album. Then, have a look at your database and find that album to get the password hash. Now you can execute a query like
Code: [Select]
UPDATE cpg15x_albums SET alb_password = '098f6bcd4621d373cade4e832627b4f6' WHERE category = '123'
Logged

jleonard

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Re: Category Permissions/Access
« Reply #3 on: May 08, 2012, 08:44:36 pm »

That not possible.

Set the password for one album. Then, have a look at your database and find that album to get the password hash. Now you can execute a query like
Code: [Select]
UPDATE cpg15x_albums SET alb_password = '098f6bcd4621d373cade4e832627b4f6' WHERE category = '123'

Interesting...thanks for writing.  Could I also do the same for the Password Hint?  Where would I paste that code, would it be "within" the database, or via the gallery somehow?  I can go into mysql database, but I'm not that familiar with how to edit multiple fields or entries.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category Permissions/Access
« Reply #4 on: May 09, 2012, 08:46:05 am »

Could I also do the same for the Password Hint?
Sure. The query would look like
Code: [Select]
UPDATE cpg15x_albums SET alb_password = '098f6bcd4621d373cade4e832627b4f6', alb_password_hint = 'test' WHERE category = '123'
Logged

jleonard

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Re: Category Permissions/Access
« Reply #5 on: May 09, 2012, 03:09:07 pm »

Sure. The query would look like
Code: [Select]
UPDATE cpg15x_albums SET alb_password = '098f6bcd4621d373cade4e832627b4f6', alb_password_hint = 'test' WHERE category = '123'

So, where do I enter that code?  Somewhere in the gallery settings, or somewhere in MySQL?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category Permissions/Access
« Reply #6 on: May 09, 2012, 03:30:05 pm »

In PHPMyAdmin or a similar tool.
Logged

jleonard

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Re: Category Permissions/Access
« Reply #7 on: May 09, 2012, 03:43:11 pm »

In PHPMyAdmin or a similar tool.

Would anyone be willing to give me instructions to do this?  I'm not a script programmer, I'm just a photographer.

Thanks in advance.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category Permissions/Access
« Reply #8 on: May 09, 2012, 03:49:20 pm »

Login to PHPMyAdmin, select your Coppermine database, open the "SQL" tab, copy the adjusted query to the text box and hit "Go".
Logged

jleonard

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Re: Category Permissions/Access
« Reply #9 on: May 10, 2012, 07:40:09 pm »

Login to PHPMyAdmin, select your Coppermine database, open the "SQL" tab, copy the adjusted query to the text box and hit "Go".

Thanks.  Did that, and it returned a green checkmark, but says "0 rows affected".  Here was my edited code...

UPDATE cpg_albums SET alb_password = 'mckinney', alb_password_hint = 'In what city do the Leonards live? (all lowercase)' WHERE category = '2012'
Logged

jleonard

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Category Permissions/Access
« Reply #10 on: May 10, 2012, 07:44:31 pm »

And now I can't even login to my admin account!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category Permissions/Access
« Reply #11 on: May 10, 2012, 08:40:00 pm »

You have to enter the category's ID, not the category's name at the bold part:
UPDATE cpg_albums SET alb_password = 'mckinney', alb_password_hint = 'In what city do the Leonards live? (all lowercase)' WHERE category = '2012'
Logged

jleonard

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Re: Category Permissions/Access
« Reply #12 on: May 10, 2012, 08:44:55 pm »

You have to enter the category's ID, not the category's name at the bold part:

Ok, I'll try that, thanks. So, how did this query mess up my logins?  It doesn't even recognize my login anymore. The users are still listed in the databases however.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category Permissions/Access
« Reply #13 on: May 10, 2012, 08:56:01 pm »

I don't know, as if haven't tested it. Do you get an error message? I guess Coppermine tries to access a non-existing category.


Additionally, your password is invalid. Please read my first reply how to get a valid password.
Logged

jleonard

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Re: Category Permissions/Access
« Reply #14 on: May 10, 2012, 09:00:14 pm »

I don't know, as if haven't tested it. Do you get an error message? I guess Coppermine tries to access a non-existing category.


Additionally, your password is invalid. Please read my first reply how to get a valid password.

Error returns "Login failed.  Try again."

I read your first post...what's a password "hash?"
Logged

jleonard

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Category Permissions/Access
« Reply #15 on: May 10, 2012, 09:01:48 pm »

And when I try to access the particular "album" via password, it says "invalid password."
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category Permissions/Access
« Reply #16 on: May 10, 2012, 09:26:27 pm »

when I try to access the particular "album" via password, it says "invalid password."
That's what I already told you. Please just follow my instructions (copy an already existing hash).


what's a password "hash?"
That's the value which is stored e.g. in the alb_password field. More information here.


I guess Coppermine tries to access a non-existing category.
That's of course nonsense. I mixed up two threads, sorry.
Logged

jleonard

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Category Permissions/Access
« Reply #17 on: May 10, 2012, 09:58:16 pm »

OK, I'm not explaining myself very well apparently.  I have two issues now...

1.  The album passwords:  I changed them all to a word, not a hexadecimal string.  Again, I am not a programmer, so when you said to copy the code, I did...and I entered a regular word, not a hexadecimal string.  So, the strings are all gone now...and I can't even login to the gallery to create a password because of No. 2 below!

2.  The User Login passwords:  NONE of them work anymore!  I can't login to my gallery...at all.
Logged

jleonard

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Category Permissions/Access
« Reply #18 on: May 11, 2012, 01:13:35 am »

Andre, please help if you can.  My gallery is completely innaccessible since I edited the database, and I've given out the link to a bunch of parents for a baseball team.  I don't know why I cannot login from any user (or admin) account since I ran those queries.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category Permissions/Access
« Reply #19 on: May 11, 2012, 06:37:49 am »

I don't know what exactly you did, but that query shouldn't affect the user logins. To investigate that issue I just sent you a PM.
Logged
Pages: [1] 2   Go Up
 

Page created in 0.026 seconds with 20 queries.