dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
Okay, I've have a script working which allows my clients to change their own theme. Now I'm looking for feedback from everyone.

The way it works is the script is setup like it's own theme directory and a symlink is created in each theme back to the script directory.

For a demo see
http://demo.virtual-hosting.ca:2082
Use ID: demo PW: demo1

Once in append themechg/theme.php to the URL (sorry I have not created direct links yet)

so the URL should look like

http://demo.virtual-hosting.ca:2082/frontend/THEMENAME/themechg/theme.php

All feedback is welcome. Note that until security feedback issues (if any) :) have been resolved I will not release this.
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
I'm very glad you like!

One of the challenges is creating an installer for it. I would have to create the symlink in each theme directory that exists on different hosts. (Can be done with foreach statements)

As well, figure out where to create the link for it. I cannot change others themes, and you'd have to be carefull of themes getting updated.

Any thoughts on over coming this? One was to send the link to get added to all the different theme developers.
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
Either way works, but the same problems exist, how do you get the link in every theme and have it keeped when the themes get updated.

I myself prefered this way as it is going through WHM as opposed to doing it at the file level. I know it's the same result, but I thought this way would be safer as the hidden config file is logging directly into whm.
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
[quote:e215ae5683][i:e215ae5683]Originally posted by Juanra[/i:e215ae5683]

Wouldn't it be easier to change to value of RS in /var/cpanel/users and then redirecting to the new index?[/quote:e215ae5683]

Juanra - I tried the redirect approach and sometimes the browser had to be refreshed a couple of times to notice the change. By closing the browser you clear the login and URL so when user logs back in it always goes to the correct theme path.
 

Website Rob

Well-Known Member
Mar 23, 2002
1,501
1
318
Alberta, Canada
cPanel Access Level
Root Administrator
Ok, call me dumb, but I just could not see/find the link for changing the Theme? Was it removed since original posting or do I need glasses? :)
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
[quote:aa91e5b31f][i:aa91e5b31f]Originally posted by Website Rob[/i:aa91e5b31f]

Ok, call me dumb, but I just could not see/find the link for changing the Theme? Was it removed since original posting or do I need glasses? :)[/quote:aa91e5b31f]

Definitly glasses :)

From the first post, read it all as the url has to change as there is no direct clickon link. :)

For a demo see
http://demo.virtual-hosting.ca:2082
Use ID: demo PW: demo1

Once in append themechg/theme.php to the URL (sorry I have not created direct links yet)

so the URL should look like

http://demo.virtual-hosting.ca:2082/frontend/THEMENAME/themechg/theme.php

Try that.
 

Juanra

Well-Known Member
Sep 22, 2001
777
0
316
Spain
[quote:aac7ee0b73][i:aac7ee0b73]Originally posted by dgbaker[/i:aac7ee0b73]
Juanra - I tried the redirect approach and sometimes the browser had to be refreshed a couple of times to notice the change. By closing the browser you clear the login and URL so when user logs back in it always goes to the correct theme path.[/quote:aac7ee0b73]

Anyway, it wasn't as easy as I thought. I tried to include it in my API but it needs more permissions than Cpanel gives by default.
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
For those that want to play with themechg scripts. It can be picked up here
http://www.virtual-hosting.ca/themechg.tar

INSTRUCTIONS AND WARNINGS.

I will not be responsible for this script in any way shape or form other than what I post here. USE AT YOUR OWN RISK.

SSH into your server
copy the tar file to server
cd /usr/local/cpanel/base/frontend
tar -xvof themes.tar

pico config.php and make appropriate changes.

pico theme.php and ensure correct themes are listed for the form dropdown.

You can put config.php anywhere you like for safety, and I strongly suggest you do as this is not using a hash for the password, just modify the config call in theme.php appropriatly.

Create a symlink in each theme directory as follows;

cd themename
ln -s ../themes themechg

Use your own naming for links and directories.

Now the hard part, how do you get it to your users. You have your own choice to make.
Edit every theme to add a link?
Send the link to the users?
Post the link somewhere common?
Copy themechg to each theme directory?

Your choice. Since we ourselves handle theme updates manually we added a link to each theme.

Remember, that to call the theme.php script the syntax will be
http://host:port/frontend/themename/themechg/theme.php or to that effect.

If something does not work re-read these instructions. :)

I take no responsibilty for security or any issues arising from using this.
 

smperik

Registered
Aug 21, 2002
3
0
151
How is this coming along? Do you think you will be releasing something like this anytime soon? Has anyone fine tuned security for this?
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
[quote:158b0e8cde][i:158b0e8cde]Originally posted by smperik[/i:158b0e8cde]

How is this coming along? Do you think you will be releasing something like this anytime soon? Has anyone fine tuned security for this? [/quote:158b0e8cde]

Read my previous post a copy is available. No one seemed to have any security issues.
 

EcpHosting

Well-Known Member
Dec 16, 2002
69
0
156
[quote:2aae362844][i:2aae362844]Originally posted by smperik[/i:2aae362844]

How is this coming along? Do you think you will be releasing something like this anytime soon? Has anyone fine tuned security for this? [/quote:2aae362844]

oops, someone didnt see page 2
 

EcpHosting

Well-Known Member
Dec 16, 2002
69
0
156
any updates on this?
 

EcpHosting

Well-Known Member
Dec 16, 2002
69
0
156
We would pay for such a feature. You can be assured $50 (at least from us) if you can make a stable script for this (in a rewrite).

Thanks.
 

Brownie

Well-Known Member
Aug 10, 2001
143
0
316
I, Personally, wouldnt recommend using any script that stores the Web Host Manager password in a text file, un-encrypted - rings security alarm bells