Reintegrate branche 2.2

This commit is contained in:
Michael RICOIS 2012-07-19 10:20:03 +00:00
commit 8b221bb928
2439 changed files with 9712 additions and 11901 deletions

View File

@ -1,33 +1,33 @@
[local]
webservices.interne.wsdl = "http://webservice-2.1.sd.dev/interne/v0.4?wsdl-auto"
webservices.interne.wsdl = "http://webservice-2.2.sd.dev/interne/v0.4?wsdl-auto"
webservices.interne.options.soap_version = SOAP_1_2
webservices.entreprise.wsdl = "http://webservice-2.1.sd.dev/entreprise/v0.6?wsdl-auto"
webservices.entreprise.wsdl = "http://webservice-2.2.sd.dev/entreprise/v0.7?wsdl-auto"
webservices.entreprise.options.soap_version = SOAP_1_2
webservices.gestion.wsdl = "http://webservice-2.1.sd.dev/gestion/v0.1?wsdl-auto"
webservices.gestion.wsdl = "http://webservice-2.2.sd.dev/gestion/v0.2?wsdl-auto"
webservices.gestion.options.soap_version = SOAP_1_2
webservices.saisie.wsdl = "http://webservice-2.1.sd.dev/saisie/v0.1?wsdl-auto"
webservices.saisie.wsdl = "http://webservice-2.2.sd.dev/saisie/v0.1?wsdl-auto"
webservices.saisie.options.soap_version = SOAP_1_2
webservices.pieces.wsdl = "http://webservice-2.1.sd.dev/pieces/v0.1?wsdl-auto"
webservices.pieces.wsdl = "http://webservice-2.2.sd.dev/pieces/v0.1?wsdl-auto"
webservices.pieces.options.soap_version = SOAP_1_2
[sdsrvdev01]
webservices.interne.wsdl = "http://webservice-2.1.sd.lan/interne/v0.4?wsdl-auto"
webservices.interne.wsdl = "http://webservice-2.2.sd.lan/interne/v0.4?wsdl-auto"
webservices.interne.options.soap_version = SOAP_1_2
webservices.entreprise.wsdl = "http://webservice-2.1.sd.lan/entreprise/v0.6?wsdl-auto"
webservices.entreprise.wsdl = "http://webservice-2.2.sd.lan/entreprise/v0.7?wsdl-auto"
webservices.entreprise.options.soap_version = SOAP_1_2
webservices.gestion.wsdl = "http://webservice-2.1.sd.lan/gestion/v0.1?wsdl-auto"
webservices.gestion.wsdl = "http://webservice-2.2.sd.lan/gestion/v0.2?wsdl-auto"
webservices.gestion.options.soap_version = SOAP_1_2
webservices.saisie.wsdl = "http://webservice-2.1.sd.lan/saisie/v0.1?wsdl-auto"
webservices.saisie.wsdl = "http://webservice-2.2.sd.lan/saisie/v0.1?wsdl-auto"
webservices.saisie.options.soap_version = SOAP_1_2
webservices.pieces.wsdl = "http://webservice-2.1.sd.lan/pieces/v0.1?wsdl-auto"
webservices.pieces.wsdl = "http://webservice-2.2.sd.lan/pieces/v0.1?wsdl-auto"
webservices.pieces.options.soap_version = SOAP_1_2
[sd-25137]
webservices.interne.wsdl = "http://wse.scores-decisions.com:8081/interne/v0.4?wsdl"
webservices.interne.options.soap_version = SOAP_1_2
webservices.entreprise.wsdl = "http://wse.scores-decisions.com:8081/entreprise/v0.6?wsdl"
webservices.entreprise.wsdl = "http://wse.scores-decisions.com:8081/entreprise/v0.7?wsdl"
webservices.entreprise.options.soap_version = SOAP_1_2
webservices.gestion.wsdl = "http://wse.scores-decisions.com:8081/gestion/v0.1?wsdl"
webservices.gestion.wsdl = "http://wse.scores-decisions.com:8081/gestion/v0.2?wsdl"
webservices.gestion.options.soap_version = SOAP_1_2
webservices.saisie.wsdl = "http://wse.scores-decisions.com:8081/saisie/v0.1?wsdl"
webservices.saisie.options.soap_version = SOAP_1_2
@ -37,9 +37,9 @@ webservices.pieces.options.soap_version = SOAP_1_2
[celeste]
webservices.interne.wsdl = "http://wse.scores-decisions.com:8081/interne/v0.4?wsdl"
webservices.interne.options.soap_version = SOAP_1_2
webservices.entreprise.wsdl = "http://wse.scores-decisions.com:8081/entreprise/v0.6?wsdl"
webservices.entreprise.wsdl = "http://wse.scores-decisions.com:8081/entreprise/v0.7?wsdl"
webservices.entreprise.options.soap_version = SOAP_1_2
webservices.gestion.wsdl = "http://wse.scores-decisions.com:8081/gestion/v0.1?wsdl"
webservices.gestion.wsdl = "http://wse.scores-decisions.com:8081/gestion/v0.2?wsdl"
webservices.gestion.options.soap_version = SOAP_1_2
webservices.saisie.wsdl = "http://wse.scores-decisions.com:8081/saisie/v0.1?wsdl"
webservices.saisie.options.soap_version = SOAP_1_2

View File

@ -46,4 +46,28 @@ class AideController extends Zend_Controller_Action
$this->view->assign('nouveautes', $nouveautes);
}
public function cguAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$accept = $request->getParam('accept', 0);
if ( $accept == 1 ) {
require_once 'Scores/WsScores.php';
$ws = new WsScores();
$accept = $ws->setCGU();
Zend_Registry::get('firebug')->info($accept);
if ($accept) {
//Put in session
$auth = Zend_Auth::getInstance();
$identity = $auth->getIdentity();
$identity->acceptationCGU = date('Y-m-d H:i:s');
$auth->getStorage()->write($identity);
//Redirect
$this->_redirect('/');
}
}
}
}

View File

@ -5,13 +5,11 @@ class BdfController extends Zend_Controller_Action
public function indexAction()
{
$request = $this->getRequest();
$siret = $request->getParam('siret', '');
$req = $request->getParam('req', '');
//Type de module
$module = $request->getParam('module', '');
$siret = $request->getParam('siret', '');
$req = $request->getParam('req', '');
$siret = $request->getParam('siret', '');
$req = $request->getParam('req', '');
$denom = $request->getParam('denom', '');
$type = $request->getParam('type', '');
$code = $request->getParam('code', '');
@ -44,31 +42,29 @@ class BdfController extends Zend_Controller_Action
$bdf = new BDF();
$this->view->assign('siret', $siret);
$this->view->assign('req', $req);
$this->view->assign('req', $req);
$this->view->assign('module', $session->module);
//Liste module FIBEN
$listModulesFiben = $bdf->bdf_modules_fiben();
$listModulesFiben = $bdf->bdf_modules_fiben();
$this->view->assign('listModulesFiben', $listModulesFiben);
//Liste module FCC
$listModulesFcc = $bdf->bdf_modules_fcc();
$this->view->assign('listModulesFcc', $listModulesFcc);
$this->view->assign('listModulesFcc', $listModulesFcc);
}
public function moduleAction()
{
$request = $this->getRequest();
$siret = $request->getParam('siret', '');
$req = $request->getParam('req', '');
$request = $this->getRequest();
//Type de module
$module = $request->getParam('bdfmodule', '');
$siret = $request->getParam('siret', '');
$req = $request->getParam('req', '');
$denom = $request->getParam('denom', '');
$type = $request->getParam('type', '');
$type = $request->getParam('type', 'u');
$code = $request->getParam('code', '');
$rechet = $request->getParam('rechet', '');
$ape = $request->getParam('ape', '');
@ -78,7 +74,9 @@ class BdfController extends Zend_Controller_Action
$siret = '';
} else if (substr($siret, 0, 9) == $req || empty($req)) {
$req = substr($siret, 0, 9);
}
}
Zend_Registry::get('firebug')->info($module);
$content = array();
@ -100,7 +98,7 @@ class BdfController extends Zend_Controller_Action
$listModules = $bdf->{$func_module}();
$retour['html'] = $bdf->displayModule($req, $m, $service, $listModules);
$retour['titre'] = $req.' - Module '.$listModules[$m]['titre'];
$content[] = $retour;
$content[] = $retour;
}
} else {
if (array_key_exists($module, $bdf->bdf_modules_fiben())){
@ -114,8 +112,8 @@ class BdfController extends Zend_Controller_Action
$listModules = $bdf->{$func_module}();
$content[]['html'] = $bdf->displayModule($req, $module, $service, $listModules);
$content[]['titre'] = $req.' - Module '.$listModules[$module]['titre'];
}
}
}
}
//Mode multi-identifiant
elseif ($type=='m') {
if (is_array($module))
@ -133,10 +131,51 @@ class BdfController extends Zend_Controller_Action
$listModules = $bdf->{$func_module}();
$content[]['html'] = $bdf->displayModule($req, $module, $service, $listModules);
$content[]['titre'] = 'Module '.$listModules[$module]['titre'];
}
}
}
}
}
$this->view->assign('content', $content);
}
public function module27Action()
{
$request = $this->getRequest();
$params['siret'] = $request->getParam('siret');
$params['bdfmodule'] = array(27);
$this->_forward('module', null, null, $params);
}
public function module28Action()
{
$request = $this->getRequest();
$params['siret'] = $request->getParam('siret');
$params['bdfmodule'] = array(28);
$this->_forward('module', null, null, $params);
}
public function module29Action()
{
$request = $this->getRequest();
$params['siret'] = $request->getParam('siret');
$params['bdfmodule'] = array(29);
$this->_forward('module', null, null, $params);
}
public function module40Action()
{
$request = $this->getRequest();
$params['siret'] = $request->getParam('siret');
$params['bdfmodule'] = array(40);
$this->_forward('module', null, null, $params);
}
public function module51Action()
{
$request = $this->getRequest();
$params['siret'] = $request->getParam('siret');
$params['bdfmodule'] = array(51);
$this->_forward('module', null, null, $params);
}
}

View File

