EditWrx Knowledge Base Home
 Search       Login   Register   Members   Help   Home 
Search by username

EditWrx Knowledge Base > FAQ (Frequently Asked Questions) > Installation Issues > Installing editwrx twice. One demo and one working

Installing editwrx twice. One demo and one working
 Moderated by: Keith  
 New Topic   Reply   Print 
AuthorPost
Martin
Member
 

Joined: Tue Jun 14th, 2005
Location:  
Posts: 66
 Posted: Thu Jan 26th, 2006 02:50 pm
 Quote  Reply 
Is it possible to have a demo version of editwrx running beside a working version of editwrx? And if so what is the best way to go about this?

Regards and keep up the good work Keith. EditWRX is the best!!!

Martin

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 603
 Posted: Thu Jan 26th, 2006 09:14 pm
 Quote  Reply 
You sure can Martin

The default name for the script is wrx.cgi. Make a copy of that file and name it demo.cgi. On wrx.cgi make certain that it has $demo_mode=0;. On demo.cgi change that to $demo_mode=1;

Create your DEMO user with wrx.cgi. Place demo.cgi in the same folder as wrx.cgi and point your demo to demo.cgi. That's all it takes. The script knows it's own name so there is no variable to set for the new name.

Martin
Member
 

Joined: Tue Jun 14th, 2005
Location:  
Posts: 66
 Posted: Fri Jan 27th, 2006 10:06 pm
 Quote  Reply 
Hello Keith!

I am a bit confused about this setup as you explain it.
Because this way what's the point of creating a demo. This way I could also create a new demo user in wrx.cgi and have the demo point to wrx.cgi. So in your explanation what's the difference between the demo.cgi and the wrx.cgi?

I can log-in in both demo.cgi and wrx.cgi with all the usernames and passwords I once created in wrx.cgi and also with the username demo and password demo I created in wrx.cgi just for the demo.

I can also log-in in both wrx.cgi and demo.cgi as admin with the same password.

There is no difference between both cgi's.


Martin

 


Last edited on Fri Jan 27th, 2006 10:22 pm by Martin

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 603
 Posted: Sat Jan 28th, 2006 09:16 pm
 Quote  Reply 
There is no difference between both cgi's

Ah, but there should be a difference, the $demo_mode variable. On demo.cgi give it a positive value of 1, on wrx.cgi leave it a null value of 0. That variable triggers the demo changes.

Martin
Member
 

Joined: Tue Jun 14th, 2005
Location:  
Posts: 66
 Posted: Mon Jan 30th, 2006 03:09 pm
 Quote  Reply 
Hehehehehe I know I am a bit daft in these things but I did add the $demo_mode variable to both files. I placed them at the bottom of the page. maybe that is the problem?

I placed it just below this line:

$routines = $path_to_library."/routines.txt";
require "$routines";

But demo.cgi has $demo_mode=1;
and wrx.cgi has $demo_mode=0;

Martin

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 603
 Posted: Tue Jan 31st, 2006 10:34 pm
 Quote  Reply 
Wrong place. Put the $demo_mode variables near the top, like on the next line below the $editwrx_folder_name variable. Depending on when you installed your wrx.cgi should have a line ################################## near the top. Customizing variables such as $demo_mode need to be placed above that line to ensure they get read as global variables.

Martin
Member
 

Joined: Tue Jun 14th, 2005
Location:  
Posts: 66
 Posted: Wed Feb 1st, 2006 01:46 pm
 Quote  Reply 
Hello Keith,

I now have tried placing the variable totally at the top just below the line
#!/usr/bin/perl --

and I have tried it just below:
$path_to_data

in both cases it didn't change a thing. I can still login into demo.cgi with all usernames and passwords I created for wrx.cgi. and also as admin.

I must be doing something wrong. I will retrace my steps here.

I copied and paste the file wrx.cgi and named it demo.cgi. It's in the same folder and has the same permissions as wrx.cgi (chmod 755).

I logged in into wrx.cgi as admin and created a new user named demo with password demo and gave it a bunch of restrictions (full page editing on only one single page, regular publish type and not allowed to upload files or delete pages and so on).

I saved these settings.

I opened demo.cgi and try to log in with my own personal login name (which I use for editing my own site) and can log-in. I try to log in as admin and can log-in. I try to log in with demo and demo and can log-in.

So far I can find any difference between demo.cgi and wrx.cgi.

I need more help I am sorry to say.
Martin

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 603
 Posted: Wed Feb 1st, 2006 06:56 pm
 Quote  Reply 
