how reset admin password or repair the gallery3

Dar2

Joined: 2010-11-17
Posts: 20
Posted: Fri, 2011-06-03 20:42

I cannot login with my password for some reason - basically lost password . In mysql db i see the admin user.

using this:
<?
class x_Controller extends Controller {
public function login_as_admin() {
auth::login(identity::admin_user());
url::redirect(item::root()->abs_url());
}
}

and going /gallery3/index.php/x/login_as_admin - didn't help - i got in event log:

<?php defined('SYSPATH') or die('No direct script access.'); ?>

browser shows: " 302 - Found"

Thank you for your time and help

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Fri, 2011-06-03 21:41
 
Dar2

Joined: 2010-11-17
Posts: 20
Posted: Sat, 2011-06-04 03:24

1 link I already told what i get.
2 link i changed - also doesn't help - got:

"dang.. something went wrong!

:-( We tried really hard, but it's broken. Talk to your Gallery administrator for help fixing this! "

logs show (my gallery3 was renamed to gallery during setup last year):

<?php defined('SYSPATH') or die('No direct script access.'); ?>

2011-06-03 20:19:02 -07:00 --- error: Kohana_Exception [ 403 ]: @todo FORBIDDEN
/home/mypage/public_html/gallery/modules/gallery/helpers/access.php [ 202 ]
#0 /home/mypage/public_html/gallery/modules/gallery/helpers/access.php(425): access_Core::forbidden()
#1 /home/mypage/public_html/gallery/modules/gallery/controllers/login.php(31): access_Core::verify_csrf()
#2 [internal function]: Login_Controller->auth_ajax()
#3 /home/mypage/public_html/gallery/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Login_Controller), Array)
#4 /home/mypage/public_html/gallery/system/core/Event.php(208): Kohana_Core::instance(NULL)
#5 /home/mypage/public_html/gallery/application/Bootstrap.php(67): Event_Core::run(Array, Array)
#6 /home/mypage/public_html/gallery/index.php(126): require('/home/mypage/...')
#7 {main}
2011-06-03 20:19:02 -07:00 --- error: Missing messages entry kohana/core.errors.403 for message kohana/core

------------------------------------------

by changing user password to md5: $P$DyhWrqfmMF/XKPf3CtPn0pIQDZpQKu. (12345) i see that there is a table "user_access_keys" - maybe i need to change something and there?

 
Dar2

Joined: 2010-11-17
Posts: 20
Posted: Mon, 2011-06-06 21:08

i guess, I'll need to reinstall gallery3 and somehow to move all my data to a new one (11GB of info) :(

 
wipmonkey

Joined: 2011-05-07
Posts: 4
Posted: Fri, 2011-07-15 20:14

it works but the path is wrong.. in gallery3 its moved

wrong: modules/controllers/x.php

right: system/controllers/x.php

 
Dar2

Joined: 2010-11-17
Posts: 20
Posted: Thu, 2011-07-21 03:18

didn't help

 
Tessalief

Joined: 2009-07-18
Posts: 48
Posted: Thu, 2011-07-21 08:40

What I did was going into phpmyadmin.
and changed the password in the database.

for example $P$D5GWcHX2f.1WatjewxuNw69kMhuHNS. into $P$DpEmudN/OjcGVV.6.PPNPhVcAx.zWS.

This should get you 12345 as password.

So now you should be able to log in with 12345 and change your password.

Hope this helped you also.

Tes

 
Dar2

Joined: 2010-11-17
Posts: 20
Posted: Thu, 2011-07-21 11:45

this trick doesn't work anymore... :(

 
Tessalief

Joined: 2009-07-18
Posts: 48
Posted: Thu, 2011-07-21 13:13

I've just tried this again in my G3 (3.02) and it worked on 3 accounts!!!

$P$DpEmudN/OjcGVV.6.PPNPhVcAx.zWS. gives you a password --> it is 12345

I am a firefox windows user.. maybe you use something else, then I don't have the answer.

 
Dar2

Joined: 2010-11-17
Posts: 20
Posted: Thu, 2011-07-21 14:45

thanks, i'll to recreated all gallery from scratch(10GB of info..)..-this doesn't work for me:( In db i tried to change flags for guest - made him an admin(with the password that you gave), and than i open a website it's already logged in.. Unfortunately even if i see all admin menu option it doesn't allow to anter anywhere :) - permission denied (it check by id in db)

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Thu, 2011-07-21 14:50

You can try this, but I don't know that it will work:
- Do a clean Gallery install in a new folder on the server.
- Create a new admin, password, etc.
- Copy the user-related tables from the new install's database to the old one (rewriting whatever's there now); don't overwrite the whole database, just the user-related tables--otherwise, Gallery won't have info to access whatever the 10GB of data is.
- Try to access the old Gallery install with the new admin password.

It should only take a sec to try this, so if it doesn't work, no harm done (since you're restarting everything anyway).

 
Dar2

Joined: 2010-11-17
Posts: 20
Posted: Thu, 2011-07-21 15:16

this the second time in 2 months - i believe that someone hacked my gallery somehow..I'll recreated my gallery using mudule http://codex.gallery2.org/Gallery3:Modules:serveradd -it's easy. Next step I'll make a good full backup of the database. Thanks one more time for tying to help

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2011-07-21 16:59

2nd time of what? What other software are you running on your site and is this on a shared server (shared with other sites)? If it's a shared server, how is Apache and PHP configured to run? Are they running a "nobody" or some other user for all sites on the server? If so, what software is running on those sites?
____________________________________________
Like Gallery? Like the support? Donate now!

 
Dar2

Joined: 2010-11-17
Posts: 20
Posted: Thu, 2011-07-21 17:55

this the second time with my admin password..basically it's only gallery running....one database..

kernel: 2.6.18-238.12.1.el5
MySQL: 5.0.92-community
httpd (2.2.11 (Unix))

 
Dar2

Joined: 2010-11-17
Posts: 20
Posted: Thu, 2011-07-21 18:46

all these my problems because of my hosting provider, something happened with the ownership of my files over there. I wasn't able to delete/rename or change permissions on some of my folders even if I have 0775.. - it was too late - i'm recreating everything from the beginning :)

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2011-07-21 18:53

Find a new host or have them fix it. Permission and ownership changes literally only take a couple of seconds (though over 1000s of files, the change may take a few minutes to complete)
____________________________________________
Like Gallery? Like the support? Donate now!