@ -99,6 +99,31 @@ class DashboardController extends Zend_Controller_Action
'aUA' => 'ATTESTATION DU CONJOINT COMMUN EN BIENS',
);
/**
* Return a ramdom password
* @param int $length
* Length of the string
* @param int $strength
* $strength = 1:- 0-9
* $strength = 2:- A-Z0-9
* $strength = 3:- A-Za-z0-9
* $strength = 4:- A-Za-z0-9 and # $ % &
* $strength = 5:- A-Za-z0-9 and # $ % & = > ? @
* @return string
*/
protected function randomPassword($length,$strength)
{
$char_sets=array('48-57','65-90','97-122','35-38','61-64');
$new_password='';
srand(microtime()*10000000);
for($i=0;$i<$length;$i++){
$random=rand(0,$strength-1);
list($start,$end)=explode('-',$char_sets[$random]);
$new_password.=chr(rand($start,$end));
}
return $new_password;
}
public function init()
{
require_once 'Scores/WsScores.php';
@ -501,7 +526,7 @@ class DashboardController extends Zend_Controller_Action
public function clientAction()
{
$user = new Scores_Utilisateur();
if ( !$user->isSuperAdmin() ){
if ( !$user->isSuperAdmin() ) {
$this->_forward('perms', 'error');
}
@ -545,12 +570,165 @@ class DashboardController extends Zend_Controller_Action
$this->view->assign('infos', $request->getParams());
}
public function usersAction()
{
$this->view->headLink()->appendStylesheet('/themes/default/styles/user.css', 'all');
$user = new Scores_Utilisateur();
$request = $this->getRequest();
$idClient = $request->getParam('idClient', $user->getIdClient());
if (!$user->isSuperAdmin() && !$user->isAdmin()) {
$this->renderScript('error/perms.phtml');
}
if ($user->isAdmin()){
$idClient = $user->getIdClient();
}
$ws = new WsScores();
$infos = $ws->getListeUtilisateurs($user->getLogin(), $idClient);
$utilisateurs = $infos->result->item;
$this->view->assign('utilisateurs', $utilisateurs);
$this->view->assign('idClient', $idClient);
}
public function userAction()
{
$this->view->headLink()
->appendStylesheet('/themes/default/styles/user.css', 'all')
->appendStylesheet('/themes/default/styles/form.css', 'all');
$this->view->headScript()->appendFile('/themes/default/scripts/user.js', 'text/javascript');
$request = $this->getRequest();
$op = $request->getParam('op');
$idClient = $request->getParam('idClient');
$login = $request->getParam('login');
switch($op) {
case 'new':
require_once 'Scores/WsScores.php';
$ws = new WsScores();
//Liste de tous les droits
$listeDroits = $ws->getListeDroits();
$droitsLib = array();
foreach($listeDroits->item as $droit) {
$droitsLib[strtoupper($droit->code)] = $droit->desc;
}
$this->view->assign('droitsLib', $droitsLib);
//Liste de toutes les préférences
$listePrefs = $ws->getListePrefs();
$prefsLib = array();
foreach($listePrefs->item as $pref) {
$prefsLib[strtoupper($pref->code)] = $pref->desc;
}
$this->view->assign('prefsLib', $prefsLib);
$options['idClient'] = $idClient;
$this->view->assign('options', $options);
//Customer informations
$reponse = $ws->getListeClients($idClient);
$InfosClient = $reponse->result->item[0];
$this->view->assign('loginNew', $InfosClient->racineLogin);
$this->view->assign('droitsClients', explode(' ', strtolower($InfosClient->droits)));
$this->view->assign('password', $this->randomPassword(10, 3));
$this->view->assign('action', 'new');
break;
case 'edit':
require_once 'Scores/WsScores.php';
$ws = new WsScores();
//Liste de tous les droits
$listeDroits = $ws->getListeDroits();
$droitsLib = array();
foreach($listeDroits->item as $droit) {
$droitsLib[strtoupper($droit->code)] = $droit->desc;
}
$this->view->assign('droitsLib', $droitsLib);
//Liste de toutes les préférences
$listePrefs = $ws->getListePrefs();
$prefsLib = array();
foreach($listePrefs->item as $pref) {
$prefsLib[strtoupper($pref->code)] = $pref->desc;
}
$this->view->assign('prefsLib', $prefsLib);
$options->idClient = $idClient;
$this->view->assign('options', $options);
//Customer informations
$reponse = $ws->getListeClients($idClient);
$InfosClient = $reponse->result->item[0];
$this->view->assign('loginNew', $InfosClient->racineLogin);
$this->view->assign('droitsClients', explode(' ', strtolower($InfosClient->droits)));
//User informations
$user = $ws->getUser($login);
$options = json_decode($user, true);
Zend_Registry::get('firebug')->info($user);
$this->view->assign('droits', explode(' ',$options['droits']));
$this->view->assign('prefs', explode(' ',$options['pref']));
$this->view->assign('options', $options);
$this->view->assign('action', 'edit');
break;
case 'delete':
$action = 'delete';
require_once 'Scores/WsScores.php';
$ws = new WsScores();
$ws->setInfosLogin($login, $action);
//Redirect
$this->_redirect('/dashboard/users/idClient/'.$idClient);
break;
case 'enable':
$action = 'enable';
require_once 'Scores/WsScores.php';
$ws = new WsScores();
$ws->setInfosLogin($login, $action);
//Redirect
$this->_redirect('/dashboard/users/idClient/'.$idClient);
break;
case 'disable':
$action = 'disable';
require_once 'Scores/WsScores.php';
$ws = new WsScores();
$ws->setInfosLogin($login, $action);
//Redirect
$this->_redirect('/dashboard/users/idClient/'.$idClient);
break;
case 'save':
$action = 'new'; //update
break;
}
}
/**
* Affichage du formulaire pour l'envoi des fichiers concernant les nouveautées
*/
public function newformAction()
{
//Nothing
//Only the view
}
/**

View File

@ -670,20 +670,28 @@ class IdentiteController extends Zend_Controller_Action
$items = array();
if ($googleNews!==false){
$url = 'http://news.google.fr/news?hl=fr&gl=fr&q='.
$url = 'http://news.google.fr/news?hl=fr&gl=fr&q='.
urlencode($session->getRaisonSociale()).'&output=rss';
define('MAGPIE_CACHE_ON', true);
define('MAGPIE_CACHE_DIR', APPLICATION_PATH . '/../cache/rss');
define('MAGPIE_CACHE_AGE', 60*60*24);
define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');
define('MAGPIE_INPUT_ENCODING', 'UTF-8');
define('MAGPIE_DETECT_ENCODING', false);
require_once ('Vendors/magpierss/rss_fetch.inc');
$rss = fetch_rss($url);
if ($rss!==false){
$items = array_slice($rss->items, 0, 15);
}
}
$items = array();
try {
$canal = new Zend_Feed_Rss($url);
} catch (Exception $e) {
//Do nothing
}
if (count($canal)>0)
{
$i=0;
foreach ($canal as $element)
{
$items[] = $element;
$i++;
if ($i==$nbNews) break;
}
}
}
$this->view->assign('items', $items);
} else {
$this->view->assign('disable', true);

View File

@ -23,37 +23,54 @@ class JuridiqueController extends Zend_Controller_Action
public function annoncesAction()
{
$request = $this->getRequest();
$source = $request->getParam('source');
$vue = $request->getParam('vue');
$this->view->assign('vue', $vue);
$vue = $request->getParam('vue', 'bodacc');
$p = $request->getParam('p', 1);
$this->view->assign('p', $p);
$idAnn = $request->getParam('idAnn', '');
$idAnn = $request->getParam('idAnn', 0);
$siren = substr($this->siret, 0,9);
$filtre = 0;
if (!empty($vue)) {
switch ($vue){
case 'bodacc': $filtre=1; break;
case 'balo': $filtre=2; break;
case 'asso': $filtre=3; break;
case 'bomp': $filtre=4; break;
}
}
if (!empty($source)) {
switch ($source){
case 1: $filtre=1; break;
case 2: $filtre=2; break;
case 3: $filtre=3; break;
}
$source = $request->getParam('source');
if (!empty($source)) {
switch ($source){
case 1: $vue='bodacc'; break;
case 2: $vue='balo'; break;
case 3: $vue='asso'; break;
}
}
$session = new SessionEntreprise($this->siret, $this->id);
$fj = $session->getFormeJuridique();
if ($fj>9000 && $fj<9999 && intval($siren)==0) {
$filtre=3;
$vue='asso';
}
$this->view->assign('vue', $vue);
$nbAnnonces = 20;
$position = ($p-1)*$nbAnnonces;
$ws = new WsScores();
$infos = $ws->getAnnonces($siren, $filtre, $idAnn);
switch ( $vue ) {
case 'bodacc':
case 'abod':
default:
$infos = $ws->getAnnoncesLegales($siren, $idAnn, null, $position, $nbAnnonces);
break;
case 'balo':
$infos = $ws->getAnnoncesBalo($siren, $idAnn, null, $position, $nbAnnonces);
break;
case 'asso':
$infos = $ws->getAnnoncesAsso($siren, $idAnn, null, $position, $nbAnnonces);
break;
case 'bomp':
$filtre = $request->getParam('filtre', null);
$this->view->assign('filtre', $filtre);
$infos = $ws->getAnnoncesBoamp($siren, $idAnn, $filtre, $position, $nbAnnonces);
break;
}
if ($infos === false) $this->_forward('soap', 'error');
Zend_Registry::get('firebug')->info($infos);
require_once 'Scores/Annonces.php';
@ -74,8 +91,7 @@ class JuridiqueController extends Zend_Controller_Action
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$this->view->assign('AutrePage', $request->getParam('apage'));
$this->view->assign('exportObjet', $infos);
$this->view->assign('exportObjet', $infos);
$this->view->assign('surveillance', $user->checkPerm('survannonce'));
//Affichage pour une annonce
@ -85,8 +101,7 @@ class JuridiqueController extends Zend_Controller_Action
$this->view->headScript()->appendFile('/themes/default/scripts/saisieannonces.js', 'text/javascript');
}
$type = ucfirst($vue);
$classType = 'annonces'.$type;
$classType = 'annonces'.ucfirst($vue);
foreach($objAnnonces->$classType as $ann) {
if($ann->id==$idAnn) break;
}
@ -136,6 +151,36 @@ class JuridiqueController extends Zend_Controller_Action
//Affichage pour la liste des annonces
} else {
$nbReponses = $infos->nbReponses;
$nbPages = ceil($nbReponses/$nbAnnonces);
//Attention ajout des filtres
if ( $p <= 1 ) {
$lienPagePrecedente = false;
} else {
$lienPagePrecedente = $this->view->url(array(
'controller'=>'juridique',
'action'=>'annonces',
'vue'=>$vue,
'p'=>$p-1
));
}
if ( $p+1 > $nbPages ) {
$lienPageSuivante = false;
} else {
$lienPageSuivante = $this->view->url(array(
'controller'=>'juridique',
'action'=>'annonces',
'vue'=>$vue,
'p'=>$p+1
));
}
$this->view->assign('nbPages',$nbPages);
$this->view->assign('lienPagePrecedente',$lienPagePrecedente);
$this->view->assign('lienPageSuivante',$lienPageSuivante);
foreach ($typeAnnonces as $type)
{
$classType = 'annonces'.$type;

View File

@ -32,7 +32,7 @@ class PrintController extends Zend_Controller_Action
case 'liasse':
$params['unit'] = $elements[4];
$params['date'] = $elements[5];
break;
break;
}
$params['siret'] = $elements[2];
$params['id'] = $elements[3];
@ -44,6 +44,7 @@ class PrintController extends Zend_Controller_Action
$params['id'] = $elements[3];
$params['idAnn'] = $elements[4];
$params['vue'] = $elements[5];
$params['p'] = $elements[6];
break;
case 'infosreg':
case 'conventions':
@ -62,7 +63,7 @@ class PrintController extends Zend_Controller_Action
break;
default:
return false;
break;
break;
}
break;
case 'evaluation':
@ -79,7 +80,7 @@ class PrintController extends Zend_Controller_Action
$params['filtre'] = $elements[3];
break;
}
break;
break;
default:
return false;
break;
@ -118,7 +119,7 @@ class PrintController extends Zend_Controller_Action
exit;
}
require_once 'wkhtmltopdf/wkhtmltopdf.php';
require_once 'wkhtmltopdf/wkhtmltopdf.php';
$pdf = new wkhtmltopdf();
$pdf->setOptions('footer-right', 'Page [page] sur [toPage]');
$pdf->setOptions('header-right', date('d/m/Y H:i:s'));

View File

@ -311,7 +311,8 @@ class RechercheController extends Zend_Controller_Action
$params = $request->getParams();
$type = $request->getParam('type', '');
$token = $request->getParam('token', null);
$filtre = $request->getParam('filtre', 'tout');
//On vérifie que le formulaire ait au moins un des champs rempli
$action = 'entreprise';
@ -377,7 +378,7 @@ class RechercheController extends Zend_Controller_Action
$ws = new WsScores();
//Criteres recherche entreprise
if ($type=='ent'){
if ( $type=='ent' ) {
require_once 'i18n/cleanchar.php';
@ -417,13 +418,40 @@ class RechercheController extends Zend_Controller_Action
$criteres['telFax'] = $telFax;
$criteres['naf'] = $naf;
$criteres['siege'] = false;
$criteres['actif'] = false;
$reponse = $ws->searchEntreprise($criteres, $position);
Zend_Registry::get('firebug')->info($params['filtre']);
//Affichage du filtre actif/inactif
$filtres = array(
'tout' => array(
'txt'=>'Afficher tous les résultats',
'select'=>'',
'value' => 2,
),
'actif' => array(
'txt'=>'Afficher uniquement les actifs',
'select'=>'',
'value' => 1,
),
'inactif' => array(
'txt'=>'Afficher uniquement les inactifs',
'select'=>'',
'value' => 0,
),
);
$filtres[$filtre]['select'] = ' selected';
$this->view->assign('filtres', $filtres);
$criteres['actif'] = $filtres[$filtre]['value'];
$reponse = $ws->searchEntreprise($criteres, $position);
unset($criteres['actif']);
$this->view->assign('rechCsv', $user->checkPerm('rechcsv'));
//Criteres recherche dirigeants
} else if ($type=='dir') {
} else if ( $type=='dir' ) {
// Type de recherche = dirigeants
//$dirNom = preg_replace('/[^0-9A-Z]/', ' ', strtoupper($params['dirNom']));
@ -952,7 +980,30 @@ class RechercheController extends Zend_Controller_Action
$criteres['telFax'] = $telFax;
$criteres['naf'] = $naf;
$criteres['siege'] = false;
$criteres['actif'] = false;
$request = $this->getRequest();
$filtre = $request->getParam('filtre', 'tout');
//Affichage du filtre actif/inactif
$filtres = array(
'tout' => array(
'txt'=>'Afficher tous les résultats',
'select'=>'',
'value' => 2,
),
'actif' => array(
'txt'=>'Afficher uniquement les actifs',
'select'=>'',
'value' => 1,
),
'inactif' => array(
'txt'=>'Afficher uniquement les inactifs',
'select'=>'',
'value' => 0,
),
);
$criteres['actif'] = $filtres[$filtre]['value'];
$reponse = $ws->searchEntreprise($criteres, 0, 200);
//Criteres recherche dirigeants

View File

@ -33,6 +33,7 @@ class UserController extends Zend_Controller_Action
$InfosLogin->result->timeout : 1800;
$identity->time = time() + $identity->timeout;
$identity->modeEdition = false;
$identity->acceptationCGU = $InfosLogin->result->acceptationCGU;;
return $identity;
}
@ -76,20 +77,9 @@ class UserController extends Zend_Controller_Action
//Enregistrement des données new & update
if (in_array($action, array('new','update'))) {
$infos = new stdClass();
$infos->idClient = $options['idClient'];
$infos->nom = $options['nom'];
$infos->prenom = $options['prenom'];
$infos->reference = $options['reference'];
$infos->email = strtolower($options['email']);
$infos->tel_fix = $options['tel_fix'];
$infos->tel_fax = $options['tel_fax'];
$infos->tel_mob = $options['tel_mob'];
$infos->rech_nbrep = $options['rech_nbrep'];
$infos->formatMail = $options['formatMail'];
$infos->password = '';
if ($options['changepwd']==1){
$infos->password = $options['password'];
if ($options['changepwd']!=1) {
$options['password'] = '';
}
if ( in_array($options['profil'], array('Administrateur', 'SuperAdministrateur'))
@ -97,13 +87,14 @@ class UserController extends Zend_Controller_Action
$options['droits'][] = 'monprofil';
}
$infos->droits = $options['droits'];
$infos->pref = $options['pref'];
$infos->profil = isset($options['profil']) ? $options['profil'] : 'Utilisateur';
$infos = $ws->setInfosLogin($login, $action, $infos);
if( !isset($options['profil']) ) {
$options['profil'] = 'Utilisateur';
}
$reponse = $ws->setInfosLogin($login, $action, $options);
$isProfilUpdated = true;
$message = 'Erreur lors de la mise à jour du compte !';
if ($infos->result){
if ($reponse){
$updateResult = true;
$message = 'Compte mis à jour.';
}
@ -175,7 +166,6 @@ class UserController extends Zend_Controller_Action
Zend_Registry::get('firebug')->info('action : '.$action);
if ($op=='new'){
Zend_Registry::get('firebug')->info('Gestion first user SD');
$idClient = $request->getParam('idClient', '');
if ($idClient == '') {
$idClient = $identity->idClient;
@ -334,6 +324,10 @@ class UserController extends Zend_Controller_Action
*/
public function loginAction()
{
$this->view->inlineScript()
->appendFile('/libs/jquery/jquery.js')
->appendFile('/libs/jquery/jquery.infieldlabel.min.js');
//@todo : gestion des affichages particuliers pour les clients
$this->view->headTitle()->append('Connexion');
$form = new Form_Login();
@ -362,7 +356,7 @@ class UserController extends Zend_Controller_Action
$url = $session->url;
}
}
if (!empty($url) && $url!='/user/login' && $url!='/localauth'){
if (!empty($url) && $url!='/user/login' && $url!='/user/logout' && $url!='/localauth'){
$this->_redirect($url);
}
$this->_redirect('/');
@ -378,22 +372,20 @@ class UserController extends Zend_Controller_Action
*/
public function logoutAction()
{
Zend_Auth::getInstance()->clearIdentity();
$auth = Zend_Auth::getInstance();
$auth->clearIdentity();
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$message = $request->getParam('message');
$this->view->assign('message', $message);
$url = 'http://www.scores-decisions.com/';
if (APPLICATION_ENV != 'production'){
$url = 'http://'.$_SERVER['SERVER_NAME'].$this->view->url(array(
'controller' => 'user',
'action' => 'login',
));
}
$url = 'http://'.$_SERVER['SERVER_NAME'].$this->view->url(array(
'controller' => 'user',
'action' => 'login',
));
$this->view->assign('url', $url);
$this->view->headMeta()->appendHttpEquiv('refresh', '5; url='.$url);
$this->render('logout');

View File

@ -0,0 +1,108 @@
<?=$this->doctype();?>
<html>
<head>
<?=$this->headMeta();?>
<?=$this->headTitle();?>
<?=$this->headStyle();?>
<?=$this->headLink();?>
<?=$this->headScript();?>
<style>
p { margin:10px 0;}
div#content { float:none; width:auto;}
</style>
<script>
$(document).ready(function(){
$('input[type=checkbox][name=accept]').click(function(e){
$('form[name=cgu]').css('display', 'none');
$('#msgsave').css('display', 'block');
$('form[name=cgu]').submit();
});
});
</script>
</head>
<body>
<div id="global">
<div id="content">
<div id="center">
<h1>Conditions daccès à l'extranet (comptes d'accès test et comptes payants)</h1>
<div class="paragraph">
<p>Ce site est destiné uniquement aux professionnels et non au grand public.</p>
<p>Ce site est destiné uniquement aux entreprises ayant une représentation juridique France,
il a spécialement été conçu pour les professionnels français et ne peut être considéré comme une
offre dachat ou de vente, ni comme une incitation à lachat ou à la vente dans toute autre
juridiction que la France.</p>
</div>
<h2>Mises en garde</h2>
<div class="paragraph">
<p>Les informations communiquées par lintermédiaire de ce site Web ne vous sont communiquées
quaux termes et conditions des présentes et ne sont destinées qu'à votre utilisation à des fins
professionnelles et légitimes (les « fins autorisées »). Sans laccord écrit de Scores & Décisions,
vous nêtes pas autorisé à stocker, télécharger, reproduire, vendre, redistribuer ou disposer des
informations de toute manière ou à toute autre fin que celles autorisées.</p>
<p>La consultation ou la réception de documents n'entraîne aucun transfert de droit de propriété
intellectuelle en faveur du Client. Ce dernier s'engage à ne pas rediffuser ou reproduire les
données fournies autrement que pour son usage dans le cadre de la relation contractuelle établie ou
le test entre Scores & Décisions SAS et "le Client".</p>
<p>Scores & Décisions garantit que les informations sont conforme à la réglementation en vigueur et
notamment au Code de la Propriété Intellectuelle.</p>
<p>La base de données Scores & Décisions est pour partie issue du RNCS de l'INSEE, de la DILA et
de diverses collectes internes et privés.</p>
<p>Bien que Scores & Décisions utilise des procédures rigoureuses et mette en œuvre toutes les
diligences requises par les usages de la profession pour tenir à jour la présente base de données
et fournir des informations précises, les informations peuvent comporter une certaine marge d'erreur.</p>
<p>En raison des conditions d'accès à linformation et autres aléas de traitements, les informations
issue des sources privées sont données "en l'état" sans aucune garantie, ni quelconque force
juridique ou opposabilité aux tiers. L'utilisateur recherche, traite et interprète les données sous
sa propre responsabilité.</p>
Les informations présentées sur le présent service constituent des œuvres protégeables du Code la
propriété intellectuelle, dont le producteur est seul auteur et propriétaire exclusif, toute
retransmission d'information ou données à un "tiers, personne physique ou morale" pourra faire
l'objet de poursuite par Scores & Décisions SAS le cas échéant. L'utilisateur final s'engage donc
à faire un usage strictement personnel et professionnel de ces informations, et en aucun cas pour
constituer des fichiers destinés notamment à la location ou à la (re)vente ou pour (re)diffuser ces
informations à des tiers de façon payante ou même gracieuse. »
<p>Scores & Décisions se réserve le droit daccorder ou de révoquer lautorisation dutiliser les
sites scores-decisions.com à son entière discrétion dans le cadre d'un test. Bien que toutes les
précautions raisonnables aient été prises pour veiller à lexactitude, la sécurité et la
confidentialité des informations disponibles par lintermédiaire des sites Extranets
scores-decisions.com, Scores & Décisions ne saurait cependant être tenue responsable des
conséquences des agissements dun utilisateur autorisé ou non autorisé. Scores & Décisions
communique uniquement des informations, données identifiées et sourçables et issues de sources
officielles et privées.</p>
<p>Les données communiquées dans les présentes et lutilisation que vous en faites ultérieurement
peuvent, le cas échéant, être soumises à certaines réglementations, conditions et restrictions
externes légales ou autres. Toutes les utilisations que vous faites des informations doivent
respecter les réglementations, conditions et restrictions applicables à la région ou au territoire
où vous utilisez les informations des présentes ainsi que les présentes conditions d'utilisation.</p>
<form name="cgu" method="post" action="<?=$this->url(array('controller'=>'aide','action'=>'cgu'),null,true)?>">
<p style="font-size:14px; font-weight:bold;">
<input type="checkbox" value="1" name="accept" />
Je certifie être un Professionnel (au sens visé ci-dessus) et avoir pris connaissance, compris et accepté les conditions daccès et de mise en garde.
</p>
</form>
<p id="msgsave" style="display:none; font-size:14px; font-weight:bold;">Enregistrement de votre acceptation des CGU...</p>
</div>
</div>
<div id="footer">
<?=$this->render('footer.phtml')?>
</div>
</div>
</div>
</body>
</html>

View File

@ -71,13 +71,13 @@ if (count($this->ListeClients) > 0) {
</span>
</div>
<a title="Liste des utiliateurs" href="<?=$this->url(array(
'controller' => 'user',
'action' => 'liste',
'controller' => 'dashboard',
'action' => 'users',
'idClient' => $cl->idClient
))?>">Liste des utilisateurs
</a>
<div>
</div>
</td>

View File

@ -0,0 +1,281 @@
<div id="center">
<?php if (!empty($this->message)) { ?>
<div style="margin:5px; padding: 5pt 0.7em;" class="ui-state-highlight ui-corner-all">
<p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"></span>
<?=$this->message?>
</p></div>
<?php } ?>
<h1 class="titre">PROFIL UTILISATEUR</h1>
<div class="paragraph">
<form id="moncompte" name="moncompte" action="/user" method="post">
<input type="hidden" name="frmOptions[idClient]" value="<?=$this->options['idClient']?>"/>
<input type="hidden" name="frmOptions[action]" value="<?=$this->action?>"/>
<div class="infoTitle StyleInfoLib">Identifiant utilisateur</div>
<div class="infoData">
<?php
if ($this->action == 'new') {
?>
<input type="text" size="20" maxlength="80" name="frmOptions[login]" value="<?=$this->loginNew?>"/>
<?php
} else {
?>
<input type="text" size="20" maxlength="80" name="frmOptions[login]" value="<?=$this->options['login']?>"/>
<?php } ?>
</div>
<div class="infoTitle StyleInfoLib">Identit&eacute; (NOM/Pr&eacute;nom)</div>
<div class="infoData">
<input type="text" size="20" maxlength="80" name="frmOptions[nom]" value="<?=$this->options['nom']?>"/>
<input type="text" size="20" maxlength="80" name="frmOptions[prenom]" value="<?=$this->options['prenom']?>"/>
</div>
<div class="infoTitle StyleInfoLib">R&eacute;f. facturation (service, etc...)</div>
<div class="infoData">
<input type="text" size="20" maxlength="80" name="frmOptions[reference]" value="<?=$this->options['reference']?>"/>
</div>
<div class="infoTitle StyleInfoLib">Adresse e-mail</div>
<div class="infoData">
<input type="text" size="30" maxlength="80" name="frmOptions[email]" value="<?=$this->options['email']?>"/>
</div>
<div class="infoTitle StyleInfoLib">
Num&eacute;ros de t&eacute;l&eacute;phone<br/><i>(Fixe, Fax, Mobile)</i>
</div>
<div class="infoData">
<input type="text" size="10" maxlength="15" name="frmOptions[tel_fix]" value="<?=$this->options['tel']?>"/>
<input type="text" size="10" maxlength="15" name="frmOptions[tel_fax]" value="<?=$this->options['fax']?>"/>
<input type="text" size="10" maxlength="15" name="frmOptions[tel_mob]" value="<?=$this->options['mobile']?>"/>
</div>
<br/>
<div class="infoTitle StyleInfoLib">Mot de passe</div>
<div class="infoData last">
<?php
if ($this->action=='new') {
$typeChamp = 'text';
$changePassword = 1;
?>
<input type="<?=$typeChamp?>" name="frmOptions[password]" value="<?=$this->password?>"/>
<input type="hidden" name="frmOptions[changepwd]" value="<?=$changePassword?>"/>
<?php
} else {
$typeChamp = 'hidden';
$changePassword = 0;
?>
<a href="#" id="password">Modifier le mot de passe.</a>
<input type="<?=$typeChamp?>" name="frmOptions[password]" value="<?=$this->options['password']?>"/>
<input type="hidden" name="frmOptions[changepwd]" value="<?=$changePassword?>"/>
<?php } ?>
</div>
</div>
<h2>Paramètres spécifiques</h2>
<div class="paragraph">
<div class="infoTitle StyleInfoLib">Résultats par page</div>
<div class="infoData">
<select name="frmOptions[nbReponses]">
<?php
$opts = array(10, 20, 30, 40, 50, 100, 150, 200);
foreach($opts as $opt)
{
$selected = '';
if($opt == $this->options['nbReponses']) $selected = 'selected';
?><option value="<?=$opt?>" <?=$selected?>><?=$opt?></option><?php
}
?>
</select>
</div>
<div class="infoTitle StyleInfoLib">Type de Compte</div>
<div class="infoData">
<select name="frmOptions[typeCompte]">
<?php
$opts = array('PROD', 'TEST');
foreach($opts as $opt)
{
$selected = '';
if($opt == $this->options['typeCompte']) $selected = 'selected';
?><option value="<?=$opt?>" <?=$selected?>><?=$opt?></option><?php
}
?>
</select>
</div>
<div class="infoTitle StyleInfoLib">Format mail</div>
<div class="infoData">
<select name="frmOptions[formatMail]">
<?php
$opts = array(
'txt1'=> 'Une annonce par mail',
'txt2' => 'Toutes les annonces dans un mail',
'csv' => 'Toutes les annonces dans un mail, fichier csv joint',
'pdf' => 'Une annonce par mail, fichier pdf joint',
'pdf1' => 'Toutes les annonces dans un mail, fichier pdf joint',
'xls' => 'XLS',
'htm'=> 'HTML');
foreach($opts as $opt => $lib)
{
$selected = '';
if($opt == $this->options['formatMail']) $selected = 'selected';
?><option value="<?=$opt?>" <?=$selected?>><?=$lib?></option><?php
}
?>
</select>
</div>
<div class="infoTitle StyleInfoLib">Lien vers annonces légales dans mail</div>
<div class="infoData">
<select name="frmOptions[lienExtranetMail]">
<?php
$opts = array( '0'=> 'Non', '1' => 'Oui');
foreach($opts as $opt => $lib)
{
$selected = '';
if($opt == $this->options['lienExtranetMail']) $selected = 'selected';
?><option value="<?=$opt?>" <?=$selected?>><?=$lib?></option><?php
}
?>
</select>
</div>
<div class="infoTitle StyleInfoLib">Liste Evenement</div>
<div class="infoData">
<textarea name="frmOptions[listeEven]">
<?=$this->options['listeEven']?>
</textarea>
<br/><span>Liste de code évenements séparés par des ;</span>
</div>
<div class="infoTitle StyleInfoLib">Date de debut de compte</div>
<div class="infoData">
<input type="text" name="frmOptions[dateDebutCompte]" value="<?=$this->options['dateDebutCompte']?>"/>
<br/><span>Format AAAA-MM-JJ</span>
</div>
<div class="infoTitle StyleInfoLib">Date de fin de compte</div>
<div class="infoData">
<input type="text" name="frmOptions[dateFinCompte]" value="<?=$this->options['dateFinCompte']?>"/>
<br/><span>Format AAAA-MM-JJ</span>
</div>
<div class="infoTitle StyleInfoLib">Appliquer le Filtre IP du compte Client</div>
<div class="infoData">
<select name="frmOptions[ip]">
<?php
$opts = array( 1 => 'Oui', 0 => 'Non');
foreach($opts as $opt)
{
$selected = '';
if($this->options['filtre_ip'] == $this->options['filtreIpClient']) $selected = 'selected';
?><option value="<?=$opt?>" <?=$selected?>><?=$opt?></option><?php
}
?>
</select>
<br/><span><?=$this->options['filtre_ip']?></span>
</div>
<div class="infoTitle StyleInfoLib">Type de recherche par référence</div>
<div class="infoData">
<select name="frmOptions[rechRefType]">
<?php
$opts = array('UTI', 'CLI');
foreach($opts as $opt)
{
$selected = '';
if($opt == $this->options['rechRefType']) $selected = 'selected';
?><option value="<?=$opt?>" <?=$selected?>><?=$opt?></option><?php
}
?>
</select>
</div>
<div class="infoTitle StyleInfoLib">Accès WebService</div>
<div class="infoData">
<select name="frmOptions[accesWS]">
<?php
$opts = array(0 =>'Non', 1=>'Oui');
foreach($opts as $opt => $lib)
{
$selected = '';
if($opt == $this->options['accesWs']) $selected = 'selected';
?><option value="<?=$opt?>" <?=$selected?>><?=$lib?></option><?php
}
?>
</select>
</div>
</div>
<h2>Gestion des droits</h2>
<div class="paragraph">
<div class="infoTitle StyleInfoLib">Type de profil</div>
<div class="infoData">
<select name="frmOptions[profil]">
<?php
$profil = array('Utilisateur', 'Administrateur', 'SuperAdministrateur');
foreach ($profil as $item){
$select = '';
if ($this->options['profil'] == $item) {
$select = ' selected';
}
?>
<option value="<?=$item?>"<?=$select?>><?=$item?></option>
<?php }?>
</select>
</div>
<div class="infoTitle StyleInfoLib">Droits d&#039;acc&egrave;s</div>
<div class="infoData">
<?php
foreach ($this->droitsClients as $droit) {
if (empty($droit)) continue;
$check = '';
if ( count($this->droits)>0 && in_array(strtolower($droit), $this->droits) ) {
$check = ' checked';
}
?>
<input type="checkbox" name="frmOptions[droits][]" value="<?=$droit?>"<?=$check?> class="noborder"/>
<?=$this->droitsLib[strtoupper($droit)]?><br/>
<?php }?>
</div>
<div class="infoTitle StyleInfoLib">Pr&eacute;f&eacute;rences</div>
<div class="infoData last">
<?php
foreach ($this->prefsLib as $code => $lib) {
$check = '';
if ($this->prefs && in_array(strtolower($code), $this->prefs)) {
$check = ' checked';
}
?>
<input type="checkbox" name="frmOptions[pref][]" value="<?=strtolower($code)?>"<?=$check?> class="noborder"/>
<?=$lib?><br/>
<?php }?>
</div>
</div>
<div class="submit"><p class="submit-button"><input type="submit" class="button" value="Sauver"/></p></div>
</form>
</div>
<div id="dialog" title="Modifier le mot de passe">
<form>
<label for="npass1">Nouveau mot de passe</label><br/>
<input type="password" name="npass1" size="15" maxlength="32"/><br/>
<label for="npass2">Répéter le nouveau mot de passe</label><br/>
<input type="password" name="npass2" size="15" maxlength="32"/><br/>
<span id="form-message"></span>
</form>
</div>

View File

@ -0,0 +1,130 @@
<script language="Javascript">
$(document).ready(function(){
$('a.delete').on('click', function(e){
e.preventDefault();
var href = $(this).attr('href');
var title = $(this).attr('title');
if (confirm(title)) {
document.location.href=href;
}
});
$('a.enable').on('click', function(e){
e.preventDefault();
var href = $(this).attr('href');
var title = $(this).attr('title');
if (confirm(title)) {
document.location.href=href;
}
});
$('a.disable').on('click', function(e){
e.preventDefault();
var href = $(this).attr('href');
var title = $(this).attr('title');
if (confirm(title)) {
document.location.href=href;
}
});
});
</script>
<div id="center">
<h1>GESTION DES CLIENTS</h1>
<h2>Liste des profils utilisateurs</h2>
<div class="paragraph">
<table id="utilisateur">
<?php if (isset($message) && $message != '') {?>
<tr>
<td width="30">&nbsp;</td>
<td colspan="5" class="StyleInfoData" align="center">
<h3><?=$message?></h3>
</td>
</tr>
<?php } ?>
<tr class="border titre">
<td class="StyleInfoLib">Login</td>
<td class="StyleInfoLib">Actions</td>
<td class="StyleInfoLib">Actif</td>
<td class="StyleInfoLib">Informations</td>
<td class="StyleInfoLib">Référence</td>
</tr>
<?php
if (count($this->utilisateurs)>0) {
foreach ($this->utilisateurs as $uti) {
$lienParams = ' login="'.$uti->login.'"';
?>
<tr class="border">
<td class="StyleInfoData"><?=$uti->login;?></td>
<td align="center" valign="middle">
<a href="<?=$this->url(array(
'controller' => 'dashboard',
'action' => 'user',
'op' => 'edit',
'login' => $uti->login,
))?>" class="edit">
<img src="/themes/default/images/interfaces/edit0.gif" title="Editer le profil utilisateur" width="16" height="16"/>
</a>
<a href="<?=$this->url(array(
'controller' => 'dashboard',
'action' => 'user',
'op' => 'delete',
'login' => $uti->login,
'idUti' => $uti->idUti,
))?>" class="delete" title="Supprimer l'utilisateur <?=$uti->login?>">
<img src="/themes/default/images/interfaces/delete.gif" title="Supprimer le profil utilisateur" width="11" height="11"/>
</a>
</td>
<td class="StyleInfoData">
<?php
if ($uti->actif == 1) {
?>
<a href="<?=$this->url(array(
'controller' => 'dashboard',
'action' => 'user',
'op' => 'disable',
'login' => $uti->login,
'idUti' => $uti->idUti,
))?>" class="disable" title="Désactiver le profil utilisateur <?=$uti->login?>">
<u><font color="green">Oui</font></u>
</a>
<?php
} else {
?>
<a href="<?=$this->url(array(
'controller' => 'dashboard',
'action' => 'user',
'op' => 'enable',
'login' => $uti->login,
'idUti' => $uti->idUti,
))?>" class="enable" title="Activer le profil utilisateur <?=$uti->login?>">
<u><font color="red">Non</font></u>
</a>
<?php
}
?>
</td>
<td class="StyleInfoData">
<?=$uti->nom.' '.$uti->prenom?><br/>
<a href="mailto:<?=$uti->email?>">
<?=str_replace(array(';',','), array('<br/>', '<br/>'), $uti->email);?>
</a>
</td>
<td class="StyleInfoData"><?=$uti->reference?></td>
</tr>
<?php
}
}
?>
<tr><td colspan="5">&nbsp;</td></tr>
<tr>
<td colspan="5" align="center">
<a href="<?=$this->url(array(
'controller' => 'dashboard',
'action' => 'user',
'op' => 'new'
))?>">Créer un profil utilisateur</a>
</td>
</tr>
</table>
</div>
</div>

View File

@ -148,4 +148,4 @@ Aucun bilan disponible.
</table>
</div>
<?=$this->render('cgu.phtml', $this->cgu);?>
</div>
</div>

View File

@ -29,7 +29,7 @@
<td class="align"><?php echo round($ComparaisonValeurs['current']); ?></td>
<td class="align"><?php echo round($ComparaisonValeurs['entreprise']); ?></td>
<td class="align"><?php echo $val; ?> %</td>
<td class="alignCenter" style="width:20px;"><img class="tooltip" wdth="420" title="<center><b>Evolution années précédentes</b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>.png' />" alt="icone" src="/themes/default/images/giant/<?php echo ($val > 0)? 'up': 'down';?>.png" /></td>
<td class="alignCenter" style="width:20px;"><img class="tooltip" width="420" title="<center><b>Evolution années précédentes</b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>.png' />" alt="icone" src="/themes/default/images/giant/<?php echo ($val > 0)? 'up': 'down';?>.png" /></td>
<?php if(!empty($ComparaisonValeurs['old'])):?>
<?php $i=0;foreach($ComparaisonValeurs['old'] as $valeur):$i++?>
<?php if($i == 4) break;?>

View File

@ -55,9 +55,9 @@
<?php endforeach; ?>
<td>
<?php if($end > $firstAsset):?>
<img class="tooltip IMGprint" wdth="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/down.png" />
<img class="tooltip IMGprint" wdith="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/down.png" />
<?php else: ?>
<img class="tooltip IMGprint" wdth="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/up.png" />
<img class="tooltip IMGprint" width="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/up.png" />
<?php endif;unset($firstAsset);?>
</td>
</tr>
@ -96,9 +96,9 @@
<?php endforeach; ?>
<td>
<?php if($end > $firstLiabilities):?>
<img class="tooltip IMGprint" wdth="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/down.png" />
<img class="tooltip IMGprint" width="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/down.png" />
<?php else: ?>
<img class="tooltip IMGprint" wdth="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/up.png" />
<img class="tooltip IMGprint" width="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/up.png" />
<?php endif;unset($firstLiabilities);?>
</td>
</tr>
@ -137,9 +137,9 @@
<?php endforeach; ?>
<td>
<?php if($end > $firstProfitAndLoss):?>
<img class="tooltip IMGprint" wdth="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/down.png" />
<img class="tooltip IMGprint" width="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/down.png" />
<?php else: ?>
<img class="tooltip IMGprint" wdth="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/up.png" />
<img class="tooltip IMGprint" width="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/up.png" />
<?php endif;unset($firstProfitAndLoss);?>
</td>
</tr>
@ -179,9 +179,9 @@
<?php endforeach; ?>
<td>
<?php if($end > $firstKeyCreditRatios):?>
<img class="tooltip IMGprint" wdth="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/down.png" />
<img class="tooltip IMGprint" width="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/down.png" />
<?php else: ?>
<img class="tooltip IMGprint" wdth="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/up.png" />
<img class="tooltip IMGprint" width="420" title="<center><b><?php echo $name;?></b></center><br /><img src='/fichier/imgcache/<?php echo $this->report->CompanyId.'-'.$this->Type.'-'.$name;?>-line.png' />" src="/themes/default/images/giant/up.png" />
<?php endif;unset($firstKeyCreditRatios);?>
</td>
</tr>

View File

