Category Permissions/Access Category Permissions/Access
 

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

Main Menu

Category Permissions/Access

Started by jleonard, May 08, 2012, 03:03:10 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

jleonard

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?

jleonard

Actually, it's over a 100 albums.

Αndré

Quote from: jleonard on May 08, 2012, 03:03:10 PM
Is there a way for me to create a password for an entire category?
That not possible.


Quote from: jleonard on May 08, 2012, 03:03:10 PM
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
UPDATE cpg15x_albums SET alb_password = '098f6bcd4621d373cade4e832627b4f6' WHERE category = '123'

jleonard

Quote from: Αndré on May 08, 2012, 03:29:57 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
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.

Αndré

Quote from: jleonard on May 08, 2012, 08:44:36 PM
Could I also do the same for the Password Hint?
Sure. The query would look like
UPDATE cpg15x_albums SET alb_password = '098f6bcd4621d373cade4e832627b4f6', alb_password_hint = 'test' WHERE category = '123'

jleonard

Quote from: Αndré on May 09, 2012, 08:46:05 AM
Sure. The query would look like
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?

Αndré

In PHPMyAdmin or a similar tool.

jleonard

Quote from: Αndré on May 09, 2012, 03:30:05 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.

Αndré

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

jleonard

Quote from: Αndré 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".

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'

jleonard

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

Αndré

You have to enter the category's ID, not the category's name at the bold part:
Quote from: jleonard on May 10, 2012, 07:40:09 PM
UPDATE cpg_albums SET alb_password = 'mckinney', alb_password_hint = 'In what city do the Leonards live? (all lowercase)' WHERE category = '2012'

jleonard

Quote from: Αndré 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:

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.

Αndré

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.

jleonard

Quote from: Αndré 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.

Error returns "Login failed.  Try again."

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

jleonard

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

Αndré

Quote from: jleonard on May 10, 2012, 09:01:48 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).


Quote from: jleonard on May 10, 2012, 09:00:14 PM
what's a password "hash?"
That's the value which is stored e.g. in the alb_password field. More information here.


Quote from: Αndré on May 10, 2012, 08:56:01 PM
I guess Coppermine tries to access a non-existing category.
That's of course nonsense. I mixed up two threads, sorry.

jleonard

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.

jleonard

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.

Αndré

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.