Source for file CMS3_PackageVerifier.php
Documentation is available at CMS3_PackageVerifier.php
// CMS3 - A Three Content Management System.
// Copyright (C) 2007 Jop... (Jonas F. Jensen).
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*This file defines CMS3_PackageVerifier
* @package PackageVerifier
* @author Jonas F. Jensen <jopsen@gmail.com>
* @copyright 2007 Jonas F. Jensen.
* @license http://www.gnu.org/licenses/gpl.txt
*PackageVerifier provides a frontend for verifying packages (installed plugins).
//ISystemCallback implementation
* Handles a callback from ajax application.
* @param string data Data attached to this callback
$Res =
$this->Owner->GetPlugin("PackageManager")->VerifyPlugin($_POST["SelectedPackage"]);
print
$Res ?
$this->Formatsha1sumResult($Res) :
"<b style=\"color: Red;\">Package has been modified, the master signature of package is NOT valid.</b>";
//Nothing smart to do, just return a soft 404
print
"Error: 404, data not found.";
*Add HTML formatting to the output from sha1sum
$FRes .=
"<div>" .
$Res .
"</div>";
elseif(substr($Res,-
8) ==
": FAILED")
$FRes .=
"<div style=\"background-color: Red\">" .
$Res .
"</div>";
$FRes .=
"<div style=\"background-color: Yellow\">" .
$Res .
"</div>";
//IConfigure implementation
* Gets an absolute address of an icon for this plugin
return $this->Owner->GetCMS3URL() .
"bin/" .
$this->GetPluginID() .
"/config.png";
* Gets a dojo based ajax guide for configuration of the plugin.
* @param IEmbedmentOutputHandler OutputHandler
* @return IEmbedmentOutputHandler
public function &Configure($Identifier =
null, &$EmbedmentOutputHandler ){
//Load templates from files
foreach($this->Owner->GetPlugin("PackageManager")->ListPlugins() as $Plugin) //Note: we're getting it from PackageManager, since not all plugins are removable
$Options .=
"<option value='" .
$Plugin .
"' >" .
$Plugin .
"</option>\n";
$EmbedmentOutputHandler->ExtentHeader($Head);
$EmbedmentOutputHandler->SetBody($Body);
return $EmbedmentOutputHandler;
//Implementation of IPlugin
* Gets the pluginID of the plugin.
return "PackageVerifier";
Documentation generated on Mon, 30 Apr 2007 01:59:06 +0200 by phpDocumentor 1.3.1