[SOLVED] About Login problem

gobeyondera
Posts: 10
Joined: Tue Jan 31, 2017 6:10 pm

[SOLVED] About Login problem

Post by gobeyondera »

Hi, it is great to find such a wonderful script. I just transferred all the files onto my server, everything is fine. However, I couldnot login the Admin which was not created automatically. I have no idea what the problem is and how I can fix it? It made me a little going nuts. I was wondering if you could help me with that. Thank you for your kind reply.

B.RGS,
Daniel
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: About Login problem

Post by wiz »

Can you access your domain with the default login URL (example.com/loginURL). If that login URL works with your domain, then your htaccess works properly.

Make sure that file permissions are set 644 and folder permissions to 755, as this will probably fix your problem.
gobeyondera
Posts: 10
Joined: Tue Jan 31, 2017 6:10 pm

Re: About Login problem

Post by gobeyondera »

Hi Wiz,

Thank you for your kind reply. I have tried to set permissions shown below; however, it did not work well and showed the message: "PHP Parse error: syntax error, unexpected '[' in D:\wwwroot\loveisluxury\web\index.php on line 12".

Also, there is no directory of "loginURL" on my server, I was wondering if there is any possibilities that there are some files or folders missed in my original downloaded file.

Looking forward for your reply soon.

P.S. Attached images are for your kind reference.

B.RGS,
D.
Attachments
2017-02-02_112032.jpg
2017-02-02_112032.jpg (22.86 KiB) Viewed 35238 times
2017-02-02_112345.jpg
2017-02-02_112345.jpg (20.58 KiB) Viewed 35238 times
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: About Login problem

Post by wiz »

You're welcome, and also welcome to the community.

Can you please re-download the latest ZIP from here and re-upload the files?

The login URL isn't a directory, it's just a name in the database. After you upload the files go to cmd.asia/loginURL (this is your login URL).

If this doesn't work, paste the results and we'll go from there. :)
gobeyondera
Posts: 10
Joined: Tue Jan 31, 2017 6:10 pm

Re: About Login problem

Post by gobeyondera »

Hi, Wiz,

Thank you for your quick response. I just uploaded the files, and go to cmd.asia/loginURL. It showed the same message as before. Attached image is for your kind concern.

Thanks a lot.

B.RGS,
D.
Attachments
2017-02-02_123433.jpg
2017-02-02_123433.jpg (21.68 KiB) Viewed 35236 times
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: About Login problem

Post by wiz »

No problem at all gobeyondera.

In your first post, you posted a working version of WonderCMS at your domain but you had problems with logging in - now it doesn't even load.
Please answer a couple of questions to make it easier to help you out.

1. How did you make it work the first time? (when your WonderCMS page successfully. loaded)
2. Are you sure you set the correct permissions?
3. Do you see database.js besides your index.php? It should generate itself on the first load.
4. What version of PHP are you running?
5. Are you sure you completely deleted the files before re-uploading them?

Looking forward to making this work.
gobeyondera
Posts: 10
Joined: Tue Jan 31, 2017 6:10 pm

Re: About Login problem

Post by gobeyondera »

Hi, Wiz,

Thank you for your kind reply. Now I can get to the WonderCMS page. Due to the server I rent for testing is not very stable, the version of PHP is currently set to version 5.6.

Furthermore, as I entered the word "admin" for login, it went to no page again, and it was a bit fragile. Attached images are for your kind concern.

===
1. How did you make it work the first time? (when your WonderCMS page successfully. loaded) A: Now I can enter again.
2. Are you sure you set the correct permissions? A: Yes.
3. Do you see database.js besides your index.php? It should generate itself on the first load. A: Yes.
4. What version of PHP are you running? A: Now it is php version 5.6
5. Are you sure you completely deleted the files before re-uploading them? A: for now.
===

Thank you again!
All the best.

P.S. the default password is admin, right?

B.RGS,
D.
Attachments
2017-02-03_014303.jpg
2017-02-03_014303.jpg (58.88 KiB) Viewed 35224 times
2017-02-03_014632.jpg
2017-02-03_014632.jpg (45.26 KiB) Viewed 35224 times
2017-02-03_014919.jpg
2017-02-03_014919.jpg (77.32 KiB) Viewed 35224 times
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: About Login problem

Post by wiz »

No problem at all, glad to help and see this is partially working.

The problem
As you can see something gets added to your URL (d/wwwroot/loveisluxury/web/) - this is your hosting providers hosting location for you D:/wwwroot/loveisluxury/web). This shouldn't be there and it happens because of Windows IIS hosting.

This also causes another problem, your styles to not load because of the wrong URL.
Your CSS CSS file links to http://www.cmd.asiaD:/wwwroot/loveislux ... /style.css
instead of http://www.cmd.asia/themes/default/css/style.css.

Also when I click on your login link, it redirects to http://www.cmd.asiad/wwwroot/loveisluxury/web/loginURL
instead of http://www.cmd.asia/loginURL (which works) - and yes the default password is admin.

Every time d/wwwroot/loveisluxury/web/ is added to the URL.

THE SOLUTION
Another user posted about this issue, and a fix:
Replace INC_ROOT in function url with this dirname($_SERVER['SCRIPT_NAME'])

public static function url($location = null) { return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? > 'https://' : 'http://').$_SERVER['HTTP_HOST'].str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\', '/', > INC_ROOT))."/{$location}"; }
The FIX: replace function url in your index.php with the one below.

Code: Select all

public static function url($location = null) { return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? > 'https://' : 'http://').$_SERVER['HTTP_HOST'].str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\', '/', > dirname($_SERVER['SCRIPT_NAME'])))."/{$location}"; }
The user reported the issue here: https://github.com/robiso/wondercms/issues/18.

However there are two downsides to this "hack":
1. Each time you would upgrade WonderCMS, you'd have to replace the function url again with the one posted above.
2. This hasn't been widely tested.

--
In short, to test this solution you have to replace function url with the one posted above. The login links and the styles should then work normally.
gobeyondera
Posts: 10
Joined: Tue Jan 31, 2017 6:10 pm

Re: About Login problem

Post by gobeyondera »

Thanks, Wiz,

I will try the methods as you referred below. Further updates will be delivered on the way.
Again thank you very much.

Have a nice day!

B.RGS,
D.
gobeyondera
Posts: 10
Joined: Tue Jan 31, 2017 6:10 pm

Re: About Login problem

Post by gobeyondera »

Hello, Wiz,

One more step and attached is for your kind reference. If it is okay, I was wondering if you could check index.rar to see if any command lines I missed.

Many thanks.

B.RGS,
D.
Attachments
index.rar
(5.59 KiB) Downloaded 644 times
2017-02-03_113259.jpg
2017-02-03_113259.jpg (23.12 KiB) Viewed 35214 times
Post Reply