Forum LAMS for Tech-Heads - General Forum: A stupid, stupid mistake


 
You may request notification for A stupid, stupid mistake.
Search: 

1: A stupid, stupid mistake
03/03/08 05:11 PM
[ Reply | Forward ]
I stupidly have removed the sysadmin rights from the lams sysadmin account. Without ditching my install and starting again, is ther any ewasy way to recover the admin rights?

The install is v2.03 on a Server 2k3 machine, installed on port 80, not 8080.

Another silly question, our install of lams is in the ip_address/lams folder. If a student goes to the ip_address (without the /lams folder) they get to the jboss folder for Tomcat. Where should I bew putting a .htaccess file to redirect people to the correct folder?

Thanks in advance for curing my stupidity!

Matt.
CTHS

Posted by Matthew Topp

2: Re: A stupid, stupid mistake
In response to 1 03/04/08 04:37 PM
[ Reply | Forward ]
Hi Mat,

I think that you can fix this by doing some changes on the db directly. Login into the MySQL database and run this script.

insert into lams_user_organisation_role set user_organisation_role_id = 1, user_organisation_id = 1, role_id =1 ;

That should restate sysadmin rights to your sysadmin user.

Thanks,

Ernie

Posted by Ernie Ghiglione

3: Re: Re: A stupid, stupid mistake
In response to 2 03/05/08 07:42 PM
[ Reply | Forward ]
Thanks Ernie, I tried it, but...

I get this error:

Cannot add or update a child row: a foreign key constraint fails (`lams2/lams_user_organisation_role`, CONSTRAINT `FK_lams_user_organisation_role_3` FOREIGN KEY (`user_organisation_id`) REFERENCES `lams_user_organisation` (`user_organisation_id`) ON DELETE N)

Any ideas?

Matt.

Posted by Matthew Topp

4: Re: Re: Re: A stupid, stupid mistake
In response to 3 03/05/08 08:07 PM
[ Reply | Forward ]
You need to fulfill the constraint before running that script.  Do this first:

insert into lams_user_organisation (organisation_id, user_id) values (1,1);

then do:

select user_organisation_id from lams_user_organisation where organisation_id=1 and user_id=1;

you'll get a number back.  in the following script replace <the number> with this number.

insert into lams_user_organisation_role (user_organisation_id, role_id) values (<the number>, 1);

then restart lams.  if you run these 3 commands, don't run Ernie's one.  also, insert usual warning here about modifying data, make sure you have backups, etc.

Posted by Jun-Dir Liew

5: Re: A stupid, stupid mistake
In response to 1 03/05/08 08:13 PM
[ Reply | Forward ]
If you're using Apache with mod_jk, it maybe possible to use mod_rewrite as well to achieve what you want. Or you could edit the index.html in jboss' root folder, which has the path /path/to/jboss-4.0.2/server/default/deploy/jbossweb-tomcat55.sar/ROOT.war; in there you can use a meta refresh tag to redirect people to /lams. I don't think an .htaccess file will work.

Posted by Jun-Dir Liew

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum