本文整理汇总了PHP中Kernel::getUserInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Kernel::getUserInfo方法的具体用法?PHP Kernel::getUserInfo怎么用?PHP Kernel::getUserInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kernel
的用法示例。
在下文中一共展示了Kernel::getUserInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _createContent
/**
* Commentaires d'une procedure
*
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2008/01/30
* @param object $rFiche Recordset de la procedure
*/
public function _createContent(&$toReturn)
{
$tpl = new CopixTpl();
$rFiche = $this->getParam('rFiche');
$mondroit = $this->getParam('mondroit');
$daoinfo =& _dao('infosupp');
$sql = 'SELECT * FROM module_teleprocedure_infosupp WHERE idinter=' . $rFiche->idinter . '';
$canCheckVisible = TeleproceduresService::canMakeInTelep('CHECK_VISIBLE', $mondroit);
$canAddComment = TeleproceduresService::canMakeInTelep('ADD_COMMENT', $mondroit);
if (!$canCheckVisible) {
$sql .= " AND info_message!='' AND info_message IS NOT NULL";
}
$sql .= " ORDER BY dateinfo ASC, idinfo ASC";
$results = _doQuery($sql);
// Pour chaque message on cherche les infos de son auteur
$list = array();
foreach ($results as $r) {
$userInfo = Kernel::getUserInfo("ID", $r->iduser);
//var_dump($userInfo);
$avatar = Prefs::get('prefs', 'avatar', $r->iduser);
$userInfo['avatar'] = $avatar ? CopixConfig::get('prefs|avatar_path') . $avatar : '';
$r->user = $userInfo;
$list[] = $r;
}
//print_r($rFiche);
$tpl->assign('info_message_edition', CopixZone::process('kernel|edition', array('field' => 'info_message', 'format' => $rFiche->type_format, 'content' => '', 'width' => 350, 'height' => 135, 'options' => array('toolbarSet' => 'IconitoBasic', 'enterMode' => 'br', 'toolbarStartupExpanded' => 'false'))));
$tpl->assign('info_commentaire_edition', CopixZone::process('kernel|edition', array('field' => 'info_commentaire', 'format' => $rFiche->type_format, 'content' => '', 'width' => 350, 'height' => 135, 'options' => array('toolbarSet' => 'IconitoBasic', 'enterMode' => 'br', 'toolbarStartupExpanded' => 'false'))));
$tpl->assign('canCheckVisible', $canCheckVisible);
$tpl->assign('canAddComment', $canAddComment);
$tpl->assign('list', $list);
$tpl->assign('rFiche', $rFiche);
$toReturn = $tpl->fetch('fiche-comms-zone.tpl');
return true;
}
示例2: startExec
public function startExec()
{
if (_currentUser()->isConnected()) {
$userId = _currentUser()->getId();
$userInfos = Kernel::getUserInfo('ID', $userId);
$this->director = false;
$this->animator = _currentUser()->hasAssistance();
$this->idEn = isset($userInfos['id']) ? $userInfos['id'] : null;
$this->id = $userId * 1;
$this->type = isset($userInfos['type']) ? $userInfos['type'] : null;
$this->root = false;
$this->login = $userInfos['login'];
$this->nom = $userInfos['nom'];
$this->prenom = $userInfos['prenom'];
$this->connected = true;
$this->chartValid = isset($_SESSION['chartValid']) ? $_SESSION['chartValid'] : false;
} else {
$this->director = false;
$this->animator = false;
$this->id = 0;
$this->type = 'USER_ANON';
$this->root = false;
$this->login = 'Anon';
$this->nom = 'Anon';
$this->prenom = 'Anon';
$this->connected = false;
$this->idEn = 0;
$this->chartValid = true;
}
}
示例3: _createContent
/**
* Affiche la fiche détaillée d'un utilisateur (login, nom, prénom...)
*
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2006/01/04
* @param string $type Type de personne (USER_ELE, USER_ELE...)
* @param integer $id Id
*/
public function _createContent(&$toReturn)
{
$type = $this->getParam('type') ? $this->getParam('type') : NULL;
$id = $this->getParam('id') ? $this->getParam('id') : NULL;
if ($type && $id) {
$usr = Kernel::getUserInfo($type, $id);
//print_r($usr);
/*
$res = '<?xml version="1.0" ?>
<person>
<login>'.$login.'</login>
<sexe>'.$usr['sexe'].'</sexe>
<firstname>'.$usr['prenom'].'</firstname>
<name>'.$usr['nom'].'</name>
</person>
';
*/
$tpl = new CopixTpl();
$tpl->assign('usr', $usr);
//$toReturn = utf8_encode($tpl->fetch ('getuser.tpl'));
$toReturn = $tpl->fetch('getuser.tpl');
//$toReturn = $res;
}
return true;
}
示例4: _createContent
public function _createContent(&$toReturn)
{
$ppo = new CopixPPO();
_classInclude('classeur|ClasseurService');
// Récupération des paramètres
$ppo->classeurId = $this->getParam('classeurId');
$ppo->dossierId = $this->getParam('dossierId');
// Gestion des droits
$ppo->niveauUtilisateur = Kernel::getLevel('MOD_CLASSEUR', $ppo->classeurId);
$ppo->typeUtilisateur = _currentUser()->getExtra('type');
$ppo->idUtilisateur = _currentUser()->getExtra('id');
// Récupération des paramètres d'affichages
$ppo->tri = ClasseurService::getContentSort();
// Récupération des dossiers & des fichiers / favoris
$dossierDAO = _ioDAO('classeur|classeurdossier');
if ($ppo->dossier = $dossierDAO->get($ppo->dossierId)) {
if ($ppo->dossier->parent_id != 0) {
$ppo->dossierParent = $dossierDAO->get($ppo->dossier->parent_id);
} else {
$classeurDAO = _ioDAO('classeur|classeur');
$ppo->classeurParent = $classeurDAO->get($ppo->classeurId);
$ppo->classeurParent->isPersonnel = ClasseurService::getClasseurPersonnelId() == $ppo->classeurParent->id;
}
}
if (!$ppo->dossier->casier || $ppo->niveauUtilisateur >= PROFILE_CCV_MODERATE) {
$ppo->contenus = $dossierDAO->getContenus($ppo->classeurId, $ppo->dossierId, $ppo->tri);
foreach ($ppo->contenus as $contenu) {
if ($ppo->dossier->casier) {
$user = Kernel::getUserInfo($contenu->user_type, $contenu->user_id);
$contenu->user = $user['prenom'] . ' ' . $user['nom'];
}
}
}
$toReturn = $this->_usePPO($ppo, '_vue_liste.tpl');
}
示例5: getSso
public function getSso()
{
$id = $this->getRequest('id', null);
if (!$id) {
// Récupération des infos de l'utilisateur.
$userInfo = Kernel::getUserInfo();
// Création des modules inexistants.
Kernel::createMissingModules($userInfo["type"], $userInfo["id"]);
// Liste des modules activés.
$modsList = Kernel::getModEnabled($userInfo["type"], $userInfo["id"]);
foreach ($modsList as $modInfo) {
if ($modInfo->module_type == "MOD_SSO" && $modInfo->module_id) {
$urlReturn = CopixUrl::get('sso||getSso', array('id' => $modInfo->module_id));
return new CopixActionReturn(COPIX_AR_REDIRECT, $urlReturn);
}
}
}
if (!$id) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => 'Problème', 'back' => CopixUrl::get('||')));
}
$tpl = new CopixTpl();
$tpl->assign('TITLE_PAGE', CopixI18N::get('sso.title.servext'));
$dao = CopixDAOFactory::create("sso|sso_auth");
// $all = $dao->findAll();
$all = $dao->findBySso($id);
$tpl->assign('MAIN', CopixZone::process('sso|SsoAuthList', array('list' => $all, 'id' => _request("id"))));
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例6: processLogin
public function processLogin()
{
include_once COPIX_UTILS_PATH . '../../CAS-1.2.2/CAS.php';
$_SESSION['chartValid'] = false;
$ppo = new CopixPPO();
$ppo->user = _currentUser();
if ($ppo->user->isConnected()) {
$url_return = CopixUrl::get('kernel||doSelectHome');
/*
* PATCH FOR CHARTE
*/
$this->user->forceReload();
if (!$this->service('charte|CharteService')->checkUserValidation()) {
$this->flash->redirect = $url_return;
return $this->go('charte|charte|valid');
}
return _arRedirect($url_return);
//return new CopixActionReturn (COPIX_AR_REDIRECT, $url_return);
} else {
$conf_Cas_host = CopixConfig::get('default|conf_Cas_host');
$conf_Cas_port = CopixConfig::get('default|conf_Cas_port');
$conf_Cas_path = CopixConfig::get('default|conf_Cas_path');
phpCAS::client(CAS_VERSION_2_0, $conf_Cas_host, (int) $conf_Cas_port, $conf_Cas_path, false);
phpCAS::setNoCasServerValidation();
phpCAS::forceAuthentication();
$ppo->cas_user = phpCAS::getUser();
if ($ppo->cas_user) {
$ppo->iconito_user = Kernel::getUserInfo("LOGIN", $ppo->cas_user);
if ($ppo->iconito_user['login']) {
_currentUser()->login(array('login' => $ppo->iconito_user['login'], 'assistance' => true));
$url_return = CopixUrl::get('kernel||doSelectHome');
// $url_return = CopixUrl::get ('assistance||users');
$this->user->forceReload();
if (!$this->service('charte|CharteService')->checkUserValidation()) {
$this->flash->redirect = $url_return;
return $this->go('charte|charte|valid');
}
return new CopixActionReturn(COPIX_AR_REDIRECT, $url_return);
} else {
$ppo->cas_error = 'no-iconito-user';
return _arPpo($ppo, 'cas.tpl');
}
}
}
$ppo = new CopixPPO();
$ppo->TITLE_PAGE = $pTitle;
phpCAS::setDebug();
$conf_Cas_host = CopixConfig::get('default|conf_Cas_host');
$conf_Cas_port = CopixConfig::get('default|conf_Cas_port');
$conf_Cas_path = CopixConfig::get('default|conf_Cas_path');
phpCAS::client(CAS_VERSION_2_0, $conf_Cas_host, (int) $conf_Cas_port, $conf_Cas_path, false);
phpCAS::setNoCasServerValidation();
phpCAS::forceAuthentication();
if (isset($_REQUEST['logout'])) {
phpCAS::logout();
}
die(phpCAS::getUser());
die('ok');
return _arPpo($ppo, 'handlers.list.tpl');
}
示例7: processDefault
/**
* Admins
*
* Affiche la liste des administrateurs
*
* @package Comptes
* @author Frédéric Mossmann <fmossmann@cap-tic.fr>
*/
public function processDefault()
{
if (!Kernel::isAdmin()) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('||'));
}
$roles = _request('role');
$new_admin = _request('new_admins');
if ($roles) {
$sql = "\n SELECT dbuser.*, kernel_link_bu2user.*\n FROM dbuser\n JOIN kernel_link_bu2user ON dbuser.id_dbuser=kernel_link_bu2user.user_id\n WHERE dbuser.id_dbuser IN (" . implode(',', array_keys($roles)) . ")\n ";
$admins_mod = _doQuery($sql);
foreach ($admins_mod as $admins_mod_item) {
$sql = "\n DELETE FROM kernel_link_user2node\n WHERE node_type='ROOT' AND node_id=0\n AND user_type=:bu_type AND user_id=:bu_id\n ";
_doQuery($sql, array(':bu_type' => $admins_mod_item->bu_type, ':bu_id' => $admins_mod_item->bu_id));
$sql = "\n DELETE FROM dbgroup_users\n WHERE id_dbgroup=:id_dbgroup AND userhandler_dbgroup=:userhandler_dbgroup AND user_dbgroup=:user_dbgroup";
$params = array(':id_dbgroup' => 1, ':userhandler_dbgroup' => 'auth|dbuserhandler', ':user_dbgroup' => $admins_mod_item->id_dbuser);
_doQuery($sql, $params);
if ($roles[$admins_mod_item->id_dbuser]) {
$sql = "\n INSERT INTO kernel_link_user2node\n ( user_type, user_id, node_type, node_id, droit)\n VALUES\n (:user_type, :user_id, :node_type, :node_id, :droit)\n ";
$params = array(':user_type' => $admins_mod_item->bu_type, ':user_id' => $admins_mod_item->bu_id, ':node_type' => 'ROOT', ':node_id' => 0, ':droit' => $roles[$admins_mod_item->id_dbuser]);
_doQuery($sql, $params);
$sql = "\n INSERT INTO dbgroup_users\n ( id_dbgroup, userhandler_dbgroup, user_dbgroup)\n VALUES\n (:id_dbgroup, :userhandler_dbgroup, :user_dbgroup)\n ";
$params = array(':id_dbgroup' => 1, ':userhandler_dbgroup' => 'auth|dbuserhandler', ':user_dbgroup' => $admins_mod_item->id_dbuser);
_doQuery($sql, $params);
}
}
}
if ($new_admin) {
$new_admin_array = split(',', $new_admin);
$new_admin_array_clean = array_map('trim', $new_admin_array);
$sql_newadmins = "OR dbuser.login_dbuser IN (";
$first = true;
foreach ($new_admin_array_clean as $new_admin_array_item) {
$sql_newadmins .= (!$first ? ", " : "") . "'" . addslashes($new_admin_array_item) . "'";
$first = false;
}
$sql_newadmins .= ")";
} else {
$sql_newadmins = '';
}
$sql = "\n SELECT dbuser.*, kernel_link_bu2user.*, kernel_link_user2node.*\n FROM dbuser\n JOIN kernel_link_bu2user ON dbuser.id_dbuser=kernel_link_bu2user.user_id\n LEFT JOIN kernel_link_user2node ON kernel_link_bu2user.bu_type=kernel_link_user2node.user_type AND kernel_link_bu2user.bu_id=kernel_link_user2node.user_id AND kernel_link_user2node.node_type='ROOT' AND kernel_link_user2node.node_id=0\n WHERE (node_type='ROOT' AND node_id=0)\n " . $sql_newadmins . "\n ORDER BY kernel_link_user2node.droit DESC,dbuser.login_dbuser\n ";
$admins = _doQuery($sql);
foreach ($admins as &$admin) {
$admin->user_infos = Kernel::getUserInfo($admin->bu_type, $admin->bu_id);
}
/*
dbuser : id_dbuser login_dbuser password_dbuser email_dbuser enabled_dbuser
kernel_link_bu2user : user_id bu_type bu_id
kernel_link_user2node : user_type user_id node_type node_id droit debut fin
*/
$tpl = new CopixTpl();
$tplListe = new CopixTpl();
$tplListe->assign("admins", $admins);
$tplListe->assign("user_id", _currentUser()->getExtra('user_id'));
$tplListe->assign("admin_fonctionnel", Kernel::isAdminFonctionnel());
$main = $tplListe->fetch("admins-list.tpl");
$tpl->assign('TITLE_PAGE', CopixI18N::get('comptes.moduleDescription') . " » " . CopixI18N::get('comptes.title.admins'));
$tpl->assign('MAIN', $main);
$tpl->assign('MENU', $this->menu);
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例8: getAvailableAgenda
/**
* Récupération de tous les agendas en base de données
* @author Audrey Vassal <avassal@sqli.com>
* @since 2006/07/24
* @return array tableau d'objet agenda
*/
public function getAvailableAgenda()
{
//var_dump($_SESSION);
if (!_sessionGet('modules|agenda|his')) {
$serviceAuth = new AgendaAuth();
$res = array();
$ags = array();
// 1. Son agenda perso
$userInfo = Kernel::getUserInfo();
// Création des modules inexistants.
Kernel::createMissingModules($userInfo["type"], $userInfo["id"]);
// Liste des modules activés.
$modsList = Kernel::getModEnabled($userInfo["type"], $userInfo["id"]);
foreach ($modsList as $modInfo) {
if ($modInfo->module_type == "MOD_AGENDA" && $modInfo->module_id) {
$ags[] = $modInfo->module_id;
}
}
// 2. Ceux de sa classe, son école, ses groupes...
$mynodes = Kernel::getNodes();
foreach ($mynodes as $nodes) {
foreach ($nodes as $node) {
//print_r($node);
if (substr($node['type'], 0, 5) == 'USER_') {
continue;
}
$modules = Kernel::getModEnabled($node['type'], $node['id']);
$agenda = Kernel::filterModuleList($modules, 'MOD_AGENDA');
if ($agenda && $serviceAuth->getCapability($agenda[0]->module_id) >= $serviceAuth->getRead()) {
$ags[] = $agenda[0]->module_id;
}
}
}
//print_r($ags);
$daoAgenda =& CopixDAOFactory::getInstanceOf('agenda|agenda');
$agendas = $daoAgenda->findAgendasInIds($ags);
foreach ($agendas as $agenda) {
$tmp = new stdClass();
$tmp->id_agenda = $agenda->id_agenda;
$tmp->title_agenda = $agenda->title_agenda;
$tmp->desc_agenda = $agenda->desc_agenda;
$tmp->type_agenda = $agenda->type_agenda;
/*
$tmp = array (
'id_agenda' => $agenda->id_agenda,
'title_agenda' => $agenda->title_agenda,
'desc_agenda' => $agenda->desc_agenda,
'type_agenda' => $agenda->type_agenda,
);
*/
$res[] = $tmp;
}
//die();
//$sess = $daoAgenda->findAll ();
_sessionSet('modules|agenda|his', serialize($res));
}
return unserialize(_sessionGet('modules|agenda|his'));
}
示例9: getSwitchUser
public function getSwitchUser()
{
$login = _request('login');
if ($login != '') {
$me_info = Kernel::getUserInfo("ME", 0);
$animateurs_dao =& CopixDAOFactory::create("kernel|kernel_animateurs");
$animateur = $animateurs_dao->get($me_info['type'], $me_info['id']);
$ien_dao =& CopixDAOFactory::create("kernel|kernel_ien");
$ien = $ien_dao->get($me_info['type'], $me_info['id']);
// echo "<pre>"; print_r($ien); die("</pre>");
if (!$ien && (!$animateur || !isset($animateur->can_connect) || !$animateur->can_connect)) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('assistance||users', array('error' => 'forbidden')));
}
$user_info = Kernel::getUserInfo("LOGIN", $login);
// $user_info->user_id
if (!$user_info) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('assistance||users', array('error' => 'forbidden')));
}
$ok = false;
$assistance_service =& CopixClassesFactory::Create('assistance|assistance');
$user_assistance = $assistance_service->getAssistanceUsers();
if (!$user_assistance) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('assistance||users', array('error' => 'forbidden')));
}
foreach ($user_assistance as $ville_id => $ville) {
foreach ($ville as $ecole_id => $ecole) {
foreach ($ecole->personnels as $personnel_id => $personnel) {
if ($personnel->id_copix == $user_info['user_id']) {
$ok = $personnel->assistance;
}
}
}
}
if (!$ok) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('assistance||users', array('error' => 'forbidden')));
}
$currentUserLogin = _currentUser()->getLogin();
CopixSession::destroyNamespace('default');
_sessionSet('user_animateur', $currentUserLogin);
_sessionSet('prisedecontrole_ien', $ien ? true : false);
_currentUser()->login(array('login' => $login, 'assistance' => true));
$url_return = CopixUrl::get('kernel||doSelectHome');
} else {
if ($session = _sessionGet('user_animateur')) {
CopixSession::destroyNamespace('default');
//_sessionSet('user_animateur', null);
_currentUser()->login(array('login' => $session, 'assistance' => true));
}
$url_return = CopixUrl::get('assistance||users');
}
return new CopixActionReturn(COPIX_AR_REDIRECT, $url_return);
}
示例10: beforeProcess
public function beforeProcess(&$action)
{
if (CopixConfig::get('conf_Saml_actif') != 1) {
return;
}
require_once COPIX_UTILS_PATH . '../../simplesamlphp/lib/_autoload.php';
$asId = 'iconito-sql';
if (CopixConfig::exists('default|conf_Saml_authSource') && CopixConfig::get('default|conf_Saml_authSource')) {
$asId = CopixConfig::get('default|conf_Saml_authSource');
}
$as = new SimpleSAML_Auth_Simple($asId);
$ppo->user = _currentUser();
if ($as->isAuthenticated() && !$ppo->user->isConnected()) {
$attributes = $as->getAttributes();
$uidAttribute = 'login_dbuser';
if (CopixConfig::exists('default|conf_Saml_uidAttribute') && CopixConfig::get('default|conf_Saml_uidAttribute')) {
$uidAttribute = CopixConfig::get('default|conf_Saml_uidAttribute');
}
$ppo->saml_user = null;
if (isset($attributes[$uidAttribute]) && isset($attributes[$uidAttribute][0])) {
$ppo->saml_user = $attributes[$uidAttribute][0];
}
if ($ppo->saml_user) {
$ppo->iconito_user = Kernel::getUserInfo("LOGIN", $ppo->saml_user);
if ($ppo->iconito_user['login']) {
_currentUser()->login(array('login' => $ppo->iconito_user['login'], 'assistance' => true));
$url_return = CopixUrl::get('kernel||doSelectHome');
// $url_return = CopixUrl::get ('assistance||users');
return new CopixActionReturn(COPIX_AR_REDIRECT, $url_return);
} else {
$ppo->cas_error = 'no-iconito-user';
return _arPpo($ppo, 'cas.tpl');
}
}
}
if (!$as->isAuthenticated() && $ppo->user->isConnected()) {
$ppo->user = _currentUser();
if ($ppo->user->isConnected()) {
CopixAuth::getCurrentUser()->logout(array());
CopixEventNotifier::notify('logout', array('login' => CopixAuth::getCurrentUser()->getLogin()));
CopixAuth::destroyCurrentUser();
CopixSession::destroyNamespace('default');
}
}
}
示例11: smarty_function_user_id
/**
* Affichage des infos d'une personne selon son ID utilisateur
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2010/12/13
* @param integer $id Id utilisateur (cf table dbuser)
* @return string
*/
function smarty_function_user_id($params, &$smarty)
{
if (!isset($params['id'])) {
$smarty->trigger_error("mailto: missing 'id' parameter");
return;
}
$res = '';
if ($userInfo = Kernel::getUserInfo("ID", $params['id'])) {
$label = trim($userInfo['prenom'] . ' ' . $userInfo['nom']);
$res = '<a ' . $params['linkAttribs'] . ' class="viewuser" user_type="' . $userInfo['type'] . '" user_id="' . $userInfo['id'] . '">' . $label . '</a>';
}
if (isset($params['assign'])) {
$smarty->assign($params['assign'], $res);
return '';
} else {
return $res;
}
}
示例12: _createContent
public function _createContent(&$toReturn)
{
$ppo = new CopixPPO();
_classInclude('classeur|ClasseurService');
// Récupération des paramètres
$ppo->classeurId = $this->getParam('classeurId');
$ppo->dossierId = $this->getParam('dossierId');
// Gestion des droits
$ppo->niveauUtilisateur = Kernel::getLevel('MOD_CLASSEUR', $ppo->classeurId);
$ppo->typeUtilisateur = _currentUser()->getExtra('type');
$ppo->idUtilisateur = _currentUser()->getExtra('id');
// Récupération des paramètres d'affichages
$ppo->tri = ClasseurService::getContentSort();
// Récupération des dossiers & des fichiers / favoris
$fichierDAO = _ioDAO('classeur|classeurfichier');
$dossierDAO = _ioDAO('classeur|classeurdossier');
if ($ppo->dossier = $dossierDAO->get($ppo->dossierId)) {
if ($ppo->dossier->parent_id != 0) {
$ppo->dossierParent = $dossierDAO->get($ppo->dossier->parent_id);
} else {
$classeurDAO = _ioDAO('classeur|classeur');
$ppo->classeurParent = $classeurDAO->get($ppo->classeurId);
$ppo->classeurParent->isPersonnel = ClasseurService::getClasseurPersonnelId() == $ppo->classeurParent->id;
}
}
if (!$ppo->dossier->casier || $ppo->niveauUtilisateur >= PROFILE_CCV_MODERATE) {
$imgTypes = array('PNG', 'GIF', 'JPG', 'JPEG', 'png', 'gif', 'jpg', 'jpeg');
$ppo->contenus = $dossierDAO->getContenus($ppo->classeurId, $ppo->dossierId, $ppo->tri);
foreach ($ppo->contenus as $contenu) {
if ($contenu->content_type == 'fichier' && in_array($contenu->type, $imgTypes)) {
$fichier = $fichierDAO->get($contenu->id);
$contenu->lienMiniature = $fichier->getLienMiniature(90);
}
if ($ppo->dossier->casier) {
$user = Kernel::getUserInfo($contenu->user_type, $contenu->user_id);
$contenu->user = $user['prenom'] . ' ' . $user['nom'];
}
}
$ppo->fileExtensionAllowed = array('ai', 'avi', 'bmp', 'css', 'csv', 'doc', 'docx', 'eps', 'gif', 'html', 'ico', 'jpg', 'jpeg', 'js', 'json', 'mov', 'mp3', 'odp', 'ods', 'odt', 'pdf', 'png', 'ppt', 'pptx', 'psd', 'svg', 'swf', 'tiff', 'ttf', 'txt', 'wav', 'xls', 'xlsx', 'xml', 'zip');
}
$toReturn = $this->_usePPO($ppo, '_vue_vignette.tpl');
}
示例13: _createContent
/**
* Affiche la liste des personnes ayant des droits spécifiques sur un blog
*
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2007/05/31
* @param object $blog Blog (recordset)
* @param integer $kind Numéro générique de la rubrique (ne pas y toucher)
* @param string $attribs Attributs HTML de la liste (STYLE, ONCHANGE...)
*/
public function _createContent(&$toReturn)
{
//Getting the user.
//Create Services, and DAO
$tpl = new CopixTpl();
$blog = $this->getParam('blog', null);
$kind = $this->getParam('kind', null);
$droit = $this->getParam('droit', null);
$errors = $this->getParam('errors');
$membres = $this->getParam('membres');
$droit = $this->getParam('droit');
//Kernel::deb("droit=$droit");
//print_r($blog);
// On vérifie le droit d'être ici
if (!BlogAuth::canMakeInBlog("ADMIN_DROITS", $blog)) {
return false;
}
$groupeService =& CopixClassesFactory::Create('groupe|groupeService');
$childs = Kernel::getNodeChilds("MOD_BLOG", $blog->id_blog);
foreach ($childs as $k => $v) {
//print_r($v);
$userInfo = Kernel::getUserInfo($v["type"], $v["id"]);
$childs[$k]["login"] = $userInfo["login"];
$childs[$k]["nom"] = $userInfo["nom"];
$childs[$k]["prenom"] = $userInfo["prenom"];
$childs[$k]["droitnom"] = $groupeService->getRightName($v['droit']);
}
//print_r($childs);
$tplHome = new CopixTpl();
//$tplHome->assign ('groupe', $groupe[0]);
$tpl->assign('kind', $kind);
$tpl->assign('droit', $droit);
$tpl->assign('list', $childs);
$tpl->assign('errors', $errors);
$tpl->assign('membres', $membres);
$tpl->assign('linkpopup', CopixZone::process('annuaire|linkpopup', array('field' => 'membres')));
$tpl->assign('droit_values', array(PROFILE_CCV_VALID => $groupeService->getRightName(PROFILE_CCV_VALID), PROFILE_CCV_MODERATE => $groupeService->getRightName(PROFILE_CCV_MODERATE)));
$tpl->assign('blog', $blog);
// retour de la fonction :
$toReturn = $tpl->fetch('blog.show.droits.tpl');
return true;
}
示例14: _createContent
/**
* Affiche la fiche détaillée d'un utilisateur (login, nom, prénom...)
*
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2006/01/04
* @param string $type Type de personne (USER_ELE, USER_ELE...)
* @param integer $id Id
*/
public function _createContent(&$toReturn)
{
$annuaireService =& CopixClassesFactory::Create('annuaire|AnnuaireService');
$type = $this->getParam('type') ? $this->getParam('type') : NULL;
$id = $this->getParam('id') ? $this->getParam('id') : NULL;
$canWrite = $canView = false;
if ($type && $id) {
$usr = Kernel::getUserInfo($type, $id);
$usr['type_nom'] = Kernel::Code2Name($usr['type']);
//Kernel::myDebug($usr);
$droits = Kernel::getUserInfoMatrix($usr);
$canView = $droits['voir'];
$canWrite = $droits['communiquer'];
if ($canView) {
// Avatar
$avatar = '';
if (isset($usr['user_id'])) {
$avatar = Prefs::get('prefs', 'avatar', $usr['user_id']);
}
$usr['avatar'] = $avatar ? CopixConfig::get('prefs|avatar_path') . $avatar : '';
$parents = $enfants = array();
if ($type == 'USER_ELE') {
// Pour un élève, on cherche ses parents
$parents = $annuaireService->getParentsFromEleve($id);
} elseif ($type == 'USER_RES') {
// Pour un parent, on cherche ses enfants
$enfants = $annuaireService->getEnfantsFromParent($id);
}
} else {
$usr = $parents = $enfants = false;
}
$tpl = new CopixTpl();
$tpl->assign('usr', $usr);
$tpl->assign('canWrite', $canWrite);
$tpl->assign('parents', $parents);
$tpl->assign('enfants', $enfants);
$toReturn = $tpl->fetch('getuserprofilzone.tpl');
}
return true;
}
示例15: getPrefs
public function getPrefs($data = null)
{
$toReturn = array();
$toReturn['name'] = CopixI18N::get('prefs.string.generalprefs');
$toReturn['form'][] = array('type' => 'titre', 'text' => CopixI18N::get('prefs.config.passwd.title'), 'expl' => CopixI18N::get('prefs.config.passwd.expl'));
$toReturn['form'][] = array('code' => 'passwd1', 'type' => 'password', 'text' => CopixI18N::get('prefs.config.passwd1.input'), 'value' => '');
$toReturn['form'][] = array('code' => 'passwd2', 'type' => 'password', 'text' => CopixI18N::get('prefs.config.passwd2.input'), 'value' => '');
if (!CopixConfig::exists('|can_pref_assistance_animtice') || CopixConfig::get('|can_pref_assistance_animtice')) {
$toReturn['form'][] = array('type' => 'titre', 'text' => CopixI18N::get('prefs.config.assistance.title'), 'expl' => CopixI18N::get('prefs.config.assistance.expl'));
$toReturn['form'][] = array('code' => 'assistance', 'type' => 'checkbox', 'text' => CopixI18N::get('prefs.config.assistance'), 'value' => isset($data['assistance']) && $data['assistance'] ? true : false);
}
if (!CopixConfig::exists('|can_pref_assistance_ien') || CopixConfig::get('|can_pref_assistance_ien')) {
$user_infos = Kernel::getUserInfo();
if ($user_infos['type'] == 'USER_ENS') {
$toReturn['form'][] = array('type' => 'titre', 'text' => CopixI18N::get('prefs.config.ien.title'), 'expl' => CopixI18N::get('prefs.config.ien.expl'));
$toReturn['form'][] = array('code' => 'assistance_ien', 'type' => 'checkbox', 'text' => CopixI18N::get('prefs.config.ien'), 'value' => isset($data['assistance_ien']) && $data['assistance_ien'] ? true : false);
}
}
$toReturn['form'][] = array('type' => 'titre', 'text' => CopixI18N::get('prefs.config.avatar.title'), 'expl' => CopixI18N::get('prefs.config.avatar.expl'));
$avatar = Prefs::get('prefs', 'avatar');
if ($avatar) {
$avatar_url = 'static/prefs/avatar/' . $avatar;
$toReturn['form'][] = array('type' => 'image', 'text' => CopixI18N::get('prefs.config.avatar.image'), 'value' => $avatar_url);
}
$toReturn['form'][] = array('code' => 'avatar_upload', 'type' => 'upload', 'text' => CopixI18N::get('prefs.config.avatar.upload'), 'value' => isset($data['nom']) ? $data['nom'] : _currentUser()->getExtra('nom'));
if ($avatar) {
$toReturn['form'][] = array('code' => 'avatar_delete', 'type' => 'checkbox', 'text' => CopixI18N::get('prefs.config.avatar.delete'), 'value' => false);
}
/////////////////////////// ALERTE MAIL ///////////////////////////
$toReturn['form'][] = array('type' => 'titre', 'text' => CopixI18N::get('prefs.config.mail.title'), 'expl' => CopixI18N::get('prefs.config.mail.expl'));
/*
$toReturn['form'][] = array(
'code'=>'alerte_mail_active',
'type'=>'checkbox',
'text'=>CopixI18N::get ('prefs.config.mail.alerte_mail_active'), // 'Souhaitez-vous être alerté par un email à chaque fois que vous recevez un minimail ?',
'value'=>($data['alerte_mail_active']?true:false) );
*/
$toReturn['form'][] = array('code' => 'alerte_mail_email', 'type' => 'string', 'text' => CopixI18N::get('prefs.config.mail.alerte_mail_email'), 'value' => isset($data['alerte_mail_email']) ? $data['alerte_mail_email'] : '');
return $toReturn;
}