* * * This software is protected by copyright, please * read the file COPYRIGHT. * This program is distributed in the hope that it * will be useful, but without any warranty; without * even the implied warranty of merchantability or * fitness for a particular purpose. Please * read the file LICENCE. * * Fichier UserPrint.php * * Ce fichier contient la classe UserPrint * * @author Initiance * @copyright Copyright © 2009-2018, Rooty * @since 2004/06/07 * @version 0.3 * @link www.rooty.me * @package object_printing * @subpackage UserPrint */ if ( !defined('SYSTEM_IN') ) { die("Hacking attempt"); } /** * Classe UserPrint *

Cette classe permet la recuperation des UserPrint

* @package object_printing * @subpackage UserPrint */ class UserPrint extends Printing { // // Constructor // /** * Constructeur de la classe UserPrint * @access public */ function UserPrint() { $this->__construct(); } function __construct() { parent::__construct("1.0", "Olivier DEVAINE", "Affichage soit du formulaire d'UserPrint, soit de déconnection (avec les infos utilisateurs)"); } /** * Remplace dans la template principale * @access public */ function __print() { global $SERVER_NAME, $SCRIPT_NAME, $CONF_AUTH_SECURE; if ($GLOBALS["SYSTEM_USER_SESSION"]->user->getId()==$GLOBALS["SYSTEM_DEFAULT_USER_GUEST"]) { $MaTemplate = new ModeliXeQware($GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."object_printing/userprint/auth.mxt"); $MaTemplate->SetModeliXe(true); $nodeId = $GLOBALS["SYSTEM_USER_SESSION"]->navigationNodeId; $GLOBALS['SYSTEM_TEMPLATE']->MxText("imgPath", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']); /* création de l'url de login */ $url =$_SERVER['SCRIPT_NAME']; $url.="?system=authSession"; $url=addIdToUrl($url); $tabObject =$this->getObjectSon(eid()); for ($i=0; $igetClassName()=="Home") { $urlArray["id"]=$tabObject[$i][1]->getId(); } } $node=$GLOBALS["SYSTEM_USER_SESSION"]->getNode(recupCommunity()); /* Création de l'URL pour nouveau compte */ $urlNewAccount = $_SERVER['SCRIPT_NAME']; $urlNewAccount.= "?system=authNewAccount"; $urlNewAccount = addIdToUrl($urlNewAccount); $MaTemplate->MxAttribut("urlActionNewAccount", formatUrl($urlArray["id"],"Home","formLecture","",recupCommunity())); // var_dump($node->getCType()); if ($node->getCType() == "asso") { $MaTemplate->MxText("blocSubscription".".NEWSUBSCRIPTION", getMessage("UserPrintNewSubscription")); $MaTemplate->MxAttribut("blocSubscription".".urlActionNewSubscription", formatUrl($urlArray["id"], "Home", "formLectureAdh", "", recupCommunity())); } else $MaTemplate->MxBloc("blocSubscription", "delete"); /* Création de l'URL pour rappel du mot de passe */ $urlForgotPassword = $_SERVER['SCRIPT_NAME']; // $urlForgotPassword.= "?system=authForgotPassword"; $urlForgotPassword.= "?msg=forgotPasswordTempDisabled"; $urlForgotPassword = addIdToUrl($urlForgotPassword); /* picto en fonction de la template */ $MaTemplate->MxImage("pictoAuth", $GLOBALS['CONF_DATA_PATH']."data/template/".$GLOBALS['SYSTEM_TEMPLATE_DIR']."media/picto/authorise.png"); $MaTemplate->MxText("auth", getMessage("UserPrintAuth")); $MaTemplate->MxText("LOGIN", getMessage("UserPrintLogin")); $MaTemplate->MxFormField("login", "text", "login", "", "title='".getMessage("tipUserPrintLogin")."'"); $MaTemplate->MxText("PASSWORD", getMessage("UserPrintPassword")); $MaTemplate->MxFormField("password", "password", "password", "", "title='".getMessage("tipUserPrintPassword")."'"); $MaTemplate->MxAttribut("urlActionNewAccount", $urlNewAccount); $MaTemplate->MxText("NEWACCOUNT", getMessage("UserPrintNewAccount")); $MaTemplate->MxAttribut("urlActionForgotPassword", $urlForgotPassword); $MaTemplate->MxText("FORGOTPASSWORD", getMessage("UserPrintForgotPassword")); $MaTemplate->MxAttribut("urlActionLogin", $url); $MaTemplate->MxAttribut("BtnEnter", getMessage("UserPrintEnter")); $MaTemplate->MxText("BtnEnter", getMessage("UserPrintEnter")); $MaTemplate->MxAttribut("titleButton", getMessage("tipUserPrintEnter")); $data=$MaTemplate->MxWrite(); }else{ $MaTemplate = new ModeliXeQware($GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."object_printing/userprint/userinfo.mxt"); $MaTemplate->SetModeliXe(true); /* picto en fonction de la template */ $MaTemplate->MxImage("picto", $GLOBALS['CONF_DATA_PATH']."data/template/".$GLOBALS['SYSTEM_TEMPLATE_DIR']."media/picto/user.png"); $MaTemplate->MxText("firstName", $GLOBALS["SYSTEM_USER_SESSION"]->user->getFirstName()); $MaTemplate->MxText("lastName", $GLOBALS["SYSTEM_USER_SESSION"]->user->getLastName()); $MaTemplate->MxText("id", $GLOBALS["SYSTEM_USER_SESSION"]->user->getId()); $MaTemplate->MxText("mail", $GLOBALS["SYSTEM_USER_SESSION"]->user->getMail()); $MaTemplate->MxText("organisation", $GLOBALS["SYSTEM_USER_SESSION"]->user->getOrganisation()); $MaTemplate->MxText("title", $GLOBALS["SYSTEM_USER_SESSION"]->user->getTitle()); $MaTemplate->MxText("postalAddress", $GLOBALS["SYSTEM_USER_SESSION"]->user->getPostalAddress()); $MaTemplate->MxText("postalCode", $GLOBALS["SYSTEM_USER_SESSION"]->user->getPostalCode()); $MaTemplate->MxText("state", $GLOBALS["SYSTEM_USER_SESSION"]->user->getState()); $MaTemplate->MxText("country", $GLOBALS["SYSTEM_USER_SESSION"]->user->getCountry()); $MaTemplate->MxText("login", $GLOBALS["SYSTEM_USER_SESSION"]->user->getLogin()); $MaTemplate->MxText("tel", $GLOBALS["SYSTEM_USER_SESSION"]->user->getTel()); $MaTemplate->MxText("decon", getMessage("UserPrintDecon")); $MaTemplate->MxAttribut("decon", getMessage("UserPrintDecon")); $MaTemplate->MxText("fax", $GLOBALS["SYSTEM_USER_SESSION"]->user->getFax()); $MaTemplate->MxText("TxtWelcome", getMessage("TxtWelcome")); /* création de l'url de l'outil de gestion du compte utilisateur */ $tabObjectNode =$this->getObjectSon(eid()); $hasUserModif = false; for ($j=0; $jgetClassName()=="UserModif") { $MaTemplate->MxAttribut("blocUrlAccount".".urlAccount", formatUrl($tabObjectNode[$j][1]->getId(), $tabObjectNode[$j][0]->getClassName(), $tabObjectNode[$j][0]->getMethodName(), "", "")); $hasUserModif = true; } } if(!$hasUserModif) $MaTemplate->MxBloc("blocUrlAccount", "delete"); /* création de l'url de login */ $url =$_SERVER['SCRIPT_NAME']; $url.="?system=disconnectSession"; $url=addIdToUrl($url); /* picto en fonction de la template */ $MaTemplate->MxAttribut("pictoDisco", $GLOBALS['CONF_DATA_PATH']."data/template/".$GLOBALS['SYSTEM_TEMPLATE_DIR']."media/picto/exit.png"); $MaTemplate->MxAttribut("disconnectURL", $url); $data=$MaTemplate->MxWrite(); } $GLOBALS["SYSTEM_TEMPLATE"]->MxText("userprint", $data); // Et voila!!!!! return true; } /** * recupere les fils d'un noeud depuis le noeud principal * @access public */ private function getObjectSon($nodeId) { $tab=$GLOBALS["SYSTEM_CONTROL"]->getListObjectForNavigation($nodeId); return $tab; } } ?>