Page 1 of 1

Make /admin root

Posted: Tue May 15, 2012 11:27 pm
by steve
I have tried to make /admin my Hesk Root with no success, no matter what I try the pages do not load properly.

I want mydomain.com/hesk/admin/index.php to read mydomain.com/hesk/index.php.

I have tried various code in .htaccess, also no success, the pages just wont load properly.

Has anybody had any experience with this?

I use the admin interface for user loggin with limited accounts. I have totally removed the customer interface.

Re: Make /admin root

Posted: Wed May 16, 2012 12:55 pm
by Klemen
First of all I wouldn't recommend it as it could lead to all kinds of problems and you would have to make all changes again for each updated version.

You would have to modify all files inside "hesk/admin" folder when moving them to "hesk/" - replace all instances of

Code: Select all

../
to

Code: Select all

./
and delete all instances of

Code: Select all

admin/
It would possibly require more modifications - would be up to you to test everything with trial and error.

Re: Make /admin root

Posted: Wed May 16, 2012 3:09 pm
by steve
I have modified HESK so much, that I will have to spend a week modifying 2.4 before i can update anyways.

Thanks for that, Ill give it a try.

Re: Make /admin root

Posted: Thu May 17, 2012 5:52 am
by steve
Well, I tried to accomplish this using the method described my Klemen with no success. The login screen is displayed, however once I submit my user credentials, the screen goes blank.

I know there are a lot of files to modify and I could have missed something, I tried three times with no luck.

Any ideas on where to look?

Has anybody else managed to pull this off?

Thanks!

Re: Make /admin root

Posted: Thu May 17, 2012 7:02 am
by Klemen
Try setting debug mode to ON and see if you get any errors.

Re: Make /admin root

Posted: Thu May 17, 2012 5:42 pm
by steve
Do I ever.

When I navigate to the Hesk root in my browser on index.php (admin/ index.php) theses errors are shown above the login screen.

Code: Select all

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/ramp/public_html/test/language/en/text.php:1973) in /home/ramp/public_html/test/inc/common.inc.php on line 2415

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/ramp/public_html/test/language/en/text.php:1973) in /home/ramp/public_html/test/inc/common.inc.php on line 2415

Warning: Cannot modify header information - headers already sent by (output started at /home/ramp/public_html/test/language/en/text.php:1973) in /home/ramp/public_html/test/inc/common.inc.php on line 2427
When enter user credential this is shown on a white screen

Code: Select all

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/ramp/public_html/test/language/en/text.php:1973) in /home/ramp/public_html/test/inc/common.inc.php on line 2415

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/ramp/public_html/test/language/en/text.php:1973) in /home/ramp/public_html/test/inc/common.inc.php on line 2415

Warning: Cannot modify header information - headers already sent by (output started at /home/ramp/public_html/test/language/en/text.php:1973) in /home/ramp/public_html/test/inc/common.inc.php on line 2427

Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in /home/ramp/public_html/test/inc/common.inc.php on line 2200

Warning: Cannot modify header information - headers already sent by (output started at /home/ramp/public_html/test/language/en/text.php:1973) in /home/ramp/public_html/test/index.php on line 204

Warning: Cannot modify header information - headers already sent by (output started at /home/ramp/public_html/test/language/en/text.php:1973) in /home/ramp/public_html/test/index.php on line 205

Warning: Cannot modify header information - headers already sent by (output started at /home/ramp/public_html/test/language/en/text.php:1973) in /home/ramp/public_html/test/index.php on line 239

Re: Make /admin root

Posted: Thu May 17, 2012 6:17 pm
by Klemen
Try with the original language/en/text.php file instead.

Re: Make /admin root

Posted: Thu May 17, 2012 6:24 pm
by steve
After reverting back to the original text.php here are the errors in index.php (admin.index.php)

Code: Select all

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/ramp/public_html/test/inc/common.inc.php:3052) in /home/ramp/public_html/test/inc/common.inc.php on line 2415

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/ramp/public_html/test/inc/common.inc.php:3052) in /home/ramp/public_html/test/inc/common.inc.php on line 2415

Warning: Cannot modify header information - headers already sent by (output started at /home/ramp/public_html/test/inc/common.inc.php:3052) in /home/ramp/public_html/test/inc/common.inc.php on line 2427
Once I submit my credentials this is show on a white screen

Code: Select all

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/ramp/public_html/test/inc/database.inc.php:433) in /home/ramp/public_html/test/inc/common.inc.php on line 1211

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/ramp/public_html/test/inc/database.inc.php:433) in /home/ramp/public_html/test/inc/common.inc.php on line 1211

Warning: Cannot modify header information - headers already sent by (output started at /home/ramp/public_html/test/inc/database.inc.php:433) in /home/ramp/public_html/test/inc/common.inc.php on line 1217

Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in /home/ramp/public_html/test/inc/common.inc.php on line 1102

Warning: Cannot modify header information - headers already sent by (output started at /home/ramp/public_html/test/inc/database.inc.php:433) in /home/ramp/public_html/test/index.php on line 204

Warning: Cannot modify header information - headers already sent by (output started at /home/ramp/public_html/test/inc/database.inc.php:433) in /home/ramp/public_html/test/index.php on line 205

Warning: Cannot modify header information - headers already sent by (output started at /home/ramp/public_html/test/inc/database.inc.php:433) in /home/ramp/public_html/test/index.php on line 239

Re: Make /admin root

Posted: Thu May 17, 2012 7:45 pm
by Klemen
Now you need the original common.inc.php file as there are errors in your current one...

You need to be really careful when editing files, because any text/code output before location headers will cause these errors. And since it's thing you modified yourself it's not really something I support.

Re: Make /admin root

Posted: Thu May 17, 2012 10:11 pm
by steve
I was able to make it work by restoring the original common.inc.php file also the database.ini.php.

I am going to wait for the next version upgrade, Ill change the files I need to make the root folder use the admin interface then customize Hesk to my needs. That way I wont have this same issue in the future.

Thanks for all our help.

Re: Make /admin root

Posted: Fri May 18, 2012 8:58 am
by Klemen
Yes, version 2.4 is not far away so you might be better of waiting a while and save yourself a lot of work.

When making changes to files I recommend making small changes step-by-step and testing in between. This way it is much easier to detect and troubleshoot errors.

When modifying include files (files that are included/required inside other files) make sure you don't print out any HTML code inside (except within functions when required) or don't have any empty lines outside <?php ... ?> tags. Such things output HTTP headers so if the script alter tries to set new headers (for example cookies or redirects) you get the "headers already started" error.

Re: Make /admin root

Posted: Thu Jul 19, 2012 8:46 pm
by steve
I was able to make this work using Klemen's method above. i guess the first time around I missed something.

Re: Make /admin root

Posted: Mon Aug 06, 2012 10:46 pm
by dr_patso
wouldn't this be easier? and just not care about the path in the browser?

this is what my index.php looks like, we are just using it as a tracker internally, requests come in through a shared mailbox for the team that we flag/categorize as ours.

I guess in your case you would put the location as yourdomain.com/hesk/admin i dunno, people at big corps work with the most confusing links possible all day, it shouldn't be a big deal, maybe you are being OCD Steve =)

Code: Select all

<?php

   header( 'Location: http://yourdomain.com/admin' ) ;

?>