@ -16,17 +16,17 @@
<td width="200" class="StyleInfoLib">Raison Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
<?php
<?php
if ($this->actif == -1 && is_array($this->etabs) && count($this->etabs)>0){
?>
?>
<tr>
<td width="30">&nbsp;</td>
<td colspan="2" class="StyleInfoData">
L'entreprise à <?=$this->nbEtabActif?> établissement<?php if ($this->nbEtabActif>0) echo 's';?> actif<?php if ($this->nbEtabActif>0) echo 's';?>
L'entreprise à <?=$this->nbEtabActif?> établissement<?php if ($this->nbEtabActif>0) echo 's';?> actif<?php if ($this->nbEtabActif>0) echo 's';?>
et <?=$this->nbEtabRadie?> établissement<?php if ($this->nbEtabRadie>0) echo 's';?> radié<?php if ($this->nbEtabRadie>0) echo 's';?>.
</td>
</tr>
<?php } ?>
</tr>
<?php } ?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Actif/Inactif</td>
@ -121,7 +121,7 @@ if ($this->actif == -1 && is_array($this->etabs) && count($this->etabs)>0){
</tr>
<?php if($this->hasPrefCarte){?>
<tr>
<td align="center" colspan="3">
<td align="center" colspan="3">
<?=$this->action('carte', 'identite', null, array('siret'=>$this->siret, 'id'=>$this->id, 'actif'=>$this->actif) )?>
</td>
</tr>
@ -129,4 +129,8 @@ if ($this->actif == -1 && is_array($this->etabs) && count($this->etabs)>0){
</table>
</div>
<?php if (empty($this->AutrePage)):?>
<?=$this->render('cgu.phtml', $this->cgu)?>
<?php endif;?>
</div>

View File

@ -19,7 +19,7 @@
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Raison Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
</tr>
<?php if ($this->liengroupe){ ?>
<tr>
<td width="30">&nbsp;</td>
@ -189,6 +189,10 @@ if (count($this->participations)>0)
</table>
</div>
<?php if (empty($this->AutrePage)):?>
<?=$this->render('cgu.phtml', $this->cgu)?>
<?php endif;?>
<?php if (empty($this->AutrePage)):?>
</div>
<?php endif;?>

View File

@ -1,14 +1,20 @@
<?php if(!$this->disable):?>
<div id="news">
<h2>Information presse (Source Google News &copy;)</h2>
<div id="paragraph">
<ul style="margin-left:50px;">
<?php foreach($this->items as $item):?>
<li style="padding-top:2px;">
<a target="_blank" href="<?php echo $item['link'];?>"> Le <?php echo $this->NewsDate($item['pubdate']);?> - <?php echo $item['title'];?></a>
</li>
<?php endforeach;?>
</ul>
</div>
<h2>Information presse (Source Google News &copy;)</h2>
<div id="paragraph">
<ul style="margin-left:50px;">
<?php foreach($this->items as $item):?>
<li style="padding-top:2px;">
<a target="_blank" href="<?=$item->link()?>">
Le <?=$this->NewsDate($item->pubDate())?> - <?=$item->title()?>
</a>
</li>
<?php endforeach;?>
</ul>
</div>
</div>
<?php endif;?>

View File

@ -0,0 +1,3 @@
<div id="center">
<pre><?php print_r($this->infos); ?></pre>
</div>

View File

@ -45,50 +45,155 @@
</div>
<?php endif;?>
<?php if (count($this->annoncesBodacc)+count($this->annoncesBalo)+count($this->annoncesBomp)+count($this->annoncesAsso)==0):?>
<h2>EV&Eacute;NEMENTS L&Eacute;GAUX</h2>
<div class="paragraph">
Néant
</div>
<?php endif;?>
<style>
div.blockType {
width:140px;
height:25px;
line-height:20px;
padding:2px;
margin:5px;
text-align:center;
float:left;
display:block;
border-radius: 10px;
background-color: #464C54;
}
<?php if(count($this->annoncesBodacc)>0){ ?>
<h2>EV&Eacute;NEMENTS L&Eacute;GAUX</h2>
<div class="paragraph">
<table>
<?=$this->partialLoop('juridique/annonces-resume.phtml', $this->annoncesBodacc)?>
</table>
div.blockTypeActive {
width:140px;
height:25px;
line-height:20px;
padding:2px;
margin:5px;
text-align:center;
float:left;
display:block;
border-radius: 10px;
background-color:#2f343a;
border-color:#2f343a;
}
div.blockType:hover {
background-color:#2f343a;
border-color:#2f343a;
}
a.lienType {
width:140px;
vertical-align:middle;
display:inline-block;
line-height:1.2;
color: #FFEBB5;
font-weight:bold;
}
</style>
<div class="paragraph" style="width:680px;">
<div class="clearfix" style="margin:0 auto; width:640px;">
<div class="blockType<?php if ($this->vue=='bodacc') echo 'Active';?>">
<a class="lienType" title="Annonces légales" href="<?=$this->url(array('controller'=>'juridique', 'action'=>'annonces', 'vue'=>'bodacc', 'siret'=>$this->siret, 'id'=>$this->id))?>">Annonces Légales</a>
</div>
<div class="blockType<?php if ($this->vue=='balo') echo 'Active';?>">
<a class="lienType" title="Bulletin des Annonces Légales Obligatoires" href="<?=$this->url(array('controller'=>'juridique', 'action'=>'annonces', 'vue'=>'balo', 'siret'=>$this->siret, 'id'=>$this->id))?>">B.A.L.O.</a>
</div>
<div class="blockType<?php if ($this->vue=='bomp') echo 'Active';?>">
<a class="lienType" title="Bulletin officiel des annonces des marchés publics" href="<?=$this->url(array('controller'=>'juridique', 'action'=>'annonces', 'vue'=>'bomp', 'siret'=>$this->siret, 'id'=>$this->id))?>">B.O.A.M.P.</a>
</div>
<div class="blockType<?php if ($this->vue=='asso') echo 'Active';?>">
<a class="lienType" title="Journal Officiel des Associations" href="<?=$this->url(array('controller'=>'juridique', 'action'=>'annonces', 'vue'=>'asso', 'siret'=>$this->siret, 'id'=>$this->id))?>">J.O Associations</a>
</div>
</div>
</div>
<?php if ($this->vue=='bodacc'){ ?>
<h2>EV&Eacute;NEMENTS L&Eacute;GAUX</h2>
<div class="paragraph">
<?php if(count($this->annoncesBodacc)==0){ ?>
Néant
<?php } else {?>
<table>
<?=$this->partialLoop('juridique/annonces-resume.phtml', $this->annoncesBodacc)?>
</table>
<?php }?>
</div>
<?php }?>
<?php if(count($this->annoncesBalo)>0){ ?>
<h2>BALO</h2>
<div class="paragraph">
<table>
<?=$this->partialLoop('juridique/annonces-resume.phtml', $this->annoncesBalo)?>
</table>
</div>
<?php if ($this->vue=='balo'){ ?>
<h2>BALO</h2>
<div class="paragraph">
<?php if(count($this->annoncesBalo)==0){ ?>
Néant
<?php } else {?>
<table>
<?=$this->partialLoop('juridique/annonces-resume.phtml', $this->annoncesBalo)?>
</table>
<?php }?>
</div>
<?php }?>
<?php if(count($this->annoncesBomp)>0){ ?>
<?php if ($this->vue=='bomp'){ ?>
<div class="paragraph" style="margin:0 0 0 40px;">
<form name="filtreBoamp" method="post" action="<?=$this->url(array('controller'=>'juridique',
'action'=>'annonces','vue'=>'bomp','siret'=>$this->siret,'id'=>$this->id),null,true)?>">
<label>Type d'annonce</label>
<select name="filtre">
<option value="">-</option>
<option value="A"<?=($this->filtre=='A')?' selected':'';?>>Avis d'attribution</option>
<option value="M"<?=($this->filtre=='M')?' selected':'';?>>Avis de marchés</option>
</select>
</form>
<script>
$('select[name=filtre]').on('change',function(){
$(this).parent('form').submit();
});
</script>
</div>
<h2>March&eacute;s publics</h2>
<div class="paragraph">
<?php if (count($this->annoncesBomp)==0) { ?>
Néant
<?php } else {?>
<table>
<?=$this->partialLoop('juridique/annonces-resume.phtml', $this->annoncesBomp)?>
</table>
<?php }?>
</div>
<?php }?>
<?php if(count($this->annoncesAsso)>0){ ?>
<?php if ($this->vue=='asso') { ?>
<h2>Associations</h2>
<div class="paragraph">
<?php if (count($this->annoncesAsso)==0){ ?>
Néant
<?php } else {?>
<table>
<?=$this->partialLoop('juridique/annonces-resume.phtml', $this->annoncesAsso)?>
</table>
<?php }?>
</div>
<?php }?>
<?php if (empty($this->AutrePage)):?>
<div style="text-align:center;">
<?php if ($this->lienPagePrecedente) { ?>
<a href="<?=$this->lienPagePrecedente?>" title="Page précédente...">&lt;&lt;</a>
<?php }?>
<?php if ($this->nbPages>1) { ?>
<span>Page <?=$this->p?>/<?=$this->nbPages?></span>
<?php } ?>
<?php if ($this->lienPageSuivante) {?>
<a href="<?=$this->lienPageSuivante?>" title="Page suivante...">&gt;&gt;</a>
<?php }?>
</div>
<?php if (empty($this->AutrePage)) {?>
<?=$this->render('cgu.phtml', $this->cgu)?>
</div>
<?php endif;?>
<?php }?>

View File

@ -2,6 +2,7 @@
<div id="recherche-info">
<p class="StyleInfoLib">
<?=$this->nbReponsesTotal?> r&eacute;ponse<?php if ($this->nbReponsesTotal>1){?>s<?php }?>
avec les crit&egrave;res "<a href="<?php echo $this->criteresLien?>">
<?=$this->criteresTexte?></a>".
@ -9,6 +10,20 @@
<?=$this->nbReponses?> r&eacute;sultats affich&eacute;s.
Page <?=$this->curPage.'/'.$this->totPage.'.';?>
<?php }?>
<?php if ($this->filtres) { ?>
<select name="filtre">
<?php foreach ($this->filtres as $k => $filtre) {?>
<option value="<?=$this->url(array('filtre'=>$k))?>"<?=$filtre['select']?>><?=$filtre['txt']?></option>
<?php }?>
</select>
<script type="text/javascript">
$('select[name=filtre]').change(function(e){
window.location = $(this).val();
});
</script>
<?php }?>
</p>
</div>
@ -25,26 +40,23 @@ if (!empty($this->info)) {
<?php foreach ( $this->liste as $item ) { ?>
<li style="list-style-type:decimal;" class="<?=$item['class']?>" type="1" value="<?=$item['position']?>">
<b><a title="Voir la fiche d'identité de cet établissement" href="<?=$this->url(array(
'controller' => 'identite',
'action' => 'fiche',
'id' => $item['id'],
'siret' => $item['siret']
), null, true);
?>"><?=$item['InfoNom']?></a></b><br/>
<?=$item['InfoNomDetail']?>
<b>RCS <?=$item['InfoSiret']?></b>
<br/>
<b><?=$item['InfoEtab']?></b><br/>
<?=$item['InfoAdresse']?><br/>
<?=$item['InfoForme']?>
<?=$item['InfoActivite']?>
<?php if (isset($item['InfoDirigeant'])) { ?>
<?=$item['InfoDirigeant']?>
<?php } elseif(isset($item['InfoActionnaire'])) {?>
<?=$item['InfoActionnaire']?>
<?php }?>
<?php if (isset($item['lien']) && count($item['lien'])>0){?>
<br/> Liens : <?php foreach($item['lien'] as $lien){?>
'controller' => 'identite', 'action' => 'fiche', 'id' => $item['id'], 'siret' => $item['siret']
), null, true)?>">
<?=$item['InfoNom']?></a></b><br/>
<?=$item['InfoNomDetail']?>
<b>RCS <?=$item['InfoSiret']?></b>
<br/>
<b><?=$item['InfoEtab']?></b><br/>
<?=$item['InfoAdresse']?><br/>
<?=$item['InfoForme']?>
<?=$item['InfoActivite']?>
<?php if (isset($item['InfoDirigeant'])) { ?>
<?=$item['InfoDirigeant']?>
<?php } elseif(isset($item['InfoActionnaire'])) {?>
<?=$item['InfoActionnaire']?>
<?php }?>
<?php if (isset($item['lien']) && count($item['lien'])>0) {?>
<br/> Liens : <?php foreach($item['lien'] as $lien){?>
<a href="<?=$lien['href']?>"><?=$lien['title']?></a>
<?php }?>
<?php }?>
@ -74,8 +86,9 @@ if ($this->curPage<$this->totPage) {
<br/>
<?php if ($this->rechCsv) { ?>
<?php foreach ($this->filtres as $k => $filtre) { if ( !empty($filtre['select']) ) break; }?>
<p class="StyleInfoLib">
<a href="<?=$this->url(array('controller'=>'recherche', 'action'=>'csv'), null, true)?>" target="_blank">
<a href="<?=$this->url(array('controller'=>'recherche', 'action'=>'csv', 'filtre'=>$k), null, true)?>" target="_blank">
Exporter les résultas de la recherche en CSV.</a>
</p>
<?php } ?>

View File

@ -0,0 +1,63 @@
<div id="center">
<?php if ($message!='') { ?>
<div style="margin:5px; padding: 0pt 0.7em;" class="ui-state-highlight ui-corner-all">
<p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"></span>
<?=$message?></p>
</div>
<?php } ?>
<h1 class="titre">Saisie ou Correction Liasse</h1>
<div class="paragraph">
<div>
<label>Num&eacute;ro identifiant Siret</label>
<?=$this->SiretTexte($this->siret)?>
</div>
<div class="clearfix">
<label>Raison Sociale</label>
<?=$this->raisonSociale?>
</div>
</div>
<h2>TITRE</h2>
<style>
#tabs { font-size:0.8em; }
</style>
<div id="tabs">
<ul>
<?php foreach ( $this->entetes as $i => $entete ) {?>
<li><a href="#tabs-<?=$i?>"><?=$entete?></a></li>
<?php }?>
</ul>
<?php foreach ( $this->postes as $i => $item ) {?>
<div id="tabs-<?=$i?>">
<table>
<?php
$max = count($item['cols'][0]);
$nbcols = count($item['cols']);
for ($i=0;$i<$max;$i++) {
?>
<tr>
<?php for ($k=0;$k<$nbcols;$k++) {?>
<td>
<?=(isset($item['cols'][$k][$i]))?$item['cols'][$k][$i].'=':'';?>
</td>
<td>0</td>
<?php }?>
</tr>
<?php }?>
</table>
</div>
<?php }?>
</div>
<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>
</div>

View File

@ -24,9 +24,7 @@ if ($this->action != 'new') {
} else {
?>
<input type="text" size="20" maxlength="80" name="frmOptions[login]" value="<?=$this->loginNew?>"/>
<?php
}
?>
<?php } ?>
</div>
<div class="infoTitle StyleInfoLib">Identit&eacute; (NOM/Pr&eacute;nom)</div>
@ -83,7 +81,7 @@ if ($this->action=='new') {
//Consomation
if ($this->isAdmin || $this->isSuperAdmin){
echo $this->action('conso', 'user', null, array(
'login' => $this->loginVu,
'login' => $this->loginVu,
'idClient' => $this->options->idClient)
);
}
@ -95,7 +93,7 @@ if ($this->isAdmin || $this->isSuperAdmin){
<div class="infoTitle StyleInfoLib">R&eacute;sultats par page</div>
<div class="infoData">
<select name="frmOptions[rech_nbrep]">
<select name="frmOptions[nbReponses]">
<?php
$opts = array(10, 20, 30, 40, 50, 100, 150, 200);
foreach($opts as $opt)
@ -137,12 +135,12 @@ foreach($opts as $opt)
<div class="infoData">
<?php if ($this->isSuperAdmin){ ?>
<select name="frmOptions[profil]">
<?php
<?php
$profil = array('Utilisateur', 'Administrateur', 'SuperAdministrateur');
foreach ($profil as $item){
$select = '';
if ($this->options->profil == $item){
$select = ' selected';
if ($this->options->profil == $item){
$select = ' selected';
}
?>
<option value="<?=$item?>"<?=$select?>><?=$item?></option>

View File

@ -1,6 +1,6 @@
<script language="Javascript">
$(document).ready(function(){
$('.delete').on('click', function(e){
$('a.delete').on('click', function(e){
e.preventDefault();
var href = $(this).attr('href');
var title = $(this).attr('title');
@ -8,7 +8,7 @@ $(document).ready(function(){
document.location.href=href;
}
});
$('.active').on('click', function(e){
$('a.enable').on('click', function(e){
e.preventDefault();
var href = $(this).attr('href');
var title = $(this).attr('title');
@ -16,7 +16,7 @@ $(document).ready(function(){
document.location.href=href;
}
});
$('.desactive').on('click', function(e){
$('a.disable').on('click', function(e){
e.preventDefault();
var href = $(this).attr('href');
var title = $(this).attr('title');
@ -82,10 +82,10 @@ foreach ($this->utilisateurs as $uti) {
?>
<a href="<?=$this->url(array(
'controller' => 'user',
'action' => 'unactivate',
'action' => 'disable',
'login' => $uti->login,
'idUti' => $uti->idUti,
))?>" class="desactive" title="Désactiver le profil utilisateur <?=$uti->login?>">
))?>" class="disable" title="Désactiver le profil utilisateur <?=$uti->login?>">
<u><font color="green">Oui</font></u>
</a>
<?php
@ -93,10 +93,10 @@ foreach ($this->utilisateurs as $uti) {
?>
<a href="<?=$this->url(array(
'controller' => 'user',
'action' => 'activate',
'action' => 'enable',
'login' => $uti->login,
'idUti' => $uti->idUti,
))?>" class="active" title="Activer le profil utilisateur <?=$uti->login?>">
))?>" class="enable" title="Activer le profil utilisateur <?=$uti->login?>">
<u><font color="red">Non</font></u>
</a>
<?php

View File

@ -4,10 +4,616 @@
<?=$this->headMeta();?>
<?=$this->headTitle();?>
<link rel="shortcut icon" type="image/x-icon" href="<?='http://'.$_SERVER['SERVER_NAME']?>/favicon.ico" />
<style>
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {
border: 0 none;
cursor: default;
font-family: inherit;
font-size: 100%;
font-weight: inherit;
margin: 0;
outline: 0 none;
padding: 0;
vertical-align: baseline;
}
html, body {
height: 100%;
}
article, aside, dialog, figure, footer, header, hgroup, nav, section {
display: block;
}
body {
line-height: 1.5;
}
table {
border-collapse: separate;
border-spacing: 0;
white-space: nowrap;
}
caption, th, td {
font-weight: normal;
text-align: left;
}
table, td, th {
vertical-align: middle;
}
a {
border: 0 none;
color: #000000;
text-decoration: none;
}
a, a *, input, input *, select, .button span, li, label {
cursor: pointer;
}
ul {
list-style: none outside none;
}
body {
background: none repeat scroll 0 0 #FEFEFE;
color: #000000;
font: 0.8em/1.6em "Lucida Grande",Arial,Verdana,sans-serif;
}
#body-user #header, #body-settings #header {
background: none repeat scroll 0 0 #1D2D44;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5), 0 -2px 10px #222222 inset;
height: 2.5em;
padding: 0.5em;
position: fixed;
top: 0;
width: 100%;
z-index: 100;
}
#body-login #header {
margin: -2em auto 0;
text-align: center;
height: 10em;
padding: 1em 0 .5em;
-moz-box-shadow: 0 0 1em rgba(0, 0, 0, .5);
-webkit-box-shadow: 0 0 1em rgba(0, 0, 0, .5);
box-shadow: 0 0 1em rgba(0, 0, 0, .5);
background: #1D2D44;
background: -moz-linear-gradient(top, #35537A 0%, #1D2D42 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #35537A), color-stop(100%, #1D2D42));
background: -webkit-linear-gradient(top, #35537A 0%, 1D2D42 100%);
background: -o-linear-gradient(top, #35537A 0%, #1D2D42 100%);
background: -ms-linear-gradient(top, #35537A 0%, #1D2D42 100%);
background: linear-gradient(top, #35537A 0%, #1D2D42 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', endColorstr='#1d2d42',GradientType=0 );
}
#body-login #header span {
color:#FFFFFF;
font-weight:bold;
font-size:1.6em;
line-height:5em;
}
input[type="text"], input[type="password"] {
cursor: text;
}
input, textarea, select, button, .button, #quota, div.jp-progress, .pager li a {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #DDDDDD;
border-radius: 0.5em 0.5em 0.5em 0.5em;
box-shadow: 0 1px 1px #FFFFFF, 0 1px 0 #BBBBBB inset;
color: #333333;
font-size: 1em;
margin: 0.3em;
outline: medium none;
padding: 0.6em 0.5em 0.4em;
width: 10em;
}
input[type="text"], input[type="password"], input[type="search"] {
background: none repeat scroll 0 0 #F8F8F8;
color: #555555;
cursor: text;
}
input[type="text"], input[type="password"], input[type="search"] {
-moz-appearance: textfield;
-moz-box-sizing: content-box;
}
input[type="text"]:hover, input[type="text"]:focus, input[type="text"]:active, input[type="password"]:hover, input[type="password"]:focus, input[type="password"]:active, .searchbox input[type="search"]:hover, .searchbox input[type="search"]:focus, .searchbox input[type="search"]:active {
background-color: #FFFFFF;
color: #333333;
opacity: 1;
}
input[type="submit"], input[type="button"], button, .button, #quota, div.jp-progress, select, .pager li a {
background: none repeat scroll 0 0 #F8F8F8;
border: 1px solid #DDDDDD;
border-radius: 0.5em 0.5em 0.5em 0.5em;
color: #555555;
cursor: pointer;
font-weight: bold;
padding: 0.4em;
text-shadow: 0 1px 0 #FFFFFF;
width: auto;
}
input[type="submit"]:hover, input[type="submit"]:focus, input[type="button"]:hover, select:hover, select:focus, select:active, input[type="button"]:focus, .button:hover {
background: none repeat scroll 0 0 #FFFFFF;
color: #333333;
}
input[type="checkbox"] {
width: auto;
}
#quota {
cursor: default;
}
#body-login input {
font-size: 1.5em;
}
#body-login input[type="text"], #body-login input[type="password"] {
width: 13em;
}
#body-login input.login {
float: right;
width: auto;
}
#remember_login {
margin: 0.8em 0.2em 0 1em;
}
.searchbox input[type="search"] {
-moz-transition: opacity 300ms ease 0s;
background: url("../img/actions/search.svg") no-repeat scroll 0.5em center #FFFFFF;
border: 0 none;
border-radius: 1em 1em 1em 1em;
font-size: 1.2em;
opacity: 0.7;
padding: 0.2em 0.5em 0.2em 1.5em;
position: fixed;
right: 3em;
top: 0.4em;
}
input.enabled[type="submit"] {
background: none repeat scroll 0 0 #66F866;
border: 1px solid #55EE55;
box-shadow: 0 1px 1px #F8F8F8, 0 1px 1px #CCFFCC inset;
}
input.highlight[type="submit"] {
background: none repeat scroll 0 0 #FFC100;
border: 1px solid #DDBB00;
box-shadow: 0 1px 1px #F8F8F8, 0 1px 1px #FFEEDD inset;
text-shadow: 0 1px 0 #FFEEDD;
}
#select_all {
margin-top: 0.4em !important;
}
#controls {
background: none repeat scroll 0 0 #F7F7F7;
border-bottom: 1px solid #EEEEEE;
box-shadow: 0 -3px 7px #000000;
height: 2.8em;
margin: 0;
padding: 0 0.5em;
position: fixed;
top: 3.5em;
width: 100%;
z-index: 50;
}
#controls .button {
display: inline-block;
}
#content {
left: 12.5em;
position: absolute;
top: 3.5em;
}
#leftcontent, .leftcontent {
background: none repeat scroll 0 0 #F8F8F8;
border-right: 1px solid #DDDDDD;
overflow: auto;
position: fixed;
top: 6.4em;
width: 20em;
}
#leftcontent li, .leftcontent li {
-moz-transition: background-color 200ms ease 0s;
background: none repeat scroll 0 0 #F8F8F8;
overflow: hidden;
padding: 0.5em 0.8em;
text-overflow: ellipsis;
white-space: nowrap;
}
#leftcontent li:hover, #leftcontent li:active, #leftcontent li.active, .leftcontent li:hover, .leftcontent li:active, .leftcontent li.active {
background: none repeat scroll 0 0 #EEEEEE;
}
#leftcontent li.active, .leftcontent li.active {
font-weight: bold;
}
#leftcontent li:hover, .leftcontent li:hover {
background: none repeat scroll 0 0 #DDDDDD;
color: #333333;
}
#leftcontent a {
display: block;
float: left;
height: 100%;
margin: 0;
padding: 0 1em 0 0;
}
#rightcontent, .rightcontent {
left: 32.5em;
overflow: auto;
position: fixed;
top: 6.4em;
}
#body-login {
background: none repeat scroll 0 0 #DDDDDD;
}
#body-login div.buttons {
text-align: center;
}
#body-login p.info {
color: #777777;
margin: 2em auto;
text-align: center;
text-shadow: 0 1px 0 #FFFFFF;
width: 22em;
}
#body-login p.info a {
color: #777777;
font-weight: bold;
}
#login {
background: none repeat scroll 0 0 #EEEEEE;
border-bottom: 1px solid #F8F8F8;
margin: 2em auto 0;
min-height: 30em;
}
#login form {
margin: 2em auto;
padding: 0;
width: 22em;
}
#login form fieldset {
background: none repeat scroll 0 center transparent;
border: 0 none;
margin-bottom: 2em;
padding: 0;
}
#login form fieldset legend {
font-weight: bold;
}
#login form label {
color: #666666;
margin: 0.95em 0 0 0.85em;
}
p.infield {
position: relative;
}
label.infield {
cursor: text !important;
}
#login form label.infield {
color: #AAAAAA;
font-size: 1.5em;
position: absolute;
}
#login #dbhostlabel, #login #directorylabel {
display: block;
margin: 0.95em 0 0.8em -8em;
}
#login form input[type="checkbox"] + label {
font-size: 1em;
margin: 0;
position: relative;
text-shadow: 0 1px 0 #FFFFFF;
}
#login form .errors {
background: none repeat scroll 0 0 #FED7D7;
border: 1px solid #FF0000;
margin: 0 0 2em;
padding: 1em;
}
#login form #selectDbType {
text-align: center;
}
#login form #selectDbType label {
background: none repeat scroll 0 0 #F8F8F8;
border: 1px solid #DDDDDD;
color: #555555;
cursor: pointer;
font-size: 1em;
font-weight: bold;
margin: 0 -0.3em 1em;
padding: 0.4em;
position: static;
text-shadow: 0 1px 0 #EEEEEE;
}
#login form #selectDbType label span {
cursor: pointer;
font-size: 0.9em;
}
#login form #selectDbType label.ui-state-hover span, #login form #selectDbType label.ui-state-active span {
color: #000000;
}
#login form #selectDbType label.ui-state-hover, #login form #selectDbType label.ui-state-active {
background-color: #CCCCCC;
color: #333333;
}
#navigation {
background: none repeat scroll 0 0 #EEEEEE;
border-right: 1px solid #CCCCCC;
box-shadow: -3px 0 7px #000000;
float: left;
height: 100%;
overflow: hidden;
padding: 0;
position: fixed;
top: 3.5em;
width: 12.5em;
z-index: 75;
}
#navigation a {
-moz-transition: background 300ms ease 0s;
background: none no-repeat scroll 1em center #EEEEEE;
border-bottom: 1px solid #DDDDDD;
border-top: 1px solid #FFFFFF;
color: #666666;
display: block;
font-size: 1.2em;
padding: 0.6em 0.5em 0.4em 2.5em;
text-decoration: none;
text-shadow: 0 1px 0 #F8F8F8;
}
#navigation a.active, #navigation a:hover, #navigation a:focus {
background-color: #DBDBDB;
border-bottom: 1px solid #CCCCCC;
border-top: 1px solid #D4D4D4;
color: #333333;
}
#navigation a.active {
background-color: #DDDDDD;
}
#navigation #settings {
bottom: 3.5em;
position: absolute;
width: 100%;
}
#expand {
cursor: pointer;
margin-bottom: -0.5em;
padding: 0.5em 10.1em 0.7em 1.2em;
position: relative;
z-index: 100;
}
#expand + span {
-moz-transition: opacity 300ms ease 0s;
color: #666666;
font-size: 1.2em;
margin: -1.7em 0 0 2.5em;
opacity: 0;
position: absolute;
text-shadow: 0 1px 0 #F8F8F8;
z-index: 99;
}
#expand:hover + span, #expand + span:hover {
cursor: pointer;
opacity: 1;
}
#logout {
padding: 1.2em 2em 0.55em 1.2em;
position: absolute;
right: 0;
top: 0;
}
.hidden {
display: none;
}
.bold {
font-weight: bold;
}
#notification {
background-color: #FFCC44;
border: 0 none;
border-bottom-left-radius: 1em;
border-bottom-right-radius: 1em;
cursor: pointer;
display: none;
left: 50%;
padding: 0 0.7em 0.3em;
position: fixed;
top: 0;
z-index: 101;
}
.action, .selectedActions a {
-moz-transition: opacity 200ms ease 0s;
opacity: 0.5;
}
.action {
height: 16px;
width: 16px;
}
#logout {
opacity: 0.8;
}
.action:hover, .selectedActions a:hover, #logout:hover {
opacity: 1;
}
table:not(.nostyle) tr {
-moz-transition: background-color 200ms ease 0s;
}
tbody tr:hover, tr:active {
background-color: #F8F8F8;
}
#body-settings .personalblock, #body-settings .helpblock {
background: none repeat scroll 0 0 #F8F8F8;
border-radius: 0.5em 0.5em 0.5em 0.5em;
color: #555555;
margin: 1em;
padding: 0.5em 1em;
text-shadow: 0 1px 0 #FFFFFF;
}
#body-settings #quota.personalblock {
padding: 0;
position: relative;
}
#body-settings #controls + .helpblock {
margin-top: 3em;
position: relative;
}
.personalblock > legend {
margin-top: 2em;
}
.personalblock > legend, th, dt, label {
font-weight: bold;
}
code {
font-family: "Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono",monospace;
}
#quota div, div.jp-play-bar, div.jp-seek-bar {
background: none repeat scroll 0 0 #E6E6E6;
border-bottom-left-radius: 0.4em;
border-top-left-radius: 0.4em;
font-weight: normal;
padding: 0;
white-space: nowrap;
}
#quotatext {
padding: 0.6em 1em;
}
div.jp-play-bar, div.jp-seek-bar {
padding: 0;
}
.pager {
display: inline;
float: right;
list-style: none outside none;
margin: 0.7em 13em 0 0;
}
.pager li {
display: inline-block;
}
li.error {
background: none no-repeat scroll 0.8em 0.8em #FFFFEE;
border: 1px solid #CCCCCC;
border-radius: 10px 10px 10px 10px;
color: #FF3B3B;
margin: 4em auto;
padding: 1em 1em 1em 4em;
width: 640px;
}
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
overflow: hidden;
text-overflow: ellipsis;
}
.hint {
background-image: url("/core/img/actions/info.png");
background-position: 0 0.3em;
background-repeat: no-repeat;
color: #777777;
padding-left: 25px;
}
.separator {
border-left: 1px solid #D3D3D3;
border-right: 1px solid #FFFFFF;
display: inline;
height: 10px;
margin: 4px;
width: 0;
}
a.bookmarklet {
background-color: #DDDDDD;
border: 1px solid #CCCCCC;
margin-top: 5px;
padding: 0 5px 2px;
text-decoration: none;
}
#dirtree {
width: 100%;
}
#filelist {
background-color: white;
height: 270px;
overflow: scroll;
width: 100%;
}
.filepicker_element_selected {
background-color: lightblue;
}
.filepicker_loader {
background-color: #333333;
height: 120px;
left: 0;
opacity: 0.3;
padding-top: 150px;
position: absolute;
text-align: center;
top: 0;
visibility: visible;
width: 100%;
}
#categoryform .scrollarea {
background: none repeat scroll 0 0 #F8F8F8;
border: 1px solid #DDDDDD;
bottom: 50px;
left: 10px;
overflow: auto;
position: absolute;
right: 10px;
top: 10px;
}
#categoryform .bottombuttons {
bottom: 10px;
position: absolute;
}
#categoryform .bottombuttons * {
float: left;
}
#categorylist li {
-moz-transition: background-color 500ms ease 0s;
background: none repeat scroll 0 0 #F8F8F8;
overflow: hidden;
padding: 0.3em 0.8em;
text-overflow: ellipsis;
white-space: nowrap;
}
#categorylist li:hover, li:active {
background: none repeat scroll 0 0 #EEEEEE;
}
#category_addinput {
width: 10em;
}
</style>
<!--[if IE 8]><style>input[type="checkbox"]{padding:0;}</style><![endif]-->
<?=$this->inlineScript()?>
<script>
$(document).ready(function(){
$("label").inFieldLabels();
});
</script>
</head>
<body>
<h2>CONNEXION EXTRANET</h2>
<?=$this->message?>
<?=$this->form?>
<body id="body-login">
<div id="login">
<header>
<div id="header">
<span>EXTRANET SCORES & DECISIONS</span>
</div>
</header>
<form method="post" action="<?=$this->url(array('controller'=>'user', 'action'=>'login'),null, true)?>">
<p style="text-align:center; color:red;"><span><?=$this->message?></span></p>
<fieldset>
<p class="infield">
<label for="user" class="infield">Identifiant</label>
<input type="text" name="login" id="user" value="" autofocus autocomplete="off" required />
</p>
<p class="infield">
<label for="password" class="infield">Mot de passe</label>
<input type="password" name="pass" id="password" value="" required />
</p>
<!-- <input type="checkbox" name="remember_login" value="1" id="remember_login" /><label for="remember_login">Remember</label> -->
<input type="submit" id="submit" class="login" value="Connexion" />
</fieldset>
</form>
</div>
<footer>
<p class="info">
<a href="http://www.scores-decisions.com/">Scores & Décisions SAS</a>
</p>
</footer>
</body>
</html>

View File

@ -10,11 +10,11 @@ $tempDirs = array(
),
'bdf' => array(
'path' => 'bdf',
'files' => array('*.pdf')
'files' => array('*.html')
),
'consommation' => array(
'path' => 'consommation',
'files' => array('*.pdf')
'files' => array('*.csv')
),
'creditsafe' => array(
'path' => 'creditsafe',
@ -38,23 +38,31 @@ $tempDirs = array(
),
'pages' => array(
'path' => 'pages',
'files' => array('*.tpl', '*.xml', '*.csv', '*.pdf')
'files' => array('*.tpl', '*.html', '*.csv', '*.pdf')
),
'pagesxml' => array(
'path' => 'pagesxml',
'files' => array('*.xml')
),
'imgcache' => array(
'path' => 'pages/imgcache',
'files' => array('*.png', '*.gif')
),
'portefeuille' => array(
'path' => 'portefeuille',
'files' => array('*.pdf')
/*
'rss' => array(),
*/
'sessions' => array(
'path' => 'sessions',
'files' => array('sess_*')
),
'surveillance' => array(
'path' => 'surveillance',
'files' => array('*.pdf')
'files' => array('*.csv')
),
'survliste' => array(
'path' => 'survliste',
'files' => array('*.pdf')
'files' => array('*.csv')
),
);
@ -87,11 +95,13 @@ function removeFile($path, $filePattern)
$dir = PATH_TEMPFILE.DIRECTORY_SEPARATOR.$path;
if (is_dir($dir)) {
if (stristr(PHP_OS, 'WIN')) {
$exe = 'del';
$cmd = 'del '.$dir.DIRECTORY_SEPARATOR.$filePattern;
} else {
$exe = 'rm';
/**
* To avoid too args error from rm command
*/
$cmd = 'find '.$dir.'/ -name "'.$filePattern.'" -exec rm {} \;';
}
$cmd = $exe.' '.$dir.DIRECTORY_SEPARATOR.$filePattern;
return shell_exec($cmd);
}
return false;

View File

@ -11,10 +11,10 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
{
$checkAuth = true;
if ($request->getControllerName()=='user' && $request->getActionName()=='login'){
$checkAuth = false;
$checkAuth = false;
}
if ($checkAuth)
if ($checkAuth)
{
$login = $request->getParam('login');
$pass = $request->getParam('pass', '');
@ -25,9 +25,9 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
//Est ce que l'on a checkIp=only lors de la requête
$iponly = false;
if ($checkIp=='only') {
if ($checkIp=='only') {
$hach = 'iponly:'.$_SERVER['REMOTE_ADDR'];
$iponly = true;
$iponly = true;
}
//On vérifie le tout lors d'une connexion par url
@ -35,7 +35,7 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
$authAdapter = new Scores_AuthAdapter($login, $hach, $iponly);
$result = $auth->authenticate($authAdapter);
if (!$result->isValid()) {
$messageF = '';
foreach ($result->getMessages() as $message) {
@ -45,7 +45,7 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
->setControllerName('user')
->setActionName('logout')
->setParam('message', $messageF);
} else {
} else {
$storage = new Zend_Auth_Storage_Session();
$session = new Zend_Session_Namespace($storage->getNamespace());
//$session->setExpirationSeconds(86400);
@ -63,7 +63,7 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
$session->url = $_SERVER['REQUEST_URI'];
$layout = Zend_Layout::getMVCInstance();
if ( !$layout->isEnabled() ) {
if ( !$layout->isEnabled() ) {
echo "Identification incorrect ou périmé.";
} else {
$this->_response->setRedirect('/user/login')->sendResponse();
@ -72,7 +72,7 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
//Authentifié => on met à jour la session
} else {
$identity = $auth->getIdentity();
$identity = $auth->getIdentity();
$identity->time = time() + $identity->timeout;
$auth->getStorage()->write($identity);
@ -80,8 +80,17 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
Zend_Session::namespaceUnset('login');
}
//Check CGU
if ( $request->getControllerName()!='aide' && $request->getActionName()!='cgu'
&& $request->getControllerName()!='user' && $request->getActionName()!='logout') {
if ( empty($identity->acceptationCGU) || $identity->acceptationCGU=='0000-00-00 00:00:00' ) {
$request->setModuleName('default')
->setControllerName('aide')
->setActionName('cgu');
}
}
}
}
}
}
}
}

View File

@ -8,13 +8,13 @@ class Form_Login extends Zend_Form {
$this->setMethod('post');
$this->addElement('text', 'login', array(
'filters' => array('StringTrim'),
'label' => 'Identifiant : ',
'label' => 'Identifiant',
'required' => 'true',
)
);
$this->addElement('password', 'pass',
array(
'label' => 'Mot de passe : ',
'label' => 'Mot de passe',
'required' => 'true',
)
);

View File

@ -1,4 +1,6 @@
<?php
ini_set('max_execution_time', 300);
require_once ('Functions.lib.php');
define("DATA_SET_VERSION", '1.0');
class WSgiant extends Zend_Soap_Client

View File

@ -22,7 +22,7 @@ class Scores_AuthAdapter implements Zend_Auth_Adapter_Interface
require_once 'Scores/WsScores.php';
$ws = new WsScores($this->_username, $this->_password);
$InfosLogin = $ws->getInfosLogin($this->_username, $adressIp);
$InfosLogin = $ws->getInfosLogin($this->_username, $adressIp);
$identity = new stdClass();
$identity->username = $this->_username;
$identity->password = $this->_password;
@ -40,14 +40,15 @@ class Scores_AuthAdapter implements Zend_Auth_Adapter_Interface
$identity->idClient = $InfosLogin->result->idClient;
$identity->reference = $InfosLogin->result->reference;
$identity->nbReponses = $InfosLogin->result->nbReponses;
$identity->typeScore = $InfosLogin->result->typeScore;
$identity->typeScore = $InfosLogin->result->typeScore;
$identity->dateValidation = $InfosLogin->result->dateValidation;
$identity->nombreConnexions = $InfosLogin->result->nombreConnexions;
$identity->dateDerniereConnexion = $InfosLogin->result->dateDerniereConnexion;
$identity->dateDebutCompte = $InfosLogin->result->dateDebutCompte;
$identity->dateFinCompte = $InfosLogin->result->dateFinCompte;
$identity->dateFinCompte = $InfosLogin->result->dateFinCompte;
$identity->acceptationCGU = $InfosLogin->result->acceptationCGU;
$identity->ip = $adressIp;
$identity->modeEdition = false;
$identity->modeEdition = false;
$timeout = (!empty($InfosLogin->result->timeout)) ? $InfosLogin->result->timeout : $this->_timeout;
$identity->timeout = $timeout;
@ -57,7 +58,7 @@ class Scores_AuthAdapter implements Zend_Auth_Adapter_Interface
/*
* Adresse Ip interdites
*/
$ipInterdites =
$ipInterdites =
'81.252.88.0-81.252.88.7' // CTE D AGGLOMERATION DE SOPHIA
. ';' . '195.200.187.163' // PacWan
. ';' . '213.11.81.41' // Verizon France SAS
@ -71,13 +72,13 @@ class Scores_AuthAdapter implements Zend_Auth_Adapter_Interface
. ';' . '193.104.158.0-193.104.158.255' // Altares.fr
. ';' . '195.6.3.0-195.6.3.255' // ORT
. ';' . '217.144.112.0-217.144.116.63' // Coface
;
if ( $this->checkPlagesIp($ipInterdites, $adressIp) ) {
;
if ( $this->checkPlagesIp($ipInterdites, $adressIp) ) {
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity);
}
// Renvoi
if ( is_string($InfosLogin) || $InfosLogin->error->errnum!=0){
// Renvoi
if ( is_string($InfosLogin) || $InfosLogin->error->errnum!=0){
$message = $InfosLogin;
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $identity, array($message));
} elseif ($this->_username == $InfosLogin->result->login) {
@ -92,7 +93,7 @@ class Scores_AuthAdapter implements Zend_Auth_Adapter_Interface
* @param string $strPlageIP La plage d'adresses IP
* @param string $adresseIP L'adresse IP à tester
*/
protected function checkPlagesIp($strPlageIP, $adresseIP)
protected function checkPlagesIp($strPlageIP, $adresseIP)
{
$connected = false;
$tabIpAllowed = explode(';', trim($strPlageIP));
@ -133,7 +134,7 @@ class Scores_AuthAdapter implements Zend_Auth_Adapter_Interface
return false;
}
/**
/**
* Converti une IP en nombre
* @param string $ip Adresse IP
* @return integer

View File

@ -231,40 +231,39 @@ class Menu
array(
'label' => 'BANQUE DE FRANCE',
'permission' => 'BDF',
'activateMenu' => array(
array('controller'=>'bdf', 'action'=>'module'),
),
'pages' => array(
array(
'label' => "27. Panorama",
'controller' => 'bdf',
'action' => '',
'action' => 'module27',
),
array(
'label' => "28. Concours Bancaires",
'controller' => 'bdf',
'action' => '',
'action' => 'module28',
),
array(
'label' => "29. Impayés",
'controller' => 'bdf',
'action' => '',
),
array(
'controller' => 'bdf',
'action' => '',
'action' => 'module29',
),
array(
'label' => "40. Relations Bancaires",
'controller' => 'bdf',
'action' => '',
'action' => 'module40',
),
array(
'label' => "51. Dirigeants",
'controller' => 'bdf',
'action' => '',
'action' => 'module51',
),
array(
'label' => "Autres",
'controller' => 'bdf',
'action' => '',
'action' => 'index',
),
),
),
@ -401,6 +400,8 @@ class Menu
'activateMenu' => array(
array('controller'=>'dashboard', 'action'=>'clients'),
array('controller'=>'dashboard', 'action'=>'client'),
array('controller'=>'dashboard', 'action'=>'users'),
array('controller'=>'dashboard', 'action'=>'user'),
array('controller'=>'dashboard', 'action'=>'commandes'),
),
'pages' => array(
@ -625,15 +626,11 @@ class Menu
protected function checkParams($controller, $action = '')
{
switch($controller) {
case 'dashboard':
case 'bdf':
return true;
break;
case 'administration':
$user = new Scores_Utilisateur();
if (in_array($user->getProfil(),array('Administrateur', 'SuperAdministrateur'))) {
return true;
}
return false;
case 'dashboard':
return true;
break;
case 'recherche':
switch($action) {
@ -661,9 +658,10 @@ class Menu
switch($action){
case 'liste':
$user = new Scores_Utilisateur();
if (!$user->isAdmin()){
return false;
if ($user->isAdmin() || $user->isSuperAdmin()){
return true;
}
return false;
break;
}
return true;
@ -838,6 +836,11 @@ class Menu
break;
}
break;
case 'bdf':
if (!empty($this->siret)) {
$params['siret'] = $this->siret;
}
break;
}
return $params;
}

View File

@ -19,7 +19,7 @@ class PagePrint
'finance-liasse' => 'siret,id,unit,date',
'finance-bourse' => 'siret,id',
'finance-banque' => 'siret,id',
'juridique-annonces' => 'siret,id,idAnn,vue',
'juridique-annonces' => 'siret,id,idAnn,vue,p',
'juridique-infosreg' => 'siret,id',
'juridique-competences' => 'siret,id,type',
'juridique-marques' => 'siret,id,idObject',
@ -50,7 +50,7 @@ class PagePrint
'finance-liasse' => 'siret,id,unit,date',
'finance-bourse' => 'siret,id',
'finance-banque' => 'siret,id',
'juridique-annonces' => 'siret,id,idAnn,vue',
'juridique-annonces' => 'siret,id,idAnn,vue,p',
'juridique-infosreg' => 'siret,id',
'juridique-competences' => 'siret,id,type',
'juridique-marques' => 'siret,id,idObject',
@ -79,7 +79,7 @@ class PagePrint
'finance-liasse' => 'siret,id,unit,date',
'finance-bourse' => 'siret,id',
'finance-banque' => 'siret,id',
'juridique-annonces' => 'siret,id,idAnn,vue',
'juridique-annonces' => 'siret,id,idAnn,vue,p',
'juridique-infosreg' => 'siret,id',
'juridique-competences' => 'siret,id,type',
'juridique-marques' => 'siret,id,idObject',

View File

@ -28,6 +28,40 @@ class WsScores
}
}
public function setCGU()
{
$params = new stdClass();
$params->application ='';
$client = $this->loadClient('gestion');
try {
$reponse = $client->setCGU($params);
Zend_Registry::get('firebug')->info($reponse);
return $reponse->setCGUResult;
} catch(SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
/**
* Get all infos for a user (Admin)
* @param string $login
*/
public function getUser($login)
{
$params = new stdClass();
$params->login = $login;
$client = $this->loadClient('gestion');
try {
$reponse = $client->getUser($params);
return $reponse->getUserResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
/**
* Retourne les infos du groupe
* @param string $siren
@ -966,8 +1000,117 @@ class WsScores
return false;
}
}
}
public function getAnnoncesBalo($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
{
$filename = 'annoncesbalo-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
$cache = new Cache($filename);
if ( $cache->exist() && !$this->toNotCache ){
return $cache->getBlock();
}
$params = new stdClass();
$params->siren = $siren;
$params->idAnn = $idAnn;
$params->filtre = $filtre;
$params->position = $position;
$params->nbRep = $nbRep;
$client = $this->loadClient('entreprise');
try {
$reponse = $client->getAnnoncesBalo($params);
$cache->deletefile();
$cache->setBlock($reponse->getAnnoncesBaloResult);
return $reponse->getAnnoncesBaloResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
public function getAnnoncesBoamp($siren, $idAnn=null, $filtre = null, $position=0, $nbRep=20)
{
$filename = 'annoncesboamp-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
$cache = new Cache($filename);
/*if ( $cache->exist() && !$this->toNotCache ){
return $cache->getBlock();
}*/
$params = new stdClass();
$params->siren = $siren;
$params->idAnn = $idAnn;
$params->filtre = null;
if (!empty($filtre) && in_array($filtre,array('A','M'))) {
$filtreStruct = new stdClass();
$filtreStruct->key = 'type';
$filtreStruct->value = $filtre;
$params->filtre[] = $filtreStruct;
}
$params->position = $position;
$params->nbRep = $nbRep;
$client = $this->loadClient('entreprise');
try {
$reponse = $client->getAnnoncesBoamp($params);
$cache->deletefile();
$cache->setBlock($reponse->getAnnoncesBoampResult);
return $reponse->getAnnoncesBoampResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
public function getAnnoncesAsso($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
{
$filename = 'annoncesasso-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
$cache = new Cache($filename);
/*if ( $cache->exist() && !$this->toNotCache ){
return $cache->getBlock();
}*/
$params = new stdClass();
$params->siren = $siren;
$params->idAnn = $idAnn;
$params->filtre = $filtre;
$params->position = $position;
$params->nbRep = $nbRep;
$client = $this->loadClient('entreprise');
try {
$reponse = $client->getAnnoncesAsso($params);
$cache->deletefile();
$cache->setBlock($reponse->getAnnoncesAssoResult);
return $reponse->getAnnoncesAssoResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
public function getAnnoncesLegales($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
{
$filename = 'annonceslegales-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
$cache = new Cache($filename);
/*if ( $cache->exist() && !$this->toNotCache ){
return $cache->getBlock();
}*/
$params = new stdClass();
$params->siren = $siren;
$params->idAnn = $idAnn;
$params->filtre = $filtre;
$params->position = $position;
$params->nbRep = $nbRep;
$client = $this->loadClient('entreprise');
try {
$reponse = $client->getAnnoncesLegales($params);
Zend_Registry::get('firebug')->info($reponse);
$cache->deletefile();
$cache->setBlock($reponse->getAnnoncesLegalesResult);
return $reponse->getAnnoncesLegalesResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}
/**
* getAnnonces
* @param string $siren
@ -1277,7 +1420,6 @@ class WsScores
return $reponse->getIdentiteLightResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
//throw new Zend_Soap_Client_Exception($fault);
return false;
}
}
@ -1306,7 +1448,6 @@ class WsScores
return $reponse->getIdentiteResult;
} catch (SoapFault $fault) {
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
//throw new Zend_Soap_Client_Exception($fault);
return false;
}
}
@ -1437,9 +1578,10 @@ class WsScores
/**
* searchEntreprise
* @param unknown_type $type
* @param unknown_type $criteres
* @param unknown_type $position
* @param array $criteres
* @param int $position
* @param int $nbRep
* @param int $actif
*/
public function searchEntreprise($criteres, $position = 0, $nbRep = null)
{
@ -1453,7 +1595,7 @@ class WsScores
$params->criteres->telFax = $criteres['telFax'];
$params->criteres->naf = $criteres['naf'];
$params->criteres->siege = false;
$params->criteres->actif = false;
$params->criteres->actif = in_array($criteres['actif'], array(0,1,2)) ? $criteres['actif'] : 2;
$params->position = $position;
$params->nbRep = empty($nbRep) ? $this->nbReponses : $nbRep ;
$client = $this->loadClient('entreprise');
@ -1518,14 +1660,16 @@ class WsScores
* setInfosLogin
* @param string $login
* @param string $action
* @param object $infos
* @param array $infos
*/
public function setInfosLogin($login, $action, $infos = null)
{
$params = new stdClass();
$params->login = $login;
$params->action = $action;
$params->infos = $infos;
if ($infos !== null ) {
$params->infos = json_encode($infos);
}
try {
$client = $this->loadClient('gestion');
$reponse = $client->setInfosLogin($params);
@ -1664,7 +1808,8 @@ class WsScores
$mail->addToKey('supportdev');
$mail->send();
}
/**
* loadClient
* @param unknown_type $webservice
@ -1681,8 +1826,8 @@ class WsScores
$options['cache_wsdl'] = WSDL_CACHE_NONE;
}
$options['trace'] = true;
$options['encoding'] = 'utf-8';
$client = new SoapClient($wsdl, $options);
$options['encoding'] = 'utf-8';
$client = new SoapClient($wsdl, $options);
return $client;
}
}

View File

@ -1 +0,0 @@
kellan <kellan@protest.net>

View File

@ -1,41 +0,0 @@
Version 0.72
-----------
- fix security exploit: http://www.sec-consult.com/216.html
Version 0.7
-----------
- support for input and output charset encoding
based on the work in FoF, uses iconv or mbstring if available
-
Version 0.6
-----------
- basic support for Atom syndication format
including support for Atom content constructs
- fixed support for private feeds (HTTP Auth and SSL)
(thanks to silverorange.com for providing test feeds)
- support for some broken webservers
Version 0.52
-----------
- support GZIP content negoiation
- PHP 4.3.2 support
Version 0.4
-----------
- improved error handling, better access for script authors
- included example scripts of working with MagpieRSS
- new Smarty plugin for RSS date parsing
Version 0.3
-----------
- added support for conditional gets (Last-Modified, ETag)
- now use Snoopy to handle fetching RSS files
Version 0.2
-----------
- MAJOR CLEAN UP
- removed kludgy $options array in favour of constants
- phased out returning arrays
- added better error handling
- re-worked comments

View File

@ -1,405 +0,0 @@
2005-10-28 14:11 kellan
* extlib/Snoopy.class.inc: a better solution
2005-10-28 11:51 kellan
* extlib/Snoopy.class.inc: fix arbtriary code execution
vulnerability when using curl+ssl
http://www.sec-consult.com/216.html
2005-03-08 10:46 kellan
* rss_parse.inc: fix bug w/ atom and date normalization
2005-02-09 14:59 kellan
* rss_fetch.inc: fix stale cache bug
2005-01-28 02:27 kellan
* rss_parse.inc: support php w/o array_change_case
2005-01-23 20:02 kellan
* rss_fetch.inc: fix cache bug introduced by charset encoding
2005-01-12 09:14 kellan
* rss_cache.inc, rss_fetch.inc: more sanity checks for when things
go wrong
2004-12-12 13:44 kellan
* INSTALL, rss_cache.inc, rss_utils.inc: detab
2004-11-23 20:15 kellan
* rss_parse.inc: fix calling iconv instead of mb_convert_encoding
2004-11-22 02:11 kellan
* CHANGES, ChangeLog, rss_parse.inc, scripts/magpie_debug.php: last
bit of tidying
2004-11-22 01:45 kellan
* rss_fetch.inc: detab, bump version
2004-11-22 01:43 kellan
* rss_parse.inc: was filtering too much
2004-11-22 00:03 kellan
* rss_fetch.inc, rss_parse.inc: cache on $url . $output_encoding
otherwise we can get munged output
2004-11-21 23:52 kellan
* rss_parse.inc: add WARNING
2004-11-21 23:45 kellan
* rss_parse.inc: don't set ERROR on notice or warning (rss_fetch
dies on parse errors)
2004-11-21 23:44 kellan
* rss_fetch.inc: add encoding defines (fix timeout error reporting)
2004-11-21 20:21 kellan
* rss_parse.inc: incorporate steve's patch
2004-11-21 19:26 kellan
* rss_parse.inc: remove old debugging functions, totally
arbitrarily. might break stuff. can't really explain why i'm
doing this.
2004-10-28 15:52 kellan
* rss_parse.inc: fixed '=' instead of '=='
2004-10-26 00:48 kellan
* rss_parse.inc: chance epoch to timestamp to conform w/ php naming
conventions
2004-06-15 12:00 kellan
* rss_parse.inc: [no log message]
2004-04-26 14:16 kellan
* rss_fetch.inc: bump version
2004-04-26 12:36 kellan
* rss_parse.inc: fix field doubling
2004-04-24 17:47 kellan
* CHANGES, ChangeLog: updated
2004-04-24 17:35 kellan
* rss_fetch.inc: bumped version
2004-04-24 16:52 kellan
* rss_parse.inc: support arbitrary atom content constructs
some refactoring
2004-04-24 16:15 kellan
* rss_parse.inc: support summary content contstruct. add normalize
function
2004-03-27 16:29 kellan
* extlib/Snoopy.class.inc: accept self-signed certs
2004-03-27 12:53 kellan
* extlib/Snoopy.class.inc: fixed SSL support * set status * set
error on bad curl
(also ripped out big chunks of dead weight (submit_form) which
were getting in my way
2004-01-25 02:25 kellan
* rss_parse.inc: make RSS 1.0's rdf:about available
2004-01-25 02:07 kellan
* rss_parse.inc: clean up text, and line formats. add support item
rdf:about
2004-01-24 23:40 kellan
* CHANGES, ChangeLog: update changes
2004-01-24 23:37 kellan
* rss_fetch.inc: updated version
2004-01-24 23:35 kellan
* rss_parse.inc: whitespace
2004-01-24 23:23 kellan
* extlib/Snoopy.class.inc: support badly formatted http headers
2004-01-24 23:20 kellan
* rss_parse.inc: added alpha atom parsing support
2003-06-25 22:34 kellan
* extlib/Snoopy.class.inc: fixed fread 4.3.2 compatibility problems
2003-06-13 11:31 kellan
* rss_fetch.inc: reset cache on 304
2003-06-12 21:37 kellan
* rss_cache.inc, rss_fetch.inc, rss_parse.inc, rss_utils.inc:
bumped up version numbers
2003-06-12 21:32 kellan
* htdocs/index.html: updated news
2003-06-12 21:27 kellan
* NEWS: a manual blog :)
2003-06-12 21:22 kellan
* htdocs/index.html: fully qualified img
2003-06-12 21:20 kellan
* htdocs/index.html: clean up. added badge.
2003-06-12 21:04 kellan
* rss_utils.inc: clean up regex
2003-06-12 21:02 kellan
* rss_cache.inc: suppress some warnings
2003-05-30 20:44 kellan
* extlib/Snoopy.class.inc: more comments, cleaned up notice
2003-05-30 15:14 kellan
* extlib/Snoopy.class.inc: don't advertise gzip support if the user
hasn't built php with gzinflate support
2003-05-12 22:32 kellan
* ChangeLog: changes
2003-05-12 22:11 kellan
* htdocs/index.html: announce 0.5
2003-05-12 21:42 kellan
* htdocs/index.html: change
2003-05-12 21:39 kellan
* rss_fetch.inc: use gzip
2003-05-12 21:37 kellan
* extlib/Snoopy.class.inc: added support gzip encoded content
negoiation
2003-05-12 21:32 kellan
* rss_cache.inc, rss_fetch.inc, rss_parse.inc, rss_utils.inc: fixed
typoes
2003-04-26 21:44 kellan
* rss_parse.inc: fix minor typo
2003-04-18 08:19 kellan
* htdocs/cookbook.html: updated cookbook to show more code for
limiting items
2003-03-03 16:02 kellan
* rss_parse.inc, scripts/magpie_slashbox.php: committed (or
adpated) patch from Nicola (www.technick.com) to quell 'Undefined
Indexes' notices
2003-03-03 15:59 kellan
* rss_fetch.inc: commited patch from nicola (www.technick.com) to
quell 'undefined indexes' notices.
* Magpie now automatically includes its version in the
user-agent, & whether cacheing is turned on.
2003-02-12 01:22 kellan
* CHANGES, ChangeLog: ChangeLog now auto-generated by cvs2cl
2003-02-12 00:21 kellan
* rss_fetch.inc: better errors, hopefully stomped on pesky notices
2003-02-12 00:19 kellan
* rss_parse.inc: check to see is xml is supported, if not die
also throw better xml errors
2003-02-12 00:18 kellan
* rss_cache.inc: hopefully cleared up some notices that were being
thrown into the log
fixed a debug statement that was being called as an error
2003-02-12 00:15 kellan
* scripts/: magpie_simple.php, magpie_slashbox.php: moved
magpie_simple to magpie_slashbox, and replaced it with a simpler
demo.
2003-02-12 00:02 kellan
* INSTALL, README, TROUBLESHOOTING: Improved documentation. Better
install instructions.
TROUBLESHOOTING cover common installation and usage problems
2003-01-22 14:40 kellan
* htdocs/cookbook.html: added cookbook.html
2003-01-21 23:47 kellan
* cookbook: a magpie cookbook
2003-01-20 10:09 kellan
* ChangeLog: updated
2003-01-20 09:23 kellan
* scripts/simple_smarty.php: minor clean up
2003-01-20 09:15 kellan
* scripts/README: added smarty url
2003-01-20 09:14 kellan
* magpie_simple.php, htdocs/index.html, scripts/README,
scripts/magpie_debug.php, scripts/magpie_simple.php,
scripts/simple_smarty.php,
scripts/smarty_plugin/modifier.rss_date_parse.php,
scripts/templates/simple.smarty: Added scripts directory for
examples on how to use MagpieRSS
magpie_simple - is a simple example magpie_debug - spew all the
information from a parsed RSS feed simple_smary - example of
using magpie with Smarty template system
smarty_plugin/modifier.rss_date_parse.php - support file for the
smarty demo templates/simple.smary - template for the smarty demo
2003-01-20 09:11 kellan
* rss_fetch.inc, rss_parse.inc: changes to error handling to give
script authors more access to magpie's errors.
added method magpie_error() to retrieve global MAGPIE_ERROR
variable for when fetch_rss() returns false
2002-10-26 19:02 kellan
* htdocs/index.html: putting the website under source control
2002-10-26 18:43 kellan
* AUTHORS, ChangeLog, INSTALL, README: some documentation to make
it all look official :)
2002-10-25 23:04 kellan
* magpie_simple.php: quxx
2002-10-25 23:04 kellan
* rss_parse.inc: added support for textinput and image
2002-10-25 19:23 kellan
* magpie_simple.php, rss_cache.inc, rss_fetch.inc, rss_parse.inc,
rss_utils.inc: switched to using Snoopy for fetching remote RSS
files.
added support for conditional gets
2002-10-25 19:22 kellan
* rss_cache.inc, rss_fetch.inc, rss_parse.inc, rss_utils.inc:
Change comment style to slavishly imitate the phpinsider style
found in Smarty and Snoopy :)
2002-10-25 19:18 kellan
* extlib/Snoopy.class.inc: added Snoopy in order to support
conditional gets
2002-10-23 23:19 kellan
* magpie_simple.php, rss_cache.inc, rss_fetch.inc, rss_parse.inc:
MAJOR CLEANUP!
* rss_fetch got rid of the options array, replaced it with a more
PHP-like solution of using defines. constants are setup, with
defaults, in the function init()
got rid of the idiom of passing back an array, its was awkward to
deal with in PHP, and unusual (and consquently confusing to
people). now i return true/false values, and try to setup error
string where appropiate (rss_cache has the most complete example
of this)
change the logic for interacting with the cache
* rss_cache major re-working of how error are handled. tried to
make the code more resillient. the cache is now much more aware
of MAX_AGE, where before this was being driven out of rss_fetch
(which was silly)
* rss_parse properly handles xml parse errors. used to sail
along blithely unaware.
2002-09-11 11:11 kellan
* rss_cache.inc, rss_parse.inc, magpie_simple.php, rss_fetch.inc,
rss_utils.inc: Initial revision
2002-09-11 11:11 kellan
* rss_cache.inc, rss_parse.inc, magpie_simple.php, rss_fetch.inc,
rss_utils.inc: initial import

View File

@ -1,143 +0,0 @@
REQUIREMENTS
MapieRSS requires a recent PHP 4+ (developed with 4.2.0)
with xml (expat) support.
Optionally:
* PHP5 with libxml2 support.
* cURL for SSL support
* iconv (preferred) or mb_string for expanded character set support
QUICK START
Magpie consists of 4 files (rss_fetch.inc, rss_parser.inc, rss_cache.inc,
and rss_utils.inc), and the directory extlib (which contains a modified
version of the Snoopy HTTP client)
Copy these 5 resources to a directory named 'magpierss' in the same
directory as your PHP script.
At the top of your script add the following line:
require_once('magpierss/rss_fetch.inc');
Now you can use the fetch_rss() method:
$rss = fetch_rss($url);
Done. That's it. See README for more details on using MagpieRSS.
NEXT STEPS
Important: you'll probably want to get the cache directory working in
order to speed up your application, and not abuse the webserver you're
downloading the RSS from.
Optionally you can install MagpieRSS in your PHP include path in order to
make it available server wide.
Lastly you might want to look through the constants in rss_fetch.inc see if
there is anything you want to override (the defaults are pretty good)
For more info, or if you have trouble, see TROUBLESHOOTING
SETTING UP CACHING
Magpie has built-in transparent caching. With caching Magpie will only
fetch and parse RSS feeds when there is new content. Without this feature
your pages will be slow, and the sites serving the RSS feed will be annoyed
with you.
** Simple and Automatic **
By default Magpie will try to create a cache directory named 'cache' in the
same directory as your PHP script.
** Creating a Local Cache Directory **
Often this will fail, because your webserver doesn't have sufficient
permissions to create the directory.
Exact instructions for how to do this will vary from install to install and
platform to platform. The steps are:
1. Make a directory named 'cache'
2. Give the web server write access to that directory.
An example of how to do this on Debian would be:
1. mkdir /path/to/script/cache
2. chgrp www-data /path/to/script/cache
3. chmod 775 /path/to/script/cache
On other Unixes you'll need to change 'www-data' to what ever user Apache
runs as. (on MacOS X the user would be 'www')
** Cache in /tmp **
Sometimes you won't be able to create a local cache directory. Some reasons
might be:
1. No shell account
2. Insufficient permissions to change ownership of a directory
3. Webserver runs as 'nobody'
In these situations using a cache directory in /tmp can often be a good
option.
The drawback is /tmp is public, so anyone on the box can read the cache
files. Usually RSS feeds are public information, so you'll have to decide
how much of an issue that is.
To use /tmp as your cache directory you need to add the following line to
your script:
define('MAGPIE_CACHE_DIR', '/tmp/magpie_cache');
** Global Cache **
If you have several applications using Magpie, you can create a single
shared cache directory, either using the /tmp cache, or somewhere else on
the system.
The upside is that you'll distribute fetching and parsing feeds across
several applications.
INSTALLING MAGPIE SERVER WIDE
Rather then following the Quickstart instructions which requires you to have
a copy of Magpie per application, alternately you can place it in some
shared location.
** Adding Magpie to Your Include Path **
Copy the 5 resources (rss_fetch.inc, rss_parser.inc, rss_cache.inc,
rss_utils.inc, and extlib) to a directory named 'magpierss' in your include
path. Now any PHP file on your system can use Magpie with:
require_once('magpierss/rss_fetch.inc');
Different installs have different include paths, and you'll have to figure
out what your include_path is.
From shell you can try:
php -i | grep 'include_path'
Alternatley you can create a phpinfo.php file with contains:
<?php phpinfo(); ?>
Debian's default is:
/usr/share/php
(though more idealogically pure location would be /usr/local/share/php)
Apple's default include path is:
/usr/lib/php
While the Entropy PHP build seems to use:
/usr/local/php/lib/php

View File

@ -1,53 +0,0 @@
MagpieRSS News
MAGPIERSS 0.51 RELEASED
* important bugfix!
* fix "silent failure" when PHP doesn't have zlib
FEED ON FEEDS USES MAGPIE
* web-based RSS aggregator built with Magpie
* easy to install, easy to use.
http://minutillo.com/steve/feedonfeeds/
MAGPIERSS 0.5 RELEASED
* supports transparent HTTP gzip content negotiation for reduced bandwidth usage
* quashed some undefined index notices
MAGPIERSS 0.46 RELEASED
* minor release, more error handling clean up
* documentation fixes, simpler example
* new trouble shooting guide for installation and usage problems
http://magpierss.sourceforge.net/TROUBLESHOOTING
MAGPIE NEWS AS RSS
* releases, bug fixes, releated stories in RSS
MAGPIERSS COOKBOOK: SIMPLE PHP RSS HOW TOS
* answers some of the most frequently asked Magpie questions
* feedback, suggestions, requests, recipes welcome
http://magpierss.sourceforge.net/cookbook.html
MAGPIERSS 0.4 RELEASED!
* improved error handling, more flexibility for script authors, backwards compatible
* new and better examples! including using MagpieRSS and Smarty
* new Smarty plugin for RSS date parsing
http://smarty.php.net
INFINITE PENGUIN NOW SUPPORTS MAGPIE 0.3
* simple, sophisticated RSS viewer
* includes auto-generated javascript ticker from RSS feed
http://www.infinitepenguins.net/rss/
TRAUMWIND RELEASES REX BACKEND FOR MAGPIERSS
* drop in support using regex based XML parser
* parses improperly formed XML that chokes expat
http://traumwind.de/blog/magpie/magpie_alike.php
MAGPIERSS 0.3 RELEASED!
* Support added for HTTP Conditional GETs.
http://fishbowl.pastiche.org/archives/001132.html
MAGPIERSS 0.2!
* Major clean up of the code. Easier to use.
* Simpler install on shared hosts.
* Better documentation and comments.

View File

@ -1,48 +0,0 @@
NAME
MagpieRSS - a simple RSS integration tool
SYNOPSIS
require_once(rss_fetch.inc);
$url = $_GET['url'];
$rss = fetch_rss( $url );
echo "Channel Title: " . $rss->channel['title'] . "<p>";
echo "<ul>";
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
echo "<li><a href=$href>$title</a></li>";
}
echo "</ul>";
DESCRIPTION
MapieRSS is an XML-based RSS parser in PHP. It attempts to be "PHP-like",
and simple to use.
Some features include:
* supports RSS 0.9 - 1.0, with limited RSS 2.0 support
* supports namespaces, and modules, including mod_content and mod_event
* open minded [1]
* simple, functional interface, to object oriented backend parser
* automatic caching of parsed RSS objects makes its easy to integrate
* supports conditional GET with Last-Modified, and ETag
* uses constants for easy override of default behaviour
* heavily commented
1. By open minded I mean Magpie will accept any tag it finds in good faith that
it was supposed to be here. For strict validation, look elsewhere.
GETTING STARTED
COPYRIGHT:
Copyright(c) 2002 kellan@protest.net. All rights reserved.
This software is released under the GNU General Public License.
Please read the disclaimer at the top of the Snoopy.class.inc file.

View File

@ -1,152 +0,0 @@
TROUBLESHOOTING
Trouble Installing MagpieRSS:
1. Fatal error: Failed opening required '/path/to/script/rss_fetch.inc'
(include_path='.:/usr/local/lib/php:/usr/local/lib/php/pear')
2. Cache couldn't make dir './cache'.
3. Fatal error: Failed to load PHP's XML Extension.
http://www.php.net/manual/en/ref.xml.php
Trouble Using MagpieRSS
4. Warning: MagpieRSS: Failed to fetch example.com/index.rdf.
(HTTP Error: Invalid protocol "")
5. Warning: MagpieRSS: Failed to parse RSS file.
(not well-formed (invalid token) at line 19, column 98)
6. Warning: MagpieRSS: Failed to fetch http://localhost/rss/features.1-0.rss.
(HTTP Response: HTTP/1.1 404 Not Found)
If you would rather provide a custom error, see the COOKBOOK
(http://magpierss.sf.net/cookbook.html) recipe 2.
*************************************************************************
1. Fatal error: Failed opening required '/path/to/script/rss_fetch.inc'
(include_path='.:/usr/local/lib/php:/usr/local/lib/php/pear')
This could mean that:
a) PHP can't find the MagpieRSS files.
b) PHP found them the MagpieRSS files, but can't read them.
a. Telling PHP where to look for MagpieRSS file.
This might mean your PHP program can't find the MagpieRSS libraries.
Magpie relies on 4 include files, rss_fetch.inc, rss_parse.inc,
rss_cache.inc, rss_util.inc, and for normal use you'll need all 4 (see the
cookbook for exceptions).
This can be fixed by making sure the MagpieRSS files are in your include
path.
If you can edit your include path (for example your on a shared host) then
you need to replace:
require_once('rss_fetch.inc');
-with-
define('MAGPIE_DIR', '/path/to/magpierss/');
require_once(MAGPIE_DIR.'rss_fetch.inc');
b. PHP can't read the MagpieRSS files
All PHP libraries need to be readable by your webserver.
On Unix you can accomplish this with:
chmod 755 rss_fetch.inc rss_parse.inc rss_cache.inc rss_util.inc
*************************************************************************
2. Cache couldn't make dir './cache'.
MagpieRSS caches the results of fetched and parsed RSS to reduce the load on
both your server, and the remote server providing the RSS. It does this by
writing files to a cache directory.
This error means the webserver doesn't have write access to the current
directory.
a. Make a webserver writeable cache directory
Find the webserver's group. (on my system it is 'www')
mkdir ./cache
chgrp www directory_name
chmod g+w directory_name
(this is the best, and desired solution)
b. Tell MagpieRSS to create the cache directory somewhere the webserver can
write to.
define('MAGPIE_CACHE_DIR', '/tmp/magpierss');
(this is not a great solution, and might have security considerations)
c. Turn off cacheing.
Magpie can work fine with cacheing, but it will be slower, and you might
become a nuiance to the RSS provider, but it is an option.
define('MAGPIE_CACHE_ON', 0);
d. And lastly, do NOT
chmod 777 ./cache
Any of the above solutions are better then this.
NOTE: If none of this works for you, let me know. I've got root, and a
custom compiled Apache on almost any box I ever touch, so I can be a little
out of touch with reality. But I won't know that if I don't feedback.
************************************************************************* 3.
3. Fatal error: Failed to load PHP's XML Extension.
http://www.php.net/manual/en/ref.xml.php
-or-
Fatal error: Failed to create an instance of PHP's XML parser.
http://www.php.net/manual/en/ref.xml.php
Make sure your PHP was built with --with-xml
This has been turned on by default for several versions of PHP, but it might
be turned off in your build.
See php.net for details on building and configuring PHP.
*************************************************************************
4. Warning: MagpieRSS: Failed to fetch index.rdf.
(HTTP Error: Invalid protocol "")
You need to put http:// in front of your the URL to your RSS feed
*************************************************************************
5. Warning: MagpieRSS: Failed to parse RSS file.
(not well-formed (invalid token) at line 19, column 98)
There is a problem with the RSS feed you are trying to read.
MagpieRSS is an XML parser, and therefore can't parse RSS feed with invalid
characters. Some RSS parser are based on regular expressions, and can
parse invalid RSS but they have their own problems.
You could try contacting the author of the RSS feed, and pointing them to
the online RSS validator at:
http://feeds.archive.org/validator/
*************************************************************************
6. Warning: MagpieRSS: Failed to fetch http://example.com/index.rdf
(HTTP Response: HTTP/1.1 404 Not Found)
Its a 404! The RSS file ain't there.

View File

@ -1,125 +0,0 @@
MAGPIERSS RECIPES: Cooking with Corbies
"Four and twenty blackbirds baked in a pie."
1. LIMIT THE NUMBER OF HEADLINES(AKA ITEMS) RETURNED.
PROBLEM:
You want to display the 10 (or 3) most recent headlines, but the RSS feed
contains 15.
SOLUTION:
$num_items = 10;
$rss = fetch_rss($url);
$items = array_slice($rss->items, 0, $num_items);
DISCUSSION:
Rather then trying to limit the number of items Magpie parses, a much simpler,
and more flexible approach is to take a "slice" of the array of items. And
array_slice() is smart enough to do the right thing if the feed has less items
then $num_items.
See: http://www.php.net/array_slice
2. DISPLAY A CUSTOM ERROR MESSAGE IF SOMETHING GOES WRONG
PROBLEM:
You don't want Magpie's error messages showing up if something goes wrong.
SOLUTION:
# Magpie throws USER_WARNINGS only
# so you can cloak these, by only showing ERRORs
error_reporting(E_ERROR);
# check the return value of fetch_rss()
$rss = fetch_rss($url);
if ( $rss ) {
...display rss feed...
}
else {
echo "An error occured! " .
"Consider donating more $$$ for restoration of services." .
"<br>Error Message: " . magpie_error();
}
DISCUSSION:
MagpieRSS triggers a warning in a number of circumstances. The 2 most common
circumstances are: if the specified RSS file isn't properly formed (usually
because it includes illegal HTML), or if Magpie can't download the remote RSS
file, and there is no cached version.
If you don't want your users to see these warnings change your error_reporting
settings to only display ERRORs. Another option is to turn off display_error,
so that WARNINGs, and NOTICEs still go to the error_log but not to the webpages.
You can do this with:
ini_set('display_errors', 0);
See: http://www.php.net/error_reporting,
http://www.php.net/ini_set,
http://www.php.net/manual/en/ref.errorfunc.php
3. GENERATE A NEW RSS FEED
PROBLEM:
Create an RSS feed for other people to use.
SOLUTION:
Use Useful Inc's RSSWriter (http://usefulinc.com/rss/rsswriter/)
DISCUSSION:
An example of turning a Magpie parsed RSS object back into an RSS file is forth
coming. In the meantime RSSWriter has great documentation.
4. DISPLAY HEADLINES MORE RECENT THEN X DATE
PROBLEM:
You only want to display headlines that were published on, or after a certain
date.
SOLUTION:
require 'rss_utils.inc';
# get all headlines published today
$today = getdate();
# today, 12AM
$date = mktime(0,0,0,$today['mon'], $today['mday'], $today['year']);
$rss = fetch_rss($url);
foreach ( $rss->items as $item ) {
$published = parse_w3cdtf($item['dc']['date']);
if ( $published >= $date ) {
echo "Title: " . $item['title'];
echo "Published: " . date("h:i:s A", $published);
echo "<p>";
}
}
DISCUSSION:
This recipe only works for RSS 1.0 feeds that include the <dc:date> field.
(which is very good RSS style)
parse_w3cdtf is defined in rss_utils.inc, and parses RSS style dates into Unix
epoch seconds.
See: http://www.php.net/manual/en/ref.datetime.php

View File

@ -1,900 +0,0 @@
<?php
/*************************************************
Snoopy - the PHP net client
Author: Monte Ohrt <monte@ispi.net>
Copyright (c): 1999-2000 ispi, all rights reserved
Version: 1.0
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You may contact the author of Snoopy by e-mail at:
monte@ispi.net
Or, write to:
Monte Ohrt
CTO, ispi
237 S. 70th suite 220
Lincoln, NE 68510
The latest version of Snoopy can be obtained from:
http://snoopy.sourceforge.com
*************************************************/
class Snoopy
{
/**** Public variables ****/
/* user definable vars */
var $host = "www.php.net"; // host name we are connecting to
var $port = 80; // port we are connecting to
var $proxy_host = ""; // proxy host to use
var $proxy_port = ""; // proxy port to use
var $agent = "Snoopy v1.0"; // agent we masquerade as
var $referer = ""; // referer info to pass
var $cookies = array(); // array of cookies to pass
// $cookies["username"]="joe";
var $rawheaders = array(); // array of raw headers to send
// $rawheaders["Content-type"]="text/html";
var $maxredirs = 5; // http redirection depth maximum. 0 = disallow
var $lastredirectaddr = ""; // contains address of last redirected address
var $offsiteok = true; // allows redirection off-site
var $maxframes = 0; // frame content depth maximum. 0 = disallow
var $expandlinks = true; // expand links to fully qualified URLs.
// this only applies to fetchlinks()
// or submitlinks()
var $passcookies = true; // pass set cookies back through redirects
// NOTE: this currently does not respect
// dates, domains or paths.
var $user = ""; // user for http authentication
var $pass = ""; // password for http authentication
// http accept types
var $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
var $results = ""; // where the content is put
var $error = ""; // error messages sent here
var $response_code = ""; // response code returned from server
var $headers = array(); // headers returned from server sent here
var $maxlength = 500000; // max return data length (body)
var $read_timeout = 0; // timeout on read operations, in seconds
// supported only since PHP 4 Beta 4
// set to 0 to disallow timeouts
var $timed_out = false; // if a read operation timed out
var $status = 0; // http request status
var $curl_path = "/usr/bin/curl";
// Snoopy will use cURL for fetching
// SSL content if a full system path to
// the cURL binary is supplied here.
// set to false if you do not have
// cURL installed. See http://curl.haxx.se
// for details on installing cURL.
// Snoopy does *not* use the cURL
// library functions built into php,
// as these functions are not stable
// as of this Snoopy release.
// send Accept-encoding: gzip?
var $use_gzip = true;
/**** Private variables ****/
var $_maxlinelen = 4096; // max line length (headers)
var $_httpmethod = "GET"; // default http request method
var $_httpversion = "HTTP/1.0"; // default http request version
var $_submit_method = "POST"; // default submit method
var $_submit_type = "application/x-www-form-urlencoded"; // default submit type
var $_mime_boundary = ""; // MIME boundary for multipart/form-data submit type
var $_redirectaddr = false; // will be set if page fetched is a redirect
var $_redirectdepth = 0; // increments on an http redirect
var $_frameurls = array(); // frame src urls
var $_framedepth = 0; // increments on frame depth
var $_isproxy = false; // set if using a proxy server
var $_fp_timeout = 30; // timeout for socket connection
/*======================================================================*\
Function: fetch
Purpose: fetch the contents of a web page
(and possibly other protocols in the
future like ftp, nntp, gopher, etc.)
Input: $URI the location of the page to fetch
Output: $this->results the output text from the fetch
\*======================================================================*/
function fetch($URI)
{
//preg_match("|^([^:]+)://([^:/]+)(:[\d]+)*(.*)|",$URI,$URI_PARTS);
$URI_PARTS = parse_url($URI);
if (!empty($URI_PARTS["user"]))
$this->user = $URI_PARTS["user"];
if (!empty($URI_PARTS["pass"]))
$this->pass = $URI_PARTS["pass"];
switch($URI_PARTS["scheme"])
{
case "http":
$this->host = $URI_PARTS["host"];
if(!empty($URI_PARTS["port"]))
$this->port = $URI_PARTS["port"];
if($this->_connect($fp))
{
if($this->_isproxy)
{
// using proxy, send entire URI
$this->_httprequest($URI,$fp,$URI,$this->_httpmethod);
}
else
{
$path = $URI_PARTS["path"].(isset($URI_PARTS["query"]) ? "?".$URI_PARTS["query"] : "");
// no proxy, send only the path
$this->_httprequest($path, $fp, $URI, $this->_httpmethod);
}
$this->_disconnect($fp);
if($this->_redirectaddr)
{
/* url was redirected, check if we've hit the max depth */
if($this->maxredirs > $this->_redirectdepth)
{
// only follow redirect if it's on this site, or offsiteok is true
if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
{
/* follow the redirect */
$this->_redirectdepth++;
$this->lastredirectaddr=$this->_redirectaddr;
$this->fetch($this->_redirectaddr);
}
}
}
if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
{
$frameurls = $this->_frameurls;
$this->_frameurls = array();
while(list(,$frameurl) = each($frameurls))
{
if($this->_framedepth < $this->maxframes)
{
$this->fetch($frameurl);
$this->_framedepth++;
}
else
break;
}
}
}
else
{
return false;
}
return true;
break;
case "https":
if(!$this->curl_path || (!is_executable($this->curl_path))) {
$this->error = "Bad curl ($this->curl_path), can't fetch HTTPS \n";
return false;
}
$this->host = $URI_PARTS["host"];
if(!empty($URI_PARTS["port"]))
$this->port = $URI_PARTS["port"];
if($this->_isproxy)
{
// using proxy, send entire URI
$this->_httpsrequest($URI,$URI,$this->_httpmethod);
}
else
{
$path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : "");
// no proxy, send only the path
$this->_httpsrequest($path, $URI, $this->_httpmethod);
}
if($this->_redirectaddr)
{
/* url was redirected, check if we've hit the max depth */
if($this->maxredirs > $this->_redirectdepth)
{
// only follow redirect if it's on this site, or offsiteok is true
if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
{
/* follow the redirect */
$this->_redirectdepth++;
$this->lastredirectaddr=$this->_redirectaddr;
$this->fetch($this->_redirectaddr);
}
}
}
if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
{
$frameurls = $this->_frameurls;
$this->_frameurls = array();
while(list(,$frameurl) = each($frameurls))
{
if($this->_framedepth < $this->maxframes)
{
$this->fetch($frameurl);
$this->_framedepth++;
}
else
break;
}
}
return true;
break;
default:
// not a valid protocol
$this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n';
return false;
break;
}
return true;
}
/*======================================================================*\
Private functions
\*======================================================================*/
/*======================================================================*\
Function: _striplinks
Purpose: strip the hyperlinks from an html document
Input: $document document to strip.
Output: $match an array of the links
\*======================================================================*/
function _striplinks($document)
{
preg_match_all("'<\s*a\s+.*href\s*=\s* # find <a href=
([\"\'])? # find single or double quote
(?(1) (.*?)\\1 | ([^\s\>]+)) # if quote found, match up to next matching
# quote, otherwise match up to next space
'isx",$document,$links);
// catenate the non-empty matches from the conditional subpattern
while(list($key,$val) = each($links[2]))
{
if(!empty($val))
$match[] = $val;
}
while(list($key,$val) = each($links[3]))
{
if(!empty($val))
$match[] = $val;
}
// return the links
return $match;
}
/*======================================================================*\
Function: _stripform
Purpose: strip the form elements from an html document
Input: $document document to strip.
Output: $match an array of the links
\*======================================================================*/
function _stripform($document)
{
preg_match_all("'<\/?(FORM|INPUT|SELECT|TEXTAREA|(OPTION))[^<>]*>(?(2)(.*(?=<\/?(option|select)[^<>]*>[\r\n]*)|(?=[\r\n]*))|(?=[\r\n]*))'Usi",$document,$elements);
// catenate the matches
$match = implode("\r\n",$elements[0]);
// return the links
return $match;
}
/*======================================================================*\
Function: _striptext
Purpose: strip the text from an html document
Input: $document document to strip.
Output: $text the resulting text
\*======================================================================*/
function _striptext($document)
{
// I didn't use preg eval (//e) since that is only available in PHP 4.0.
// so, list your entities one by one here. I included some of the
// more common ones.
$search = array("'<script[^>]*?>.*?</script>'si", // strip out javascript
"'<[\/\!]*?[^<>]*?>'si", // strip out html tags
"'([\r\n])[\s]+'", // strip out white space
"'&(quote|#34);'i", // replace html entities
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i"
);
$replace = array( "",
"",
"\\1",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169));
$text = preg_replace($search,$replace,$document);
return $text;
}
/*======================================================================*\
Function: _expandlinks
Purpose: expand each link into a fully qualified URL
Input: $links the links to qualify
$URI the full URI to get the base from
Output: $expandedLinks the expanded links
\*======================================================================*/
function _expandlinks($links,$URI)
{
preg_match("/^[^\?]+/",$URI,$match);
$match = preg_replace("|/[^\/\.]+\.[^\/\.]+$|","",$match[0]);
$search = array( "|^http://".preg_quote($this->host)."|i",
"|^(?!http://)(\/)?(?!mailto:)|i",
"|/\./|",
"|/[^\/]+/\.\./|"
);
$replace = array( "",
$match."/",
"/",
"/"
);
$expandedLinks = preg_replace($search,$replace,$links);
return $expandedLinks;
}
/*======================================================================*\
Function: _httprequest
Purpose: go get the http data from the server
Input: $url the url to fetch
$fp the current open file pointer
$URI the full URI
$body body contents to send if any (POST)
Output:
\*======================================================================*/
function _httprequest($url,$fp,$URI,$http_method,$content_type="",$body="")
{
if($this->passcookies && $this->_redirectaddr)
$this->setcookies();
$URI_PARTS = parse_url($URI);
if(empty($url))
$url = "/";
$headers = $http_method." ".$url." ".$this->_httpversion."\r\n";
if(!empty($this->agent))
$headers .= "User-Agent: ".$this->agent."\r\n";
if(!empty($this->host) && !isset($this->rawheaders['Host']))
$headers .= "Host: ".$this->host."\r\n";
if(!empty($this->accept))
$headers .= "Accept: ".$this->accept."\r\n";
if($this->use_gzip) {
// make sure PHP was built with --with-zlib
// and we can handle gzipp'ed data
if ( function_exists(gzinflate) ) {
$headers .= "Accept-encoding: gzip\r\n";
}
else {
trigger_error(
"use_gzip is on, but PHP was built without zlib support.".
" Requesting file(s) without gzip encoding.",
E_USER_NOTICE);
}
}
if(!empty($this->referer))
$headers .= "Referer: ".$this->referer."\r\n";
if(!empty($this->cookies))
{
if(!is_array($this->cookies))
$this->cookies = (array)$this->cookies;
reset($this->cookies);
if ( count($this->cookies) > 0 ) {
$cookie_headers .= 'Cookie: ';
foreach ( $this->cookies as $cookieKey => $cookieVal ) {
$cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; ";
}
$headers .= substr($cookie_headers,0,-2) . "\r\n";
}
}
if(!empty($this->rawheaders))
{
if(!is_array($this->rawheaders))
$this->rawheaders = (array)$this->rawheaders;
while(list($headerKey,$headerVal) = each($this->rawheaders))
$headers .= $headerKey.": ".$headerVal."\r\n";
}
if(!empty($content_type)) {
$headers .= "Content-type: $content_type";
if ($content_type == "multipart/form-data")
$headers .= "; boundary=".$this->_mime_boundary;
$headers .= "\r\n";
}
if(!empty($body))
$headers .= "Content-length: ".strlen($body)."\r\n";
if(!empty($this->user) || !empty($this->pass))
$headers .= "Authorization: BASIC ".base64_encode($this->user.":".$this->pass)."\r\n";
$headers .= "\r\n";
// set the read timeout if needed
if ($this->read_timeout > 0)
socket_set_timeout($fp, $this->read_timeout);
$this->timed_out = false;
fwrite($fp,$headers.$body,strlen($headers.$body));
$this->_redirectaddr = false;
unset($this->headers);
// content was returned gzip encoded?
$is_gzipped = false;
while($currentHeader = fgets($fp,$this->_maxlinelen))
{
if ($this->read_timeout > 0 && $this->_check_timeout($fp))
{
$this->status=-100;
return false;
}
// if($currentHeader == "\r\n")
if(preg_match("/^\r?\n$/", $currentHeader) )
break;
// if a header begins with Location: or URI:, set the redirect
if(preg_match("/^(Location:|URI:)/i",$currentHeader))
{
// get URL portion of the redirect
preg_match("/^(Location:|URI:)\s+(.*)/",chop($currentHeader),$matches);
// look for :// in the Location header to see if hostname is included
if(!preg_match("|\:\/\/|",$matches[2]))
{
// no host in the path, so prepend
$this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port;
// eliminate double slash
if(!preg_match("|^/|",$matches[2]))
$this->_redirectaddr .= "/".$matches[2];
else
$this->_redirectaddr .= $matches[2];
}
else
$this->_redirectaddr = $matches[2];
}
if(preg_match("|^HTTP/|",$currentHeader))
{
if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$currentHeader, $status))
{
$this->status= $status[1];
}
$this->response_code = $currentHeader;
}
if (preg_match("/Content-Encoding: gzip/", $currentHeader) ) {
$is_gzipped = true;
}
$this->headers[] = $currentHeader;
}
# $results = fread($fp, $this->maxlength);
$results = "";
while ( $data = fread($fp, $this->maxlength) ) {
$results .= $data;
if (
strlen($results) > $this->maxlength ) {
break;
}
}
// gunzip
if ( $is_gzipped ) {
// per http://www.php.net/manual/en/function.gzencode.php
$results = substr($results, 10);
$results = gzinflate($results);
}
if ($this->read_timeout > 0 && $this->_check_timeout($fp))
{
$this->status=-100;
return false;
}
// check if there is a a redirect meta tag
if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]+URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
{
$this->_redirectaddr = $this->_expandlinks($match[1],$URI);
}
// have we hit our frame depth and is there frame src to fetch?
if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match))
{
$this->results[] = $results;
for($x=0; $x<count($match[1]); $x++)
$this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
}
// have we already fetched framed content?
elseif(is_array($this->results))
$this->results[] = $results;
// no framed content
else
$this->results = $results;
return true;
}
/*======================================================================*\
Function: _httpsrequest
Purpose: go get the https data from the server using curl
Input: $url the url to fetch
$URI the full URI
$body body contents to send if any (POST)
Output:
\*======================================================================*/
function _httpsrequest($url,$URI,$http_method,$content_type="",$body="")
{
if($this->passcookies && $this->_redirectaddr)
$this->setcookies();
$headers = array();
$URI_PARTS = parse_url($URI);
if(empty($url))
$url = "/";
// GET ... header not needed for curl
//$headers[] = $http_method." ".$url." ".$this->_httpversion;
if(!empty($this->agent))
$headers[] = "User-Agent: ".$this->agent;
if(!empty($this->host))
$headers[] = "Host: ".$this->host;
if(!empty($this->accept))
$headers[] = "Accept: ".$this->accept;
if(!empty($this->referer))
$headers[] = "Referer: ".$this->referer;
if(!empty($this->cookies))
{
if(!is_array($this->cookies))
$this->cookies = (array)$this->cookies;
reset($this->cookies);
if ( count($this->cookies) > 0 ) {
$cookie_str = 'Cookie: ';
foreach ( $this->cookies as $cookieKey => $cookieVal ) {
$cookie_str .= $cookieKey."=".urlencode($cookieVal)."; ";
}
$headers[] = substr($cookie_str,0,-2);
}
}
if(!empty($this->rawheaders))
{
if(!is_array($this->rawheaders))
$this->rawheaders = (array)$this->rawheaders;
while(list($headerKey,$headerVal) = each($this->rawheaders))
$headers[] = $headerKey.": ".$headerVal;
}
if(!empty($content_type)) {
if ($content_type == "multipart/form-data")
$headers[] = "Content-type: $content_type; boundary=".$this->_mime_boundary;
else
$headers[] = "Content-type: $content_type";
}
if(!empty($body))
$headers[] = "Content-length: ".strlen($body);
if(!empty($this->user) || !empty($this->pass))
$headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass);
for($curr_header = 0; $curr_header < count($headers); $curr_header++) {
$cmdline_params .= " -H \"".$headers[$curr_header]."\"";
}
if(!empty($body))
$cmdline_params .= " -d \"$body\"";
if($this->read_timeout > 0)
$cmdline_params .= " -m ".$this->read_timeout;
$headerfile = uniqid(time());
# accept self-signed certs
$cmdline_params .= " -k";
exec($this->curl_path." -D \"/tmp/$headerfile\"".escapeshellcmd($cmdline_params)." ".escapeshellcmd($URI),$results,$return);
if($return)
{
$this->error = "Error: cURL could not retrieve the document, error $return.";
return false;
}
$results = implode("\r\n",$results);
$result_headers = file("/tmp/$headerfile");
$this->_redirectaddr = false;
unset($this->headers);
for($currentHeader = 0; $currentHeader < count($result_headers); $currentHeader++)
{
// if a header begins with Location: or URI:, set the redirect
if(preg_match("/^(Location: |URI: )/i",$result_headers[$currentHeader]))
{
// get URL portion of the redirect
preg_match("/^(Location: |URI:)(.*)/",chop($result_headers[$currentHeader]),$matches);
// look for :// in the Location header to see if hostname is included
if(!preg_match("|\:\/\/|",$matches[2]))
{
// no host in the path, so prepend
$this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port;
// eliminate double slash
if(!preg_match("|^/|",$matches[2]))
$this->_redirectaddr .= "/".$matches[2];
else
$this->_redirectaddr .= $matches[2];
}
else
$this->_redirectaddr = $matches[2];
}
if(preg_match("|^HTTP/|",$result_headers[$currentHeader]))
{
$this->response_code = $result_headers[$currentHeader];
if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$this->response_code, $match))
{
$this->status= $match[1];
}
}
$this->headers[] = $result_headers[$currentHeader];
}
// check if there is a a redirect meta tag
if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]+URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
{
$this->_redirectaddr = $this->_expandlinks($match[1],$URI);
}
// have we hit our frame depth and is there frame src to fetch?
if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match))
{
$this->results[] = $results;
for($x=0; $x<count($match[1]); $x++)
$this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
}
// have we already fetched framed content?
elseif(is_array($this->results))
$this->results[] = $results;
// no framed content
else
$this->results = $results;
unlink("/tmp/$headerfile");
return true;
}
/*======================================================================*\
Function: setcookies()
Purpose: set cookies for a redirection
\*======================================================================*/
function setcookies()
{
for($x=0; $x<count($this->headers); $x++)
{
if(preg_match("/^set-cookie:[\s]+([^=]+)=([^;]+)/i", $this->headers[$x],$match))
$this->cookies[$match[1]] = $match[2];
}
}
/*======================================================================*\
Function: _check_timeout
Purpose: checks whether timeout has occurred
Input: $fp file pointer
\*======================================================================*/
function _check_timeout($fp)
{
if ($this->read_timeout > 0) {
$fp_status = socket_get_status($fp);
if ($fp_status["timed_out"]) {
$this->timed_out = true;
return true;
}
}
return false;
}
/*======================================================================*\
Function: _connect
Purpose: make a socket connection
Input: $fp file pointer
\*======================================================================*/
function _connect(&$fp)
{
if(!empty($this->proxy_host) && !empty($this->proxy_port))
{
$this->_isproxy = true;
$host = $this->proxy_host;
$port = $this->proxy_port;
}
else
{
$host = $this->host;
$port = $this->port;
}
$this->status = 0;
if($fp = fsockopen(
$host,
$port,
$errno,
$errstr,
$this->_fp_timeout
))
{
// socket connection succeeded
return true;
}
else
{
// socket connection failed
$this->status = $errno;
switch($errno)
{
case -3:
$this->error="socket creation failed (-3)";
case -4:
$this->error="dns lookup failure (-4)";
case -5:
$this->error="connection refused or timed out (-5)";
default:
$this->error="connection failed (".$errno.")";
}
return false;
}
}
/*======================================================================*\
Function: _disconnect
Purpose: disconnect a socket connection
Input: $fp file pointer
\*======================================================================*/
function _disconnect($fp)
{
return(fclose($fp));
}
/*======================================================================*\
Function: _prepare_post_body
Purpose: Prepare post body according to encoding type
Input: $formvars - form variables
$formfiles - form upload files
Output: post body
\*======================================================================*/
function _prepare_post_body($formvars, $formfiles)
{
settype($formvars, "array");
settype($formfiles, "array");
if (count($formvars) == 0 && count($formfiles) == 0)
return;
switch ($this->_submit_type) {
case "application/x-www-form-urlencoded":
reset($formvars);
while(list($key,$val) = each($formvars)) {
if (is_array($val) || is_object($val)) {
while (list($cur_key, $cur_val) = each($val)) {
$postdata .= urlencode($key)."[]=".urlencode($cur_val)."&";
}
} else
$postdata .= urlencode($key)."=".urlencode($val)."&";
}
break;
case "multipart/form-data":
$this->_mime_boundary = "Snoopy".md5(uniqid(microtime()));
reset($formvars);
while(list($key,$val) = each($formvars)) {
if (is_array($val) || is_object($val)) {
while (list($cur_key, $cur_val) = each($val)) {
$postdata .= "--".$this->_mime_boundary."\r\n";
$postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n";
$postdata .= "$cur_val\r\n";
}
} else {
$postdata .= "--".$this->_mime_boundary."\r\n";
$postdata .= "Content-Disposition: form-data; name=\"$key\"\r\n\r\n";
$postdata .= "$val\r\n";
}
}
reset($formfiles);
while (list($field_name, $file_names) = each($formfiles)) {
settype($file_names, "array");
while (list(, $file_name) = each($file_names)) {
if (!is_readable($file_name)) continue;
$fp = fopen($file_name, "r");
$file_content = fread($fp, filesize($file_name));
fclose($fp);
$base_name = basename($file_name);
$postdata .= "--".$this->_mime_boundary."\r\n";
$postdata .= "Content-Disposition: form-data; name=\"$field_name\"; filename=\"$base_name\"\r\n\r\n";
$postdata .= "$file_content\r\n";
}
}
$postdata .= "--".$this->_mime_boundary."--\r\n";
break;
}
return $postdata;
}
}
?>

View File

@ -1,237 +0,0 @@
<html>
<head>
<title>Magie RSS Recipes: Simple PHP RSS How To</title>
<style>
body {
font-family:trebuchet MS, trebuchet, verdana, arial, sans-serif;
font-size: 11px;
}
pre { font-family: "Courier New", monospace;
padding: 1em;
margin: 0.2em 2.5em 0.2em 3em;
background-color: #efeff5;
border: 1px solid #cfcfcf;
white-space: pre;
}
</style>
</head>
<body>
<p>
<h1>MagpieRSS Recipes: Cooking with Corbies</h1>
<div align="center"><h3><em>"Four and twenty blackbirds baked in a
pie."</em></h3></div>
</p>
<p>
<ol>
<li><a href="#limit">Limit the Number of Headlines(aka Items) Returned</a></li>
<li><a href="#error_message">Display a Custom Error Message if Something Goes
Wrong</a></li>
<li><a href="#write_rss">Generate a New RSS Feed</a></li>
<li><a href="#by_date">Display Headlines More Recent then X Date</a></li>
<li><a href="#from_file">Parse a Local File Containing RSS</a></li>
</ol>
</p>
<a name="limit"></a><h2>1. Limit the Number of Headlines(aka Items) Returned.</h2>
<h3>Problem:</h3>
You want to display the 10 (or 3 or whatever) most recent headlines, but the RSS feed
contains 15.
<h3>Solution:</h3>
<pre>
$num_items = 10;
$rss = fetch_rss($url);
$items = array_slice($rss->items, 0, $num_items);
foreach ( $items as $item ) {
</pre>
<h3>Discussion:</h3>
Rather then trying to limit the number of items Magpie parses, a much simpler,
and more flexible approach is to take a "slice" of the array of items. And
array_slice() is smart enough to do the right thing if the feed has less items
then $num_items.
<h3>See:</h3> <a href="http://www.php.net/array_slice">http://www.php.net/array_slice</a>
</p>
<a name="error_message"></a><h2>2. Display a Custom Error Message if Something Goes Wrong</h2>
<h3>Problem:</h3>
You don't want Magpie's error messages showing up if something goes wrong.
<h3>Solution:</h3>
<pre>
# Magpie throws USER_WARNINGS only
# so you can cloak these, by only showing ERRORs
error_reporting(E_ERROR);
# check the return value of fetch_rss()
$rss = fetch_rss($url);
if ( $rss ) {
...display rss feed...
}
else {
echo "An error occured! " .
"Consider donating more $$$ for restoration of services." .
"&lt;br&gt;Error Message: " . magpie_error();
}
</pre>
<h3>Discussion:</h3>
MagpieRSS triggers a warning in a number of circumstances. The 2 most common
circumstances are: if the specified RSS file isn't properly formed (usually
because it includes illegal HTML), or if Magpie can't download the remote RSS
file, and there is no cached version.
If you don't want your users to see these warnings change your error_reporting
settings to only display ERRORs.<br />
Another option is to turn off display_error,
so that WARNINGs, and NOTICEs still go to the error_log but not to the webpages.
You can do this with:
<pre>
# you can also do this in your php.ini file
ini_set('display_errors', 0);
</pre>
<h3>See:</h3>
<a
href="http://www.php.net/error_reporting">http://www.php.net/error_reporting</a>,<br
/>
<a href="http://www.php.net/ini_set">http://www.php.net/ini_set</a>, <br />
<a
href="http://www.php.net/manual/en/ref.errorfunc.php">http://www.php.net/manual/en/ref.errorfunc.php</a><br
/>
<a name="write_rss"></a><h2>3. Generate a New RSS Feed</h2>
<h3>Problem:</h3>
Create an RSS feed for other people to use.
<h3>Solution:</h3>
Use Useful Inc's <a href="http://usefulinc.com/rss/rsswriter/">RSSWriter</a>.
<h3>Discussion:</h3>
An example of turning a Magpie parsed RSS object back into an RSS file is
forthcoming. In the meantime RSSWriter is well documented.
<a name="by_date"></a><h2>4. Display Headlines More Recent then X Date</h2>
<h3>Problem:</h3>
You only want to display headlines that were published on, or after a certain
date.
<h3>Solution:</h3>
<pre>
require_once('rss_utils.inc');
# get all headlines published today
$today = getdate();
# today, 12AM
$date = mktime(0,0,0,$today['mon'], $today['mday'], $today['year']);
$rss = fetch_rss($url);
foreach ( $rss->items as $item ) {
$published = parse_w3cdtf($item['dc']['date']);
if ( $published &gt;= $date ) {
echo "Title: " . $item['title'];
echo "Published: " . date("h:i:s A", $published);
echo "&lt;p&gt;";
}
}
</pre>
<h3>Discussion:</h3>
This recipe only works for RSS 1.0 feeds that include the <dc:date> field.
(which is very good RSS style) <br />
<code>parse_w3cdtf()</code> is defined in
<code>rss_utils.inc</code>, and parses RSS style dates into Unix epoch
seconds.
<h3>See: </h3>
<a
href="http://www.php.net/manual/en/ref.datetime.php">http://www.php.net/manual/en/ref.datetime.php</a>
<a name="from_file"></a>
<h2>5. Parse a Local File Containing RSS</h2>
<h3>Problem:</h3>
MagpieRSS provides <code>fetch_rss()</code> which takes a URL and returns a
parsed RSS object, but what if you want to parse a file stored locally that
doesn't have a URL?
<h3>Solution</h3>
<pre>
require_once('rss_parse.inc');
$rss_file = 'some_rss_file.rdf';
$rss_string = read_file($rss_file);
$rss = new MagpieRSS( $rss_string );
if ( $rss and !$rss->ERROR) {
...display rss...
}
else {
echo "Error: " . $rss->ERROR;
}
# efficiently read a file into a string
# in php >= 4.3.0 you can simply use file_get_contents()
#
function read_file($filename) {
$fh = fopen($filename, 'r') or die($php_errormsg);
$rss_string = fread($fh, filesize($filename) );
fclose($fh);
return $rss_string;
}
</pre>
<h3>Discussion</h3>
Here we are using MagpieRSS's RSS parser directly without the convience wrapper
of <code>fetch_rss()</code>. We read the contents of the RSS file into a
string, and pass it to the parser constructor. Notice also that error handling
is subtly different.
<h3>See: </h3>
<a
href="http://www.php.net/manual/en/ref.filesystem.php">http://www.php.net/manual/en/ref.filesystem.php</a>,<br
/>
<a
href="http://www.php.net/manual/en/language.oop.php">http://www.php.net/manual/en/language.oop.php</a>
<!--
<a name="link"></a><h2>#. Recipe</h2>
<h3>Problem:</h3>
Problem description
<h3>Solution</h3>
<pre>
code
</pre>
<h3>Discussion/h3>
Discuss code
<h3>See: </h3>
Documentation links:
-->
</body>
</html>

View File

@ -1,419 +0,0 @@
<html>
<head>
<title>Magpie RSS - PHP RSS Parser</title>
<link rel="alternate" type="application/rss+xml" title="RSS"
href="http://laughingmeme.org/magpierss.rdf" />
<style>
body {
font-family:trebuchet MS, trebuchet, verdana, arial, sans-serif;
font-size: 11px;
}
pre { font-family: "Courier New", monospace;
padding: 1em;
margin: 0.2em 2.5em 0.2em 3em;
background-color: #efeff5;
border: 1px solid #cfcfcf;
white-space: pre;
}
li.news {
padding-bottom:15px;
}
a.nav { color: #FFFFFF; }
div.nav {
width: 2in;
float: right;
border: 2px solid #cfcfcf;
padding: 5px;
background-color: #996699;
}
</style>
</head>
<body>
<img src="magpie-photo.jpg">
<h1>MagpieRSS</h1>
<p>
<h2>MagpieRSS provides an XML-based (expat) RSS parser in PHP.</h2>
<p>
MagpieRSS is compatible with RSS .9 through RSS 1.0, and supports the
RSS 1.0's modules. (with a few exceptions)
<p>
<div class="nav">
<center><h3>Project Info</h3></center>
<ul>
<li><a class="nav"
href="http://sourceforge.net/project/showfiles.php?group_id=55691">Download
Magpie</a></li>
<li><a class="nav"
href="http://sourceforge.net/mail/?group_id=55691">Mailing
Lists</a></li>
<li><a class="nav" href="#news">News!</a></li>
<li><a class="nav" href="#why">Why?</a></li>
<li><a class="nav" href="#features">Features</a></li>
<li><a class="nav" href="#philosophy">Philosophy</a></li>
<li><a class="nav" href="#usage">Usage Examples</a></li>
<li><a class="nav" href="/cookbook.html">Cookbook</a></li>
<li><a class="nav" href="#todo">Todo</a></li>
<li style="list-style: none; padding-top: 5px;"><a title="Keep up on MagpieRSS news via RSS" href="http://laughingmeme.org/magpierss.rdf"><img
src="http://magpierss.sf.net/black_grey_magpie_news.gif" border="0"></a></li>
</ul>
</div>
<a name="news"></a>
<h3>News!</h3>
<ul>
<li class="news">
<a
href="http://sourceforge.net/project/showfiles.php?group_id=55691">MagpieRSS
0.51 Released</a>
<ul>
<li> important bugfix!</li>
<li> fix <a href="http://laughingmeme.org/archives/000811.html
">"silent failure"</a> when PHP doesn't have zlib</li>
</ul>
</li>
<li class="news">
<a href="http://minutillo.com/steve/feedonfeeds/">Feed On Feeds Uses Magpie</a>
<ul>
<li> server based PHP RSS aggregator built with MagpieRSS</li>
<li> easy to install, easy to use.</li>
</ul>
</li>
<li class="news">
<a
href="http://sourceforge.net/project/showfiles.php?group_id=55691&release_id=158897">MagpieRSS
0.5 Released</a>
<ul>
<li> supports transparent HTTP gzip content negotiation for reduced bandwidth usage</li>
<li> quashed some undefined index notices</li>
</ul>
</li>
<li class="news">
<a
href="http://sourceforge.net/project/showfiles.php?group_id=55691&release_id=139643">MagpieRSS
0.46 Released</a>
<ul>
<li> minor release, more error handling clean up</li>
<li> documentation fixes, simpler example</li>
<li> new <a href="/TROUBLESHOOTING">trouble shooting</a> guide for installation and usage problems</a>
</ul>
</li>
<li class="news">
<a
href="http://laughingmeme.org/magpierss.rdf">Magpie News as RSS</a>
<ul>
<li> releases, bug fixes, releated stories as an RSS feed</li>
</ul>
</li>
<li class="news">
<a
href="http://magpierss.sourceforge.net/cookbook.html">MagpieRSS
Cookbook: Simple PHP RSS How Tos</a>
<ul>
<li> answers some of the most frequently asked Magpie questions</li>
<li> feedback, suggestions, requests, recipes welcome</li>
</ul>
</li>
<li clas="news">
<a href="http://sourceforge.net/project/showfiles.php?group_id=55691&release_id=134850">MagpieRSS 0.4 Released!</a>
<ul>
<li> improved error handling, more flexibility for script authors,
backwards compatible</li>
<li> new and better examples! including using MagpieRSS and <a
href="http://smarty.php.net">Smarty</a></li>
<li> new Smarty plugin for RSS date parsing</li>
</ul>
<br />
</li>
<!--
<li class="news">
<a href="http://www.infinitepenguins.net/rss/">Infinite Penguin now
supports Magpie 0.3</a>
<ul>
<li> simple, sophisticated RSS viewer</li>
<li> includes auto-generated javascript ticker from RSS feed</li>
</ul>
</li>
<li class="news">
<a
href="http://traumwind.tierpfad.de/blog/magpie/magpie_alike.php">Traumwind
releases REX backend for MagpieRSS</a>
<ul>
<li>drop in support using regex based XML parser</li>
<li>parses improperly formed XML that chokes expat</li>
</ul>
</li>
<li class="news">
<a
href="http://sourceforge.net/project/showfiles.php?group_id=55691&release_id=118652">
MagpieRSS 0.3 Released!</a>
<ul>
<li>Support added for
<a href="http://fishbowl.pastiche.org/archives/001132.html">HTTP
Conditional GETs</a>.</li>
<li>See <a href="http://sourceforge.net/project/shownotes.php?group_id=55691&release_id=118652">ChangeLog</a>
for more info.</li>
</ul>
</li>
<li class="news">MagpieRSS 0.2!</a>
<ul>
<li>Major clean up of the code. Easier to use.</li>
<li>Simpler install on shared hosts.</li>
<li>Better documentation and comments.</li>
</ul>
</li>
<li class="news">We've <a href="http://sourceforge.net/projects/magpierss/">moved to
Sourceforge!</a></li>
-->
</ul>
</p>
<p>
<a name="why"></a>
<h3>Why?</h3>
I wrote MagpieRSS out of a frustration with the limitations of existing
solutions. In particular many of the existing PHP solutions seemed to:
<ul>
<li>use a parser based on regular expressions, making for an inherently
fragile solution
<li>only support early versions of RSS
<li>discard all the interesting information besides item title, description,
and link.
<li>not build proper separation between parsing the RSS and displaying it.
</ul>
In particular I failed to find any PHP RSS parsers that could sufficiently
parse RSS 1.0 feeds, to be useful on the RSS based event feeds we generate
at <a href="http://protest.net">Protest.net</a>.
</p>
<p>
<a name="features"></a>
<h3>Features</h3>
<ul>
<li class="toplevel">
<h4>Easy to Use</h4>
As simple as:
<pre>
require('rss_fetch.inc');
$rss = fetch_rss($url);
</pre>
</li>
<li class="toplevel">
<h4>Parses RSS 0.9 - RSS 1.0</h4>
Parses most RSS formats, including support for
<a href="http://www.purl.org/rss/1.0/modules/">1.0 modules</a> and limited
namespace support. RSS is packed into convenient data structures; easy to
use in PHP, and appropriate for passing to a templating system, like
<a href="http://smarty.php.net">Smarty</a>.
</li>
<li>
<h4>Integrated Object Cache</h4>
Caching the parsed RSS means that the 2nd request is fast, and that
including the rss_fetch call in your PHP page won't destroy your performance,
and force you to reply on an external cron job. And it happens transparently.
</li>
<li>
<h4>HTTP Conditional GETs</h4>
Save bandwidth and speed up download times with intelligent use of
Last-Modified and ETag.<br /> See <a
href="http://fishbowl.pastiche.org/archives/001132.html">HTTP Conditional Get for RSS Hackers</a>
</li>
<li><h4>Configurable</h4>
Makes extensive use of constants to allow overriding default behaviour, and
installation on shared hosts.
</li>
<li><h4>Modular</h4>
<ul>
<li>rss_fetch.inc - wraps a simple interface (<code>fetch_rss()</code>)
around the library.
<li>rss_parse.inc - provides the RSS parser, and the RSS object
<li>rss_cache.inc - a simple (no GC) object cache, optimized for RSS objects
<li>rss_utils.inc - utility functions for working with RSS. currently
provides <code>parse_w3cdtf()</code>, for parsing <a
href="http://www.w3.org/TR/NOTE-datetime">W3CDTF</a> into epoch seconds.
</ul>
</ul>
</p>
<p>
<a name="philosophy"></a>
<h3>Magpie's approach to parsing RSS</h3>
Magpie takes a naive, and inclusive approach. Absolutely
non-validating, as long as the RSS feed is well formed, Magpie will
cheerfully parse new, and never before seen tags in your RSS feeds.
</p>
<p>
This makes it very simple support the varied versions of RSS simply, but
forces the consumer of a RSS feed to be cognizant of how it is
structured.(at least if you want to do something fancy)
</p>
<p>
Magpie parses a RSS feed into a simple object, with 4 fields:
<code>channel</code>, <code>items</code>, <code>image</code>, and
<code>textinput</code>.
</p>
<p>
<h4>channel</h4>
<code>$rss->channel</code> contains key-value pairs of all tags, without
nested tags, found between the root tag (&lt;rdf:RDF&gt;, or &lt;rss&gt;)
and the end of the document.
</p>
<p>
<h4>items</h4>
<code>$rss->items</code> is an array of associative arrays, each one
describing a single item. An example that looks like:
<pre>
&lt;item rdf:about="http://protest.net/NorthEast/calendrome.cgi?span=event&#38;ID=210257"&gt;
&lt;title&gt;Weekly Peace Vigil&lt;/title&gt;
&lt;link&gt;http://protest.net/NorthEast/calendrome.cgi?span=event&#38;ID=210257&lt;/link&gt;
&lt;description&gt;Wear a white ribbon&lt;/description&gt;
&lt;dc:subject&gt;Peace&lt;/dc:subject&gt;
&lt;ev:startdate&gt;2002-06-01T11:00:00&lt;/ev:startdate&gt;
&lt;ev:location&gt;Northampton, MA&lt;/ev:location&gt;
&lt;ev:enddate&gt;2002-06-01T12:00:00&lt;/ev:enddate&gt;
&lt;ev:type&gt;Protest&lt;/ev:type&gt;
&lt;/item&gt;
</pre><p>
Is parsed, and pushed on the <code>$rss-&gt;items</code> array as:
<p><pre>
array(
title =&gt; 'Weekly Peace Vigil',
link =&gt; 'http://protest.net/NorthEast/calendrome.cgi?span=event&#38;ID=210257',
description =&gt; 'Wear a white ribbon',
dc =&gt; array (
subject =&gt; 'Peace'
),
ev =&gt; array (
startdate =&gt; '2002-06-01T11:00:00',
enddate =&gt; '2002-06-01T12:00:00',
type =&gt; 'Protest',
location =&gt; 'Northampton, MA'
)
);
</pre>
</p>
<p>
<h4>image and textinput</h4>
<code>$rss->image</code> and <code>$rss-textinput</code> are associative arrays
including name-value pairs for anything found between the respective parent
tags.
</p>
<p>
<a name="usage"></a>
<h3>Usage Examples:</h3>
A very simple example would be:
<pre>
require_once 'rss_fetch.inc';
$url = 'http://magpie.sf.net/samples/imc.1-0.rdf';
$rss = fetch_rss($url);
echo "Site: ", $rss->channel['title'], "&lt;br&gt;\n";
foreach ($rss->items as $item ) {
$title = $item[title];
$url = $item[link];
echo "&lt;a href=$url&gt;$title&lt;/a&gt;&lt;/li&gt;&lt;br&gt;\n";
}
</pre>
More soon....in the meantime you can check out a
<a href="http://www.infinitepenguins.net/rss/">cool tool built with
MagpieRSS</a>, version 0.1.
</p>
<p>
<a name="todo"></a>
<h3>Todos</h3>
<h4>RSS Parser</h4>
<ul>
<li>Swap in a smarter parser that includes optional
support for validation, and required fields.</li>
<li>Support RSS 2.0 (as much as I'm annoyed by it)</li>
<li>Improve support for modules that rely on attributes</li>
</ul>
<h4>RSS Cache</h4>
<ul>
<li>Light-weight garbage collection
</ul>
<h4>Fetch RSS</h4>
<ul>
<li>Attempt to <a
href="http://diveintomark.org/archives/2002/08/15.html">auto-detect an
RSS feed</a>, given a URL following, much like <a
href="http://diveintomark.org/projects/misc/rssfinder.py.txt">rssfinder.py</a>does.
</li>
</ul>
<h4>Misc</h4>
<ul>
<li>More examples</li>
<li>A test suite</li>
<li>RSS generation, perhaps with <a
href="http://usefulinc.com/rss/rsswriter/">RSSwriter</a>?
</li>
</ul>
</p>
<p>
<h3>RSS Resources</h3>
<ul>
<li><a href="http://mnot.net/rss/tutorial/">RSS Tutorial for Content Publishers
and Webmasters</a> is a great place to start.
<li><a href="http://gils.utah.gov/rss/">RSS Workshop: Publish and Syndicate
Your News to the Web</a> is also a good introduction</li>
<li><a href="http://www.disobey.com/amphetadesk/finding_more.html">Finding
More Channels</a> on how to find RSS feeds.
<li>Hammersley's <a href="http://rss.benhammersley.com/">Content Syndication
with XML and RSS</a> is a blog covering RSS current events.
<li><a href="http://groups.yahoo.com/group/rss-dev/">RSS-DEV mailing
list</a> is generally a very helpful, informative space, with the occasional
heated debate
<li><a href="http://feeds.archive.org/validator/">RSS Validator</a>
</ul>.
</p>
<h3>License and Contact Info</h3>
Magpie is distributed under the GPL license...
<p>
coded by: kellan (at) protest.net, feedback is always appreciated.
<p>
<a href="http://sourceforge.net"><img
src="http://sourceforge.net/sflogo.php?group_id=55691&amp;type=3"
width="125" height="37" border="0" alt="SourceForge.net Logo"></a>
<img src="http://laughingmeme.org/magpie_views.gif">
</body>
</html>

View File

@ -1,200 +0,0 @@
<?php
/*
* Project: MagpieRSS: a simple RSS integration tool
* File: rss_cache.inc, a simple, rolling(no GC), cache
* for RSS objects, keyed on URL.
* Author: Kellan Elliott-McCrea <kellan@protest.net>
* Version: 0.51
* License: GPL
*
* The lastest version of MagpieRSS can be obtained from:
* http://magpierss.sourceforge.net
*
* For questions, help, comments, discussion, etc., please join the
* Magpie mailing list:
* http://lists.sourceforge.net/lists/listinfo/magpierss-general
*
*/
class RSSCache {
var $BASE_CACHE = './cache'; // where the cache files are stored
var $MAX_AGE = 3600; // when are files stale, default one hour
var $ERROR = ""; // accumulate error messages
function RSSCache ($base='', $age='') {
if ( $base ) {
$this->BASE_CACHE = $base;
}
if ( $age ) {
$this->MAX_AGE = $age;
}
// attempt to make the cache directory
if ( ! file_exists( $this->BASE_CACHE ) ) {
$status = @mkdir( $this->BASE_CACHE, 0755 );
// if make failed
if ( ! $status ) {
$this->error(
"Cache couldn't make dir '" . $this->BASE_CACHE . "'."
);
}
}
}
/*=======================================================================*\
Function: set
Purpose: add an item to the cache, keyed on url
Input: url from wich the rss file was fetched
Output: true on sucess
\*=======================================================================*/
function set ($url, $rss) {
$this->ERROR = "";
$cache_file = $this->file_name( $url );
$fp = @fopen( $cache_file, 'w' );
if ( ! $fp ) {
$this->error(
"Cache unable to open file for writing: $cache_file"
);
return 0;
}
$data = $this->serialize( $rss );
fwrite( $fp, $data );
fclose( $fp );
return $cache_file;
}
/*=======================================================================*\
Function: get
Purpose: fetch an item from the cache
Input: url from wich the rss file was fetched
Output: cached object on HIT, false on MISS
\*=======================================================================*/
function get ($url) {
$this->ERROR = "";
$cache_file = $this->file_name( $url );
if ( ! file_exists( $cache_file ) ) {
$this->debug(
"Cache doesn't contain: $url (cache file: $cache_file)"
);
return 0;
}
$fp = @fopen($cache_file, 'r');
if ( ! $fp ) {
$this->error(
"Failed to open cache file for reading: $cache_file"
);
return 0;
}
if ($filesize = filesize($cache_file) ) {
$data = fread( $fp, filesize($cache_file) );
$rss = $this->unserialize( $data );
return $rss;
}
return 0;
}
/*=======================================================================*\
Function: check_cache
Purpose: check a url for membership in the cache
and whether the object is older then MAX_AGE (ie. STALE)
Input: url from wich the rss file was fetched
Output: cached object on HIT, false on MISS
\*=======================================================================*/
function check_cache ( $url ) {
$this->ERROR = "";
$filename = $this->file_name( $url );
if ( file_exists( $filename ) ) {
// find how long ago the file was added to the cache
// and whether that is longer then MAX_AGE
$mtime = filemtime( $filename );
$age = time() - $mtime;
if ( $this->MAX_AGE > $age ) {
// object exists and is current
return 'HIT';
}
else {
// object exists but is old
return 'STALE';
}
}
else {
// object does not exist
return 'MISS';
}
}
function cache_age( $cache_key ) {
$filename = $this->file_name( $url );
if ( file_exists( $filename ) ) {
$mtime = filemtime( $filename );
$age = time() - $mtime;
return $age;
}
else {
return -1;
}
}
/*=======================================================================*\
Function: serialize
\*=======================================================================*/
function serialize ( $rss ) {
return serialize( $rss );
}
/*=======================================================================*\
Function: unserialize
\*=======================================================================*/
function unserialize ( $data ) {
return unserialize( $data );
}
/*=======================================================================*\
Function: file_name
Purpose: map url to location in cache
Input: url from wich the rss file was fetched
Output: a file name
\*=======================================================================*/
function file_name ($url) {
$filename = md5( $url );
return join( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) );
}
/*=======================================================================*\
Function: error
Purpose: register error
\*=======================================================================*/
function error ($errormsg, $lvl=E_USER_WARNING) {
// append PHP's error message if track_errors enabled
if ( isset($php_errormsg) ) {
$errormsg .= " ($php_errormsg)";
}
$this->ERROR = $errormsg;
if ( MAGPIE_DEBUG ) {
trigger_error( $errormsg, $lvl);
}
else {
error_log( $errormsg, 0);
}
}
function debug ($debugmsg, $lvl=E_USER_NOTICE) {
if ( MAGPIE_DEBUG ) {
$this->error("MagpieRSS [debug] $debugmsg", $lvl);
}
}
}
?>

View File

@ -1,458 +0,0 @@
<?php
/*
* Project: MagpieRSS: a simple RSS integration tool
* File: rss_fetch.inc, a simple functional interface
to fetching and parsing RSS files, via the
function fetch_rss()
* Author: Kellan Elliott-McCrea <kellan@protest.net>
* License: GPL
*
* The lastest version of MagpieRSS can be obtained from:
* http://magpierss.sourceforge.net
*
* For questions, help, comments, discussion, etc., please join the
* Magpie mailing list:
* magpierss-general@lists.sourceforge.net
*
*/
// Setup MAGPIE_DIR for use on hosts that don't include
// the current path in include_path.
// with thanks to rajiv and smarty
if (!defined('DIR_SEP')) {
define('DIR_SEP', DIRECTORY_SEPARATOR);
}
if (!defined('MAGPIE_DIR')) {
define('MAGPIE_DIR', dirname(__FILE__) . DIR_SEP);
}
require_once( MAGPIE_DIR . 'rss_parse.inc' );
require_once( MAGPIE_DIR . 'rss_cache.inc' );
// for including 3rd party libraries
define('MAGPIE_EXTLIB', MAGPIE_DIR . 'extlib' . DIR_SEP);
require_once( MAGPIE_EXTLIB . 'Snoopy.class.inc');
/*
* CONSTANTS - redefine these in your script to change the
* behaviour of fetch_rss() currently, most options effect the cache
*
* MAGPIE_CACHE_ON - Should Magpie cache parsed RSS objects?
* For me a built in cache was essential to creating a "PHP-like"
* feel to Magpie, see rss_cache.inc for rationale
*
*
* MAGPIE_CACHE_DIR - Where should Magpie cache parsed RSS objects?
* This should be a location that the webserver can write to. If this
* directory does not already exist Mapie will try to be smart and create
* it. This will often fail for permissions reasons.
*
*
* MAGPIE_CACHE_AGE - How long to store cached RSS objects? In seconds.
*
*
* MAGPIE_CACHE_FRESH_ONLY - If remote fetch fails, throw error
* instead of returning stale object?
*
* MAGPIE_DEBUG - Display debugging notices?
*
*/
/*=======================================================================*\
Function: fetch_rss:
Purpose: return RSS object for the give url
maintain the cache
Input: url of RSS file
Output: parsed RSS object (see rss_parse.inc)
NOTES ON CACHEING:
If caching is on (MAGPIE_CACHE_ON) fetch_rss will first check the cache.
NOTES ON RETRIEVING REMOTE FILES:
If conditional gets are on (MAGPIE_CONDITIONAL_GET_ON) fetch_rss will
return a cached object, and touch the cache object upon recieving a
304.
NOTES ON FAILED REQUESTS:
If there is an HTTP error while fetching an RSS object, the cached
version will be return, if it exists (and if MAGPIE_CACHE_FRESH_ONLY is off)
\*=======================================================================*/
define('MAGPIE_VERSION', '0.72');
$MAGPIE_ERROR = "";
function fetch_rss ($url) {
// initialize constants
init();
if ( !isset($url) ) {
error("fetch_rss called without a url");
return false;
}
// if cache is disabled
if ( !MAGPIE_CACHE_ON ) {
// fetch file, and parse it
$resp = _fetch_remote_file( $url );
if ( is_success( $resp->status ) ) {
return _response_to_rss( $resp );
}
else {
error("Failed to fetch $url and cache is off");
return false;
}
}
// else cache is ON
else {
// Flow
// 1. check cache
// 2. if there is a hit, make sure its fresh
// 3. if cached obj fails freshness check, fetch remote
// 4. if remote fails, return stale object, or error
$cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE );
if (MAGPIE_DEBUG and $cache->ERROR) {
debug($cache->ERROR, E_USER_WARNING);
}
$cache_status = 0; // response of check_cache
$request_headers = array(); // HTTP headers to send with fetch
$rss = 0; // parsed RSS object
$errormsg = 0; // errors, if any
// store parsed XML by desired output encoding
// as character munging happens at parse time
$cache_key = $url . MAGPIE_OUTPUT_ENCODING;
if (!$cache->ERROR) {
// return cache HIT, MISS, or STALE
$cache_status = $cache->check_cache( $cache_key);
}
// if object cached, and cache is fresh, return cached obj
if ( $cache_status == 'HIT' ) {
$rss = $cache->get( $cache_key );
if ( isset($rss) and $rss ) {
// should be cache age
$rss->from_cache = 1;
if ( MAGPIE_DEBUG > 1) {
debug("MagpieRSS: Cache HIT", E_USER_NOTICE);
}
return $rss;
}
}
// else attempt a conditional get
// setup headers
if ( $cache_status == 'STALE' ) {
$rss = $cache->get( $cache_key );
if ( $rss and $rss->etag and $rss->last_modified ) {
$request_headers['If-None-Match'] = $rss->etag;
$request_headers['If-Last-Modified'] = $rss->last_modified;
}
}
$resp = _fetch_remote_file( $url, $request_headers );
if (isset($resp) and $resp) {
if ($resp->status == '304' ) {
// we have the most current copy
if ( MAGPIE_DEBUG > 1) {
debug("Got 304 for $url");
}
// reset cache on 304 (at minutillo insistent prodding)
$cache->set($cache_key, $rss);
return $rss;
}
elseif ( is_success( $resp->status ) ) {
$rss = _response_to_rss( $resp );
if ( $rss ) {
if (MAGPIE_DEBUG > 1) {
debug("Fetch successful");
}
// add object to cache
$cache->set( $cache_key, $rss );
return $rss;
}
}
else {
$errormsg = "Failed to fetch $url ";
if ( $resp->status == '-100' ) {
$errormsg .= "(Request timed out after " . MAGPIE_FETCH_TIME_OUT . " seconds)";
}
elseif ( $resp->error ) {
# compensate for Snoopy's annoying habbit to tacking
# on '\n'
$http_error = substr($resp->error, 0, -2);
$errormsg .= "(HTTP Error: $http_error)";
}
else {
$errormsg .= "(HTTP Response: " . $resp->response_code .')';
}
}
}
else {
$errormsg = "Unable to retrieve RSS file for unknown reasons.";
}
// else fetch failed
// attempt to return cached object
if ($rss) {
if ( MAGPIE_DEBUG ) {
debug("Returning STALE object for $url");
}
return $rss;
}
// else we totally failed
error( $errormsg );
return false;
} // end if ( !MAGPIE_CACHE_ON ) {
} // end fetch_rss()
/*=======================================================================*\
Function: error
Purpose: set MAGPIE_ERROR, and trigger error
\*=======================================================================*/
function error ($errormsg, $lvl=E_USER_WARNING) {
global $MAGPIE_ERROR;
// append PHP's error message if track_errors enabled
if ( isset($php_errormsg) ) {
$errormsg .= " ($php_errormsg)";
}
if ( $errormsg ) {
$errormsg = "MagpieRSS: $errormsg";
$MAGPIE_ERROR = $errormsg;
trigger_error( $errormsg, $lvl);
}
}
function debug ($debugmsg, $lvl=E_USER_NOTICE) {
trigger_error("MagpieRSS [debug] $debugmsg", $lvl);
}
/*=======================================================================*\
Function: magpie_error
Purpose: accessor for the magpie error variable
\*=======================================================================*/
function magpie_error ($errormsg="") {
global $MAGPIE_ERROR;
if ( isset($errormsg) and $errormsg ) {
$MAGPIE_ERROR = $errormsg;
}
return $MAGPIE_ERROR;
}
/*=======================================================================*\
Function: _fetch_remote_file
Purpose: retrieve an arbitrary remote file
Input: url of the remote file
headers to send along with the request (optional)
Output: an HTTP response object (see Snoopy.class.inc)
\*=======================================================================*/
function _fetch_remote_file ($url, $headers = "" ) {
// Snoopy is an HTTP client in PHP
$client = new Snoopy();
$client->agent = MAGPIE_USER_AGENT;
$client->read_timeout = MAGPIE_FETCH_TIME_OUT;
$client->use_gzip = MAGPIE_USE_GZIP;
if (is_array($headers) ) {
$client->rawheaders = $headers;
}
@$client->fetch($url);
return $client;
}
/*=======================================================================*\
Function: _response_to_rss
Purpose: parse an HTTP response object into an RSS object
Input: an HTTP response object (see Snoopy)
Output: parsed RSS object (see rss_parse)
\*=======================================================================*/
function _response_to_rss ($resp) {
$rss = new MagpieRSS( $resp->results, MAGPIE_OUTPUT_ENCODING, MAGPIE_INPUT_ENCODING, MAGPIE_DETECT_ENCODING );
// if RSS parsed successfully
if ( $rss and !$rss->ERROR) {
// find Etag, and Last-Modified
foreach($resp->headers as $h) {
// 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1"
if (strpos($h, ": ")) {
list($field, $val) = explode(": ", $h, 2);
}
else {
$field = $h;
$val = "";
}
if ( $field == 'ETag' ) {
$rss->etag = $val;
}
if ( $field == 'Last-Modified' ) {
$rss->last_modified = $val;
}
}
return $rss;
} // else construct error message
else {
$errormsg = "Failed to parse RSS file.";
if ($rss) {
$errormsg .= " (" . $rss->ERROR . ")";
}
error($errormsg);
return false;
} // end if ($rss and !$rss->error)
}
/*=======================================================================*\
Function: init
Purpose: setup constants with default values
check for user overrides
\*=======================================================================*/
function init () {
if ( defined('MAGPIE_INITALIZED') ) {
return;
}
else {
define('MAGPIE_INITALIZED', true);
}
if ( !defined('MAGPIE_CACHE_ON') ) {
define('MAGPIE_CACHE_ON', true);
}
if ( !defined('MAGPIE_CACHE_DIR') ) {
define('MAGPIE_CACHE_DIR', './cache');
}
if ( !defined('MAGPIE_CACHE_AGE') ) {
define('MAGPIE_CACHE_AGE', 60*60); // one hour
}
if ( !defined('MAGPIE_CACHE_FRESH_ONLY') ) {
define('MAGPIE_CACHE_FRESH_ONLY', false);
}
if ( !defined('MAGPIE_OUTPUT_ENCODING') ) {
define('MAGPIE_OUTPUT_ENCODING', 'ISO-8859-1');
}
if ( !defined('MAGPIE_INPUT_ENCODING') ) {
define('MAGPIE_INPUT_ENCODING', null);
}
if ( !defined('MAGPIE_DETECT_ENCODING') ) {
define('MAGPIE_DETECT_ENCODING', true);
}
if ( !defined('MAGPIE_DEBUG') ) {
define('MAGPIE_DEBUG', 0);
}
if ( !defined('MAGPIE_USER_AGENT') ) {
$ua = 'MagpieRSS/'. MAGPIE_VERSION . ' (+http://magpierss.sf.net';
if ( MAGPIE_CACHE_ON ) {
$ua = $ua . ')';
}
else {
$ua = $ua . '; No cache)';
}
define('MAGPIE_USER_AGENT', $ua);
}
if ( !defined('MAGPIE_FETCH_TIME_OUT') ) {
define('MAGPIE_FETCH_TIME_OUT', 5); // 5 second timeout
}
// use gzip encoding to fetch rss files if supported?
if ( !defined('MAGPIE_USE_GZIP') ) {
define('MAGPIE_USE_GZIP', true);
}
}
// NOTE: the following code should really be in Snoopy, or at least
// somewhere other then rss_fetch!
/*=======================================================================*\
HTTP STATUS CODE PREDICATES
These functions attempt to classify an HTTP status code
based on RFC 2616 and RFC 2518.
All of them take an HTTP status code as input, and return true or false
All this code is adapted from LWP's HTTP::Status.
\*=======================================================================*/
/*=======================================================================*\
Function: is_info
Purpose: return true if Informational status code
\*=======================================================================*/
function is_info ($sc) {
return $sc >= 100 && $sc < 200;
}
/*=======================================================================*\
Function: is_success
Purpose: return true if Successful status code
\*=======================================================================*/
function is_success ($sc) {
return $sc >= 200 && $sc < 300;
}
/*=======================================================================*\
Function: is_redirect
Purpose: return true if Redirection status code
\*=======================================================================*/
function is_redirect ($sc) {
return $sc >= 300 && $sc < 400;
}
/*=======================================================================*\
Function: is_error
Purpose: return true if Error status code
\*=======================================================================*/
function is_error ($sc) {
return $sc >= 400 && $sc < 600;
}
/*=======================================================================*\
Function: is_client_error
Purpose: return true if Error status code, and its a client error
\*=======================================================================*/
function is_client_error ($sc) {
return $sc >= 400 && $sc < 500;
}
/*=======================================================================*\
Function: is_client_error
Purpose: return true if Error status code, and its a server error
\*=======================================================================*/
function is_server_error ($sc) {
return $sc >= 500 && $sc < 600;
}
?>

View File

@ -1,605 +0,0 @@
<?php
/**
* Project: MagpieRSS: a simple RSS integration tool
* File: rss_parse.inc - parse an RSS or Atom feed
* return as a simple object.
*
* Handles RSS 0.9x, RSS 2.0, RSS 1.0, and Atom 0.3
*
* The lastest version of MagpieRSS can be obtained from:
* http://magpierss.sourceforge.net
*
* For questions, help, comments, discussion, etc., please join the
* Magpie mailing list:
* magpierss-general@lists.sourceforge.net
*
* @author Kellan Elliott-McCrea <kellan@protest.net>
* @version 0.7a
* @license GPL
*
*/
define('RSS', 'RSS');
define('ATOM', 'Atom');
require_once (MAGPIE_DIR . 'rss_utils.inc');
/**
* Hybrid parser, and object, takes RSS as a string and returns a simple object.
*
* see: rss_fetch.inc for a simpler interface with integrated caching support
*
*/
class MagpieRSS {
var $parser;
var $current_item = array(); // item currently being parsed
var $items = array(); // collection of parsed items
var $channel = array(); // hash of channel fields
var $textinput = array();
var $image = array();
var $feed_type;
var $feed_version;
var $encoding = ''; // output encoding of parsed rss
var $_source_encoding = ''; // only set if we have to parse xml prolog
var $ERROR = "";
var $WARNING = "";
// define some constants
var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright');
var $_KNOWN_ENCODINGS = array('UTF-8', 'US-ASCII', 'ISO-8859-1');
// parser variables, useless if you're not a parser, treat as private
var $stack = array(); // parser stack
var $inchannel = false;
var $initem = false;
var $incontent = false; // if in Atom <content mode="xml"> field
var $intextinput = false;
var $inimage = false;
var $current_namespace = false;
/**
* Set up XML parser, parse source, and return populated RSS object..
*
* @param string $source string containing the RSS to be parsed
*
* NOTE: Probably a good idea to leave the encoding options alone unless
* you know what you're doing as PHP's character set support is
* a little weird.
*
* NOTE: A lot of this is unnecessary but harmless with PHP5
*
*
* @param string $output_encoding output the parsed RSS in this character
* set defaults to ISO-8859-1 as this is PHP's
* default.
*
* NOTE: might be changed to UTF-8 in future
* versions.
*
* @param string $input_encoding the character set of the incoming RSS source.
* Leave blank and Magpie will try to figure it
* out.
*
*
* @param bool $detect_encoding if false Magpie won't attempt to detect
* source encoding. (caveat emptor)
*
*/
function MagpieRSS ($source, $output_encoding='ISO-8859-1',
$input_encoding=null, $detect_encoding=true)
{
# if PHP xml isn't compiled in, die
#
if (!function_exists('xml_parser_create')) {
$this->error( "Failed to load PHP's XML Extension. " .
"http://www.php.net/manual/en/ref.xml.php",
E_USER_ERROR );
}
list($parser, $source) = $this->create_parser($source,
$output_encoding, $input_encoding, $detect_encoding);
if (!is_resource($parser)) {
$this->error( "Failed to create an instance of PHP's XML parser. " .
"http://www.php.net/manual/en/ref.xml.php",
E_USER_ERROR );
}
$this->parser = $parser;
# pass in parser, and a reference to this object
# setup handlers
#
xml_set_object( $this->parser, $this );
xml_set_element_handler($this->parser,
'feed_start_element', 'feed_end_element' );
xml_set_character_data_handler( $this->parser, 'feed_cdata' );
$status = xml_parse( $this->parser, $source );
if (! $status ) {
$errorcode = xml_get_error_code( $this->parser );
if ( $errorcode != XML_ERROR_NONE ) {
$xml_error = xml_error_string( $errorcode );
$error_line = xml_get_current_line_number($this->parser);
$error_col = xml_get_current_column_number($this->parser);
$errormsg = "$xml_error at line $error_line, column $error_col";
$this->error( $errormsg );
}
}
xml_parser_free( $this->parser );
$this->normalize();
}
function feed_start_element($p, $element, &$attrs) {
$el = $element = strtolower($element);
$attrs = array_change_key_case($attrs, CASE_LOWER);
// check for a namespace, and split if found
$ns = false;
if ( strpos( $element, ':' ) ) {
list($ns, $el) = split( ':', $element, 2);
}
if ( $ns and $ns != 'rdf' ) {
$this->current_namespace = $ns;
}
# if feed type isn't set, then this is first element of feed
# identify feed from root element
#
if (!isset($this->feed_type) ) {
if ( $el == 'rdf' ) {
$this->feed_type = RSS;
$this->feed_version = '1.0';
}
elseif ( $el == 'rss' ) {
$this->feed_type = RSS;
$this->feed_version = $attrs['version'];
}
elseif ( $el == 'feed' ) {
$this->feed_type = ATOM;
$this->feed_version = $attrs['version'];
$this->inchannel = true;
}
return;
}
if ( $el == 'channel' )
{
$this->inchannel = true;
}
elseif ($el == 'item' or $el == 'entry' )
{
$this->initem = true;
if ( isset($attrs['rdf:about']) ) {
$this->current_item['about'] = $attrs['rdf:about'];
}
}
// if we're in the default namespace of an RSS feed,
// record textinput or image fields
elseif (
$this->feed_type == RSS and
$this->current_namespace == '' and
$el == 'textinput' )
{
$this->intextinput = true;
}
elseif (
$this->feed_type == RSS and
$this->current_namespace == '' and
$el == 'image' )
{
$this->inimage = true;
}
# handle atom content constructs
elseif ( $this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
{
// avoid clashing w/ RSS mod_content
if ($el == 'content' ) {
$el = 'atom_content';
}
$this->incontent = $el;
}
// if inside an Atom content construct (e.g. content or summary) field treat tags as text
elseif ($this->feed_type == ATOM and $this->incontent )
{
// if tags are inlined, then flatten
$attrs_str = join(' ',
array_map('map_attrs',
array_keys($attrs),
array_values($attrs) ) );
$this->append_content( "<$element $attrs_str>" );
array_unshift( $this->stack, $el );
}
// Atom support many links per containging element.
// Magpie treats link elements of type rel='alternate'
// as being equivalent to RSS's simple link element.
//
elseif ($this->feed_type == ATOM and $el == 'link' )
{
if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' )
{
$link_el = 'link';
}
else {
$link_el = 'link_' . $attrs['rel'];
}
$this->append($link_el, $attrs['href']);
}
// set stack[0] to current element
else {
array_unshift($this->stack, $el);
}
}
function feed_cdata ($p, $text) {
if ($this->feed_type == ATOM and $this->incontent)
{
$this->append_content( $text );
}
else {
$current_el = join('_', array_reverse($this->stack));
$this->append($current_el, $text);
}
}
function feed_end_element ($p, $el) {
$el = strtolower($el);
if ( $el == 'item' or $el == 'entry' )
{
$this->items[] = $this->current_item;
$this->current_item = array();
$this->initem = false;
}
elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )
{
$this->intextinput = false;
}
elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )
{
$this->inimage = false;
}
elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
{
$this->incontent = false;
}
elseif ($el == 'channel' or $el == 'feed' )
{
$this->inchannel = false;
}
elseif ($this->feed_type == ATOM and $this->incontent ) {
// balance tags properly
// note: i don't think this is actually neccessary
if ( $this->stack[0] == $el )
{
$this->append_content("</$el>");
}
else {
$this->append_content("<$el />");
}
array_shift( $this->stack );
}
else {
array_shift( $this->stack );
}
$this->current_namespace = false;
}
function concat (&$str1, $str2="") {
if (!isset($str1) ) {
$str1="";
}
$str1 .= $str2;
}
function append_content($text) {
if ( $this->initem ) {
$this->concat( $this->current_item[ $this->incontent ], $text );
}
elseif ( $this->inchannel ) {
$this->concat( $this->channel[ $this->incontent ], $text );
}
}
// smart append - field and namespace aware
function append($el, $text) {
if (!$el) {
return;
}
if ( $this->current_namespace )
{
if ( $this->initem ) {
$this->concat(
$this->current_item[ $this->current_namespace ][ $el ], $text);
}
elseif ($this->inchannel) {
$this->concat(
$this->channel[ $this->current_namespace][ $el ], $text );
}
elseif ($this->intextinput) {
$this->concat(
$this->textinput[ $this->current_namespace][ $el ], $text );
}
elseif ($this->inimage) {
$this->concat(
$this->image[ $this->current_namespace ][ $el ], $text );
}
}
else {
if ( $this->initem ) {
$this->concat(
$this->current_item[ $el ], $text);
}
elseif ($this->intextinput) {
$this->concat(
$this->textinput[ $el ], $text );
}
elseif ($this->inimage) {
$this->concat(
$this->image[ $el ], $text );
}
elseif ($this->inchannel) {
$this->concat(
$this->channel[ $el ], $text );
}
}
}
function normalize () {
// if atom populate rss fields
if ( $this->is_atom() ) {
$this->channel['description'] = $this->channel['tagline'];
for ( $i = 0; $i < count($this->items); $i++) {
$item = $this->items[$i];
if ( isset($item['summary']) )
$item['description'] = $item['summary'];
if ( isset($item['atom_content']))
$item['content']['encoded'] = $item['atom_content'];
$atom_date = (isset($item['issued']) ) ? $item['issued'] : $item['modified'];
if ( $atom_date ) {
$epoch = @parse_w3cdtf($atom_date);
if ($epoch and $epoch > 0) {
$item['date_timestamp'] = $epoch;
}
}
$this->items[$i] = $item;
}
}
elseif ( $this->is_rss() ) {
$this->channel['tagline'] = $this->channel['description'];
for ( $i = 0; $i < count($this->items); $i++) {
$item = $this->items[$i];
if ( isset($item['description']))
$item['summary'] = $item['description'];
if ( isset($item['content']['encoded'] ) )
$item['atom_content'] = $item['content']['encoded'];
if ( $this->is_rss() == '1.0' and isset($item['dc']['date']) ) {
$epoch = @parse_w3cdtf($item['dc']['date']);
if ($epoch and $epoch > 0) {
$item['date_timestamp'] = $epoch;
}
}
elseif ( isset($item['pubdate']) ) {
$epoch = @strtotime($item['pubdate']);
if ($epoch > 0) {
$item['date_timestamp'] = $epoch;
}
}
$this->items[$i] = $item;
}
}
}
function is_rss () {
if ( $this->feed_type == RSS ) {
return $this->feed_version;
}
else {
return false;
}
}
function is_atom() {
if ( $this->feed_type == ATOM ) {
return $this->feed_version;
}
else {
return false;
}
}
/**
* return XML parser, and possibly re-encoded source
*
*/
function create_parser($source, $out_enc, $in_enc, $detect) {
if ( substr(phpversion(),0,1) == 5) {
$parser = $this->php5_create_parser($in_enc, $detect);
}
else {
list($parser, $source) = $this->php4_create_parser($source, $in_enc, $detect);
}
if ($out_enc) {
$this->encoding = $out_enc;
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $out_enc);
}
return array($parser, $source);
}
/**
* Instantiate an XML parser under PHP5
*
* PHP5 will do a fine job of detecting input encoding
* if passed an empty string as the encoding.
*
* All hail libxml2!
*
*/
function php5_create_parser($in_enc, $detect) {
// by default php5 does a fine job of detecting input encodings
if(!$detect && $in_enc) {
return xml_parser_create($in_enc);
}
else {
return xml_parser_create('');
}
}
/**
* Instaniate an XML parser under PHP4
*
* Unfortunately PHP4's support for character encodings
* and especially XML and character encodings sucks. As
* long as the documents you parse only contain characters
* from the ISO-8859-1 character set (a superset of ASCII,
* and a subset of UTF-8) you're fine. However once you
* step out of that comfy little world things get mad, bad,
* and dangerous to know.
*
* The following code is based on SJM's work with FoF
* @see http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss
*
*/
function php4_create_parser($source, $in_enc, $detect) {
if ( !$detect ) {
return array(xml_parser_create($in_enc), $source);
}
if (!$in_enc) {
if (preg_match('/<?xml.*encoding=[\'"](.*?)[\'"].*?>/m', $source, $m)) {
$in_enc = strtoupper($m[1]);
$this->source_encoding = $in_enc;
}
else {
$in_enc = 'UTF-8';
}
}
if ($this->known_encoding($in_enc)) {
return array(xml_parser_create($in_enc), $source);
}
// the dectected encoding is not one of the simple encodings PHP knows
// attempt to use the iconv extension to
// cast the XML to a known encoding
// @see http://php.net/iconv
if (function_exists('iconv')) {
$encoded_source = iconv($in_enc,'UTF-8', $source);
if ($encoded_source) {
return array(xml_parser_create('UTF-8'), $encoded_source);
}
}
// iconv didn't work, try mb_convert_encoding
// @see http://php.net/mbstring
if(function_exists('mb_convert_encoding')) {
$encoded_source = mb_convert_encoding($source, 'UTF-8', $in_enc );
if ($encoded_source) {
return array(xml_parser_create('UTF-8'), $encoded_source);
}
}
// else
$this->error("Feed is in an unsupported character encoding. ($in_enc) " .
"You may see strange artifacts, and mangled characters.",
E_USER_NOTICE);
return array(xml_parser_create(), $source);
}
function known_encoding($enc) {
$enc = strtoupper($enc);
if ( in_array($enc, $this->_KNOWN_ENCODINGS) ) {
return $enc;
}
else {
return false;
}
}
function error ($errormsg, $lvl=E_USER_WARNING) {
// append PHP's error message if track_errors enabled
if ( isset($php_errormsg) ) {
$errormsg .= " ($php_errormsg)";
}
if ( MAGPIE_DEBUG ) {
trigger_error( $errormsg, $lvl);
}
else {
error_log( $errormsg, 0);
}
$notices = E_USER_NOTICE|E_NOTICE;
if ( $lvl&$notices ) {
$this->WARNING = $errormsg;
} else {
$this->ERROR = $errormsg;
}
}
} // end class RSS
function map_attrs($k, $v) {
return "$k=\"$v\"";
}
// patch to support medieval versions of PHP4.1.x,
// courtesy, Ryan Currie, ryan@digibliss.com
if (!function_exists('array_change_key_case')) {
define("CASE_UPPER",1);
define("CASE_LOWER",0);
function array_change_key_case($array,$case=CASE_LOWER) {
if ($case=CASE_LOWER) $cmd=strtolower;
elseif ($case=CASE_UPPER) $cmd=strtoupper;
foreach($array as $key=>$value) {
$output[$cmd($key)]=$value;
}
return $output;
}
}
?>

View File

@ -1,67 +0,0 @@
<?php
/*
* Project: MagpieRSS: a simple RSS integration tool
* File: rss_utils.inc, utility methods for working with RSS
* Author: Kellan Elliott-McCrea <kellan@protest.net>
* Version: 0.51
* License: GPL
*
* The lastest version of MagpieRSS can be obtained from:
* http://magpierss.sourceforge.net
*
* For questions, help, comments, discussion, etc., please join the
* Magpie mailing list:
* magpierss-general@lists.sourceforge.net
*/
/*======================================================================*\
Function: parse_w3cdtf
Purpose: parse a W3CDTF date into unix epoch
NOTE: http://www.w3.org/TR/NOTE-datetime
\*======================================================================*/
function parse_w3cdtf ( $date_str ) {
# regex to match wc3dtf
$pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";
if ( preg_match( $pat, $date_str, $match ) ) {
list( $year, $month, $day, $hours, $minutes, $seconds) =
array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]);
# calc epoch for current date assuming GMT
$epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year);
$offset = 0;
if ( $match[10] == 'Z' ) {
# zulu time, aka GMT
}
else {
list( $tz_mod, $tz_hour, $tz_min ) =
array( $match[8], $match[9], $match[10]);
# zero out the variables
if ( ! $tz_hour ) { $tz_hour = 0; }
if ( ! $tz_min ) { $tz_min = 0; }
$offset_secs = (($tz_hour*60)+$tz_min)*60;
# is timezone ahead of GMT? then subtract offset
#
if ( $tz_mod == '+' ) {
$offset_secs = $offset_secs * -1;
}
$offset = $offset_secs;
}
$epoch = $epoch + $offset;
return $epoch;
}
else {
return -1;
}
}
?>

View File

@ -1,27 +0,0 @@
Some example on how to use Magpie:
* magpie_simple.php *
Simple example of fetching and parsing an RSS file. Expects to be
called with a query param 'rss_url=http://<some rss file>'
* simple_smarty.php *
Similiar to magpie_simple, but using the Smarty template engine to do
display. Also demostrates using rss_utils.inc and a smarty plugin to
parse and display when each RSS item was published.
* magpie_debug.php *
Displays all the information available from a parsed feed.
* smarty_plugin/modifier.rss_date_parse.php *
A Smarty plugin for parsing RSS style dates. You must include rss_utils.inc
for this plugin to work. It also must be installed in the Smarty plugin
directory, see the Smarty docs for details.
* templates/simple.smarty
A Smarty template used by simple_smarty.php which demostrates
displaying an RSS feed and using the date parse plugin.
The Smarty template engine and documentation on how to use it are available from
http://smarty.php.net

View File

@ -1,80 +0,0 @@
<?php
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');
define('MAGPIE_DIR', '../');
define('MAGPIE_DEBUG', 1);
// flush cache quickly for debugging purposes, don't do this on a live site
define('MAGPIE_CACHE_AGE', 10);
require_once(MAGPIE_DIR.'rss_fetch.inc');
if ( isset($_GET['url']) ) {
$url = $_GET['url'];
}
else {
$url = 'http://magpierss.sf.net/test.rss';
}
test_library_support();
$rss = fetch_rss( $url );
if ($rss) {
echo "<h3>Example Output</h3>";
echo "Channel: " . $rss->channel['title'] . "<p>";
echo "<ul>";
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
echo "<li><a href=$href>$title</a></li>";
}
echo "</ul>";
}
else {
echo "Error: " . magpie_error();
}
?>
<form>
RSS URL: <input type="text" size="30" name="url" value="<?php echo $url ?>"><br />
<input type="submit" value="Parse RSS">
</form>
<h3>Parsed Results (var_dump'ed)</h3>
<pre>
<?php var_dump($rss); ?>
</pre>
<?php
function test_library_support() {
if (!function_exists('xml_parser_create')) {
echo "<b>Error:</b> PHP compiled without XML support (--with-xml), Mapgie won't work without PHP support for XML.<br />\n";
exit;
}
else {
echo "<b>OK:</b> Found an XML parser. <br />\n";
}
if ( ! function_exists('gzinflate') ) {
echo "<b>Warning:</b> PHP compiled without Zlib support (--with-zlib). No support for GZIP encoding.<br />\n";
}
else {
echo "<b>OK:</b> Support for GZIP encoding.<br />\n";
}
if ( ! (function_exists('iconv') and function_exists('mb_convert_encoding') ) ) {
echo "<b>Warning:</b> No support for iconv (--with-iconv) or multi-byte strings (--enable-mbstring)." .
"No support character set munging.<br />\n";
}
else {
echo "<b>OK:</b> Support for character munging.<br />\n";
}
}
?>

View File

@ -1,29 +0,0 @@
<?php
define('MAGPIE_DIR', '../');
require_once(MAGPIE_DIR.'rss_fetch.inc');
$url = $_GET['url'];
if ( $url ) {
$rss = fetch_rss( $url );
echo "Channel: " . $rss->channel['title'] . "<p>";
echo "<ul>";
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
echo "<li><a href=$href>$title</a></li>";
}
echo "</ul>";
}
?>
<form>
RSS URL: <input type="text" size="30" name="url" value="<?php echo $url ?>"><br />
<input type="submit" value="Parse RSS">
</form>
<p>
<h2>Security Note:</h2>
This is a simple <b>example</b> script. If this was a <b>real</b> script we probably wouldn't allow strangers to submit random URLs, and we certainly wouldn't simply echo anything passed in the URL. Additionally its a bad idea to leave this example script lying around.
</p>

View File

@ -1,66 +0,0 @@
<?php
define('MAGPIE_DIR', '../');
require_once(MAGPIE_DIR.'rss_fetch.inc');
$url = $_GET['rss_url'];
?>
<html
<body LINK="#999999" VLINK="#000000">
<form>
<input type="text" name="rss_url" size="40" value="<?php echo $url ?>"><input type="Submit">
</form>
<?php
if ( $url ) {
echo "displaying: $url<p>";
$rss = fetch_rss( $url );
echo slashbox ($rss);
}
echo "<pre>";
print_r($rss);
echo "</pre>";
?>
</body>
</html>
<?php
# just some quick and ugly php to generate html
#
#
function slashbox ($rss) {
echo "<table cellpadding=2 cellspacing=0><tr>";
echo "<td bgcolor=#006666>";
# get the channel title and link properties off of the rss object
#
$title = $rss->channel['title'];
$link = $rss->channel['link'];
echo "<a href=$link><font color=#FFFFFF><b>$title</b></font></a>";
echo "</td></tr>";
# foreach over each item in the array.
# displaying simple links
#
# we could be doing all sorts of neat things with the dublin core
# info, or the event info, or what not, but keeping it simple for now.
#
foreach ($rss->items as $item ) {
echo "<tr><td bgcolor=#cccccc>";
echo "<a href=$item[link]>";
echo $item['title'];
echo "</a></td></tr>";
}
echo "</table>";
}
?>

