• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Create a list of the CMS versions of multiple client websites with a UDT.
PostPosted: Wed Aug 25, 2010 12:32 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 7545
Location: The Netherlands
Some time ago in the Dutch board somebody was looking for a possibility to automaticly create a list of the CMS versions of several other (client) websites.

I have created two small User Defined Tags (UDTs). One for the clientside and one for the serverside. The data is stored in a automaticly created textfile on the clients server, you can change the name of this file and the folder where it is stored.
You can secure the version information per website with an identification code, and the info will be hashed transmitted by means of the PHP md5 function.
I would say it is fairly safe...

Client side

At the client websites you create the following UDT with a unique id code:
set_version_file
Code:
// CLIENT CODE
// The unique id code must be equal to the one used in the {read_version_file} tag in the receiving site
$id = "hfue3nfls91";

// The filename should be the same as in the {read_version_file} tag
$file = "tmp/version.txt";

$create_write = @fopen(($_SERVER['DOCUMENT_ROOT'] . "/" . $file), 'w') or die("ERROR set_version_file UDT: Can't create or open version file!!");

global $CMS_VERSION;
$current_version= $CMS_VERSION;

$send_code = md5(($id . $current_version));

fwrite($create_write, $send_code);

fclose($create_write);


In the CMSMS EventManager you can call this UDT with for example LogoutPost
Every time somebody logs out of the admin, the data file is updated

Server side

Create another UDT at your own (secured) website:
read_version_file
Code:
// SERVER CODE
// Example: {read_version_file url="www.yourwebsitename.com" id="hfue3nfls91"}
// The id code must be the same as in the 'set_version_file' udt in the other website

$id = $params[id];

$url = $params[url];

// The filename must be the same as in the 'set_version_file' udt
$file = "tmp/version.txt";

$complete_url = ("http://" . $url . "/" . $file);

$received_code = @file_get_contents($complete_url);

// Enter new release numbers below!
$cms_release = array (
"1.6",
"1.6.1",
"1.6.2",
"1.6.3",
"1.6.4",
"1.6.5",
"1.6.6",
"1.6.7",
"1.6.8",
"1.7",
"1.7.1",
"1.7.2",
"1.8",
"1.8.1",
"1.8.2",
"1.8.3",
"1.9",
"2.0",
"2.1",
"2.2",
"2.3"
);

foreach ($cms_release as $foo) {

     $bar = md5(($id . $foo));

     if ($bar == $received_code) {
             echo $foo;
     }

}



In a secured webpage you can use the {read_version_file} tag like this:
Code:
<p>www website.com {read_version_file url="www.website.com" id="hfue3nfls91"}</p>
<p>website.nl {read_version_file url="website.nl" id="hg6ogjvdruik33"}</p>
<p>www2 website.org {read_version_file url="www2.website.org" id="kjghlhgc55djf"}</p>



You will create a list of client websites, with it CMS version behind it:
Quote:
www website.com 1.8.2
website.nl 1.6.8
www2 website.org 1.8.2

_________________
Image

Did my post help you solving a problem at your (customers) website and it saved you many hours of work? Great!! Consider buying me a cup of coffee in return! [ Click here ]



Last edited by Rolf on Wed Aug 25, 2010 5:49 pm, edited 1 time in total.

Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Create a list of the CMS versions of multiple client web
PostPosted: Wed Aug 25, 2010 12:42 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Tue Aug 12, 2008 9:30 pm
Posts: 2071
Location: Feldkirchen in Kärnten, Austria
Thx Rolf for sharing, this is very usefull tip.

I was already thinking about feature like this, but it would be even better if it would be sort of a core feature for example in "Global Settings" where there would be a checkbox=send update notification input=my@mail.com.
Since user already gets notified in the Admin about an update available, this would be handy with options like above, so the main admin or developer who developed the site gets automated notification about update and site address and/or info.

_________________
CMSMS Blog - I do this!
Forge profile
Github profile
Twitter
=============================================
Support CMSMS


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Create a list of the CMS versions of multiple client websites with a UDT.
PostPosted: Wed Aug 25, 2010 5:34 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Fri Feb 02, 2007 4:31 pm
Posts: 2387
Location: Comox Valley, BC
Thank you for this excellent tip, Rolf.

What would be fantastic would be to extend it to also show the installed modules and their versions. That would make it easier to stay on top of things for sites you manage.

Nullig


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Create a list of the CMS versions of multiple client web
PostPosted: Wed Sep 10, 2014 9:42 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 7545
Location: The Netherlands
Latest version http://www.cmscanbesimple.org/blog/main ... msms-sites

_________________
Image

Did my post help you solving a problem at your (customers) website and it saved you many hours of work? Great!! Consider buying me a cup of coffee in return! [ Click here ]



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Create a list of the CMS versions of multiple client web
PostPosted: Thu Jan 28, 2016 3:12 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 7545
Location: The Netherlands
New release of the SimpleSiteInfo and SimpleSiteMgr module available in the Forge.

Module is for CMSMS 2.x only and in not backwards compatible with previous releases...

-1 Install at all your websites:
http://dev.cmsmadesimple.org/projects/simplesiteinfo

-2 Install at your master website:
http://dev.cmsmadesimple.org/projects/simplesitemgr

-3 Fill the website information and pass phrase from #1 into the SimpleSiteMgr module

Now you have a nice maintenance tool to see the status of your websites!

Have fun!

_________________
Image

Did my post help you solving a problem at your (customers) website and it saved you many hours of work? Great!! Consider buying me a cup of coffee in return! [ Click here ]



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting