coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: apathys on July 30, 2005, 04:53:40 AM

Title: No admin menu
Post by: apathys on July 30, 2005, 04:53:40 AM
I go to my coppermine gallery
I am already logged in
but no admin menu
http://www.apathysecstasy.com/coppermine/index.php

I login and it logs me says 'welcome admin' continue
and it brings me right back to the same page.
no admin menu.
I have my permissions set as directed to 777, tried 755 same results.
I have version 1.3
Please help
Thank you


Title: Re: No admin menu
Post by: kegobeer on July 30, 2005, 05:55:23 AM
I suspect you aren't actually logged in, otherwise you would have an admin menu.  Send me a PM with your admin username/password so I can check it out.
Title: Re: No admin menu
Post by: apathys on July 30, 2005, 06:03:24 AM
okay thank you
just did
:)
Title: Re: No admin menu
Post by: kegobeer on July 30, 2005, 06:14:38 AM
The cookie appears to be set correctly.  Have you done any modifications to Coppermine?

This seems to be the same problem as in this post. (http://forum.coppermine-gallery.net/index.php?topic=19364)
Title: Re: No admin menu
Post by: apathys on July 30, 2005, 06:18:06 AM
no followed the instructions to a 't'
I looked at that other post too
still stumped
Title: Re: No admin menu
Post by: Nibbler on July 30, 2005, 03:08:57 PM
You may be missing the admin group from your groups table. That would cause you to not be recognised. Browse your cpg_groups table with phpmyadmin and verify it has 4 groups defined.
Title: Re: No admin menu
Post by: apathys on July 31, 2005, 05:57:43 AM
this is what I have in my phpmyadmin

bdweb319966_coppermine
   cpg133_albums
   cpg133_banned
   cpg133_categories
   cpg133_comments
   cpg133_config
   cpg133_ecards
   cpg133_exif
   cpg133_filetypes
   cpg133_pictures
   cpg133_temp_data
   cpg133_usergroups
   cpg133_users
   cpg133_votes

and when I click on usergroups I get this

Database bdweb319966_coppermine - table cpg133_usergroups
Browse

Field Type Attributes Null Default Extra Action
group_id  int(11)   No    auto_increment  Change  Drop  Primary  Index  Unique 
group_name  varchar(255)   No      Change  Drop  Primary  Index  Unique 
group_quota  int(11)   No  0    Change  Drop  Primary  Index  Unique 
has_admin_access  tinyint(4)   No  0    Change  Drop  Primary  Index  Unique 
can_rate_pictures  tinyint(4)   No  0    Change  Drop  Primary  Index  Unique 
can_send_ecards  tinyint(4)   No  0    Change  Drop  Primary  Index  Unique 
can_post_comments  tinyint(4)   No  0    Change  Drop  Primary  Index  Unique 
can_upload_pictures  tinyint(4)   No  0    Change  Drop  Primary  Index  Unique 
can_create_albums  tinyint(4)   No  0    Change  Drop  Primary  Index  Unique 
pub_upl_need_approval  tinyint(4)   No  1    Change  Drop  Primary  Index  Unique 
priv_upl_need_approval  tinyint(4)   No  1    Change  Drop  Primary  Index  Unique 
upload_form_config  tinyint(4)   No  3    Change  Drop  Primary  Index  Unique 
custom_user_upload  tinyint(4)   No  0    Change  Drop  Primary  Index  Unique 
num_file_upload  tinyint(4)   No  5    Change  Drop  Primary  Index  Unique 
num_URI_upload  tinyint(4)   No  3    Change  Drop  Primary  Index  Unique 


is that right?
Title: Re: No admin menu
Post by: kegobeer on July 31, 2005, 06:04:43 AM
That's the structure, but does the table have any data in it?  Click browse.
Title: Re: No admin menu
Post by: apathys on July 31, 2005, 06:20:48 AM
here  you go

clicked on browse

Database bdweb319966_coppermine - table cpg133_usergroups
Showing records 0 - 4 (4 total)

SQL-query : [Edit]
SELECT * FROM cpg133_usergroups LIMIT 0, 30 


group_id 
1   
group_name 
Administrators
group_quota 
0
has_admin_access 
1
can_rate_pictures
1
can_send_ecards

can_post_comments 

can_upload_pictures
1
can_create_albums 
1
pub_upl_need_approval 
0
priv_upl_need_approval 
0
upload_form_config 
3
custom_user_upload
0
num_file_upload
3
num_URI_upload 


that is the first line on that

Title: Re: No admin menu
Post by: Nibbler on July 31, 2005, 01:19:08 PM
Hmm, that's not the problem then.
Title: Re: No admin menu
Post by: apathys on July 31, 2005, 06:15:57 PM
also
when I go to http://www.apathysecstasy.com/coppermine/config.php
after I have logged in as admin
it says 'you are not allowed to access this page"
I tried renaming the config.php to something else besides config and still get
the same error message??
thanks for trying to help
I have never had this happen before.
Title: Re: No admin menu
Post by: kegobeer on July 31, 2005, 06:39:53 PM
That's because you are not logged in, even though the cookie appears to be set.  When did this start happening?  Have you done any modifications to your files?
Title: Re: No admin menu
Post by: apathys on July 31, 2005, 09:09:31 PM
this happened from the get go
no havent done anything to the files
except changing the name of the config.php file to change.php to see if
I could access it, then I changed it back to config.php
when I click on login , it accepts my username/password and then it says 'welcome admin" and then the continute button appears below
that 'continue"
where it brings be to that screen with no admin menu
???
Title: Re: No admin menu
Post by: neilh on August 01, 2005, 12:53:26 PM
Just thought you might like to know I have exactly the same problem so I am interested in the solution to this as well.......
Title: Re: No admin menu
Post by: kegobeer on August 01, 2005, 03:18:00 PM
This is probably related to how the server is set up.  I can't replicate this issue on my test box or my hosted site.  I suggest telling your host about the cookie problem and see if they have any recommendations.

You can also post a link to a phpinfo file.

What is phpinfo? (http://coppermine.sourceforge.net/faq.php#VersionPHP)

@neilh: 1.4.x is unsupported, and this thread deals with 1.3.x.
Title: Re: No admin menu
Post by: neilh on August 01, 2005, 06:46:03 PM
I assumed that as it had been released into the wild you would be interested in reports!
Title: Re: No admin menu
Post by: apathys on August 02, 2005, 01:42:51 AM
and from my webhosts
" We are contacting you in regards to your recent support request, Ticket #100468.  It appears that this issue is a scripting problem."
Title: Re: No admin menu
Post by: Nibbler on August 02, 2005, 01:54:08 AM
If you are happy to PM me ftp details for your gallery I can take a closer look for you.
Title: Re: No admin menu
Post by: apathys on August 02, 2005, 02:16:17 AM
okay thank you
just did
Title: Re: No admin menu
Post by: Nibbler on August 02, 2005, 03:20:35 AM
Ok, the problem is that for some reason your server only lets you set one cookie at once. Coppermine uses several cookies, and only the first ever got set. I've merged the pass and uid cookies into a new single cookie and restricted the use of the data cookie to non login related pages so it doesn't block the login cookie. This means that login now works but there may be some side effects.
Title: Re: No admin menu
Post by: Nibbler on August 02, 2005, 03:35:15 AM
Code changes required for the fix:

include/functions.inc.php

find:

setcookie($CONFIG['cookie_name'].'_data', $data, time()+86400*30, $CONFIG['cookie_path']);

change to

if (!defined('LOGIN_PHP') && !defined('LOGOUT_PHP')) setcookie($CONFIG['cookie_name'].'_data', $data, time()+86400*30, $CONFIG['cookie_path']);

include/init.inc.php

find:

    if (!isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_uid']) || !isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_pass'])) {
        $cookie_uid = 0;
        $cookie_pass = '*';
    } else {
        $cookie_uid = (int)$HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_uid'];
        $cookie_pass = substr(addslashes($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_pass']), 0, 32);
    }


change to

if (!isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_id'])) {
$cookie_uid = 0;
$cookie_pass = '*';
    } else {
list($cookie_uid, $cookie_pass) = unserialize($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_id']);
$cookie_pass = substr(addslashes($cookie_pass), 0, 32);
                $cookie_uid = (int) $cookie_uid;
    }


login.php

find:

setcookie($CONFIG['cookie_name'] . '_uid', $USER_DATA['user_id'], time() + $cookie_life_time, $CONFIG['cookie_path']);
setcookie($CONFIG['cookie_name'] . '_pass', md5($HTTP_POST_VARS['password']), time() + $cookie_life_time, $CONFIG['cookie_path']);


change to:
$data = serialize(array($USER_DATA['user_id'], md5($HTTP_POST_VARS['password'])));
setcookie($CONFIG['cookie_name'] . '_id', $data, time() + $cookie_life_time, $CONFIG['cookie_path']);


logout.php

find:

setcookie($CONFIG['cookie_name'] . '_pass', '', time()-86400, $CONFIG['cookie_path']);
setcookie($CONFIG['cookie_name'] . '_uid', '', time()-86400, $CONFIG['cookie_path']);


change to

setcookie($CONFIG['cookie_name'] . '_id', '', time()-86400, $CONFIG['cookie_path']);

Note to others: Only use this workaround if you are sure this is the real reason you are unable to login.
Title: Re: No admin menu
Post by: apathys on August 02, 2005, 04:06:35 AM
HOT DANM!! you are Good!!!
thank you thank you thank you!!
:)
Title: Re: No admin menu
Post by: Joachim Müller on August 02, 2005, 07:25:00 AM
...and once you upgrade, Nibbler's fix will be lost. I suggest complaining at your webhost once more - show them a link to this thread, don't let yourself be turned down by a statement like "scripting problem"; it's just a poor excuse if a webhost has a silly server setup...