View File

@ -1,58 +0,0 @@
<?php
// Define path to Smarty files (don't forget trailing slash)
// and load library. (you'll want to change this value)
//
// NOTE: you can also simply add Smarty to your include path
define('SMARTY_DIR', '/home/kellan/projs/magpierss/scripts/Smarty/');
require_once(SMARTY_DIR.'Smarty.class.php');
// define path to Magpie files and load library
// (you'll want to change this value)
//
// NOTE: you can also simple add MagpieRSS to your include path
define('MAGPIE_DIR', '/home/kellan/projs/magpierss/');
require_once(MAGPIE_DIR.'rss_fetch.inc');
require_once(MAGPIE_DIR.'rss_utils.inc');
// optionally show lots of debugging info
# define('MAGPIE_DEBUG', 2);
// optionally flush cache quickly for debugging purposes,
// don't do this on a live site
# define('MAGPIE_CACHE_AGE', 10);
// use cache? default is yes. see rss_fetch for other Magpie options
# define('MAGPIE_CACHE_ON', 1)
// setup template object
$smarty = new Smarty;
$smarty->compile_check = true;
// url of an rss file
$url = $_GET['rss_url'];
if ( $url ) {
// assign a variable to smarty for use in the template
$smarty->assign('rss_url', $url);
// use MagpieRSS to fetch remote RSS file, and parse it
$rss = fetch_rss( $url );
// if fetch_rss returned false, we encountered an error
if ( !$rss ) {
$smarty->assign( 'error', magpie_error() );
}
$smarty->assign('rss', $rss );
$item = $rss->items[0];
$date = parse_w3cdtf( $item['dc']['date'] );
$smarty->assign( 'date', $date );
}
// parse smarty template, and display using the variables we assigned
$smarty->display('simple.smarty');
?>