Martin

Your are correct. A wrx user can login at demo.cgi and the demo user can login at demo.cgi. That is because all users share the same users.txt. The $demo_mode=1 does not effect any of that.

But, any user logging into demo.cgi has the demo limitations. Any function that would result in a change on the server gets an alert "DISABLED FOR DEMO" instead of the function. Try to save edits to a file and you get the alert instead. Try to upload a file, or delete a file, or rename a file and you get the alert instead.

One peculiararity of demo mode is that the Open Page dialog does not function at all. That tool should not be given to a demo user in User Setups. A demo user should not be loading any page other than your demo page anyhow. You should infact make your demo user a File Restricted user. Our demo assumes that a demo user would login using the pop-up login prompt. Be sure that that prompt points to demo.cgi?prompt

There would be no harm in the demo user logging into wrx.cgi since they could not open a page for editing.

Martin
Member
 

Joined: Tue Jun 14th, 2005
Location:  
Posts: 66
 Posted: Wed Feb 1st, 2006 07:30 pm
 Quote  Reply 
Aha now I understand slightly but .....

 But, any user logging into demo.cgi has the demo limitations. Any function that would result in a change on the server gets an alert "DISABLED FOR DEMO" instead of the function. Try to save edits to a file and you get the alert instead. Try to upload a file, or delete a file, or rename a file and you get the alert instead.


what you are saying here would mean that if I login into demo.cgi with my name and password I normally use to log-in into wrx.cgi so I can edit my site, would now restrict me and not allow me to delete files for instance.

I have just tried it and I could delete a file whilst I was logged in, in demo.cgi with the name and password I normally use for loggin into wrx.cgi.

The only time I get a disabled for demo is when I just login with the demo name and demo password and only then when I have set these restrictions myself when I was creating a new user (the demo user) when I logged into wrx.cgi.

For example I haven't set the restrictions in the admin part for the demo user for saving a file which in your own demo is restricted. How did you go about getting this restricted?


 One peculiararity of demo mode is that the Open Page dialog does not function at all.

Well the open page dialog does function but when I try to open a different page than I have restricted the demo user to (only when I am logged in with demo username and demo password) it opens and then shows a warning stating: >>You do not have permission to edit this page. Select a page you do have permission to edit<< as soon as I click on Ok a blanc screen shows with the restricted page.

As far as I can tell the only reason to create a demo.cgi at all is so that it looks nice in the adress bar. I still can see no difference between demo users login into wrx.cgi or into demo.cgi. I therefore still don't understand what the point is of setting the variable $demo_mode=0 or $demo_mode=1 or even creating a demo.cgi.

Martin

Last edited on Wed Feb 1st, 2006 08:57 pm by Martin

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 603
 Posted: Wed Feb 1st, 2006 09:28 pm
 Quote  Reply 
From your description demo.cgi does not have $demo_mode=1; set correctly.  Or if it is you've also got demo_mode=0; somewhere else on demo.cgi or in config.txt or some other file that is converting it to a 0 from the 1. Look back over all you've done to see if you've placed $demo_mode=0; on any other files.

The $demo_mode variable simply makes conversions in 35 places scattered throughout the code that prevents functions that would immediately result in changing files on the server and instead result in the alert. The $demo_mode variable in no way effects a user or a user's setup, it effects how EditWrx functions in those 35 places. Likewise, nothing you can do to a user's setup effects the way EditWrx functions in regards to being in demo mode.

 

Martin
Member
 

Joined: Tue Jun 14th, 2005
Location:  
Posts: 66
 Posted: Thu Feb 2nd, 2006 11:11 am
 Quote  Reply 
I now uderstand the working of the demo part thanks for explaining it to me Keith! I know I can be a pain the ****.

I haven't touched any other files than wrx.cgi and demo.cgi but just to make sure I checked the other files and the only place I could find demo_mode==1 (in this case it has the = twice) was inside toolbar_js.txt.

So I am not sure what to do now.
Maybe you could take a look at it yourself? Because I have no idea what I am doing as you know and can see:-).

But I sure appreciate the help so far.

Martin

 

Last edited on Thu Feb 2nd, 2006 11:11 am by Martin

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 603
 Posted: Thu Feb 2nd, 2006 07:59 pm
 Quote  Reply 
Martin

Send a support request to support@editwrx.com with the site's FTP url, username and password and I'll get this hammered back into shape for you.


 Current time is 12:20 am




Powered by WowBB 1.62 - Copyright © 2003-2004 Aycan Gulez