View File

@ -1,31 +0,0 @@
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* Type: modifier
* Name: rss_date_parse
* Purpose: parse rss date into unix epoch
* Input: string: rss date
* default_date: default date if $rss_date is empty
*
* NOTE!!! parse_w3cdtf provided by MagpieRSS's rss_utils.inc
* this file needs to be included somewhere in your script
* -------------------------------------------------------------
*/
function smarty_modifier_rss_date_parse ($rss_date, $default_date=null)
{
if($rss_date != '') {
return parse_w3cdtf( $rss_date );
} elseif (isset($default_date) && $default_date != '') {
return parse_w3cdtf( $default_date );
} else {
return;
}
}
?>

View File

@ -1,46 +0,0 @@
<html>
<head>
<title>A Simple RSS Box: I'm not a designer</title>
</head>
<body>
<form>
<b>RSS File:</b>
<input type=text" name="rss_url" value="{$rss_url}" size="50">
<input type="submit">
</form>
<b>Displaying:</b> {$rss_url}
<p>
{* if $error display the error
elseif parsed RSS object display the RSS
else solicit user for a URL
*}
{if $error }
<b>Error:</b> {$error}
{elseif $rss}
<table border=1>
<tr>
<th colspan=2>
<a href="{$rss->channel.link}">{$rss->channel.title}</a>
</th>
</tr>
{foreach from=$rss->items item=item}
<tr>
<td>
<a href="{$item.link}">{$item.title}</a>
</td>
<td>
{$item.dc.date|rss_date_parse|date_format:"%A, %B %e, %Y"}
</td>
</tr>
{/foreach}
</table>
{else}
Enter the URL of an RSS file to display.
{/if}
</body>
</html>

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Acl.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Acl.php 24772 2012-05-07 01:16:52Z adamlundrigan $
*/
@ -53,7 +53,7 @@ require_once 'Zend/Acl/Resource.php';
/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Acl
@ -140,7 +140,7 @@ class Zend_Acl
* will have the least priority, and the last parent added will have the
* highest priority.
*
* @param Zend_Acl_Role_Interface $role
* @param Zend_Acl_Role_Interface|string $role
* @param Zend_Acl_Role_Interface|string|array $parents
* @uses Zend_Acl_Role_Registry::add()
* @return Zend_Acl Provides a fluent interface

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Interface.php 24594 2012-01-05 21:27:01Z matthew $
*/
@ -41,7 +41,7 @@ require_once 'Zend/Acl/Resource/Interface.php';
/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Acl_Assert_Interface

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Exception.php 24594 2012-01-05 21:27:01Z matthew $
*/
@ -29,7 +29,7 @@ require_once 'Zend/Exception.php';
/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Acl_Exception extends Zend_Exception

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Resource.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Resource.php 24594 2012-01-05 21:27:01Z matthew $
*/
@ -29,7 +29,7 @@ require_once 'Zend/Acl/Resource/Interface.php';
/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Acl_Resource implements Zend_Acl_Resource_Interface

View File

@ -14,16 +14,16 @@
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Interface.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Acl_Resource_Interface

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Role.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Role.php 24594 2012-01-05 21:27:01Z matthew $
*/
@ -29,7 +29,7 @@ require_once 'Zend/Acl/Role/Interface.php';
/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Acl_Role implements Zend_Acl_Role_Interface

View File

@ -14,16 +14,16 @@
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Interface.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Acl_Role_Interface

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Registry.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Registry.php 24594 2012-01-05 21:27:01Z matthew $
*/
@ -29,7 +29,7 @@ require_once 'Zend/Acl/Role/Interface.php';
/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Acl_Role_Registry

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Exception.php 24594 2012-01-05 21:27:01Z matthew $
*/
@ -29,7 +29,7 @@ require_once 'Zend/Acl/Exception.php';
/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Acl_Role_Registry_Exception extends Zend_Acl_Exception

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Auth.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Auth.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** @see Zend_Amf_Auth_Abstract */
@ -33,7 +33,7 @@ require_once 'Zend/Auth/Result.php';
*
* @package Zend_Amf
* @subpackage Adobe
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Adobe_Auth extends Zend_Amf_Auth_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: DbInspector.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: DbInspector.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -24,7 +24,7 @@
*
* @package Zend_Amf
* @subpackage Adobe
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Adobe_DbInspector

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Introspector.php 23953 2011-05-03 05:47:39Z ralph $
* @version $Id: Introspector.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** @see Zend_Amf_Parse_TypeLoader */
@ -33,7 +33,7 @@ require_once 'Zend/Server/Reflection.php';
*
* @package Zend_Amf
* @subpackage Adobe
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Adobe_Introspector

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Abstract.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Abstract.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** @see Zend_Auth_Adapter_Interface */
@ -27,7 +27,7 @@ require_once 'Zend/Auth/Adapter/Interface.php';
*
* @package Zend_Amf
* @subpackage Auth
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Amf_Auth_Abstract implements Zend_Auth_Adapter_Interface

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Constants.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Constants.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -24,7 +24,7 @@
* deserialization to detect the AMF marker and encoding types.
*
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
final class Zend_Amf_Constants

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Exception.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -26,7 +26,7 @@ require_once 'Zend/Exception.php';
/**
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Exception extends Zend_Exception

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Parse_Amf0
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Deserializer.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Deserializer.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** Zend_Amf_Constants */
@ -33,7 +33,7 @@ require_once 'Zend/Amf/Parse/Deserializer.php';
* @todo Class could be implemented as Factory Class with each data type it's own class
* @package Zend_Amf
* @subpackage Parse_Amf0
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_Amf0_Deserializer extends Zend_Amf_Parse_Deserializer

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Parse_Amf0
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Serializer.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Serializer.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** Zend_Amf_Constants */
@ -32,7 +32,7 @@ require_once 'Zend/Amf/Parse/Serializer.php';
* @uses Zend_Amf_Parse_Serializer
* @package Zend_Amf
* @subpackage Parse_Amf0
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_Amf0_Serializer extends Zend_Amf_Parse_Serializer

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Parse_Amf3
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Deserializer.php 24386 2011-08-15 18:24:49Z padraic $
* @version $Id: Deserializer.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** Zend_Amf_Parse_Deserializer */
@ -34,7 +34,7 @@ require_once 'Zend/Amf/Parse/TypeLoader.php';
* @todo Class could be implemented as Factory Class with each data type it's own class.
* @package Zend_Amf
* @subpackage Parse_Amf3
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_Amf3_Deserializer extends Zend_Amf_Parse_Deserializer

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Parse_Amf3
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Serializer.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Serializer.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** Zend_Amf_Constants */
@ -35,7 +35,7 @@ require_once 'Zend/Amf/Parse/TypeLoader.php';
*
* @package Zend_Amf
* @subpackage Parse_Amf3
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_Amf3_Serializer extends Zend_Amf_Parse_Serializer

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Deserializer.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Deserializer.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -30,7 +30,7 @@
* @see http://opensource.adobe.com/svn/opensource/blazeds/trunk/modules/core/src/java/flex/messaging/io/amf/
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Amf_Parse_Deserializer

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: InputStream.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: InputStream.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** Zend_Amf_Util_BinaryStream */
@ -31,7 +31,7 @@ require_once 'Zend/Amf/Util/BinaryStream.php';
*
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_InputStream extends Zend_Amf_Util_BinaryStream

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: OutputStream.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: OutputStream.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** Zend_Amf_Util_BinaryStream */
@ -32,7 +32,7 @@ require_once 'Zend/Amf/Util/BinaryStream.php';
* @uses Zend_Amf_Util_BinaryStream
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_OutputStream extends Zend_Amf_Util_BinaryStream

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: MysqlResult.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: MysqlResult.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -26,7 +26,7 @@
*
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_Resource_MysqlResult

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: MysqliResult.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: MysqliResult.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -26,7 +26,7 @@
*
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_Resource_MysqliResult

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Stream.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Stream.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -25,7 +25,7 @@
*
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_Resource_Stream

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Serializer.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Serializer.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -25,7 +25,7 @@
*
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Amf_Parse_Serializer

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: TypeLoader.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: TypeLoader.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -47,7 +47,7 @@ require_once 'Zend/Amf/Value/Messaging/RemotingMessage.php';
* @todo PHP 5.3 can drastically change this class w/ namespace and the new call_user_func w/ namespace
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
final class Zend_Amf_Parse_TypeLoader

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Request.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Request.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** @see Zend_Amf_Parse_InputStream */
@ -40,7 +40,7 @@ require_once 'Zend/Amf/Value/MessageBody.php';
*
* @todo Currently not checking if the object needs to be Type Mapped to a server object.
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Request

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Request
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Http.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Http.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** @see Zend_Amf_Request */
@ -32,7 +32,7 @@ require_once 'Zend/Amf/Request.php';
*
* @package Zend_Amf
* @subpackage Request
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Request_Http extends Zend_Amf_Request

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Response.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Response.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** @see Zend_Amf_Constants */
@ -32,7 +32,7 @@ require_once 'Zend/Amf/Parse/Amf0/Serializer.php';
* Handles converting the PHP object ready for response back into AMF
*
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Response

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Response
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Http.php 24482 2011-09-29 14:19:21Z matthew $
* @version $Id: Http.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** Zend_Amf_Response */
@ -28,7 +28,7 @@ require_once 'Zend/Amf/Response.php';
*
* @package Zend_Amf
* @subpackage Response
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Response_Http extends Zend_Amf_Response
@ -56,7 +56,7 @@ class Zend_Amf_Response_Http extends Zend_Amf_Response
protected function isIeOverSsl()
{
$ssl = $_SERVER['HTTPS'];
$ssl = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : false;
if (!$ssl || ($ssl == 'off')) {
// IIS reports "off", whereas other browsers simply don't populate
return false;

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Server.php 24206 2011-07-06 13:52:02Z matthew $
* @version $Id: Server.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** @see Zend_Server_Interface */
@ -52,7 +52,7 @@ require_once 'Zend/Auth.php';
* @todo Make the reflection methods cache and autoload.
* @package Zend_Amf
* @subpackage Server
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Server implements Zend_Server_Interface
@ -323,6 +323,7 @@ class Zend_Amf_Server implements Zend_Server_Interface
throw new Zend_Amf_Server_Exception('Class "' . $className . '" does not exist: '.$e->getMessage(), 0, $e);
}
// Add the new loaded class to the server.
require_once 'Zend/Amf/Server/Exception.php';
$this->setClass($className, $source);
}
@ -340,6 +341,8 @@ class Zend_Amf_Server implements Zend_Server_Interface
$params = array_merge($params, $argv);
}
$params = $this->_castParameters($info, $params);
if ($info instanceof Zend_Server_Reflection_Function) {
$func = $info->getName();
$this->_checkAcl(null, $func);
@ -961,4 +964,85 @@ class Zend_Amf_Server implements Zend_Server_Interface
{
return array_keys($this->_table);
}
/**
* Cast parameters
*
* Takes the provided parameters from the request, and attempts to cast them
* to objects, if the prototype defines any as explicit object types
*
* @param Reflection $reflectionMethod
* @param array $params
* @return array
*/
protected function _castParameters($reflectionMethod, array $params)
{
$prototypes = $reflectionMethod->getPrototypes();
$nonObjectTypes = array(
'null',
'mixed',
'void',
'unknown',
'bool',
'boolean',
'number',
'int',
'integer',
'double',
'float',
'string',
'array',
'object',
'stdclass',
);
$types = array();
foreach ($prototypes as $prototype) {
foreach ($prototype->getParameters() as $parameter) {
$type = $parameter->getType();
if (in_array(strtolower($type), $nonObjectTypes)) {
continue;
}
$position = $parameter->getPosition();
$types[$position] = $type;
}
}
if (empty($types)) {
return $params;
}
foreach ($params as $position => $value) {
if (!isset($types[$position])) {
// No specific type to cast to? done
continue;
}
$type = $types[$position];
if (!class_exists($type)) {
// Not a class, apparently. done
continue;
}
if ($value instanceof $type) {
// Already of the right type? done
continue;
}
if (!is_array($value) && !is_object($value)) {
// Can't cast scalars to objects easily; done
continue;
}
// Create instance, and loop through value to set
$object = new $type;
foreach ($value as $property => $defined) {
$object->{$property} = $defined;
}
$params[$position] = $object;
}
return $params;
}
}

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Server
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: Exception.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** Zend_Amf_Exception */
@ -29,7 +29,7 @@ require_once 'Zend/Amf/Exception.php';
* @category Zend
* @package Zend_Amf
* @subpackage Server
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Server_Exception extends Zend_Amf_Exception

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Util
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: BinaryStream.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: BinaryStream.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -25,7 +25,7 @@
*
* @package Zend_Amf
* @subpackage Util
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Util_BinaryStream

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ByteArray.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: ByteArray.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -25,7 +25,7 @@
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_ByteArray

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: MessageBody.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: MessageBody.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -33,7 +33,7 @@
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_MessageBody

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: MessageHeader.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: MessageHeader.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -28,7 +28,7 @@
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_MessageHeader

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: AbstractMessage.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: AbstractMessage.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -26,7 +26,7 @@
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_Messaging_AbstractMessage

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: AcknowledgeMessage.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: AcknowledgeMessage.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** Zend_Amf_Value_Messaging_AsyncMessage */
@ -32,7 +32,7 @@ require_once 'Zend/Amf/Value/Messaging/AsyncMessage.php';
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_Messaging_AcknowledgeMessage extends Zend_Amf_Value_Messaging_AsyncMessage

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ArrayCollection.php 24473 2011-09-26 19:33:55Z matthew $
* @version $Id: ArrayCollection.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -27,7 +27,7 @@
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_Messaging_ArrayCollection extends ArrayObject

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: AsyncMessage.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: AsyncMessage.php 24594 2012-01-05 21:27:01Z matthew $
*/
@ -30,7 +30,7 @@ require_once 'Zend/Amf/Value/Messaging/AbstractMessage.php';
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_Messaging_AsyncMessage extends Zend_Amf_Value_Messaging_AbstractMessage

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: CommandMessage.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: CommandMessage.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
@ -36,7 +36,7 @@ require_once 'Zend/Amf/Value/Messaging/AsyncMessage.php';
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_Messaging_CommandMessage extends Zend_Amf_Value_Messaging_AsyncMessage

View File

@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ErrorMessage.php 23775 2011-03-01 17:25:24Z ralph $
* @version $Id: ErrorMessage.php 24594 2012-01-05 21:27:01Z matthew $
*/
/** @see Zend_Amf_Value_Messaging_AcknowledgeMessage */
@ -30,7 +30,7 @@ require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php';
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_Messaging_ErrorMessage extends Zend_Amf_Value_Messaging_AcknowledgeMessage

Some files were not shown because too many files have changed in this diff Show More